Commit e5296771 刘韬

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

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