diff --git a/Service/Plc/Handler/SummaryFailuresReqHandler.cs b/Service/Plc/Handler/SummaryFailuresReqHandler.cs index adcf172..a7ddb4e 100644 --- a/Service/Plc/Handler/SummaryFailuresReqHandler.cs +++ b/Service/Plc/Handler/SummaryFailuresReqHandler.cs @@ -26,12 +26,13 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler0) - { - EquipAlarmDefine alarm = PlcConst.EquipAlarmDefines.Where(i => i.ErrorCode == number).First(); - - if (alarm != null) - { - EquipAlarmRecordRepository.Insert(new EquipAlarmRecord() - { - EquipTypeCode = alarm.EquipTypeCode, - EquipCode = alarm.EquipCode, - ErrorCode = alarm.ErrorCode, - ErrorLevel = alarm.ErrorLevel, - ErrorMsg = alarm.ErrorMsg, - ProcessMethod = alarm.ProcessMethod, - StartTime = DateTime.Now, - }); - } - } - - } - /// /// /// @@ -73,15 +50,17 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler i.EquipCode == "plc"); List lstAlarm = new List(); + void Alarm(string number) + { + var alarm = lstEquipAlarmDefine.Where(i => i.ErrorCode == number); + if (alarm.Count() > 0) + lstAlarm.Add(alarm.ToList()[0].ErrorCode); + } + if (msg.ScreenEmergencyStop) Alarm("1"); if (msg.PassageEmergencyStop) @@ -228,7 +207,7 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler i.EquipCode == "plc"); var sqllstAlarm = lstNowEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList(); //当前报警列表 @@ -278,7 +257,7 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler