Commit c3c5f862 LN

入库扫码流程优化

1 个父辈 5cf9644b
...@@ -548,7 +548,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -548,7 +548,9 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_08_BatchAxisToP2)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_08_BatchAxisToP2))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_09_TrayLocation_Before); MoveInfo.NextMoveStep(LineMoveStep.FI_09_TrayLocation_Before);
InLog("料架入库" + MoveInfo.SLog + ":升降盘定位气缸前进"); InLog("料架入库" + MoveInfo.SLog + ":升降盘定位气缸前进,清空条码信息");
LastCodeList = new List<string>();
NextCodeList = new List<string>();
TrayLCylinderBefore(MoveInfo); TrayLCylinderBefore(MoveInfo);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_09_TrayLocation_Before)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_09_TrayLocation_Before))
...@@ -571,41 +573,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -571,41 +573,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_12_CylinderGive)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_12_CylinderGive))
{ {
if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW)) FI_13_ScanCode();
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
InLog("料盘移栽" + MoveInfo.SLog + ":开始扫码:是否需要扫码【" + isScan + "】");
LastCodeList = new List<string>();
if (isScan)
{
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
try
{
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
return LastCodeList;
});
}
catch (Exception ex)
{
LogUtil.error("FI_13_ScanCode扫码出错:", ex);
}
}
}
else
{
FI_12_MoveCylinder_Give();
}
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_ScanCode)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_ScanCode))
{ {
...@@ -644,7 +612,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -644,7 +612,6 @@ namespace OnlineStore.DeviceLibrary
LastHeight = GetHeight(); LastHeight = GetHeight();
LastWidth = GetWidth(); LastWidth = GetWidth();
//判断是否还有料盘 //判断是否还有料盘
if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW))
{ {
...@@ -685,8 +652,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -685,8 +652,37 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_CylinderGive)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_CylinderGive))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_20_WaitTray); MoveInfo.NextMoveStep(LineMoveStep.FI_20_WaitTray);
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达"); bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
//TODO 此处需要等待空托盘 //TODO 此处需要等待空托盘
if (MoveInfo.ShelfNoTray.Equals(false) && isScan)
{
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达,同时为下一盘料预扫码");
//还有料盘,直接扫码
NextCodeList = new List<string>();
try
{
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
NextCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (NextCodeList.Count <= 0)
{
NextCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
return NextCodeList;
});
}
catch (Exception ex)
{
LogUtil.error(" 为下一盘料扫码出错:", ex);
}
}
else
{
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达");
}
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_WaitTray))//TODO else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_WaitTray))//TODO
{ {
...@@ -853,12 +849,61 @@ namespace OnlineStore.DeviceLibrary ...@@ -853,12 +849,61 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
} }
} }
private void FI_13_ScanCode()
{
if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
LastCodeList = new List<string>();
if (NextCodeList.Count > 0)
{
InLog("料盘移栽" + MoveInfo.SLog + ":开始扫码:使用预扫码NextCodeList中的条码");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
LastCodeList = new List<string>(NextCodeList);
NextCodeList = new List<string>();
}
else if (isScan)
{
InLog("料盘移栽" + MoveInfo.SLog + ":开始扫码");
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
try
{
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
return LastCodeList;
});
}
catch (Exception ex)
{
LogUtil.error("FI_13_ScanCode扫码出错:", ex);
}
}
else
{
InLog("料盘移栽" + MoveInfo.SLog + ":不需要扫码");
}
}
else
{
FI_12_MoveCylinder_Give();
}
}
private void CheckHasTray() private void CheckHasTray()
{ {
if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.HIGH) && MoveInfo.ShelfNoTray.Equals(false)) if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.HIGH) && MoveInfo.ShelfNoTray.Equals(false))
{ {
FI_12_MoveCylinder_Give(); FI_13_ScanCode();
} }
else else
{ {
...@@ -904,6 +949,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -904,6 +949,7 @@ namespace OnlineStore.DeviceLibrary
private int LastHeight = 0; private int LastHeight = 0;
private int LastWidth = 0; private int LastWidth = 0;
private List<string> LastCodeList = new List<string>(); private List<string> LastCodeList = new List<string>();
private List<string> NextCodeList = new List<string>();
private int GetHeight() private int GetHeight()
{ {
int AxisChangeValue = Config.Height_ChangeValue; int AxisChangeValue = Config.Height_ChangeValue;
......
...@@ -64,7 +64,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -64,7 +64,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.MoveParam = moveParam; MoveInfo.MoveParam = moveParam;
MoveInfo.NewMove(LineMoveType.OutStore); MoveInfo.NewMove(LineMoveType.OutStore);
posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : ""; posId = moveParam.PosId;
MoveInfo.NextMoveStep(LineMoveStep.DLO_01_WaitEntryNoTray); MoveInfo.NextMoveStep(LineMoveStep.DLO_01_WaitEntryNoTray);
LogUtil.info(Name + "开始出料【" + moveParam.ToStr() + "】:" + MoveInfo.SLog + "等待出口无料盘,NG气缸后退"); LogUtil.info(Name + "开始出料【" + moveParam.ToStr() + "】:" + MoveInfo.SLog + "等待出口无料盘,NG气缸后退");
if (equipBeanId.Equals(302) && EntryLocation_Check.Equals(IO_Type.EntryLocation_Check2)) if (equipBeanId.Equals(302) && EntryLocation_Check.Equals(IO_Type.EntryLocation_Check2))
......
...@@ -185,7 +185,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -185,7 +185,7 @@ namespace OnlineStore.DeviceLibrary
} }
public string NumStr() public string NumStr()
{ {
return "" + RFType + "" + ((int)Num).ToString().PadLeft(2, '0'); return "" + (char)RFType + "" + ((int)Num).ToString().PadLeft(2, '0');
//return " [" + RFType + "],[" + Num + "] "; //return " [" + RFType + "],[" + Num + "] ";
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!