pry пре 2 година
родитељ
комит
81309f16e6
2 измењених фајлова са 15 додато и 0 уклоњено
  1. +13
    -0
      BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs
  2. +2
    -0
      DosingSystem/Model/DeviceInquire.cs

+ 13
- 0
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<AlarmT> where AlarmT : class, new()
{


//private volatile static ConcurrentDictionary<string, AlarmT> _Instance;
//public static AlarmT GetInstance(string name)
//{
// if (_Instance == null) _Instance = new ConcurrentDictionary<string, AlarmT>();
// if (!_Instance.ContainsKey(name)) _Instance.TryAdd(name, new AlarmT());
// return _Instance[name];
//}
//private AlarmHelper() { }


public static ObservableCollection<Alarm> Alarms { get; set; } = new ObservableCollection<Alarm>();
public static List<Alarm> HistoryAlarms { get; set; } = new List<Alarm>();
static ConcurrentDictionary<string, bool> flagbit = new ConcurrentDictionary<string, bool>();


+ 2
- 0
DosingSystem/Model/DeviceInquire.cs Прегледај датотеку

@@ -318,6 +318,8 @@ namespace BPASmartClient.DosingSystem
AlarmHelper<AlarmInfo>.Alarm.SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8);
AlarmHelper<AlarmInfo>.Alarm.SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);

AlarmHelper<AlarmInfo>("dd").Alarm.SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);

Thread.Sleep(100);
}), $"{DeviceName} 开始监听", true);
}


Loading…
Откажи
Сачувај