|
@@ -4,6 +4,7 @@ using SCADA.CommonLib;
|
|
|
using SCADA.CommonLib.Data.DIL;
|
|
|
using SCADA.Drive;
|
|
|
using SCADA_DAQ.Customer.Models;
|
|
|
+using SCADA_DAQ.Plugin.Machine;
|
|
|
using SCADA_DAQ.Plugin.Machine.Device;
|
|
|
using SqlSchema.DBNames;
|
|
|
using System;
|
|
@@ -20,6 +21,8 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
[DisplayName("CP1H")]
|
|
|
public class CP1HMachine : SampleMachine
|
|
|
{
|
|
|
+ public SampleMachine machine = MachineServer.GetInstance().GetMachine<SampleMachine>("高机母线冲剪机");
|
|
|
+
|
|
|
public YaweiStateInfoModel ProgramStart = new YaweiStateInfoModel();
|
|
|
|
|
|
public YaweiStateInfoModel ChangeModel = new YaweiStateInfoModel();
|
|
@@ -30,15 +33,20 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
|
|
|
public YaweiStateInfoModel RepairTime = new YaweiStateInfoModel();
|
|
|
|
|
|
+ public YaweiStateInfoModel AlarmTime = new YaweiStateInfoModel();
|
|
|
+
|
|
|
public string WaitNameStateCode { get; set; }
|
|
|
|
|
|
public string OrgID { get; set; }
|
|
|
- private int _MyProperty;
|
|
|
|
|
|
+
|
|
|
+ public bool AlarmCode { get; set; }
|
|
|
public CP1HMachine(string machieID) : base(machieID)
|
|
|
{
|
|
|
+
|
|
|
Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
|
|
|
PropertyChanged += CP1HMachine_PropertyChanged;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -51,6 +59,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
|
|
|
private void CP1HMachine_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
|
{
|
|
|
+ AlarmCode = this.BaseDevice.IsAlarmed;
|
|
|
if (e.PropertyName == nameof(IsOpenTime))
|
|
|
{
|
|
|
if (IsOpenTime == true)
|
|
@@ -92,6 +101,16 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
RepairTime.OnOrgID_Str = "";
|
|
|
}
|
|
|
|
|
|
+ if (AlarmTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{AlarmTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - AlarmTime.StateOnTime_Dt)),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - AlarmTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ AlarmTime.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
else
|
|
@@ -101,92 +120,90 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
if (ConnectState == SCADA.Comm.ConnectStates.Connected)
|
|
|
{
|
|
|
var repairTime = this.GetListenReg("维修时间");
|
|
|
- int RepairValueRegFlag = 0;
|
|
|
- RepairValueRegFlag =(int)repairTime.Value;
|
|
|
if (repairTime.Value == 1)
|
|
|
- {
|
|
|
- RepairValueRegTrue = true;
|
|
|
- RepairTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
- RepairTime.StateOnTime_Dt = DateTime.Now;
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, RepairTime.OnOrgID_Str),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "维修时间"));
|
|
|
+ {
|
|
|
+ RepairValueRegTrue = true;
|
|
|
+ RepairTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ RepairTime.StateOnTime_Dt = DateTime.Now;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, RepairTime.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "维修时间"));
|
|
|
|
|
|
- }
|
|
|
- else if (repairTime.Value == 0)
|
|
|
+ }
|
|
|
+ else if (repairTime.Value == 0)
|
|
|
+ {
|
|
|
+ if (RepairTime.OnOrgID_Str != "")
|
|
|
{
|
|
|
- if (RepairTime.OnOrgID_Str != "")
|
|
|
- {
|
|
|
- RepairValueRegTrue = false;
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{RepairTime.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - RepairTime.StateOnTime_Dt)),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - RepairTime.StateOnTime_Dt).TotalSeconds));
|
|
|
- RepairTime.OnOrgID_Str = "";
|
|
|
- }
|
|
|
-
|
|
|
+ RepairValueRegTrue = false;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{RepairTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - RepairTime.StateOnTime_Dt)),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - RepairTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ RepairTime.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
var runTIme = this.GetListenReg("运行标志位");
|
|
|
- if (runTIme.Value == 1 && RepairValueRegTrue != true)
|
|
|
- {
|
|
|
- ProgramStart.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
- ProgramStart.StateOnTime_Dt = DateTime.Now;
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, ProgramStart.OnOrgID_Str),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "运行标志位"));
|
|
|
- }
|
|
|
- else if (runTIme.Value == 0)
|
|
|
+ if (runTIme.Value == 1 && RepairValueRegTrue != true && AlarmCode != true)
|
|
|
+ {
|
|
|
+ ProgramStart.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ ProgramStart.StateOnTime_Dt = DateTime.Now;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, ProgramStart.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "运行标志位"));
|
|
|
+ }
|
|
|
+ else if (runTIme.Value == 0)
|
|
|
+ {
|
|
|
+ if (ProgramStart.OnOrgID_Str != "")
|
|
|
{
|
|
|
- if (ProgramStart.OnOrgID_Str != "")
|
|
|
- {
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ProgramStart.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ProgramStart.StateOnTime_Dt).TotalSeconds));
|
|
|
- ProgramStart.OnOrgID_Str = "";
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ProgramStart.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ProgramStart.StateOnTime_Dt).TotalSeconds));
|
|
|
+ ProgramStart.OnOrgID_Str = "";
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
var changeMoldTime = this.GetListenReg("换模标志位");
|
|
|
- if (changeMoldTime.Value == 0 && RepairValueRegTrue != true)
|
|
|
- {
|
|
|
- ChangeModel.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
- ChangeModel.StateOnTime_Dt = DateTime.Now;
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, ChangeModel.OnOrgID_Str),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "换模标志位"));
|
|
|
- }
|
|
|
- else
|
|
|
+ if (changeMoldTime.Value == 0 && RepairValueRegTrue != true && AlarmCode != true)
|
|
|
+ {
|
|
|
+ ChangeModel.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ ChangeModel.StateOnTime_Dt = DateTime.Now;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, ChangeModel.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "换模标志位"));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (ChangeModel.OnOrgID_Str != "")
|
|
|
{
|
|
|
- if (ChangeModel.OnOrgID_Str != "")
|
|
|
- {
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ChangeModel.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- //new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - ProgramStart.StateOnTime_Dt)),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ChangeModel.StateOnTime_Dt).TotalSeconds));
|
|
|
- ChangeModel.OnOrgID_Str = "";
|
|
|
- }
|
|
|
-
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ChangeModel.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ //new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - ProgramStart.StateOnTime_Dt)),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ChangeModel.StateOnTime_Dt).TotalSeconds));
|
|
|
+ ChangeModel.OnOrgID_Str = "";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
var runFlag = this.GetListenReg("运行标志位");
|
|
|
var toolChangeFlag = this.GetListenReg("换模标志位");
|
|
|
var repairFlag = this.GetListenReg("维修时间");
|
|
|
RegInfo reg = runFlag.Value == 1 ? runFlag : toolChangeFlag.Value == 0 ? toolChangeFlag : repairFlag.Value == 1 ? repairFlag : null;
|
|
|
- if (reg == null)
|
|
|
+ if (reg == null && AlarmCode != true)
|
|
|
{
|
|
|
if (WaitNameStateCode != "停止标志位")
|
|
|
{
|
|
@@ -216,18 +233,83 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if (AlarmCode == true && RepairValueRegTrue != true)
|
|
|
+ {
|
|
|
+ if (WaitTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{WaitTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - WaitTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ WaitTime.OnOrgID_Str = "";
|
|
|
+ WaitNameStateCode = "";
|
|
|
+ }
|
|
|
+ if (ChangeModel.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ChangeModel.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ChangeModel.StateOnTime_Dt).TotalSeconds));
|
|
|
+ ChangeModel.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+ if (ProgramStart.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ProgramStart.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ProgramStart.StateOnTime_Dt).TotalSeconds));
|
|
|
+ ProgramStart.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+ if (AlarmTime.OnOrgID_Str == "")
|
|
|
+ {
|
|
|
+ AlarmTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ AlarmTime.StateOnTime_Dt = DateTime.Now;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, AlarmTime.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "故障标志位"));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (AlarmTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{AlarmTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - AlarmTime.StateOnTime_Dt)),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - AlarmTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ AlarmTime.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- WaitTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
- WaitTime.StateOnTime_Dt = DateTime.Now;
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, WaitTime.OnOrgID_Str),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"));
|
|
|
- WaitNameStateCode = "停止标志位";
|
|
|
+ if (WaitNameStateCode != "停止标志位")
|
|
|
+ {
|
|
|
+ WaitTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ WaitTime.StateOnTime_Dt = DateTime.Now;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, WaitTime.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"));
|
|
|
+ WaitNameStateCode = "停止标志位";
|
|
|
+ }
|
|
|
+ //WaitTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ //WaitTime.StateOnTime_Dt = DateTime.Now;
|
|
|
+ //Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ // new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, WaitTime.OnOrgID_Str),
|
|
|
+ // new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ // new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ // new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"));
|
|
|
+ //WaitNameStateCode = "停止标志位";
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -236,6 +318,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
protected override void RegReadValueChanged(object sender, RegReadValueChangedEventArgs e)
|
|
|
{
|
|
|
|
|
|
+ AlarmCode = this.BaseDevice.IsAlarmed;
|
|
|
if (!IsOpenTime)
|
|
|
{
|
|
|
if (ConnectState == SCADA.Comm.ConnectStates.Connected)
|
|
@@ -271,15 +354,13 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - RepairTime.StateOnTime_Dt).TotalSeconds));
|
|
|
RepairTime.OnOrgID_Str = "";
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (reg.Comment.Variable == "运行标志位" && RepairValueRegTrue==false)
|
|
|
+ if (reg.Comment.Variable == "运行标志位" && RepairValueRegTrue == false && AlarmCode != true)
|
|
|
{
|
|
|
|
|
|
if (reg.Value == 1)
|
|
@@ -307,7 +388,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
|
|
|
}
|
|
|
|
|
|
- if (reg.Comment.Variable == "换模标志位" && RepairValueRegTrue == false)
|
|
|
+ if (reg.Comment.Variable == "换模标志位" && RepairValueRegTrue == false && AlarmCode != true)
|
|
|
{
|
|
|
if (reg.Value == 0)
|
|
|
{
|
|
@@ -337,9 +418,9 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
var toolChangeFlag = this.GetListenReg("换模标志位");
|
|
|
var repairFlag = this.GetListenReg("维修时间");
|
|
|
reg = runFlag.Value == 1 ? runFlag : toolChangeFlag.Value == 0 ? toolChangeFlag : repairFlag.Value == 1 ? repairFlag : null;
|
|
|
- if (reg == null)
|
|
|
+ if (reg == null && AlarmCode != true)
|
|
|
{
|
|
|
- if (WaitNameStateCode != "停止标志位")
|
|
|
+ if (WaitTime.OnOrgID_Str == "" & WaitNameStateCode != "停止标志位")
|
|
|
{
|
|
|
WaitTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
WaitTime.StateOnTime_Dt = DateTime.Now;
|
|
@@ -347,8 +428,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, WaitTime.OnOrgID_Str),
|
|
|
new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.TagName_Str, "停止标志位"));
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"));
|
|
|
WaitNameStateCode = "停止标志位";
|
|
|
}
|
|
|
|
|
@@ -367,69 +447,139 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ if (AlarmCode == true && RepairValueRegTrue != true)
|
|
|
+ {
|
|
|
+ if (WaitTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{WaitTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - WaitTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ WaitTime.OnOrgID_Str = "";
|
|
|
+ WaitNameStateCode = "";
|
|
|
+ }
|
|
|
+ if (ChangeModel.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ChangeModel.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ChangeModel.StateOnTime_Dt).TotalSeconds));
|
|
|
+ ChangeModel.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+ if (ProgramStart.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ProgramStart.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ProgramStart.StateOnTime_Dt).TotalSeconds));
|
|
|
+ ProgramStart.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+ if (AlarmTime.OnOrgID_Str == "")
|
|
|
+ {
|
|
|
+ AlarmTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ AlarmTime.StateOnTime_Dt = DateTime.Now;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, AlarmTime.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "故障标志位"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (AlarmTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{AlarmTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - AlarmTime.StateOnTime_Dt)),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - AlarmTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ AlarmTime.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- WaitTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
- WaitTime.StateOnTime_Dt = DateTime.Now;
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, WaitTime.OnOrgID_Str),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"));
|
|
|
- WaitNameStateCode = "停止标志位";
|
|
|
+ if (WaitNameStateCode != "停止标志位")
|
|
|
+ {
|
|
|
+ WaitTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ WaitTime.StateOnTime_Dt = DateTime.Now;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, WaitTime.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"));
|
|
|
+ WaitNameStateCode = "停止标志位";
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
public override void ConnectStateChanged(object sender, ConnectStateChangedEventArgs e)
|
|
|
{
|
|
|
base.ConnectStateChanged(sender, e);
|
|
|
+ AlarmCode = this.BaseDevice.IsAlarmed;
|
|
|
if (!IsOpenTime)
|
|
|
{
|
|
|
- if (ConnectState != SCADA.Comm.ConnectStates.Connected)
|
|
|
- {
|
|
|
- PowerOn.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
- Env.SqlDAL.App_Vertiv_WorkTime.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_WorkTime.OrgID_Str, PowerOn.OnOrgID_Str),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_WorkTime.DeviceName_Str, BaseDevice.DeviceID)
|
|
|
- );
|
|
|
- PowerOn.StateOnTime_Dt = DateTime.Now;
|
|
|
+
|
|
|
+ if (ConnectState != SCADA.Comm.ConnectStates.Connected)
|
|
|
+ {
|
|
|
+ PowerOn.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ Env.SqlDAL.App_Vertiv_WorkTime.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_WorkTime.OrgID_Str, PowerOn.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_WorkTime.DeviceName_Str, BaseDevice.DeviceID)
|
|
|
+ );
|
|
|
+ PowerOn.StateOnTime_Dt = DateTime.Now;
|
|
|
|
|
|
- WaitTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
- WaitTime.StateOnTime_Dt = DateTime.Now;
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, WaitTime.OnOrgID_Str),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.TagName_Str, "停止标志位"));
|
|
|
- WaitNameStateCode = "停止标志位";
|
|
|
- OrgID = WaitTime.OnOrgID_Str;
|
|
|
- }
|
|
|
- else if (ConnectState == SCADA.Comm.ConnectStates.Connected)
|
|
|
- {
|
|
|
|
|
|
- if (PowerOn.OnOrgID_Str != "")
|
|
|
+ if (WaitNameStateCode != "停止标志位")
|
|
|
{
|
|
|
- Env.SqlDAL.App_Vertiv_WorkTime.Update($"{T_Col_Name.App_Vertiv_WorkTime.OrgID_Str} = '{PowerOn.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_WorkTime.TurnOffTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_WorkTime.DurationSec_Dec, (DateTime.Now - PowerOn.StateOnTime_Dt).TotalSeconds));
|
|
|
- PowerOn.OnOrgID_Str = "";
|
|
|
+ WaitTime.OnOrgID_Str = Guid.NewGuid().ToString();
|
|
|
+ WaitTime.StateOnTime_Dt = DateTime.Now;
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Insert(
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateId_Str, WaitTime.OnOrgID_Str),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Device_Str, BaseDevice.DeviceID),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StartTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.StateCode_Str, "停止标志位"),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.TagName_Str, "停止标志位"));
|
|
|
+ WaitNameStateCode = "停止标志位";
|
|
|
+ OrgID = WaitTime.OnOrgID_Str;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- if (WaitTime.OnOrgID_Str != "")
|
|
|
+ else if (ConnectState == SCADA.Comm.ConnectStates.Connected)
|
|
|
{
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{WaitTime.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - WaitTime.StateOnTime_Dt).TotalSeconds));
|
|
|
- }
|
|
|
|
|
|
+ if (PowerOn.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_WorkTime.Update($"{T_Col_Name.App_Vertiv_WorkTime.OrgID_Str} = '{PowerOn.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_WorkTime.TurnOffTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_WorkTime.DurationSec_Dec, (DateTime.Now - PowerOn.StateOnTime_Dt).TotalSeconds));
|
|
|
+ PowerOn.OnOrgID_Str = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (WaitTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{WaitTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - WaitTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -460,55 +610,66 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- if (e.ChangeType == DateTimeChangeType.MinuteChanged)
|
|
|
+ if (e.ChangeType == DateTimeChangeType.SecondChanged & e.TimeFlag.Second % 15 == 0)
|
|
|
{
|
|
|
- if (ConnectState != SCADA.Comm.ConnectStates.Connected)
|
|
|
- {
|
|
|
+ AlarmCode = this.BaseDevice.IsAlarmed;
|
|
|
+
|
|
|
+ if (ConnectState != SCADA.Comm.ConnectStates.Connected)
|
|
|
+ {
|
|
|
+ if (WaitTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{WaitTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - WaitTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (WaitTime.OnOrgID_Str != "")
|
|
|
{
|
|
|
Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{WaitTime.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - WaitTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{WaitTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - WaitTime.StateOnTime_Dt).TotalSeconds));
|
|
|
}
|
|
|
- }
|
|
|
+ if (ChangeModel.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ChangeModel.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ChangeModel.StateOnTime_Dt).TotalSeconds));
|
|
|
|
|
|
- if (WaitTime.OnOrgID_Str != "")
|
|
|
- {
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{WaitTime.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - WaitTime.StateOnTime_Dt).TotalSeconds));
|
|
|
- }
|
|
|
- if (ChangeModel.OnOrgID_Str != "")
|
|
|
- {
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ChangeModel.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ChangeModel.StateOnTime_Dt).TotalSeconds));
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ if (ProgramStart.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ProgramStart.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ProgramStart.StateOnTime_Dt).TotalSeconds));
|
|
|
|
|
|
- if (ProgramStart.OnOrgID_Str != "")
|
|
|
- {
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{ProgramStart.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - ProgramStart.StateOnTime_Dt).TotalSeconds));
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ if (RepairTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{RepairTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - RepairTime.StateOnTime_Dt)),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - RepairTime.StateOnTime_Dt).TotalSeconds));
|
|
|
|
|
|
- if (RepairTime.OnOrgID_Str != "")
|
|
|
- {
|
|
|
- Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
- $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{RepairTime.OnOrgID_Str}'",
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - RepairTime.StateOnTime_Dt)),
|
|
|
- new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - RepairTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ if (AlarmTime.OnOrgID_Str != "")
|
|
|
+ {
|
|
|
+ Env.SqlDAL.App_Vertiv_MachineInfo.Update(
|
|
|
+ $"{T_Col_Name.App_Vertiv_MachineInfo.StateId_Str} = '{AlarmTime.OnOrgID_Str}'",
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.EndTime_Dt, DateTime.Now),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.Duration_Dt, (DateTime.Now - AlarmTime.StateOnTime_Dt)),
|
|
|
+ new UpdateItem(T_Col_Name.App_Vertiv_MachineInfo.DurationSec_Int, (DateTime.Now - AlarmTime.StateOnTime_Dt).TotalSeconds));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|