Commit e5296771 刘韬

AB口一起出库, 入库机构复位时料仓一起复位

1 个父辈 8edc95ae
...@@ -118,6 +118,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -118,6 +118,26 @@ namespace OnlineStore.DeviceLibrary
//CSVPositionReader<DrawerPosition>.AddCSVFile(drawConfigFile); //CSVPositionReader<DrawerPosition>.AddCSVFile(drawConfigFile);
XLRStore = new XLRStoreBean(Config, inputConfig, boxConfig); XLRStore = new XLRStoreBean(Config, inputConfig, boxConfig);
//for (int i = 0; i < 60; i++)
//{
// var height = i;
// int LastHeight = 0;
// List<int> heightList = StoreManager.GetTrayList();
// heightList = (from m in heightList orderby m descending select m).ToList<int>();
// float minCha = height;
// foreach (int h in heightList)
// {
// //取差值最小的接近值
// float cha = Math.Abs(h - (height - 4));
// if (cha < minCha)
// {
// LastHeight = h;
// minCha = cha;
// }
// }
// LogUtil.info($"height:{height}, cha:{minCha}, 对应高度:{LastHeight}");
//}
LogUtil.info("加载 完成!"); LogUtil.info("加载 完成!");
return true; return true;
} }
......
...@@ -46,7 +46,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -46,7 +46,6 @@ namespace OnlineStore.DeviceLibrary
Name = ($" {title}_" + " ").ToUpper(); Name = ($" {title}_" + " ").ToUpper();
MoveInfo = new DeviceMoveInfo(Name); MoveInfo = new DeviceMoveInfo(Name);
List<string> ioList = new List<string>(); List<string> ioList = new List<string>();
ioList = new List<string>(DeviceConfig.ProIOIpMap.Values); ioList = new List<string>(DeviceConfig.ProIOIpMap.Values);
......
...@@ -99,7 +99,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -99,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// B面等待出库的队列 /// B面等待出库的队列
/// </summary> /// </summary>
//public ConcurrentQueue<InOutParam> waitBOutStoreList = new ConcurrentQueue<InOutParam>(); public ConcurrentQueue<InOutParam> waitBOutStoreList = new ConcurrentQueue<InOutParam>();
//库位表 //库位表
public List<string> PositionNumList; public List<string> PositionNumList;
/// <summary> /// <summary>
...@@ -764,7 +764,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -764,7 +764,7 @@ namespace OnlineStore.DeviceLibrary
private DateTime errUpperB = DateTime.Now; private DateTime errUpperB = DateTime.Now;
private DateTime errUnderA = DateTime.Now; private DateTime errUnderA = DateTime.Now;
private DateTime errUnderB = DateTime.Now; private DateTime errUnderB = DateTime.Now;
int SigLastTime = 2;//5秒 int SigLastTime = 7;//5秒
protected override void OnTimerProcess() protected override void OnTimerProcess()
{ {
//if (!runStatus.Equals(RunStatus.Runing)) //if (!runStatus.Equals(RunStatus.Runing))
...@@ -873,7 +873,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -873,7 +873,7 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
} }
else //if (CheckAOutDoor()) else if (CheckAOutDoor())
{ {
InOutParam param = null; InOutParam param = null;
bool result = waitAOutStoreList.TryPeek(out param); bool result = waitAOutStoreList.TryPeek(out param);
...@@ -885,31 +885,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -885,31 +885,31 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
//if (waitBOutStoreList.Count > 0)// if (waitBOutStoreList.Count > 0)//
//{ {
// if (CloseOutStoreCheck) if (CloseOutStoreCheck)
// { {
// InOutParam param = null; InOutParam param = null;
// bool result = waitBOutStoreList.TryDequeue(out param); bool result = waitBOutStoreList.TryDequeue(out param);
// if (result && param != null) if (result && param != null)
// { {
// LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】"); LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】");
// StartExecuctOut(param); StartExecuctOut(param);
// return; return;
// } }
// } }
// else if (CheckBOutDoor()) else if (CheckBOutDoor())
// { {
// InOutParam param = null; InOutParam param = null;
// bool result = waitBOutStoreList.TryDequeue(out param); bool result = waitBOutStoreList.TryDequeue(out param);
// if (result && param != null) if (result && param != null)
// { {
// LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】"); LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】");
// StartExecuctOut(param); StartExecuctOut(param);
// return; return;
// } }
// } }
//} }
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -408,7 +408,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -408,7 +408,7 @@ namespace OnlineStore.DeviceLibrary
//判断排队列表中是否已存在 //判断排队列表中是否已存在
List<InOutParam> reviceList = new List<InOutParam>(); List<InOutParam> reviceList = new List<InOutParam>();
reviceList.AddRange(waitAOutStoreList); reviceList.AddRange(waitAOutStoreList);
// reviceList.AddRange(waitBOutStoreList); reviceList.AddRange(waitBOutStoreList);
reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(posId) select m).ToList<InOutParam>(); reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(posId) select m).ToList<InOutParam>();
if (reviceList.Count > 0) if (reviceList.Count > 0)
{ {
...@@ -417,8 +417,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -417,8 +417,8 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
waitAOutStoreList.Enqueue(inoutParam); //waitAOutStoreList.Enqueue(inoutParam);
LogUtil.info($"加入出库队列:{inoutParam.PosInfo.ToStr()}"); //LogUtil.info($"加入出库队列:{inoutParam.PosInfo.ToStr()}");
} }
} }
...@@ -426,7 +426,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -426,7 +426,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(Name + "验证出库【" + inoutParam.PosInfo.ToStr() + "】是否重复出错:" + ex.ToString()); LogUtil.error(Name + "验证出库【" + inoutParam.PosInfo.ToStr() + "】是否重复出错:" + ex.ToString());
} }
//StartExecuctOut(inoutParam); StartExecuctOut(inoutParam);
} }
TimeSpan span = DateTime.Now - time; TimeSpan span = DateTime.Now - time;
......
...@@ -459,14 +459,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -459,14 +459,14 @@ namespace OnlineStore.DeviceLibrary
inOut.PosInfo.IsNG = true; inOut.PosInfo.IsNG = true;
inOut.PosInfo.NgMsg = "验证入库完成失败"; inOut.PosInfo.NgMsg = "验证入库完成失败";
LogInfo($"入库 {MoveInfo.SLog}:验证入库完成失败,将该库位出库[{inOut.PosInfo.ToStr()}][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:验证入库完成失败,将该库位出库[{inOut.PosInfo.ToStr()}][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
// if (CheckASide()) if (CheckASide())
{ {
waitAOutStoreList.Enqueue(inOut); waitAOutStoreList.Enqueue(inOut);
} }
//else else
//{ {
// waitBOutStoreList.Enqueue(inOut); waitBOutStoreList.Enqueue(inOut);
//} }
} }
break; break;
case StepEnum.SI_19_InoutBack: case StepEnum.SI_19_InoutBack:
......
...@@ -184,52 +184,52 @@ namespace OnlineStore.DeviceLibrary ...@@ -184,52 +184,52 @@ namespace OnlineStore.DeviceLibrary
break; break;
case StepEnum.SO_13_InoutBack: case StepEnum.SO_13_InoutBack:
//检查另一面是否有出库任务 //检查另一面是否有出库任务
//if (MoveInfo.MoveParam.PosInfoBack == null) if (MoveInfo.MoveParam.PosInfoBack == null)
//{ {
// if (CheckASide(MoveInfo.MoveParam)) if (CheckASide(MoveInfo.MoveParam))
// { {
// if (waitBOutStoreList.Count > 0 && CheckBOutDoor()) if (waitBOutStoreList.Count > 0 && CheckBOutDoor())
// { {
// if (waitBOutStoreList.TryDequeue(out InOutParam inOutParam))//B面料叉空且B面出料口无料,有出库任务 if (waitBOutStoreList.TryDequeue(out InOutParam inOutParam))//B面料叉空且B面出料口无料,有出库任务
// { {
// MoveInfo.NextMoveStep(StepEnum.SO_01_PullAxis_Ready); MoveInfo.NextMoveStep(StepEnum.SO_01_PullAxis_Ready);
// LogInfo($"存储机构-出库 {MoveInfo.SLog}:A面切换到B面,B面取料[{inOutParam.PosInfo.barcode}]"); LogInfo($"存储机构-出库 {MoveInfo.SLog}:A面切换到B面,B面取料[{inOutParam.PosInfo.barcode}]");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// MoveInfo.MoveParam.PosInfoBack = MoveInfo.MoveParam.PosInfo.ToCopy(); MoveInfo.MoveParam.PosInfoBack = MoveInfo.MoveParam.PosInfo.ToCopy();
// MoveInfo.MoveParam.PosInfo = inOutParam.PosInfo.ToCopy(); MoveInfo.MoveParam.PosInfo = inOutParam.PosInfo.ToCopy();
// MoveInfo.MoveParam.MoveP = new LineMoveP(Config, inOutParam.PosInfo.PosId); MoveInfo.MoveParam.MoveP = new LineMoveP(Config, inOutParam.PosInfo.PosId);
// PullAxis_Inout_To_Cam(); PullAxis_Inout_To_Cam();
// return; return;
// } }
// } }
// } }
// else else
// { {
// if (waitAOutStoreList.Count > 0 && CheckAOutDoor()) if (waitAOutStoreList.Count > 0 && CheckAOutDoor())
// { {
// if (waitAOutStoreList.TryDequeue(out InOutParam inOutParam)) if (waitAOutStoreList.TryDequeue(out InOutParam inOutParam))
// { {
// MoveInfo.NextMoveStep(StepEnum.SO_01_PullAxis_Ready); MoveInfo.NextMoveStep(StepEnum.SO_01_PullAxis_Ready);
// LogInfo($"存储机构-出库 {MoveInfo.SLog}:B面切换到A面,A面取料[{inOutParam.PosInfo.barcode}]"); LogInfo($"存储机构-出库 {MoveInfo.SLog}:B面切换到A面,A面取料[{inOutParam.PosInfo.barcode}]");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// MoveInfo.MoveParam.PosInfoBack = MoveInfo.MoveParam.PosInfo.ToCopy(); MoveInfo.MoveParam.PosInfoBack = MoveInfo.MoveParam.PosInfo.ToCopy();
// MoveInfo.MoveParam.PosInfo = inOutParam.PosInfo.ToCopy(); MoveInfo.MoveParam.PosInfo = inOutParam.PosInfo.ToCopy();
// MoveInfo.MoveParam.MoveP = new LineMoveP(Config, inOutParam.PosInfo.PosId); MoveInfo.MoveParam.MoveP = new LineMoveP(Config, inOutParam.PosInfo.PosId);
// PullAxis_Inout_To_Cam(); PullAxis_Inout_To_Cam();
// return; return;
// } }
// } }
// } }
//} }
//else//两夹爪都有料 else//两夹爪都有料
//{ {
// if(MoveInfo.MoveParam.PosInfoBack.PlateW==MoveInfo.MoveParam.PosInfo.PlateW && if (MoveInfo.MoveParam.PosInfoBack.PlateW == MoveInfo.MoveParam.PosInfo.PlateW &&
// MoveInfo.MoveParam.PosInfoBack.PlateH == MoveInfo.MoveParam.PosInfo.PlateH) MoveInfo.MoveParam.PosInfoBack.PlateH == MoveInfo.MoveParam.PosInfo.PlateH)
// { {
// MoveInfo.NextMoveStep(StepEnum.SOB_14_GetReels_Ready); MoveInfo.NextMoveStep(StepEnum.SOB_14_GetReels_Ready);
// return; return;
// } }
//} }
//直接出库,执行该步骤的情况:1.另一个料叉有料;2.另一面有出库任务但出料口有料;3.另一面没有出库任务; //直接出库,执行该步骤的情况:1.另一个料叉有料;2.另一面有出库任务但出料口有料;3.另一面没有出库任务;
MoveInfo.NextMoveStep(StepEnum.SO_14_GetReels_Ready); MoveInfo.NextMoveStep(StepEnum.SO_14_GetReels_Ready);
MoveAxisToP1(); MoveAxisToP1();
......
...@@ -1202,35 +1202,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -1202,35 +1202,35 @@ namespace OnlineStore.DeviceLibrary
{ {
bool result = false; bool result = false;
result = StartOutstore(param); result = StartOutstore(param);
return result; if (!result)
//if (!result) {
//{ lock (outStoreObject)
// lock (outStoreObject) {
// { if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveParam.PosInfo.PosId.Equals(param.PosInfo.PosId))
// if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveParam.PosInfo.PosId.Equals(param.PosInfo.PosId)) {
// { LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,【" + MoveInfo.MoveParam.PosInfo.PosId + "】出库执行中");
// LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,【" + MoveInfo.MoveParam.PosInfo.PosId + "】出库执行中"); return false;
// return false; }
// }
// List<InOutParam> reviceList = new List<InOutParam>(); List<InOutParam> reviceList = new List<InOutParam>();
// reviceList.AddRange(waitAOutStoreList); reviceList.AddRange(waitAOutStoreList);
// //reviceList.AddRange(waitBOutStoreList); reviceList.AddRange(waitBOutStoreList);
// reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(param.PosInfo.PosId) select m).ToList<InOutParam>(); reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(param.PosInfo.PosId) select m).ToList<InOutParam>();
// if (reviceList.Count == 0) if (reviceList.Count == 0)
// { {
// //LogInfo(" 执行出库【" + param.PosInfo.ToStr() + "】失败,加入等待队列"); LogInfo(" 执行出库【" + param.PosInfo.ToStr() + "】失败,加入等待队列");
// // if (param.PosInfo.GetPosSide().Equals("A")) if (param.PosInfo.GetPosSide().Equals("A"))
// { {
// waitAOutStoreList.Enqueue(param); waitAOutStoreList.Enqueue(param);
// } }
// //else if (param.PosInfo.GetPosSide().Equals("B")) else if (param.PosInfo.GetPosSide().Equals("B"))
// //{ {
// // waitBOutStoreList.Enqueue(param); waitBOutStoreList.Enqueue(param);
// //} }
// } }
// } }
//} }
return result;
} }
private DateTime startOutStoreTime = DateTime.Now; private DateTime startOutStoreTime = DateTime.Now;
/// <summary> /// <summary>
......
...@@ -312,7 +312,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -312,7 +312,12 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StepEnum.IB16_SaveHight); MoveInfo.NextMoveStep(StepEnum.IB16_SaveHight);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
LastHeight = GetHeight(); int width = 7;
if (StoreManager.XLRStore.inputEquip.IOValue(IO_Type.Feeding_Reel_13_Check).Equals(IO_VALUE.HIGH))
{
width = 13;
}
LastHeight = GetHeight(width);
} }
else if (MoveInfo.IsStep(StepEnum.IB17_WaitReelLeave)) else if (MoveInfo.IsStep(StepEnum.IB17_WaitReelLeave))
{ {
...@@ -558,7 +563,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -558,7 +563,7 @@ namespace OnlineStore.DeviceLibrary
public int EndMovePosition = 0; public int EndMovePosition = 0;
internal int LastHeight = 0; internal int LastHeight = 0;
string[] cames; string[] cames;
public int GetHeight() public int GetHeight(int width=7)
{ {
CodeManager.CameraCheckHeight(cames?.ToList(), Name); CodeManager.CameraCheckHeight(cames?.ToList(), Name);
LogUtil.info($"{Name} 采集料盘抓走后的图片,开始计算高度"); LogUtil.info($"{Name} 采集料盘抓走后的图片,开始计算高度");
...@@ -574,6 +579,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -574,6 +579,12 @@ namespace OnlineStore.DeviceLibrary
isLast = true; isLast = true;
} }
float height = (float)(1F * Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue);//Math.Ceiling float height = (float)(1F * Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue);//Math.Ceiling
if (width >= 13) {
height = height - 2;
LogUtil.info($"检测为13寸高度-2={height}");
}
string buchongStr = ""; string buchongStr = "";
if (isLast) if (isLast)
{ {
......
...@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
void InoutEndEvent() void InoutEndEvent()
{ {
inoutCnt++; inoutCnt++;
if (inoutCnt > resetCnt) if (inoutCnt > resetCnt && BatchMove_A.MoveInfo.ShelfNoTray && BatchMove_B.MoveInfo.ShelfNoTray)
{ {
OnlyResetInputAxis = true; OnlyResetInputAxis = true;
LogUtil.info($"入料机构出入库到达{resetCnt},准备复位"); LogUtil.info($"入料机构出入库到达{resetCnt},准备复位");
......
...@@ -189,15 +189,15 @@ namespace OnlineStore.XLRStore ...@@ -189,15 +189,15 @@ namespace OnlineStore.XLRStore
text += param.PosInfo.ToStr() + "\r"; text += param.PosInfo.ToStr() + "\r";
} }
} }
//List<InOutParam> psB = new List<InOutParam>(boxBean.waitBOutStoreList); List<InOutParam> psB = new List<InOutParam>(boxBean.waitBOutStoreList);
//if (psB.Count > 0) if (psB.Count > 0)
//{ {
// text = "B面等待出库列表:\r"; text = "B面等待出库列表:\r";
// foreach (InOutParam param in psB) foreach (InOutParam param in psB)
// { {
// text += param.PosInfo.ToStr() + "\r"; text += param.PosInfo.ToStr() + "\r";
// } }
//} }
} }
} }
if (!lblInstoreList.Text.Equals(text)) if (!lblInstoreList.Text.Equals(text))
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!