Commit 37cc5182 LN

出库shelfLoc问题修改。

1 个父辈 33ec4d36
...@@ -246,7 +246,6 @@ namespace OnlineStore.ACPackingStore ...@@ -246,7 +246,6 @@ namespace OnlineStore.ACPackingStore
string sleShelfNum = cmbShelfPosition.Text; string sleShelfNum = cmbShelfPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
InOutParam param = new InOutParam("", selectPositionNum,sleShelfNum, ktk); InOutParam param = new InOutParam("", selectPositionNum,sleShelfNum, ktk);
BoxBean.StartOutStoreMove(param); BoxBean.StartOutStoreMove(param);
} }
else else
......
...@@ -86,6 +86,33 @@ agv客户端启动时需要设置状态为none。 ...@@ -86,6 +86,33 @@ agv客户端启动时需要设置状态为none。
20200303 20200303
httpPost方法增加验证,若ping不同则不再发送。 httpPost方法增加验证,若ping不同则不再发送。
20200307
shelfLoc问题修改。
......
...@@ -35,10 +35,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -35,10 +35,10 @@ namespace OnlineStore.DeviceLibrary
/// 所有料架库位列表 /// 所有料架库位列表
/// </summary> /// </summary>
public List<string> ShelfPosList = new List<string>(); public List<string> ShelfPosList = new List<string>();
/// <summary> ///// <summary>
/// 料架未放料盘的位置列表 ///// 料架未放料盘的位置列表
/// </summary> ///// </summary>
public ConcurrentQueue<string> EmprtShelfList = new ConcurrentQueue<string>(); // public ConcurrentQueue<string> EmprtShelfList = new ConcurrentQueue<string>();
public HumitureBean humBean = null; public HumitureBean humBean = null;
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer(); private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
...@@ -624,16 +624,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -624,16 +624,16 @@ namespace OnlineStore.DeviceLibrary
//判断急停 //判断急停
else if (storeRunStatus >= StoreRunStatus.HomeMoving) else if (storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
//取新的Io状态 ////取新的Io状态
IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN); //IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN);
IO_VALUE resetBtn = IOValue(IO_Type.Reset_BTN); //IO_VALUE resetBtn = IOValue(IO_Type.Reset_BTN);
//急停按钮 //急停按钮
if (suddenBtn.Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
AirCheckProcess(); return;
} }
else if (resetBtn.Equals(IO_VALUE.HIGH)) else if (IOValue(IO_Type.Reset_BTN).Equals(IO_VALUE.HIGH))
{ {
//收到复位信号,若报警直接复位,若不报警且无操作,回到待机点 //收到复位信号,若报警直接复位,若不报警且无操作,回到待机点
if (alarmType.Equals(StoreAlarmType.None) && isInSuddenDown.Equals(false) && isNoAirCheck.Equals(false)) if (alarmType.Equals(StoreAlarmType.None) && isInSuddenDown.Equals(false) && isNoAirCheck.Equals(false))
...@@ -656,6 +656,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -656,6 +656,7 @@ namespace OnlineStore.DeviceLibrary
Reset(); Reset();
} }
} }
AirCheckProcess();
} }
} }
...@@ -750,7 +751,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -750,7 +751,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore) if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore)
{ {
LogInfo("已经累计出入库" + AutoInout.CurrInOutACount + "次,当时当前正在忙碌中暂不复位"); // LogInfo("已经累计出入库" + AutoInout.CurrInOutACount + "次,当时当前正在忙碌中暂不复位");
} }
else else
{ {
......
...@@ -234,8 +234,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -234,8 +234,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " 启动入库【" + param.ToStr() + "】出错,找不到库位信息"); LogUtil.error(Name + " 启动入库【" + param.ToStr() + "】出错,找不到库位信息");
return; return;
} }
param.NeedEnterShelf = false; //param.NeedEnterShelf = false;
param.NeedOutShelf = false; //param.NeedOutShelf = false;
LogInfo(" 启动入库【" + param.ToStr() + "】,压紧点P2【" + param.MoveP.ComPress_P2 + "】压紧前点P3【" + param.MoveP.ComPress_P3 + "】"); LogInfo(" 启动入库【" + param.ToStr() + "】,压紧点P2【" + param.MoveP.ComPress_P2 + "】压紧前点P3【" + param.MoveP.ComPress_P3 + "】");
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute; storeStatus = StoreStatus.InStoreExecute;
...@@ -265,7 +265,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -265,7 +265,7 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute; storeStatus = StoreStatus.InStoreExecute;
EmprtShelfList = new ConcurrentQueue<string>(); // EmprtShelfList = new ConcurrentQueue<string>();
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH))
{ {
MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam()); MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam());
...@@ -755,34 +755,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -755,34 +755,11 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
MoveInfo.NewMove(StoreMoveType.OutStore, param); MoveInfo.NewMove(StoreMoveType.OutStore, param);
LogInfo("启动出库【" + param.ToStr() + "】 "); LogInfo("启动出库【" + param.ToStr() + "】 ");
//出库前shelfPosID需要固定,出库时根据rfid判断是否需要出入料架
////判断当前料架是否正确
//if (MoveInfo.MoveParam.ShelfPosID.Equals(""))
//{
MoveInfo.NextMoveStep(StoreMoveStep.SO_01_DeviceBack); MoveInfo.NextMoveStep(StoreMoveStep.SO_01_DeviceBack);
InOutStoreLog("出库 " + MoveInfo.SLog + ":进出轴到P1 开始"); InOutStoreLog("出库 " + MoveInfo.SLog + ":进出轴到P1 开始");
InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1); InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
//}
////当前无料架,或料架位置为空
//if ((IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && MoveInfo.MoveParam.NeedEnterShelf) || MoveInfo.MoveParam.ShelfPosID.Equals(""))
//{
// MoveInfo.NextMoveStep(StoreMoveStep.BI_00_ReadyShelf);
// InOutStoreLog("出库 " + MoveInfo.SLog + ": 通知agv调度准备带料架的agv["+ param.rfid + "],等待agv到达或检测到料架信号,进出轴到P1");
// InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
// //需要先叫agv到达
// AgvClient.SetStatus(Config.AgvNodeName,param.rfid, param.rfid, ClientAction.NeedEnter,ClientLevel.High,true);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction((int)ClientAction.Arrive));
//}
//else
//{
// MoveInfo.NextMoveStep(StoreMoveStep.SO_01_DeviceBack);
// InOutStoreLog("出库 " + MoveInfo.SLog + ":进出轴到P1 开始");
// InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
//}
return true; return true;
} }
private void SO_03_ToBagPosition() private void SO_03_ToBagPosition()
{ {
...@@ -930,7 +907,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -930,7 +907,7 @@ namespace OnlineStore.DeviceLibrary
serverShelfData = null; serverShelfData = null;
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
int posLoc = StoreManager.GetLocByShelfPosID(MoveInfo.MoveParam.ShelfPosID, ShelfPosList); int posLoc = StoreManager.GetShelfPosIndex(MoveInfo.MoveParam.ShelfPosID, ShelfPosList);
//分盘料和紧急料发PutFinished //分盘料和紧急料发PutFinished
if (MoveInfo.MoveParam.cutReel || MoveInfo.MoveParam.urgentReel) if (MoveInfo.MoveParam.cutReel || MoveInfo.MoveParam.urgentReel)
{ {
...@@ -944,15 +921,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -944,15 +921,15 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
int newTaskCount = 0; int newTaskCount = 0;
string msg = StoreManager.UpdateTrayLoc(Name, MoveInfo.MoveParam.WareCode, CurrShelfID + "@" + posLoc.ToString(),out newTaskCount); string msg = StoreManager.UpdateTrayLoc(Name, MoveInfo.MoveParam.WareCode, CurrShelfID + "@" + posLoc.ToString(), out newTaskCount);
if (String.IsNullOrEmpty(msg).Equals(false)) if (String.IsNullOrEmpty(msg).Equals(false))
{ {
LogUtil.error(Name + "【" + MoveInfo.MoveParam.WareCode + "】【" + CurrShelfID + "】【" + posLoc + "】UpdateTrayLoc 结果:" + msg); LogUtil.error(Name + "【" + MoveInfo.MoveParam.WareCode + "】【" + CurrShelfID + "】【" + posLoc + "】UpdateTrayLoc 结果:" + msg);
serverShelfData = null; serverShelfData = null;
} }
if(newTaskCount> MoveInfo.MoveParam.taskCount) if (newTaskCount > MoveInfo.MoveParam.taskCount)
{ {
InOutStoreLog("UpdateTrayLoc 返回 newTaskCount="+ newTaskCount+ ",原有 taskCount="+ MoveInfo.MoveParam.taskCount + ",使用新数据"); InOutStoreLog("UpdateTrayLoc 返回 newTaskCount=" + newTaskCount + ",原有 taskCount=" + MoveInfo.MoveParam.taskCount + ",使用新数据");
MoveInfo.MoveParam.taskCount = newTaskCount; MoveInfo.MoveParam.taskCount = newTaskCount;
} }
} }
...@@ -978,16 +955,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -978,16 +955,22 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要送出料架 //判断是否需要送出料架
bool isNeedSend = false; bool isNeedSend = false;
//包装料料仓料架=A //包装料料仓料架=A
if (AutoInout.autoNext) //if (AutoInout.autoNext)
//{
// InOutStoreLog("出库完成,自动出入库启动中,不需要送出料架");
// isNeedSend = false;
//}
//else if (EmprtShelfList.Count <= 0)
//{
// InOutStoreLog("出库完成,料架【" + CurrShelfID + "】没有剩余位置,送出料架");
// isNeedSend = true;
//}
//只有rfid不为空才需要送出料架
if (String.IsNullOrEmpty(MoveInfo.MoveParam.rfid))
{ {
InOutStoreLog("出库完成,自动出入库启动中,不需要送出料架"); InOutStoreLog("出库完成,未设置rfid,不需要送出料架");
isNeedSend = false; isNeedSend = false;
} }
else if (EmprtShelfList.Count <= 0)
{
InOutStoreLog("出库完成,料架【" + CurrShelfID + "】没有剩余位置,送出料架");
isNeedSend = true;
}
else if (serverShelfData != null) else if (serverShelfData != null)
{ {
if (serverShelfData.packageEmpty <= 0) if (serverShelfData.packageEmpty <= 0)
......
...@@ -53,13 +53,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -53,13 +53,9 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_01_DoorOpen)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_01_DoorOpen))
{ {
//}
//else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_02_WaitReady))
//{
MoveInfo.NextMoveStep(StoreMoveStep.BI_03_LineRun); MoveInfo.NextMoveStep(StoreMoveStep.BI_03_LineRun);
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.MayEnter,线体正转,等待LineIn_Check信号"); InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.MayEnter,线体正转,等待LineIn_Check信号");
AgvClient.SetStatus(Config.AgvNodeName,"","",ClientAction.MayEnter,ClientLevel.High,true); AgvClient.SetStatus(Config.AgvNodeName, "", "", ClientAction.MayEnter, ClientLevel.High, true);
LineRun(); LineRun();
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.HIGH));
} }
...@@ -72,30 +68,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -72,30 +68,35 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.BI_05_LineStop); MoveInfo.NextMoveStep(StoreMoveStep.BI_05_LineStop);
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.FinishEnter,取料位检测到信号,停止线体正转"); InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.FinishEnter,取料位检测到信号,停止线体正转");
LineStop(); LineStop();
AgvClient.SetStatus(Config.AgvNodeName, "", "", ClientAction.FinishEnter, ClientLevel.High,true); AgvClient.SetStatus(Config.AgvNodeName, "", "", ClientAction.FinishEnter, ClientLevel.High, true);
if (!instoreShelf) if (!instoreShelf)
{ {
EmprtShelfList = new System.Collections.Concurrent.ConcurrentQueue<string>(ShelfPosList);
if (MoveInfo.MoveParam.ShelfPosID.Equals("")) if (MoveInfo.MoveParam.ShelfPosID.Equals(""))
{ {
string shelfPosId = ""; MoveInfo.MoveParam.UpdateShelfPosId(ShelfPosList[0]);
bool result = EmprtShelfList.TryDequeue(out shelfPosId); InOutStoreLog("出库 " + MoveInfo.SLog + ": ShelfPosID未设置,默认ShelfPosID=" + MoveInfo.MoveParam.ShelfPosID);
if (result)
{
MoveInfo.MoveParam.UpdateShelfPosId(shelfPosId);
InOutStoreLog("出库 " + MoveInfo.SLog + ":重置EmprtShelfList列表,设置料架位置:" + MoveInfo.MoveParam.ShelfPosID);
} }
else
{
waitOutStoreList.Enqueue(MoveInfo.MoveParam);
InOutStoreLog("出库 " + MoveInfo.SLog + ":重置EmprtShelfList列表,获取料架位置失败!结束出库,并将" + MoveInfo.MoveParam.ToStr() + "放入等待列表");
MoveEndToRuningStatus(); // EmprtShelfList = new System.Collections.Concurrent.ConcurrentQueue<string>(ShelfPosList);
} //if (MoveInfo.MoveParam.ShelfPosID.Equals(""))
} //{
// string shelfPosId = "";
// bool result = EmprtShelfList.TryDequeue(out shelfPosId);
// if (result)
// {
// MoveInfo.MoveParam.UpdateShelfPosId(shelfPosId);
// InOutStoreLog("出库 " + MoveInfo.SLog + ":重置EmprtShelfList列表,设置料架位置:" + MoveInfo.MoveParam.ShelfPosID);
// }
// else
// {
// waitOutStoreList.Enqueue(MoveInfo.MoveParam);
// InOutStoreLog("出库 " + MoveInfo.SLog + ":重置EmprtShelfList列表,获取料架位置失败!结束出库,并将" + MoveInfo.MoveParam.ToStr() + "放入等待列表");
// MoveEndToRuningStatus();
// }
//}
} }
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_05_LineStop)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_05_LineStop))
{ {
...@@ -249,7 +250,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -249,7 +250,7 @@ namespace OnlineStore.DeviceLibrary
{ {
moveName = "送出出库料架"; moveName = "送出出库料架";
} }
LogCPU(); // LogCPU();
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_01_TopDown)) if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_01_TopDown))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BS_02_LocatinDown); MoveInfo.NextMoveStep(StoreMoveStep.BS_02_LocatinDown);
...@@ -282,7 +283,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -282,7 +283,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.BS_06_LineBackRun); MoveInfo.NextMoveStep(StoreMoveStep.BS_06_LineBackRun);
//如果agv未到达,直接结束 //如果agv未到达,直接结束
MoveEndToRuningStatus(); MoveEndToRuningStatus();
EmprtShelfList = new ConcurrentQueue<string>(); //EmprtShelfList = new ConcurrentQueue<string>();
InOutStoreLog(moveName + MoveInfo.SLog + ":等待Agv " + Config.AgvNodeName + " Arrive超时,直接结束"); InOutStoreLog(moveName + MoveInfo.SLog + ":等待Agv " + Config.AgvNodeName + " Arrive超时,直接结束");
} }
} }
...@@ -343,7 +344,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -343,7 +344,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//结束 //结束
MoveEndToRuningStatus(); MoveEndToRuningStatus();
EmprtShelfList = new ConcurrentQueue<string>(); //EmprtShelfList = new ConcurrentQueue<string>();
InOutStoreLog(moveName + MoveInfo.SLog + ":停止转动,送出料架结束 ,设置状态为None,清空当前料架:"+CurrShelfID); InOutStoreLog(moveName + MoveInfo.SLog + ":停止转动,送出料架结束 ,设置状态为None,清空当前料架:"+CurrShelfID);
CurrShelfID = ""; CurrShelfID = "";
AgvClient.SetStatus(Config.AgvNodeName); AgvClient.SetStatus(Config.AgvNodeName);
...@@ -493,7 +494,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -493,7 +494,7 @@ namespace OnlineStore.DeviceLibrary
if (humBean.NeedGetTem()) if (humBean.NeedGetTem())
{ {
lineOperation.op = 5; lineOperation.op = 5;
LogInfo("没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op); LogUtil.error(Name+ "没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op,DeviceID+105);
} }
string server = ConfigAppSettings.GetValue(Setting_Init.http_server); string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), lineOperation, false); Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), lineOperation, false);
...@@ -564,7 +565,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -564,7 +565,9 @@ namespace OnlineStore.DeviceLibrary
index++; index++;
string plateW = plateWArray[index]; string plateW = plateWArray[index];
string plateH = plateHArray[index]; string plateH = plateHArray[index];
InOutParam inoutParam = new InOutParam(barcode, posId, "", plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc, taskCount, realRfid); string shelfPosID = StoreManager.GetShelfIDByLoc(rfidLoc, ShelfPosList);
InOutParam inoutParam = new InOutParam(barcode, posId, shelfPosID, plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc, taskCount, realRfid);
//根据发送的posId获取位置列表 //根据发送的posId获取位置列表
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(posId); ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(posId);
if (position == null) if (position == null)
...@@ -597,34 +600,34 @@ namespace OnlineStore.DeviceLibrary ...@@ -597,34 +600,34 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(Name + "验证出库【" + inoutParam.ToStr() + "】是否重复出错:" + ex.ToString()); LogUtil.error(Name + "验证出库【" + inoutParam.ToStr() + "】是否重复出错:" + ex.ToString());
} }
//判断出库指定的料架是否是当前料架,如果不是当前料架,需要将当前料架送出,然后进入新料架 //判断出库指定的料架是否是当前料架,如果不是当前料架,需要将当前料架送出,然后进入新料架
//TODO //TODO
string shelfPosID = ""; // string shelfPosID = "";
if (inoutParam.rfidLoc > 0 && ShelfPosList.Count >= inoutParam.rfidLoc) //if (inoutParam.rfidLoc > 0 && ShelfPosList.Count >= inoutParam.rfidLoc)
{ //{
shelfPosID = StoreManager.GetShelfIDByLoc(inoutParam.rfidLoc, ShelfPosList);
// shelfPosID = ShelfPosList[inoutParam.rfidLoc - 1]; // shelfPosID = ShelfPosList[inoutParam.rfidLoc - 1];
inoutParam.NeedEnterShelf = false; //inoutParam.NeedEnterShelf = false;
inoutParam.NeedOutShelf = false; //inoutParam.NeedOutShelf = false;
inoutParam.ShelfPosID = shelfPosID; //}
} //else
else //{
{ // bool hasShelf = EmprtShelfList.TryDequeue(out shelfPosID);
bool hasShelf = EmprtShelfList.TryDequeue(out shelfPosID); // if (hasShelf)
if (hasShelf) // {
{ // inoutParam.NeedEnterShelf = false;
inoutParam.NeedEnterShelf = false; // inoutParam.NeedOutShelf = false;
inoutParam.NeedOutShelf = false; // inoutParam.ShelfPosID = shelfPosID;
inoutParam.ShelfPosID = shelfPosID; // }
} // else
else // {
{ // inoutParam.NeedEnterShelf = true;
inoutParam.NeedEnterShelf = true; // inoutParam.NeedOutShelf = false;
inoutParam.NeedOutShelf = false; // LogInfo(Name + "执行出库【" + inoutParam.ToStr() + "】,没有空料架,需要使用新料架");
LogInfo(Name + "执行出库【" + inoutParam.ToStr() + "】,没有空料架,需要使用新料架"); // }
} //}
}
StartExecuctOut(inoutParam); StartExecuctOut(inoutParam);
} }
......
...@@ -346,7 +346,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -346,7 +346,7 @@ namespace OnlineStore.DeviceLibrary
paramMap.Add("locInfo", locInfo); // locInfo = 位置信息,移栽时为移栽编号,流水线时为托盘号,皮带线时为皮带线编号,机器人时为机器人编号 paramMap.Add("locInfo", locInfo); // locInfo = 位置信息,移栽时为移栽编号,流水线时为托盘号,皮带线时为皮带线编号,机器人时为机器人编号
string server = GetAddr(Addr_updateLocInfo, paramMap); string server = GetAddr(Addr_updateLocInfo, paramMap);
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
LogUtil.info("UpdateTrayLoc 【" + server + "】【" + resultStr + "】"); LogUtil.info(deviceName+ " ["+locInfo+"] UpdateTrayLoc 【" + server + "】【" + resultStr + "】");
// 返回: { "code": 0, "msg":"ok", "data":""} // 返回: { "code": 0, "msg":"ok", "data":""}
ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr); ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
if (serverResult == null) if (serverResult == null)
...@@ -403,46 +403,49 @@ namespace OnlineStore.DeviceLibrary ...@@ -403,46 +403,49 @@ namespace OnlineStore.DeviceLibrary
} }
return msg; return msg;
} }
public static int GetLocByShelfPosID(string shelfId, List<String> shelfPosList) public static int GetShelfPosIndex(string shelfId, List<String> shelfPosList)
{ {
int loc = -1; int loc = -1;
try if (shelfPosList.Contains(shelfId))
{
if (shelfId.Length == 3)
{ {
loc = int.Parse(shelfId.Substring(2, 1)); loc = shelfPosList.IndexOf(shelfId) + 1;
} }
else
{
try
{
loc = int.Parse(shelfId);
} }
catch (Exception ex) catch (Exception ex)
{ {
} }
if (loc <= 0)
{
loc = shelfPosList.IndexOf(shelfId);
} }
return loc; return loc;
} }
internal static string GetShelfIDByLoc(int rfidLoc, List<string> shelfPosList) internal static string GetShelfIDByLoc(int rfidLoc, List<string> shelfPosList)
{ {
string shelfId = ""; string shelfId = "";
try //try
{ //{
foreach (string id in shelfPosList) // foreach (string id in shelfPosList)
{ // {
if (id.Length == 3 && id.Substring(2, 1).Equals(rfidLoc.ToString())) // if (id.Length == 3 && id.Substring(2, 1).Equals(rfidLoc.ToString()))
{ // {
shelfId = id; // shelfId = id;
break; // break;
} // }
} // }
} //}
catch (Exception ex) //catch (Exception ex)
{ //{
//}
if (rfidLoc.Equals(-1))
{
shelfId = shelfPosList[0];
} }
if (shelfId.Equals("") && rfidLoc > 0 && rfidLoc <= shelfPosList.Count) if (rfidLoc >= 1 && rfidLoc <= 8 && rfidLoc <= shelfPosList.Count)
{ {
shelfId = shelfPosList[rfidLoc - 1]; shelfId = shelfPosList[rfidLoc - 1];
} }
......
...@@ -78,8 +78,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -78,8 +78,8 @@ namespace OnlineStore.DeviceLibrary
string posid = boxBean.PositionNumList[positionIndex]; string posid = boxBean.PositionNumList[positionIndex];
InOutParam param = new InOutParam("AAAA", posid, shelfPosId); InOutParam param = new InOutParam("AAAA", posid, shelfPosId);
param.NeedOutShelf = false; //param.NeedOutShelf = false;
param.NeedEnterShelf = false; //param.NeedEnterShelf = false;
//判断是否需要重置 //判断是否需要重置
if (CurrInOutACount >= boxBean.Config.Box_ResetACount) if (CurrInOutACount >= boxBean.Config.Box_ResetACount)
{ {
...@@ -117,7 +117,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -117,7 +117,7 @@ namespace OnlineStore.DeviceLibrary
{ {
string posid = boxBean.PositionNumList[newIndex]; string posid = boxBean.PositionNumList[newIndex];
InOutParam param = new InOutParam("AAAA", posid, shelfPosId); InOutParam param = new InOutParam("AAAA", posid, shelfPosId);
param.NeedOutShelf = false; // param.NeedOutShelf = false;
//判断是否需要重置 //判断是否需要重置
if (CurrInOutACount >= boxBean.Config.Box_ResetACount) if (CurrInOutACount >= boxBean.Config.Box_ResetACount)
{ {
......
...@@ -43,8 +43,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -43,8 +43,8 @@ namespace OnlineStore.DeviceLibrary
this.ShelfPosID = ShelfPosID; this.ShelfPosID = ShelfPosID;
PosID = posId; PosID = posId;
MoveP = linePosition; MoveP = linePosition;
NeedEnterShelf = false; //NeedEnterShelf = false;
NeedOutShelf = false; //NeedOutShelf = false;
this.urgentReel = false ; this.urgentReel = false ;
this.cutReel = false ; this.cutReel = false ;
this.smallReel = false ; this.smallReel = false ;
...@@ -77,14 +77,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -77,14 +77,14 @@ namespace OnlineStore.DeviceLibrary
public string PlateW { get; set; } public string PlateW { get; set; }
/// <summary> ///// <summary>
/// 出入库时需要进入新料架 ///// 出入库时需要进入新料架
/// </summary> ///// </summary>
public bool NeedEnterShelf = true; //public bool NeedEnterShelf = true;
/// <summary> ///// <summary>
/// 出入库结束后需要将料架送出 ///// 出入库结束后需要将料架送出
/// </summary> ///// </summary>
public bool NeedOutShelf = true; //public bool NeedOutShelf = true;
/// <summary> /// <summary>
/// urgentReel: true 表示紧急料,需要出到料串上 /// urgentReel: true 表示紧急料,需要出到料串上
/// </summary> /// </summary>
...@@ -101,26 +101,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -101,26 +101,26 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// rfid: 分配的料架RFID /// rfid: 分配的料架RFID
/// </summary> /// </summary>
public string rfid { get; set; } public string rfid = "";
/// <summary> /// <summary>
/// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线, /// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线,
/// 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线, /// 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线; /// 70,71,72时只能分配到3 / 4号皮带线;
/// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线 /// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
/// </summary> /// </summary>
public int rfidLoc { get; set; } public int rfidLoc = 0;
/// <summary> /// <summary>
/// 剩余任务数量,当剩余任务 《=1时,出库完成需要送出料架 /// 剩余任务数量,当剩余任务 《=1时,出库完成需要送出料架
/// 剩余任务数为0, 或者料架已放满,或者料架rfid与上一个任务不同,料架就要放出去 /// 剩余任务数为0, 或者料架已放满,或者料架rfid与上一个任务不同,料架就要放出去
/// 剩余任务数为1时, 当前的料放完就可以把料架放出去了 /// 剩余任务数为1时, 当前的料放完就可以把料架放出去了
///当前料放完,料架已满,也把料架放出去 ///当前料放完,料架已满,也把料架放出去
/// </summary> /// </summary>
public int taskCount { get; set; } public int taskCount = 0;
/// <summary> /// <summary>
/// 真实料架号 /// 真实料架号
/// </summary> /// </summary>
public string realRfid { get; set; } public string realRfid = "";
/// <summary> /// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1 /// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// </summary> /// </summary>
...@@ -155,13 +155,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -155,13 +155,13 @@ namespace OnlineStore.DeviceLibrary
} }
public string ToStr() public string ToStr()
{ {
return " 料架号[" + ShelfPosID + "],库位号 [" + PosID + "], [" + WareCode + "], [" + PlateW + "x" + PlateH + "]" + return " 库位 [" + PosID + "] [" + ShelfPosID + "], [" + WareCode + "], [" + PlateW + "x" + PlateH + "] ," +
"NeedEnterShelf【" + NeedEnterShelf + "】NeedOutShelf【" + NeedOutShelf + "】"+ // "NeedEnterShelf【" + NeedEnterShelf + "】NeedOutShelf【" + NeedOutShelf + "】"+
"urgentReel [" + urgentReel + "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "],taskCount ["+ taskCount + "]"; "urgentReel [" + urgentReel + "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "],taskCount ["+ taskCount + "]";
} }
public string ToShortStr() public string ToShortStr()
{ {
return " [" + ShelfPosID + "] [" + PosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "]"; return " [" + PosID + "] [" + ShelfPosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "]";
} }
internal void UpdateShelfPosId(string pId) internal void UpdateShelfPosId(string pId)
......
...@@ -483,7 +483,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -483,7 +483,7 @@ namespace OnlineStore.DeviceLibrary
protected void InOutStoreLog(string msg) protected void InOutStoreLog(string msg)
{ {
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
string shelfId = MoveInfo.MoveParam != null ? "_" + MoveInfo.MoveParam.ShelfPosID : "_"; string shelfId = MoveInfo.MoveParam != null ? "" + MoveInfo.MoveParam.ShelfPosID : "_";
LogInfo(" [" + posId +"] ["+ shelfId + "] :" + msg); LogInfo(" [" + posId +"] ["+ shelfId + "] :" + msg);
} }
protected int GetAlarmCodeByAxis(ConfigMoveAxis axis) protected int GetAlarmCodeByAxis(ConfigMoveAxis axis)
......
using OnlineStore.Common; using Asa;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary; using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
...@@ -326,7 +327,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -326,7 +327,7 @@ namespace OnlineStore.DeviceLibrary
return "扫码完成"; return "扫码完成";
}else if (WaitType.Equals(WaitEnum.W010_AgvStatus)) }else if (WaitType.Equals(WaitEnum.W010_AgvStatus))
{ {
return "Agv状态:" + AgvAction; return "Agv状态:" + (ClientAction)AgvAction;
}else if (WaitType.Equals(WaitEnum.W011_DoorCloseEvent)) }else if (WaitType.Equals(WaitEnum.W011_DoorCloseEvent))
{ {
return "Agv状态:DoorClose" ; return "Agv状态:DoorClose" ;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!