Commit 111b89b1 张东亮

消息上传打印

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