Commit e2cbaf4b LN

预扫码只使用算法扫码,未扫到不保存照片

1 个父辈 400fd790
...@@ -101,6 +101,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -101,6 +101,7 @@ namespace OnlineStore.DeviceLibrary
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan(List<string> cameraList, string deviceName, bool findRightCodeBreak = false, int timeOut = 1500) public static List<string> CameraScan(List<string> cameraList, string deviceName, bool findRightCodeBreak = false, int timeOut = 1500)
{ {
bool isPreScan = deviceName.EndsWith("预扫码");
List<string> codeList = new List<string>(); List<string> codeList = new List<string>();
if (cameraList == null || cameraList.Count <= 0) if (cameraList == null || cameraList.Count <= 0)
{ {
...@@ -153,9 +154,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -153,9 +154,11 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
List<CodeInfo> cc = new List<CodeInfo>(); if (!isPreScan)
{
if (!findRightCode) if (!findRightCode)
{ {
List<CodeInfo> cc = new List<CodeInfo>();
eyemNoCode = true; eyemNoCode = true;
foreach (string codeType in codeTypeList) foreach (string codeType in codeTypeList)
{ {
...@@ -189,7 +192,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -189,7 +192,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
//if (!findRightCode && SaveErrorImageToFile.Equals(1)) //if (!findRightCode && SaveErrorImageToFile.Equals(1))
if ( (!findRightCode) || eyemNoCode) if ((!findRightCode) || eyemNoCode)
{ {
//如果halcon没扫出的, //如果halcon没扫出的,
string nameStr = ""; string nameStr = "";
...@@ -200,6 +203,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -200,6 +203,7 @@ namespace OnlineStore.DeviceLibrary
SaveImageToFile(deviceName, cameraName + nameStr, bmp); SaveImageToFile(deviceName, cameraName + nameStr, bmp);
} }
}
if (deviceName != "" || r != "") if (deviceName != "" || r != "")
{ {
LogUtil.info(deviceName + " 【" + cameraName + "】扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】[" + findRightCode + "]" + ScanCount + " :" + r); LogUtil.info(deviceName + " 【" + cameraName + "】扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】[" + findRightCode + "]" + ScanCount + " :" + r);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!