diff --git a/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs b/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs index 0ab4aa3..9083ad5 100644 --- a/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs +++ b/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs @@ -174,7 +174,7 @@ namespace SlnMesnac.WPF.Page RefreshWeight(realtimeStatusList); //开关机时间采集 - machineStatusDtos.ForEach(x => OeeCollection(x)); + machineStatusDtos.ForEach(x => OeeCollection(x,1)); //报警采集 machineStatusDtos.ForEach(x => MachineWarnCollection(x)); @@ -260,7 +260,7 @@ namespace SlnMesnac.WPF.Page /// OEE设备关机采集 /// /// - private void OeeCollection(MachineStatusDto machineStatusDto) + private void OeeCollection(MachineStatusDto machineStatusDto,int shutType) { try { @@ -272,8 +272,8 @@ namespace SlnMesnac.WPF.Page { DmsRecordShutDown newRecord = new DmsRecordShutDown(); newRecord.DeviceId = machineStatusDto.deviceId; - newRecord.ShutType = 1; - newRecord.ShutReason = "正常停机"; + newRecord.ShutType = shutType; + newRecord.ShutReason = shutType==1 ? "正常停机" : "报警停机"; newRecord.ShutBeginTime = DateTime.Now; newRecord.CreateBy = "SlnMesnac"; newRecord.CreateTime = DateTime.Now; @@ -376,6 +376,8 @@ namespace SlnMesnac.WPF.Page #region 停止当前设备 StopAndMessageWarn(machineStatusDto.warnStatus); + //添加报警停机记录 + OeeCollection(machineStatusDto, 2); #endregion } else