Commit 2d395298 LN

增加异常看板数据

1 个父辈 9be2ce71
...@@ -211,7 +211,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -211,7 +211,7 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
serverConTimer = new System.Timers.Timer(); serverConTimer = new System.Timers.Timer();
serverConTimer.Interval = 2000; serverConTimer.Interval = 3000;
serverConTimer.AutoReset = true; serverConTimer.AutoReset = true;
serverConTimer.Elapsed += ServerConTimer_Elapsed; serverConTimer.Elapsed += ServerConTimer_Elapsed;
serverConTimer.Enabled = false; serverConTimer.Enabled = false;
...@@ -1030,6 +1030,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -1030,6 +1030,19 @@ namespace OnlineStore.DeviceLibrary
// >> - msg:消息, // >> - msg:消息,
// >> - data: // >> - data:
List<AlarmMsg> alarmList = new List<AlarmMsg>();
foreach (EquipBase equip in AllEquipMap.Values)
{
if (equip.alarmType.Equals(LineAlarmType.None) || equip.WarnMsg.Contains("等待空托盘到达超时"))
{
continue;
}
else
{
alarmList.Add(new AlarmMsg(equip.Name,"line."+ equip.Name + "_" + equip.alarmType, equip.WarnMsg));
}
}
SServerManager.updateDeviceAlarmMsg(alarmList);
} }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -688,12 +688,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -688,12 +688,13 @@ namespace OnlineStore.DeviceLibrary
if (topCylinderDown) if (topCylinderDown)
{ {
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW12_WaitTrayGo); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW12_WaitTrayGo);
SWLog("横移轨道41:关闭皮带电机,等待SW1_TrayCheck=0,最多等待5秒,关闭横移电机 "); SWLog("横移轨道41:关闭皮带电机,等待SW1_TrayCheck=0,关闭横移电机 ");
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW1_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW1_MotorRun, IO_VALUE.LOW);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.LOW)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.LOW));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); // SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
SW41_MoveInfo.OneWaitCanEndStep = true; // SW41_MoveInfo.OneWaitCanEndStep = true;
} }
else else
{ {
...@@ -924,12 +925,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -924,12 +925,13 @@ namespace OnlineStore.DeviceLibrary
if (topCylinderDown) if (topCylinderDown)
{ {
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW12_WaitTrayGo); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW12_WaitTrayGo);
SWLog("横移轨道23:关闭皮带电机,等待SW3_TrayCheck=0,最多等待5秒,关闭横移电机 "); SWLog("横移轨道23:关闭皮带电机,等待SW3_TrayCheck=0,关闭横移电机 ");
IOMove(IO_Type.SW2_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW2_MotorRun, IO_VALUE.LOW);
IOMove(IO_Type.SW3_MotorRun, IO_VALUE.LOW); IOMove(IO_Type.SW3_MotorRun, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.LOW)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.LOW));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); // SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
SW23_MoveInfo.OneWaitCanEndStep = true; // SW23_MoveInfo.OneWaitCanEndStep = true;
} }
else else
{ {
......
...@@ -299,7 +299,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -299,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
{ {
TimeSpan span = DateTime.Now - SecondMoveInfo.LastSetpTime; TimeSpan span = DateTime.Now - SecondMoveInfo.LastSetpTime;
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_04_Wait);
LogUtil.debug(Name + "托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸上升,下降耗时(" + FormUtil.GetSpanStr(span) + "),等待 阻挡2托盘检测=1)"); LogUtil.debug(Name + "托盘阻挡" + SecondMoveInfo.SLog + " 阻挡气缸上升,下降耗时(" + FormUtil.GetSpanStr(span) + "),等待 阻挡2托盘检测=1)");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.HIGH));
} }
// else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_FixtureCheck)) // else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_FixtureCheck))
...@@ -323,6 +323,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -323,6 +323,10 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait))
{ {
UpdateTrayNum(); UpdateTrayNum();
if (Config.SidesWayNum.Equals(4))
{
CylinderMove(null, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP);
}
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false)) if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{ {
if (TrayManager.ErrorDeviceId.Equals(DeviceID)) if (TrayManager.ErrorDeviceId.Equals(DeviceID))
...@@ -369,8 +373,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -369,8 +373,11 @@ namespace OnlineStore.DeviceLibrary
{ {
LineManager.Line.CylinderMove(null, IO_Type.SW1_TopCylinder_Down, IO_Type.SW1_TopCylinder_Up); LineManager.Line.CylinderMove(null, IO_Type.SW1_TopCylinder_Down, IO_Type.SW1_TopCylinder_Up);
} }
SecondMoveInfo.EndMove();
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
lastStopDown = DateTime.Now.AddSeconds(-2);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
} }
//MO_14_TopCylinder_Down();
} }
} }
else else
......
...@@ -543,7 +543,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -543,7 +543,7 @@ namespace OnlineStore.DeviceLibrary
result.Param.rfid = rfid; result.Param.rfid = rfid;
int storeId = result.Param.GetStoreId(); int storeId = result.Param.GetStoreId();
if (LineManager.Line.MoveEquipMap.ContainsKey(storeId)) if (LineManager.Line.MoveEquipMap.ContainsKey(storeId))
{ {
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId]; MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
if (LineManager.Line.IsReviceInPosId(moveEquip, posId)) if (LineManager.Line.IsReviceInPosId(moveEquip, posId))
{ {
...@@ -557,7 +557,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -557,7 +557,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
result.Param.InStoreNg = true; result.Param.InStoreNg = true;
result.Param.NgMsg = "未找到料仓["+storeId+"]"; result.Param.NgMsg = "未找到料仓[" + storeId + "]";
result.Msg = deviceName + ("收到服务器入库命令 " + "未找到料仓[" + storeId + "]: " + result.Param.ToStr() + " ,入库失败!"); result.Msg = deviceName + ("收到服务器入库命令 " + "未找到料仓[" + storeId + "]: " + result.Param.ToStr() + " ,入库失败!");
return result; return result;
} }
...@@ -598,6 +598,74 @@ namespace OnlineStore.DeviceLibrary ...@@ -598,6 +598,74 @@ namespace OnlineStore.DeviceLibrary
moveEquip.waitInStoreList.Add(param); moveEquip.waitInStoreList.Add(param);
} }
} }
//14.异常看板
// > 地址:
//>>/ rest / api / qisda / device / updateDeviceAlarmMsg
private static string Addr_updateDeviceAlarmMsg = "/rest/api/qisda/device/updateDeviceAlarmMsg";
public static string updateDeviceAlarmMsg(List<AlarmMsg> msgList)
{
string msg = "";
try
{
// >
// > 参数:
//>> deviceAlarmList : 异常列表Json字符串 `[{"name":"移栽5", "msgKey":"line.move5.timeOut", "msgValue":"运动超时"},{"name":"移栽4", "msgKey":"line.move4.timeOut", "msgValue":"误差过大"}]`
//>>>name : 异常位置名称
//>>>msgKey : 异常信息唯一标识
//>>>msgValue : 异常信息
//>
//> 返回:
//>>` {"code":0,"msg":"ok","data":""}`
//>>
//>> - code: 0为正常,其他为异常,
// >> - msg:消息,
// >> - data:
Dictionary<string, string> paramMap = new Dictionary<string, string>();
string msgListStr = JsonHelper.SerializeObject(msgList);
paramMap.Add("deviceAlarmList", msgListStr);
string server = GetAddr(Addr_updateDeviceAlarmMsg, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "",2000);
LogUtil.debug("updateDeviceAlarmMsg " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
if (data == null)
{
return msg = " updateDeviceAlarmMsg 没有收到服务器反馈";
}
else if (data.code.Equals(0).Equals(false))
{
return msg = " updateDeviceAlarmMsg 【" + server + "】【" + resultStr + "】" + data.msg;
}
return "";
}
catch (Exception ex)
{
LogUtil.error(" updateDeviceAlarmMsg Error: " + ex.ToString());
}
return msg;
}
}
public class AlarmMsg
{
//>>>name : 异常位置名称
public string name = "";
//>>>msgKey : 异常信息唯一标识
public string msgKey = "";
//>>>msgValue : 异常信息
public string msgValue = "";
public AlarmMsg(string n ,string key,string value)
{
this.name = n;
this.msgKey = key;
this.msgValue = value;
}
} }
public class GetPosResult public class GetPosResult
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!