Commit a41ebcbe 刘韬

1

1 个父辈 4b497d99
......@@ -410,11 +410,13 @@ namespace DeviceLibrary
/// 扫码线程
/// </summary>
Task<List<CodeInfo>> ScanTask;
string lastcode = "";
public void ScanCode() {
StringMoveInfo.log("开始扫码");
//RightMoveInfo.OneWaitCanEndStep = true;
//RightMoveInfo.WaitList.Add(WaitResultInfo.WaitScanCode());
//RightMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
int retry = 0;
try
{
ScanTask = Task.Run(new Func<List<CodeInfo>>(()=>
......@@ -425,10 +427,23 @@ namespace DeviceLibrary
List<CodeInfo> LastCodeList;
if (Setting_Init.SocketScanner_enable) {
retry:
LastCodeList = new List<CodeInfo>();
if (RobotManage.socketScanner.Scan(Setting_Init.SocketScanner_trigger_code, Setting_Init.SocketScanner_pattern_code, out string code)) {
LastCodeList.Add(new CodeInfo(code, 0, 0));
if (lastcode != code)
{
lastcode = code;
LastCodeList.Add(new CodeInfo(code, 0, 0));
}
else {
LogUtil.info($"前后2次条码相同:{code}");
if (retry < 2)
{
retry++;
LogUtil.info($"重试,第{retry}次");
goto retry;
}
}
}
}
else
......
......@@ -143,6 +143,7 @@ namespace DeviceLibrary
break;
case MoveStep.StringLoad_02:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_02a);
lastcode = "";
newreel = true;
downCheck1 = false;
downCheck2 = false;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!