From 81309f16e62d98ce5630949c4c1d43f51f9c1129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Wed, 19 Oct 2022 21:31:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E4=BF=A1=E6=81=AF=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/Model/AlarmHelper.cs | 13 +++++++++++++ DosingSystem/Model/DeviceInquire.cs | 2 ++ 2 files changed, 15 insertions(+) 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); }