Commit 91ea680b 几米阳光

停止重新启动料仓后无法出库修改。扫码修改。

1 个父辈 cb9f8646
......@@ -217,6 +217,8 @@ namespace OnlineStore.DeviceLibrary
#region 原点返回和复位处理
private void ReturnHome()
{
isInSuddenDown = false;
isNoAirCheck = false;
WarnMsg = "";
CurrInOutACount = 0;
CurrInOutCount = 0;
......
......@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Windows.Forms;
......@@ -111,7 +112,8 @@ namespace OnlineStore.DeviceLibrary
}
return bitm;
}
[HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan( )
{
List<string> codeList = new List<string>();
......@@ -130,32 +132,32 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.info(" 摄像机【" + cameraName + "】获取图片完成");
string path = Application.StartupPath + @"\CodeImage\";
string filePath = path + @"code.png";
if (File.Exists(filePath))
{
File.Delete(filePath);
}
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
bitmap.Save(filePath);
LogUtil.info(" 摄像机【" + cameraName + "】图片已保存到:"+filePath);
//string path = Application.StartupPath + @"\CodeImage\";
//string filePath = path + @"code.png";
//if (File.Exists(filePath))
//{
// File.Delete(filePath);
//}
//if (!Directory.Exists(path))
//{
// Directory.CreateDirectory(path);
//}
//bitmap.Save(filePath);
//LogUtil.info(" 摄像机【" + cameraName + "】图片已保存到:"+filePath);
//HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
//LogUtil.info(" 摄像机【" + cameraName + "】转换图片完成,开始扫码");
HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
LogUtil.info(" 摄像机【" + cameraName + "】转换图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(filePath);
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(filePath, 1, GetCodeParamFilePath(codeType), codeType);
cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType);
}
LogUtil.info(" 摄像机【" + cameraName + "】【"+ codeType + "】扫码完成");
}
......@@ -163,6 +165,10 @@ namespace OnlineStore.DeviceLibrary
}
}
}
catch (AccessViolationException e)
{
LogUtil.error("扫码出现AccessViolationException异常:" + e.ToString());
}
catch (Exception ex)
{
LogUtil.error("扫码出错:" + ex.ToString());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!