|
@@ -97,7 +97,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
// }
|
|
|
//}
|
|
|
if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.HourChanged ||
|
|
|
- e.ChangeType == SCADA.CommonLib.DateTimeChangeType.MinuteChanged)
|
|
|
+ e.ChangeType.HasFlag(DateTimeChangeType.MinuteChanged) == SCADA.CommonLib.DateTimeChangeType.MinuteChanged.HasFlag(DateTimeChangeType.MinuteChanged))
|
|
|
{
|
|
|
var duration = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>().ToLookup(t => t.Device);
|
|
|
foreach (var item in duration)
|
|
@@ -190,21 +190,13 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
{
|
|
|
AlarmCollection.Add(e.Alarm);
|
|
|
}));
|
|
|
- (GlobalEnv.Instance.AlarmDB as BaseDB).Insert(out _, "Base_AlarmLog",
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmId_Str, e.Alarm.Id),
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmCode_Str, e.Alarm.AlarmCode),
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.Device_Str, reg.Protocol?.DeviceID),
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.TagName_Str, reg.Comment.Variable),
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.TriggedTime_Dt, e.Alarm.TriggedTime),
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
|
|
|
- //Env.DAL.Base_AlarmLog.Insert(
|
|
|
+ //(GlobalEnv.Instance.AlarmDB as BaseDB).Insert(out _, "Base_AlarmLog",
|
|
|
// new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmId_Str, e.Alarm.Id),
|
|
|
// new UpdateItem(T_Col_Name.Base_AlarmLog.AlarmCode_Str, e.Alarm.AlarmCode),
|
|
|
// new UpdateItem(T_Col_Name.Base_AlarmLog.Device_Str, reg.Protocol?.DeviceID),
|
|
|
// new UpdateItem(T_Col_Name.Base_AlarmLog.TagName_Str, reg.Comment.Variable),
|
|
|
// new UpdateItem(T_Col_Name.Base_AlarmLog.TriggedTime_Dt, e.Alarm.TriggedTime),
|
|
|
- // new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed)
|
|
|
- // );
|
|
|
+ // new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
|
|
|
}
|
|
|
|
|
|
/// <summary> ·
|
|
@@ -219,18 +211,12 @@ 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),
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Str, e.Alarm.Duration.ToString(@"dd\.hh\:mm\:ss\.fff")),
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Int, e.Alarm.DurationTicks),
|
|
|
- new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
|
|
|
- //Env.DAL.Base_AlarmLog.Update(
|
|
|
- //$"{T_Col_Name.Base_AlarmLog.AlarmId_Str}='{e.Alarm.Id}'",
|
|
|
- //new UpdateItem(T_Col_Name.Base_AlarmLog.RecoverTime_Dt, e.Alarm.RecoverTime),
|
|
|
- //new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Str, e.Alarm.Duration.ToString(@"dd\.hh\:mm\:ss\.fff")),
|
|
|
- //new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Int, e.Alarm.DurationTicks),
|
|
|
- //new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
|
|
|
+ //(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),
|
|
|
+ // new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Str, e.Alarm.Duration.ToString(@"dd\.hh\:mm\:ss\.fff")),
|
|
|
+ // new UpdateItem(T_Col_Name.Base_AlarmLog.Duration_Int, e.Alarm.DurationTicks),
|
|
|
+ // new UpdateItem(T_Col_Name.Base_AlarmLog.IsClosed_Bit, e.Alarm.IsClosed));
|
|
|
}
|
|
|
|
|
|
public override void ConnectStateChanged(object sender, ConnectStateChangedEventArgs e)
|