Commit 111b89b1 张东亮

消息上传打印

1 个父辈 c752d3a0
...@@ -247,9 +247,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -247,9 +247,9 @@ namespace OnlineStore.DeviceLibrary
} }
} }
WarnMsg = msg; WarnMsg = msg;
if(!string.IsNullOrEmpty(WarnMsg)) if(!string.IsNullOrEmpty(msg))
{ {
Msg.add(WarnMsg, MsgLevel.alarm); Msg.add(msg, MsgLevel.alarm);
} }
} }
public void SetCriticalMsg(string msg = "") public void SetCriticalMsg(string msg = "")
...@@ -269,9 +269,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -269,9 +269,9 @@ namespace OnlineStore.DeviceLibrary
} }
} }
WarnMsg = msg; WarnMsg = msg;
if (!string.IsNullOrEmpty(WarnMsg)) if (!string.IsNullOrEmpty(msg))
{ {
Msg.add(WarnMsg, MsgLevel.critical); Msg.add(msg, MsgLevel.critical);
} }
} }
......
...@@ -137,7 +137,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -137,7 +137,7 @@ namespace OnlineStore.DeviceLibrary
} }
public void NextMoveStep(StepEnum step) public void NextMoveStep(StepEnum step)
{ {
TimeOutSeconds = 60; TimeOutSeconds = 120;
PreMoveStep = moveStep; PreMoveStep = moveStep;
moveStep = step; moveStep = step;
LastSetpTime = DateTime.Now; LastSetpTime = DateTime.Now;
...@@ -158,7 +158,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -158,7 +158,7 @@ namespace OnlineStore.DeviceLibrary
} }
public void NewMove(MoveType type ) public void NewMove(MoveType type )
{ {
TimeOutSeconds = 60; TimeOutSeconds = 120;
moveStep = StepEnum.Wait; moveStep = StepEnum.Wait;
this.moveType = type; this.moveType = type;
LastSetpTime = DateTime.Now; LastSetpTime = DateTime.Now;
...@@ -168,7 +168,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -168,7 +168,7 @@ namespace OnlineStore.DeviceLibrary
} }
public void NewMove(MoveType type, InOutParam param) public void NewMove(MoveType type, InOutParam param)
{ {
TimeOutSeconds = 60; TimeOutSeconds = 120;
moveStep = StepEnum.Wait; moveStep = StepEnum.Wait;
this.moveType = type; this.moveType = type;
this.MoveParam = param; this.MoveParam = param;
......
...@@ -267,7 +267,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -267,7 +267,7 @@ namespace OnlineStore.DeviceLibrary
if (alarmIo.Equals(1)) if (alarmIo.Equals(1))
{ {
WarnMsg = Name + " " + axisInfo.AxisName + "报警"; WarnMsg = Name + " " + axisInfo.AxisName + "报警";
Msg.add(WarnMsg, MsgLevel.alarm); Msg.add(Name + " " + axisInfo.AxisName + "报警", MsgLevel.alarm);
LogUtil.error(WarnMsg); LogUtil.error(WarnMsg);
if (NeedAlarm) if (NeedAlarm)
...@@ -330,7 +330,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -330,7 +330,7 @@ namespace OnlineStore.DeviceLibrary
{ {
isOk = false; isOk = false;
WarnMsg = Name + msg; WarnMsg = Name + msg;
Msg.add(WarnMsg, MsgLevel.alarm); Msg.add(Name + msg, MsgLevel.alarm);
Alarm(AlarmType.AxisMoveError); Alarm(AlarmType.AxisMoveError);
LogUtil.error(WarnMsg, moveInfo.ErrorLogType, moveInfo.logSeconds()); LogUtil.error(WarnMsg, moveInfo.ErrorLogType, moveInfo.logSeconds());
break; break;
......
...@@ -127,6 +127,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -127,6 +127,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
string preUploadMsg = "";
public void ProcessMsg(List<Msg> msg) public void ProcessMsg(List<Msg> msg)
{ {
uploadMsg = string.Join("\r\n", msg.Select(x => uploadMsg = string.Join("\r\n", msg.Select(x =>
...@@ -135,9 +136,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -135,9 +136,14 @@ namespace OnlineStore.DeviceLibrary
{ {
return GetMsgPrefix(x.msgLevel) + x.msgtxt; return GetMsgPrefix(x.msgLevel) + x.msgtxt;
} }
return null;
} }
).Where(x => !string.IsNullOrEmpty(x))); ).Where(x => !string.IsNullOrEmpty(x)));
if (!preUploadMsg.Equals(uploadMsg))
{
LogUtil.info("上传消息到服务器消息:" + uploadMsg);
preUploadMsg = uploadMsg;
}
} }
string GetMsgPrefix(MsgLevel msgLevel) string GetMsgPrefix(MsgLevel msgLevel)
{ {
...@@ -416,7 +422,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -416,7 +422,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因 //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = Name + "未找到库位:【" + inoutParam.PosInfo.ToStr() + "】"; WarnMsg = Name + "未找到库位:【" + inoutParam.PosInfo.ToStr() + "】";
Msg.add(WarnMsg, MsgLevel.warning); Msg.add(Name + "未找到库位:【" + inoutParam.PosInfo.ToStr() + "】", MsgLevel.warning);
LogUtil.error(WarnMsg); LogUtil.error(WarnMsg);
continue; continue;
} }
......
...@@ -333,8 +333,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -333,8 +333,14 @@ namespace OnlineStore.DeviceLibrary
MoveLog($" 入料->A侧 {MoveInfo.SLog}: 暂存区为空, 进出轴 到P2(A暂存区放料点){Config.Inout_P2}"); MoveLog($" 入料->A侧 {MoveInfo.SLog}: 暂存区为空, 进出轴 到P2(A暂存区放料点){Config.Inout_P2}");
InOutAxis.AbsMove(MoveInfo, Config.Inout_P2, Config.Inout_P2_Speed); InOutAxis.AbsMove(MoveInfo, Config.Inout_P2, Config.Inout_P2_Speed);
} }
else if (MoveInfo.IsTimeOut(60)) else if (MoveInfo.IsTimeOut(120))
{
if (StoreManager.XLRStore.boxEquip.runStatus == RunStatus.Reset ||
StoreManager.XLRStore.boxEquip.runStatus == RunStatus.HomeMoving)
{ {
MoveInfo.LastSetpTime = DateTime.Now;
}
else
SetWarnMsg("A上暂存区物料拿走"); SetWarnMsg("A上暂存区物料拿走");
} }
} }
...@@ -424,8 +430,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -424,8 +430,14 @@ namespace OnlineStore.DeviceLibrary
ClearTimeoutAlarm("B上暂存区物料拿走"); ClearTimeoutAlarm("B上暂存区物料拿走");
II63_InoutToP3(); II63_InoutToP3();
} }
else if (MoveInfo.IsTimeOut(60)) else if (MoveInfo.IsTimeOut(120))
{
if (StoreManager.XLRStore.boxEquip.runStatus == RunStatus.Reset ||
StoreManager.XLRStore.boxEquip.runStatus == RunStatus.HomeMoving)
{ {
MoveInfo.LastSetpTime = DateTime.Now;
}
else
SetWarnMsg("B上暂存区物料拿走"); SetWarnMsg("B上暂存区物料拿走");
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!