Merge remote-tracking branch 'refs/remotes/origin/master' into develop

master
lxw 2 months ago
commit a546825ce5

@ -32,6 +32,7 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler<SummaryFail
EquipAlarmRecordRepository = equipAlarmRecordRepository;
EquipAlarmProcessRecordRepository = equipAlarmProcessRecordRepository;
}
private EquipAlarmDefineRepository EquipAlarmDefineRepository { get; set; }
private EquipAlarmRecordRepository EquipAlarmRecordRepository { get; set; }
private EquipAlarmProcessRecordRepository EquipAlarmProcessRecordRepository { get; set; }
@ -42,30 +43,6 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler<SummaryFail
private static readonly ILog Log = LogManager.GetLogger(typeof(SummaryFailuresReqHandler));
void Alarm(string number)
{
if (PlcConst.EquipAlarmDefines.Count>0)
{
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,
});
}
}
}
/// <summary>
///
/// </summary>
@ -73,15 +50,17 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler<SummaryFail
{
Log.Info("Summary of failures");
/*if (msg.Message.Length < 300)
{
Log.Error($"receive data err msg={JsonConvert.SerializeObject(msg)}");
return;
}*/
var lstEquipAlarmDefine = EquipAlarmDefineRepository.QueryListByClause(i => i.EquipCode == "plc");
List<string> lstAlarm = new List<string>();
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<SummaryFail
Alarm("72");
//查询当前PLC的实时报警信息
//查询当前充电机的实时报警信息
var lstNowEquipAlarmRecord = EquipAlarmRecordRepository.QueryListByClause(i => i.EquipCode == "plc");
var sqllstAlarm = lstNowEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList(); //当前报警列表

Loading…
Cancel
Save