From 0b38918fc4c1021d63689108fbcddc87593aae36 Mon Sep 17 00:00:00 2001 From: xcd <834800634@qq.com> Date: 星期四, 02 七月 2020 18:11:46 +0800 Subject: [PATCH] 板卡操作配置可获取板卡初始配置中的IO定义 --- src/Bro.Common.Device/DeviceBase/PLCBase.cs | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Bro.Common.Device/DeviceBase/PLCBase.cs b/src/Bro.Common.Device/DeviceBase/PLCBase.cs index c6f8d6f..0c44685 100644 --- a/src/Bro.Common.Device/DeviceBase/PLCBase.cs +++ b/src/Bro.Common.Device/DeviceBase/PLCBase.cs @@ -36,8 +36,8 @@ public abstract void WriteSingleAddress(int address, int writeValue, bool waitForReply = true); #region IMonitor - public event Action<DateTime, string, IDevice, MonitorSet> OnMonitorInvoke; - public event Action<DateTime, IDevice, WarningSet> OnMonitorAlarm; + public event Action<DateTime, string, IDevice, IMonitorSet> OnMonitorInvoke; + public event Action<DateTime, IDevice, IWarningSet> OnMonitorAlarm; public List<int> MonitorValues { get; set; } = new List<int>(); @@ -122,7 +122,7 @@ //PLCIConfig.MonitorSetCollection.ForEach(set => Parallel.ForEach(PLCIConfig.MonitorSetCollection, set => { - MonitorSet monitorSet = set as MonitorSet; + PLCMonitorSet monitorSet = set as PLCMonitorSet; if (monitorSet.TriggerIndex < 0 || monitorSet.TriggerIndex >= tempNew.Count) { return; @@ -153,11 +153,11 @@ private void OnMethodInvoked(IAsyncResult ar) { - MonitorSet monitorSet = ar.AsyncState as MonitorSet; + PLCMonitorSet monitorSet = ar.AsyncState as PLCMonitorSet; ProcessResponse resValues = monitorSet.Response; - if (resValues.ResultValue == (int)PLCReplyValue.IGNORE) + if (resValues.ResultValue == (int)ReplyValue.IGNORE) { return; } @@ -211,7 +211,7 @@ } object _alarmLock = new object(); - private async void SaveAlarmCSVAsync(DateTime now, string plcName, WarningSet ws) + private async void SaveAlarmCSVAsync(DateTime now, string plcName, PLCWarningSet ws) { await Task.Run(() => { @@ -281,7 +281,7 @@ return locations; } - public bool MoveToPoint(IOperationConfig opConfig) + public ResponseMessage MoveToPoint(IOperationConfig opConfig) { throw new NotImplementedException(); } @@ -309,14 +309,14 @@ [DisplayName("璀︽姤閰嶇疆")] [TypeConverter(typeof(CollectionCountConvert))] [Editor(typeof(WarningSetsEditor), typeof(UITypeEditor))] - public List<WarningSet> WarningSetCollection { get; set; } = new List<WarningSet>(); + public List<PLCWarningSet> WarningSetCollection { get; set; } = new List<PLCWarningSet>(); #region IMonitorConfig [Category("鐩戝惉璁剧疆")] [Description("鐩戝惉鎿嶄綔閰嶇疆闆嗗悎")] [DisplayName("鐩戝惉閰嶇疆")] [TypeConverter(typeof(CollectionCountConvert))] - [Editor(typeof(ComplexCollectionEditor<MonitorSet>), typeof(UITypeEditor))] + [Editor(typeof(ComplexCollectionEditor<PLCMonitorSet>), typeof(UITypeEditor))] public List<IMonitorSet> MonitorSetCollection { get; set; } = new List<IMonitorSet>(); [Category("鐩戝惉璁剧疆")] @@ -481,9 +481,9 @@ } } - private List<WarningSet> GetWarningSets() + private List<PLCWarningSet> GetWarningSets() { - List<WarningSet> wsList = new List<WarningSet>(); + List<PLCWarningSet> wsList = new List<PLCWarningSet>(); OpenFileDialog ofd = new OpenFileDialog(); ofd.Multiselect = false; @@ -500,7 +500,7 @@ if (!string.IsNullOrWhiteSpace(list[1])) { - WarningSet ws = new WarningSet(); + PLCWarningSet ws = new PLCWarningSet(); ws.WarningCode = list[0]; ws.WarningDescription = list[1]; @@ -536,7 +536,7 @@ /// <returns></returns> protected override Type CreateCollectionItemType() { - return typeof(WarningSet); + return typeof(PLCWarningSet); } protected override string GetDisplayText(object value) -- Gitblit v1.8.0