Commit bb5392ef 张东亮

仅使用扫码小程序

1 个父辈 26557779
......@@ -176,34 +176,46 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error(deviceName + " RemoteDecodeHelper扫码出错:" + ex.ToString());
}
if (!findRightCode)
{
Task eyemtask = Task.Factory.StartNew(delegate
{
List<CodeInfo> tlci = EyemDecode.ModelDecoder(ref bmp);
foreach (CodeInfo code in tlci)
{
LogUtil.info(deviceName + " 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
string str = CodeManager.ReplaceCode(code.CodeStr);
if (!codeList.Contains(str))
{
codeList.Add(str);
r = r + "##eyem|" + code.CodeType + "|" + str;
if (!findRightCode)
{
findRightCode = HasRightCode(str);
}
}
}
});
//最多等待60秒
bool taskResult = eyemtask.Wait(60000);
if (!taskResult)
{
LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时");
eyemNoCode = true;
}
}
//if (!findRightCode)
//{
// Task eyemtask = Task.Factory.StartNew(delegate
// {
// try
// {
// List<CodeInfo> tlci = EyemDecode.ModelDecoder(ref bmp);
// foreach (CodeInfo code in tlci)
// {
// LogUtil.info(deviceName + " 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
// string str = CodeManager.ReplaceCode(code.CodeStr);
// if (!codeList.Contains(str))
// {
// codeList.Add(str);
// r = r + "##eyem|" + code.CodeType + "|" + str;
// if (!findRightCode)
// {
// findRightCode = HasRightCode(str);
// }
// }
// }
// }catch(AccessViolationException ex)
// {
// LogUtil.error(deviceName + " 扫码出现AccessViolationException异常,关闭相机【" + cameraName + "】:" + ex.ToString());
// Camera._cam.Close(cameraName);
// }
// catch(Exception ex)
// {
// LogUtil.error(deviceName + " 扫码出错:" + ex.ToString());
// }
// });
// //最多等待60秒
// bool taskResult = eyemtask.Wait(60000);
// if (!taskResult)
// {
// LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时");
// eyemNoCode = true;
// }
//}
//if (!findRightCode && SaveErrorImageToFile.Equals(1))
if ((!findRightCode) || eyemNoCode)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!