|
@@ -1,14 +1,20 @@
|
|
|
using DBNames;
|
|
|
using SCADA;
|
|
|
+using SCADA.Comm;
|
|
|
using SCADA.CommonLib;
|
|
|
using SCADA.CommonLib.Data.DIL;
|
|
|
using SCADA.Drive;
|
|
|
using SCADA_DAQ.Plugin.Machine;
|
|
|
using SCADA_DAQ.Plugin.Machine.Device;
|
|
|
using System;
|
|
|
+using System.Collections.Generic;
|
|
|
using System.Collections.ObjectModel;
|
|
|
using System.ComponentModel;
|
|
|
using System.Linq;
|
|
|
+using System.Security.Claims;
|
|
|
+using System.Speech.Synthesis;
|
|
|
+using System.Threading;
|
|
|
+using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
|
|
|
namespace SCADA_DAQ.Customer.Machines
|
|
@@ -36,8 +42,25 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
// .Select(t => new Alarm() { AlarmCode = t.AlarmCode_Str, Desc = t.AlarmDesc_Str })?
|
|
|
// .ToLookup(t => t.AlarmCode).ToDictionary(t => t.Key, t => t.First());
|
|
|
|
|
|
+ // 警报播报
|
|
|
+ Task.Run(() =>
|
|
|
+ {
|
|
|
+ while (true)
|
|
|
+ {
|
|
|
+ if (AlarmCollection.Count > 0)
|
|
|
+ {
|
|
|
+ var alarmDesc = AlarmCollection.Select(t => t.Desc).ToList(); // 缓存
|
|
|
+ var reader = new SpeechSynthesizer();
|
|
|
+ alarmDesc.ForEach(t =>
|
|
|
+ {
|
|
|
+ reader.Speak(BaseDevice.DeviceID.Substring(3, 4) + t); // 同步播报
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
+
|
|
|
///// <summary>
|
|
|
/////
|
|
|
///// </summary>
|
|
@@ -97,6 +120,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
{
|
|
|
AlarmCollection.Remove(e.Alarm);
|
|
|
}));
|
|
|
+
|
|
|
//(GlobalEnv.Instance.AlarmDB as BaseDB).Update("Base_AlarmLog",
|
|
|
// $"{T_Col_Name.Base_AlarmLog.AlarmId_Str}='{e.Alarm.Id}'",
|
|
|
// new UpdateItem(T_Col_Name.Base_AlarmLog.RecoverTime_Dt, e.Alarm.RecoverTime),
|
|
@@ -104,5 +128,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
// new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Int, e.Alarm.DurationTicks),
|
|
|
// new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|