From 9d2b48858f9c787264b8b3336b5f40efa6926e53 Mon Sep 17 00:00:00 2001 From: CZ Date: Mon, 23 Sep 2024 23:31:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=85=E9=9A=9C=E4=BF=AE=E6=94=B9=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Plc/Handler/SummaryFailuresReqHandler.cs | 47 +++++-------------- 1 file changed, 13 insertions(+), 34 deletions(-) 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