Commit 61a5bbb4 张东亮

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

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