Commit 70311462 张东亮

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

1 个父辈 d93c5c2b
......@@ -29,7 +29,7 @@ namespace OnlineStore.DeviceLibrary
if (runStatus.Equals(LineRunStatus.Runing))
{
LogInfo("启动出库【" + posId + "】升降气缸上升 ");
runStatus = LineRunStatus.Busy;
runStatus = LineRunStatus.Busy;
MoveInfo.NewMove(LineMoveType.OutStore);
MoveInfo.MoveParam = param;
MoveInfo.NextMoveStep(LineMoveStep.MO_50_StartOutProcess);
......@@ -84,7 +84,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown);
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);
}
else
......@@ -118,7 +118,8 @@ namespace OnlineStore.DeviceLibrary
UpdownUpMove();
// 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);
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 ");
......@@ -144,13 +145,13 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.MO_57_ClampCheck))
{
if (UpdownIsUp())
{
{
if (IOValue(IO_Type.ClampCylinder_Check).Equals(IO_VALUE.HIGH))
{
{
if (IsBigStore())
{
MoveInfo.NextMoveStep(LineMoveStep.MO_58_WaitTray);
OutLog("出库 " + MoveInfo.SLog + ": 等待托盘到达");
OutLog("出库 " + MoveInfo.SLog + ": 等待托盘到达");
}
else
{
......@@ -164,7 +165,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.MO_56_ResetClamp);
ClampCount = 1;
OutLog("出库 " + MoveInfo.SLog + ": 第一次未抓到料,重新抓一次,夹爪先放松",1);
OutLog("出库 " + MoveInfo.SLog + ": 第一次未抓到料,重新抓一次,夹爪先放松", 1);
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
}
}
......@@ -174,7 +175,8 @@ namespace OnlineStore.DeviceLibrary
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸上升");
UpdownUpMove();
}
}else if (MoveInfo.IsStep(LineMoveStep.MO_58_WaitTray))
}
else if (MoveInfo.IsStep(LineMoveStep.MO_58_WaitTray))
{
if (TrayIsOk())
{
......@@ -255,7 +257,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsTimeOut(180))
{
MoveTimeoutAlarm(MoveInfo, "等待空托盘到达超时");
MoveTimeoutAlarm(MoveInfo, "等待空托盘到达超时");
return false;
}
return false;
......@@ -275,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
string posId = param != null ? param.PosId : "";
if (runStatus.Equals(LineRunStatus.Runing))
{
runStatus = LineRunStatus.Busy;
runStatus = LineRunStatus.Busy;
MoveInfo.MoveParam = param;
MoveInfo.NewMove(LineMoveType.InStore);
......@@ -386,12 +388,12 @@ namespace OnlineStore.DeviceLibrary
else
{
int num = MoveInfo.MoveParam.TrayNumber;
InLog("入库 " + MoveInfo.SLog + ":抓取料盘失败,取消入库任务,清空托盘[" + num + "]信息。报警:未抓起料盘,请取走料盘后复位。");
InLog("入库 " + MoveInfo.SLog + ":抓取料盘失败,取消入库任务,清空托盘[" + num + "]信息。报警:未抓起料盘,请取走料盘后复位。");
//未抓起料盘,直接报警
MoveInfo.NextMoveStep(LineMoveStep.MI_07_ClampCheck);
MoveInfo.WaitList.Add(WaitResultInfo.WaitNoTrayAlarm());
SetWarnMsg("未抓起料盘,请取走料盘后复位", MoveInfo.GetStepDes() + "_" + "未抓起料", MoveInfo);
Alarm(LineAlarmType.IoSingleTimeOut);
Alarm(LineAlarmType.IoSingleTimeOut);
TrayInfo tray = TrayManager.GetTrayInfo(num);
LogUtil.error(Name + " 抓料失败自动清空入库任务 :" + tray.InoutPar.ToStr());
......@@ -476,7 +478,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.MI_15_SendPosToStore))
{
String notOkMsg = "";
if (!LineServer.IsInStorePro(DeviceID, MoveInfo.MoveParam.PosId,out notOkMsg))
if (!LineServer.IsInStorePro(DeviceID, MoveInfo.MoveParam.PosId, out notOkMsg))
{
//InLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓还未开始入库,再次发送starIn命令");
//LineServer.StartInStore(DeviceID, MoveInfo.MoveParam);
......@@ -489,7 +491,7 @@ namespace OnlineStore.DeviceLibrary
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 + "次";
//LogUtil.error(WarnMsg);
Alarm(LineAlarmType.IoSingleTimeOut);
......@@ -566,7 +568,7 @@ namespace OnlineStore.DeviceLibrary
{
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
&& (!MoveInfo.IsStep(LineMoveStep.MO_62_CylinderUp)))
{
......@@ -603,7 +605,7 @@ namespace OnlineStore.DeviceLibrary
{
return false;
}
if(LineManager.DisGetWare)
if (LineManager.DisGetWare)
{
return false;
}
......@@ -625,7 +627,7 @@ namespace OnlineStore.DeviceLibrary
InOutParam currCode = null;
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
if (waitInStoreList.Count > 0)
{
lock (waitInListLock)
......@@ -640,7 +642,7 @@ namespace OnlineStore.DeviceLibrary
reIndex = i;
currCode = cc;
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.IsNG);
break;
break;
}
}
if (reIndex >= 0)
......@@ -675,7 +677,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error(Name + "托盘信息 " + tray.ToStr() + " 与入库任务 " + currCode.ToStr() + " 不一致,从waitInStoreList中删除" + reIndex + ",取消入库任务");
waitInStoreList.RemoveAt(reIndex);
SServerManager.cancelPutInTask(Name, currCode.WareCode,true);
SServerManager.cancelPutInTask(Name, currCode.WareCode, true);
return false;
}
}
......@@ -684,7 +686,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
public bool RemoveInStore(InOutParam param,string logName="料盘已移走")
public bool RemoveInStore(InOutParam param, string logName = "料盘已移走")
{
if (waitInStoreList.Count > 0)
{
......@@ -705,7 +707,7 @@ namespace OnlineStore.DeviceLibrary
if (reIndex >= 0)
{
waitInStoreList.RemoveAt(reIndex);
LogInfo("*******"+ logName + ",清理入库任务:【" + param.ToStr() + "】");
LogInfo("*******" + logName + ",清理入库任务:【" + param.ToStr() + "】");
return true;
}
}
......@@ -713,6 +715,24 @@ namespace OnlineStore.DeviceLibrary
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
#region 托盘检测
......@@ -821,16 +841,17 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.StopCheck1).Equals(IO_VALUE.LOW))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopDownWait);
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 前阻挡检测消失后再等待300ms上升阻挡");
CheckLog("托盘阻挡" + SecondMoveInfo.SLog + " 前阻挡检测消失后再等待300ms上升阻挡");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else
{
else
{
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))
{
......@@ -1043,7 +1064,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_16_Stop2Down);
CheckLog("托盘放行" + SecondMoveInfo.SLog + " ,阻挡气缸1-2下降 ");
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))
{
......
......@@ -403,6 +403,45 @@ namespace OnlineStore.DeviceLibrary
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)
{
GetPosResult result = new GetPosResult();
......@@ -437,6 +476,7 @@ namespace OnlineStore.DeviceLibrary
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cids", LineServer.GetAllCID(feedEquipId));
paramMap.Add("code", codeStr);
paramMap.Add("entrance", deviceName);
paramMap.Add(ParamDefine.rfid, rfid);
string server = GetAddr(Addr_PosForPutin, paramMap);
......
......@@ -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!