Commit 70311462 张东亮

1、获取库位时上报入料口信息;2、清理出库托盘时上报。

1 个父辈 d93c5c2b
...@@ -29,7 +29,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -29,7 +29,7 @@ namespace OnlineStore.DeviceLibrary
if (runStatus.Equals(LineRunStatus.Runing)) if (runStatus.Equals(LineRunStatus.Runing))
{ {
LogInfo("启动出库【" + posId + "】升降气缸上升 "); LogInfo("启动出库【" + posId + "】升降气缸上升 ");
runStatus = LineRunStatus.Busy; runStatus = LineRunStatus.Busy;
MoveInfo.NewMove(LineMoveType.OutStore); MoveInfo.NewMove(LineMoveType.OutStore);
MoveInfo.MoveParam = param; MoveInfo.MoveParam = param;
MoveInfo.NextMoveStep(LineMoveStep.MO_50_StartOutProcess); MoveInfo.NextMoveStep(LineMoveStep.MO_50_StartOutProcess);
...@@ -84,7 +84,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -84,7 +84,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown); MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown);
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 "); OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 ");
UpdownDownP3Move(MoveInfo.MoveParam.PlateH,MoveInfo.MoveParam.PlateW); UpdownDownP3Move(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down); // CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
} }
else else
...@@ -118,7 +118,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -118,7 +118,8 @@ namespace OnlineStore.DeviceLibrary
UpdownUpMove(); UpdownUpMove();
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up); // CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
}else if (MoveInfo.IsStep(LineMoveStep.MO_56_ResetClamp)) }
else if (MoveInfo.IsStep(LineMoveStep.MO_56_ResetClamp))
{ {
MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown); MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown);
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 "); OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 ");
...@@ -144,13 +145,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -144,13 +145,13 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.MO_57_ClampCheck)) else if (MoveInfo.IsStep(LineMoveStep.MO_57_ClampCheck))
{ {
if (UpdownIsUp()) if (UpdownIsUp())
{ {
if (IOValue(IO_Type.ClampCylinder_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.ClampCylinder_Check).Equals(IO_VALUE.HIGH))
{ {
if (IsBigStore()) if (IsBigStore())
{ {
MoveInfo.NextMoveStep(LineMoveStep.MO_58_WaitTray); MoveInfo.NextMoveStep(LineMoveStep.MO_58_WaitTray);
OutLog("出库 " + MoveInfo.SLog + ": 等待托盘到达"); OutLog("出库 " + MoveInfo.SLog + ": 等待托盘到达");
} }
else else
{ {
...@@ -164,7 +165,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -164,7 +165,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(LineMoveStep.MO_56_ResetClamp); MoveInfo.NextMoveStep(LineMoveStep.MO_56_ResetClamp);
ClampCount = 1; ClampCount = 1;
OutLog("出库 " + MoveInfo.SLog + ": 第一次未抓到料,重新抓一次,夹爪先放松",1); OutLog("出库 " + MoveInfo.SLog + ": 第一次未抓到料,重新抓一次,夹爪先放松", 1);
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax); CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
} }
} }
...@@ -174,7 +175,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -174,7 +175,8 @@ namespace OnlineStore.DeviceLibrary
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸上升"); OutLog("出库 " + MoveInfo.SLog + ": 上下气缸上升");
UpdownUpMove(); UpdownUpMove();
} }
}else if (MoveInfo.IsStep(LineMoveStep.MO_58_WaitTray)) }
else if (MoveInfo.IsStep(LineMoveStep.MO_58_WaitTray))
{ {
if (TrayIsOk()) if (TrayIsOk())
{ {
...@@ -255,7 +257,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -255,7 +257,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsTimeOut(180)) else if (MoveInfo.IsTimeOut(180))
{ {
MoveTimeoutAlarm(MoveInfo, "等待空托盘到达超时"); MoveTimeoutAlarm(MoveInfo, "等待空托盘到达超时");
return false; return false;
} }
return false; return false;
...@@ -275,7 +277,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -275,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
string posId = param != null ? param.PosId : ""; string posId = param != null ? param.PosId : "";
if (runStatus.Equals(LineRunStatus.Runing)) if (runStatus.Equals(LineRunStatus.Runing))
{ {
runStatus = LineRunStatus.Busy; runStatus = LineRunStatus.Busy;
MoveInfo.MoveParam = param; MoveInfo.MoveParam = param;
MoveInfo.NewMove(LineMoveType.InStore); MoveInfo.NewMove(LineMoveType.InStore);
...@@ -386,12 +388,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -386,12 +388,12 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
int num = MoveInfo.MoveParam.TrayNumber; int num = MoveInfo.MoveParam.TrayNumber;
InLog("入库 " + MoveInfo.SLog + ":抓取料盘失败,取消入库任务,清空托盘[" + num + "]信息。报警:未抓起料盘,请取走料盘后复位。"); InLog("入库 " + MoveInfo.SLog + ":抓取料盘失败,取消入库任务,清空托盘[" + num + "]信息。报警:未抓起料盘,请取走料盘后复位。");
//未抓起料盘,直接报警 //未抓起料盘,直接报警
MoveInfo.NextMoveStep(LineMoveStep.MI_07_ClampCheck); MoveInfo.NextMoveStep(LineMoveStep.MI_07_ClampCheck);
MoveInfo.WaitList.Add(WaitResultInfo.WaitNoTrayAlarm()); MoveInfo.WaitList.Add(WaitResultInfo.WaitNoTrayAlarm());
SetWarnMsg("未抓起料盘,请取走料盘后复位", MoveInfo.GetStepDes() + "_" + "未抓起料", MoveInfo); SetWarnMsg("未抓起料盘,请取走料盘后复位", MoveInfo.GetStepDes() + "_" + "未抓起料", MoveInfo);
Alarm(LineAlarmType.IoSingleTimeOut); Alarm(LineAlarmType.IoSingleTimeOut);
TrayInfo tray = TrayManager.GetTrayInfo(num); TrayInfo tray = TrayManager.GetTrayInfo(num);
LogUtil.error(Name + " 抓料失败自动清空入库任务 :" + tray.InoutPar.ToStr()); LogUtil.error(Name + " 抓料失败自动清空入库任务 :" + tray.InoutPar.ToStr());
...@@ -476,7 +478,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -476,7 +478,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.MI_15_SendPosToStore)) else if (MoveInfo.IsStep(LineMoveStep.MI_15_SendPosToStore))
{ {
String notOkMsg = ""; String notOkMsg = "";
if (!LineServer.IsInStorePro(DeviceID, MoveInfo.MoveParam.PosId,out notOkMsg)) if (!LineServer.IsInStorePro(DeviceID, MoveInfo.MoveParam.PosId, out notOkMsg))
{ {
//InLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓还未开始入库,再次发送starIn命令"); //InLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓还未开始入库,再次发送starIn命令");
//LineServer.StartInStore(DeviceID, MoveInfo.MoveParam); //LineServer.StartInStore(DeviceID, MoveInfo.MoveParam);
...@@ -489,7 +491,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -489,7 +491,7 @@ namespace OnlineStore.DeviceLibrary
if (sendCount >= 3) if (sendCount >= 3)
{ {
SetWarnMsg(MoveInfo.Name + "[" + MoveInfo.MoveStep + "] " + " 等待BOX开始入库超时 "+ notOkMsg + " 已发送" + sendCount + "次", "等待BOX开始入库超时"); SetWarnMsg(MoveInfo.Name + "[" + MoveInfo.MoveStep + "] " + " 等待BOX开始入库超时 " + notOkMsg + " 已发送" + sendCount + "次", "等待BOX开始入库超时");
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] " + " 等待BOX开始入库超时 已发送" + sendCount + "次"; //WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] " + " 等待BOX开始入库超时 已发送" + sendCount + "次";
//LogUtil.error(WarnMsg); //LogUtil.error(WarnMsg);
Alarm(LineAlarmType.IoSingleTimeOut); Alarm(LineAlarmType.IoSingleTimeOut);
...@@ -566,7 +568,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -566,7 +568,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return false; return false;
} }
bool moveOk = (IsBigStore() && MoveInfo.MoveStep >= LineMoveStep.MO_58_WaitTray ) || MoveInfo.MoveStep >= LineMoveStep.MO_59_CylinderAfter; bool moveOk = (IsBigStore() && MoveInfo.MoveStep >= LineMoveStep.MO_58_WaitTray) || MoveInfo.MoveStep >= LineMoveStep.MO_59_CylinderAfter;
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && moveOk if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && moveOk
&& (!MoveInfo.IsStep(LineMoveStep.MO_62_CylinderUp))) && (!MoveInfo.IsStep(LineMoveStep.MO_62_CylinderUp)))
{ {
...@@ -603,7 +605,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -603,7 +605,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return false; return false;
} }
if(LineManager.DisGetWare) if (LineManager.DisGetWare)
{ {
return false; return false;
} }
...@@ -625,7 +627,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -625,7 +627,7 @@ namespace OnlineStore.DeviceLibrary
InOutParam currCode = null; InOutParam currCode = null;
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum); TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
if (waitInStoreList.Count > 0) if (waitInStoreList.Count > 0)
{ {
lock (waitInListLock) lock (waitInListLock)
...@@ -640,7 +642,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -640,7 +642,7 @@ namespace OnlineStore.DeviceLibrary
reIndex = i; reIndex = i;
currCode = cc; currCode = cc;
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.IsNG); SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.IsNG);
break; break;
} }
} }
if (reIndex >= 0) if (reIndex >= 0)
...@@ -675,7 +677,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -675,7 +677,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(Name + "托盘信息 " + tray.ToStr() + " 与入库任务 " + currCode.ToStr() + " 不一致,从waitInStoreList中删除" + reIndex + ",取消入库任务"); LogUtil.error(Name + "托盘信息 " + tray.ToStr() + " 与入库任务 " + currCode.ToStr() + " 不一致,从waitInStoreList中删除" + reIndex + ",取消入库任务");
waitInStoreList.RemoveAt(reIndex); waitInStoreList.RemoveAt(reIndex);
SServerManager.cancelPutInTask(Name, currCode.WareCode,true); SServerManager.cancelPutInTask(Name, currCode.WareCode, true);
return false; return false;
} }
} }
...@@ -684,7 +686,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -684,7 +686,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
public bool RemoveInStore(InOutParam param,string logName="料盘已移走") public bool RemoveInStore(InOutParam param, string logName = "料盘已移走")
{ {
if (waitInStoreList.Count > 0) if (waitInStoreList.Count > 0)
{ {
...@@ -705,7 +707,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -705,7 +707,7 @@ namespace OnlineStore.DeviceLibrary
if (reIndex >= 0) if (reIndex >= 0)
{ {
waitInStoreList.RemoveAt(reIndex); waitInStoreList.RemoveAt(reIndex);
LogInfo("*******"+ logName + ",清理入库任务:【" + param.ToStr() + "】"); LogInfo("*******" + logName + ",清理入库任务:【" + param.ToStr() + "】");
return true; return true;
} }
} }
...@@ -713,6 +715,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -713,6 +715,24 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
public bool RemoveOutStore(InOutParam param, string logName = "料盘已移走")
{
if (waitOutStoreList.Count > 0)
{
//判断是否是自己排队列表中的出库信息
//托盘号一致,二维码一致,库位号一致
List<InOutParam> paramList = (from m in waitOutStoreList where m.TrayNumber.Equals(param.TrayNumber) && m.PosId.Equals(param.PosId) && m.WareCode.Equals(param.WareCode) select m).ToList<InOutParam>();
if (paramList!=null && paramList.Count > 0)
{
waitInStoreList.RemoveAt(0);
LogInfo("*******" + logName + ",清理出库任务:【" + param.ToStr() + "】");
return true;
}
}
return false;
}
#endregion #endregion
#region 托盘检测 #region 托盘检测
...@@ -821,16 +841,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -821,16 +841,17 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.StopCheck1).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.StopCheck1).Equals(IO_VALUE.LOW))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopDownWait); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopDownWait);
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 前阻挡检测消失后再等待300ms上升阻挡"); CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 前阻挡检测消失后再等待300ms上升阻挡");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
} }
else else
{ {
MIO_02_TrayCheck(); MIO_02_TrayCheck();
} }
}else if (SecondMoveInfo.IsStep(LineMoveStep.MIO_01_StopDownWait)) }
else if (SecondMoveInfo.IsStep(LineMoveStep.MIO_01_StopDownWait))
{ {
MIO_02_TrayCheck(); MIO_02_TrayCheck();
} }
else if (SecondMoveInfo.IsStep(LineMoveStep.MIO_02_TrayCheck)) else if (SecondMoveInfo.IsStep(LineMoveStep.MIO_02_TrayCheck))
{ {
...@@ -1043,7 +1064,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1043,7 +1064,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_16_Stop2Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_16_Stop2Down);
CheckLog("托盘放行" + SecondMoveInfo.SLog + " ,阻挡气缸1-2下降 "); CheckLog("托盘放行" + SecondMoveInfo.SLog + " ,阻挡气缸1-2下降 ");
IOMove(IO_Type.StopDown2, IO_VALUE.HIGH); IOMove(IO_Type.StopDown2, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopDown2, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopDown2, IO_VALUE.HIGH));
} }
else if (SecondMoveInfo.IsTimeOut(120)) else if (SecondMoveInfo.IsTimeOut(120))
{ {
......
...@@ -403,6 +403,45 @@ namespace OnlineStore.DeviceLibrary ...@@ -403,6 +403,45 @@ namespace OnlineStore.DeviceLibrary
return msg; return msg;
} }
private static string Addr_clearOutTask = "/rest/api/qisda/device/clearOutTask";
public static string clearOutTask(string deviceName, string barcode)
{
string msg = "";
try
{
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error(deviceName + "clearOutTask [" + barcode + "] :未找到服务器地址");
return msg;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode);
string server = GetAddr(Addr_clearOutTask, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info(deviceName + "clearOutTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
CancelData data = JsonHelper.DeserializeJsonToObject<CancelData>(resultStr);
if (data == null)
{
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 没有收到服务器反馈";
}
else if (data.code.Equals(0).Equals(false))
{
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 :" + data.msg;
}
return "";
}
catch (Exception ex)
{
LogUtil.error(deviceName + " " + ex.ToString());
}
return msg;
}
public static GetPosResult GetPosId(string deviceName, List<string> codeList, int height, int width, string rfid, int feedEquipId) public static GetPosResult GetPosId(string deviceName, List<string> codeList, int height, int width, string rfid, int feedEquipId)
{ {
GetPosResult result = new GetPosResult(); GetPosResult result = new GetPosResult();
...@@ -437,6 +476,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -437,6 +476,7 @@ namespace OnlineStore.DeviceLibrary
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cids", LineServer.GetAllCID(feedEquipId)); paramMap.Add("cids", LineServer.GetAllCID(feedEquipId));
paramMap.Add("code", codeStr); paramMap.Add("code", codeStr);
paramMap.Add("entrance", deviceName);
paramMap.Add(ParamDefine.rfid, rfid); paramMap.Add(ParamDefine.rfid, rfid);
string server = GetAddr(Addr_PosForPutin, paramMap); string server = GetAddr(Addr_PosForPutin, paramMap);
......
...@@ -232,6 +232,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -232,6 +232,26 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
public static void ClearOutstore(TrayInfo tray, string opLog = "手动清空托盘")
{
if (tray == null)
{
return;
}
//如果是出库托盘,需要清理出库消息
if (tray.InOrOutStore.Equals(2) && tray.InoutPar.IsNG.Equals(false) && (!tray.InoutPar.PosId.Equals("")))
{
int storeId = tray.InoutPar.GetStoreId();
if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId))
{
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
moveEquip.RemoveOutStore(tray.InoutPar, opLog);
//手动清空托盘时出库任务调用
SServerManager.clearOutTask(opLog, tray.InoutPar.WareCode);
}
}
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!