Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 91ea680b
由
几米阳光
编写于
2019-02-21 10:59:54 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
停止重新启动料仓后无法出库修改。扫码修改。
1 个父辈
cb9f8646
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
16 行删除
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
91ea680
...
...
@@ -217,6 +217,8 @@ namespace OnlineStore.DeviceLibrary
#
region
原点返回和复位处理
private
void
ReturnHome
()
{
isInSuddenDown
=
false
;
isNoAirCheck
=
false
;
WarnMsg
=
""
;
CurrInOutACount
=
0
;
CurrInOutCount
=
0
;
...
...
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
91ea680
...
...
@@ -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
;
...
...
@@ -112,6 +113,7 @@ 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!
Cancel
请
注册
或
登录
后发表评论