Commit 74e0aa74 LN

扫码重复清空条码

1 个父辈 c90dd4aa
...@@ -16,8 +16,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,8 +16,9 @@ namespace OnlineStore.DeviceLibrary
public ShelfInfo CurrShelf = new ShelfInfo(); public ShelfInfo CurrShelf = new ShelfInfo();
#region 入库 #region 入库
private List<string> preCodeList = new List<string>();
private List<string> LastCodeList = new List<string>(); private List<string> LastCodeList = new List<string>();
private List<string> NextCodeList = new List<string>(); //private List<string> NextCodeList = new List<string>();
public bool StartInstore(InOutParam param) public bool StartInstore(InOutParam param)
{ {
...@@ -110,8 +111,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -110,8 +111,9 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.IB07_AxisUpMove); MoveInfo.NextMoveStep(StepEnum.IB07_AxisUpMove);
WorkLog("料串入料 :上料轴开始慢速上升到P2点,等待检测到料盘"); WorkLog("料串入料 :上料轴开始慢速上升到P2点,等待检测到料盘");
preCodeList = new List<string>(LastCodeList);
LastCodeList = new List<string>(); LastCodeList = new List<string>();
NextCodeList = new List<string>(); //NextCodeList = new List<string>();
MoveInfo.ShelfNoTray = false; MoveInfo.ShelfNoTray = false;
BatchAxisToP2(true); BatchAxisToP2(true);
} }
...@@ -300,17 +302,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -300,17 +302,17 @@ namespace OnlineStore.DeviceLibrary
LastCodeList = new List<string>(); LastCodeList = new List<string>();
if (NextCodeList.Count > 0) //if (NextCodeList.Count > 0)
{ //{
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
LastCodeList = new List<string>(NextCodeList); // LastCodeList = new List<string>(NextCodeList);
NextCodeList = new List<string>(); // NextCodeList = new List<string>();
MoveInfo.MoveParam.PosInfo.barcode = CodeManager.ProcessCode(LastCodeList); // MoveInfo.MoveParam.PosInfo.barcode = CodeManager.ProcessCode(LastCodeList);
MoveInfo.NextMoveStep(StepEnum.IB10_ScanOK); // MoveInfo.NextMoveStep(StepEnum.IB10_ScanOK);
WorkLog("料盘移栽 :使用预扫码【" + MoveInfo.MoveParam.PosInfo.barcode + "】,等待取料机构来取料"); // WorkLog("料盘移栽 :使用预扫码【" + MoveInfo.MoveParam.PosInfo.barcode + "】,等待取料机构来取料");
//}
} //else
else if (isScan) if (isScan)
{ {
WorkLog("料盘移栽 :开始扫码"); WorkLog("料盘移栽 :开始扫码");
MoveInfo.OneWaitCanEndStep = true; MoveInfo.OneWaitCanEndStep = true;
...@@ -328,6 +330,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -328,6 +330,29 @@ namespace OnlineStore.DeviceLibrary
LastCodeList = CodeManager.CameraScan(Config.CameraName, Name); LastCodeList = CodeManager.CameraScan(Config.CameraName, Name);
} }
Robot.IOMove(IO_Type.CameraLed, IO_VALUE.LOW); Robot.IOMove(IO_Type.CameraLed, IO_VALUE.LOW);
//TODO 需要判断是否和上次的条码重复,重复的条码不可用
bool isCanUse = true;
//判断是否可用
foreach (string nC in LastCodeList)
{
foreach (string n in preCodeList)
{
if(CodeManager.HasRightCode(nC))
//if (nC.Length > 15 && nC.Equals(n))
{
LogUtil.error(Name + "扫码结果【" + nC + "】与上个条码【" + n + "】重复,扫码结果不可用");
isCanUse = false;
break;
}
}
}
if (!isCanUse)
{
LastCodeList = new List<string>();
}
return LastCodeList; return LastCodeList;
}); });
} }
...@@ -382,7 +407,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -382,7 +407,9 @@ namespace OnlineStore.DeviceLibrary
} }
private void SendInShelfLeave(string msg = "") private void SendInShelfLeave(string msg = "")
{ {
WorkLog(" SendInShelfLeave :" + msg); WorkLog(" SendInShelfLeave :" + msg+",清空条码");
LastCodeList = new List<string>();
preCodeList = new List<string>();
bool needLeave = true; bool needLeave = true;
//入料完成直接开始出库 //入料完成直接开始出库
if (ShelfAutoOut || CurrShelf.ShelfState.Equals(2)) if (ShelfAutoOut || CurrShelf.ShelfState.Equals(2))
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!