diff --git a/BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs b/BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs index 1bdbc5e4..8192ebe5 100644 --- a/BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs +++ b/BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs @@ -8,6 +8,7 @@ using System.Collections.ObjectModel; using System.Linq; using System.Reflection; using System.Threading; +using System.Threading.Tasks; using System.Windows; namespace BPASmartClient.CustomResource.Pages.Model @@ -15,6 +16,18 @@ namespace BPASmartClient.CustomResource.Pages.Model public class AlarmHelper where AlarmT : class, new() { + + + //private volatile static ConcurrentDictionary _Instance; + //public static AlarmT GetInstance(string name) + //{ + // if (_Instance == null) _Instance = new ConcurrentDictionary(); + // if (!_Instance.ContainsKey(name)) _Instance.TryAdd(name, new AlarmT()); + // return _Instance[name]; + //} + //private AlarmHelper() { } + + public static ObservableCollection Alarms { get; set; } = new ObservableCollection(); public static List HistoryAlarms { get; set; } = new List(); static ConcurrentDictionary flagbit = new ConcurrentDictionary(); diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs index a6570bd1..e4bc1699 100644 --- a/DosingSystem/Model/DeviceInquire.cs +++ b/DosingSystem/Model/DeviceInquire.cs @@ -318,6 +318,8 @@ namespace BPASmartClient.DosingSystem AlarmHelper.Alarm.SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8); AlarmHelper.Alarm.SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9); + AlarmHelper("dd").Alarm.SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9); + Thread.Sleep(100); }), $"{DeviceName} 开始监听", true); }