Commit 70311462 张东亮

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

1 个父辈 d93c5c2b
......@@ -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 + ": 上下气缸下降 ");
......@@ -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())
{
......@@ -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;
}
......@@ -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 托盘检测
......@@ -828,7 +848,8 @@ namespace OnlineStore.DeviceLibrary
{
MIO_02_TrayCheck();
}
}else if (SecondMoveInfo.IsStep(LineMoveStep.MIO_01_StopDownWait))
}
else if (SecondMoveInfo.IsStep(LineMoveStep.MIO_01_StopDownWait))
{
MIO_02_TrayCheck();
}
......
......@@ -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!