上传设备报警信息

This commit is contained in:
liming 蔡
2026-07-28 10:51:38 +08:00
parent 799fb8ff06
commit a7d1772d49
11 changed files with 549 additions and 259 deletions
+48 -29
View File
@@ -1830,27 +1830,27 @@ namespace JY.Inspection
});
}
break;
//case 3://3#报警
// if (msg == "1" || msg == "2")
// {
// AlamCode = msg;
// omronPLCCom.lstMcUI[0].WriteDReg(omronPLCCom.lstMcUI[0].lstTrgUI[2].TrgParams.TriggerAddr, (short)3);
// mTaskA[2] = Task.Factory.StartNew(delegate
// {
// AlarmProcess(mctsA3, resByte);
// });
// }
// break;
//case 4: //4#异常播报
// if (omronPLCCom.lstMcUI[0].lstTrgUI[3].TrgParams.TriggerCmd == msg)
// {
// omronPLCCom.lstMcUI[0].WriteDReg(omronPLCCom.lstMcUI[0].lstTrgUI[3].TrgParams.TriggerAddr, (short)2);
// mTaskA[3] = Task.Factory.StartNew(delegate
// {
// processA3(mctsA4, resByte);
// });
// }
// break;
case 3://3#报警
if (msg == "1" || msg == "2")
{
AlamCode = msg;
omronPLCCom.lstMcUI[0].WriteDReg(omronPLCCom.lstMcUI[0].lstTrgUI[2].TrgParams.TriggerAddr, (short)3);
mTaskA[2] = Task.Factory.StartNew(delegate
{
AlarmProcess(mctsA3, resByte);
});
}
break;
//case 4: //4#异常播报
// if (omronPLCCom.lstMcUI[0].lstTrgUI[3].TrgParams.TriggerCmd == msg)
// {
// omronPLCCom.lstMcUI[0].WriteDReg(omronPLCCom.lstMcUI[0].lstTrgUI[3].TrgParams.TriggerAddr, (short)2);
// mTaskA[3] = Task.Factory.StartNew(delegate
// {
// processA3(mctsA4, resByte);
// });
// }
// break;
}
}
else
@@ -3033,27 +3033,46 @@ namespace JY.Inspection
// LogManagerControl.AddLog($"PC->FMS[MES_Alarm]:{strJosn}", LogAddtype.MES);
//TxtHelper.WriteTxt($@"{Global.strMesLogspath}\{DateTime.Now.ToString("yyyyMMdd")}\设备报警\{DateTime.Now.ToString("HH")}.txt", strJosn);
ReqAlarm req = new ReqAlarm()
{
SiteCode = Global.systemConfig.siteCode,
LineCode = Global.systemConfig.lineCode,
EquipNum = Global.systemConfig.equipCode,
MaterialCode = string.Empty,
UserName = Global.systemConfig.userName,
RecordDate = Alarm.recordDate,
SeatId = Alarm.seatId,
Guid = Alarm.guid,
AlarmLineList = new List<AlarmLine>() {
new AlarmLine() {
AlarmEndTime = Alarm.alarmEndTime,
AlarmType = Alarm.alarmType,
AlarmName = Alarm.alarmName,
AlarmStartTime = Alarm.alarmStartTime,
FaultCode = Alarm.faultCode,
}
}
};
Stopwatch swTime1 = new Stopwatch();
swTime1.Start();
var AlarmResult = JY.MES.FMS.MesHelper_EVE.MES_Alarm(Alarm);
//var AlarmResult = JY.MES.FMS.MesHelper_EVE.MES_Alarm(Alarm);
MesCallResult<RespAlarm> AlarmResult = new MESDataCombin().UpAlarmData(req);
swTime1.Stop();
LogManagerControl.AddLog($"处理报警上报FMS耗时:{swTime1.ElapsedMilliseconds}ms", LogAddtype.local, Logtype.Message);
if (result != null)
{
string strRes = "code" + "[" + AlarmResult.code + "]" + "success" + "[" + AlarmResult.success + "]" + "message" + "[" + AlarmResult.message + "]" + "category" + "[" + AlarmResult.category + "]";
{
string strRes = "code" + "[" + AlarmResult?.OriResponse?.Code + "]" + "success" + "[" + AlarmResult?.OriResponse?.Success + "]" + "message" + "[" + AlarmResult?.OriResponse?.Message + "]" + "category" + "[" + AlarmResult?.OriResponse?.Category + "]";
LogManagerControl.AddLog($"FMS->PC[MES_Alarm]:{strRes}", LogAddtype.MES);
}
else
{
LogManagerControl.AddLog($"报警上报FMS出错", LogAddtype.local, Logtype.Message);
LogManagerControl.AddLog($"报警上报Mes出错", LogAddtype.local, Logtype.Message);
}
}
// }
}
}
}