Commit 61a5bbb4 张东亮

无缓存信息持续3秒再发报警信息、发送给服务端的状态信息从异常类型改成消息

1 个父辈 4fa08e17
......@@ -103,6 +103,7 @@ namespace OnlineStore.DeviceLibrary
// private Stopwatch DiStop = new Stopwatch();
private Stopwatch abbWatch = new Stopwatch();
private string lockTimer = "";
private DateTime warnmsgDatetime = DateTime.Now;
internal void TimerProcess()
{
if (Monitor.TryEnter(lockTimer, 1))
......@@ -177,10 +178,15 @@ namespace OnlineStore.DeviceLibrary
{
CurrPoint = "";
NeedShelf = "";
if (!outMsg.Equals(""))
if (!outMsg.Equals("") && (DateTime.Now - warnmsgDatetime).TotalSeconds > 3)
{
WarnMsg = " getLocation " + outMsg;
}
else
{
warnmsgDatetime = DateTime.Now;
}
}
}
......@@ -299,7 +305,7 @@ namespace OnlineStore.DeviceLibrary
NeedRfid = CurrTray.rfid;
//料架号=000,不放料
if (!currRfid.StartsWith("D")&& !currRfid.StartsWith("C"))
if (!currRfid.StartsWith("D") && !currRfid.StartsWith("C"))
{
return false;
}
......
......@@ -500,18 +500,20 @@ namespace OnlineStore.DeviceLibrary
public string msgKey = "";
//>>>msgValue : 异常信息
public string msgValue = "";
//0:异常;1:正常显示
public int type = 0;
/// <summary>
/// 异常信息
/// </summary>
/// <param name="name">异常位置名称</param>
/// <param name="key">异常信息唯一标识</param>
/// <param name="value">异常信息</param>
public AlarmMsg(string name, string key, string value)
public AlarmMsg(string name, string key, string value, int type = 0)
{
this.name = name;
this.msgKey = key;
this.msgValue = value;
this.type = type;
}
}
public class RfidData
......
......@@ -114,7 +114,7 @@ namespace OnlineStore.DoubleLineClient
{
isAlarm = true;
showAllTaskCnt = 0;
msglist.Add(new AlarmMsg("双层线任务", "doubleLine.AllTaskInfo", DoubleLine.AllTaskInfo.ToStr()));
msglist.Add(new AlarmMsg("双层线任务", "doubleLine.AllTaskInfo", DoubleLine.AllTaskInfo.ToStr(),1));
}
if (!DoubleLine.LeftRobot.WarnMsg.Equals(""))
{
......@@ -134,12 +134,12 @@ namespace OnlineStore.DoubleLineClient
if (!LineManager.packageLine.LeftAllowIn)
{
isAlarm = true;
msglist.Add(new AlarmMsg("A5入口状态", "doubleLine.packageLine.benQInStepLeft.Msg", LineManager.packageLine.A5_State));
msglist.Add(new AlarmMsg("A5入口状态", "doubleLine.packageLine.benQInStepLeft.Msg", LineManager.packageLine.A5_State,1));
}
if (!LineManager.packageLine.A6_ReadRFID_OK)
{
isAlarm = true;
msglist.Add(new AlarmMsg("A6出口RFID读取状态", "doubleLine.packageLine.benQOutStep.Msg", LineManager.packageLine.benQOutStep.Msg));
msglist.Add(new AlarmMsg("A6出口RFID读取状态", "doubleLine.packageLine.benQOutStep.Msg", LineManager.packageLine.benQOutStep.Msg,1));
}
if (isAlarm)
HttpServer.updateDeviceAlarmMsg(msglist);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!