Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d41411c2
由
LN
编写于
2020-01-17 19:25:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
扫码处增加过滤
1 个父辈
2797984d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
18 行删除
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
d41411c
...
...
@@ -12,8 +12,8 @@ using System.Windows.Forms;
namespace
OnlineStore.DeviceLibrary
{
public
class
CodeManager
{
public
static
List
<
string
>
codeTypeList
=
new
List
<
string
>();
{
public
static
List
<
string
>
codeTypeList
=
new
List
<
string
>();
public
static
List
<
string
>
balserNameList
=
new
List
<
string
>();
public
static
List
<
string
>
hikNameList
=
new
List
<
string
>();
...
...
@@ -22,12 +22,12 @@ namespace OnlineStore.DeviceLibrary
/// 初始化摄像机名称和二维码类型
/// </summary>
public
static
void
LoadConfig
()
{
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
{
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
codeTypeList
=
new
List
<
string
>();
HDLogUtil
.
LogName
=
"RollingLogFileAppender"
;
try
{
{
string
[]
codeArray
=
codeStr
.
Split
(
spiltChar
);
foreach
(
string
str
in
codeArray
)
{
...
...
@@ -40,11 +40,11 @@ namespace OnlineStore.DeviceLibrary
}
LoadCamera
(
false
);
CodeLibrary
.
HDCodeLearnHelper
.
LoadConfig
(
""
,
codeStr
);
CodeLibrary
.
HDCodeLearnHelper
.
LoadConfig
(
""
,
codeStr
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"解析摄像机配置出错:"
,
ex
);
LogUtil
.
error
(
"解析摄像机配置出错:"
,
ex
);
}
}
private
static
void
LoadCamera
(
bool
isReLoad
)
...
...
@@ -57,7 +57,7 @@ namespace OnlineStore.DeviceLibrary
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"加载HIK相机出错:"
,
ex
);
LogUtil
.
error
(
"加载HIK相机出错:"
,
ex
);
}
try
{
...
...
@@ -65,7 +65,7 @@ namespace OnlineStore.DeviceLibrary
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"加载Basler相机出错:"
,
ex
);
LogUtil
.
error
(
"加载Basler相机出错:"
,
ex
);
}
}
string
[]
names
=
CodeLibrary
.
HIKCamera
.
Instance
.
CameraName
;
...
...
@@ -157,7 +157,7 @@ namespace OnlineStore.DeviceLibrary
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"从相机【"
+
cameraName
+
"】获取图片出错:"
,
ex
);
LogUtil
.
error
(
"从相机【"
+
cameraName
+
"】获取图片出错:"
,
ex
);
}
return
bitm
;
}
...
...
@@ -208,13 +208,14 @@ namespace OnlineStore.DeviceLibrary
else
{
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
codeCount
,
GetCodeParamFilePath
(
codeType
),
codeType
);
}
}
foreach
(
CodeInfo
c
in
cc
)
{
codeList
.
Add
(
c
.
CodeStr
);
r
=
r
+
"##"
+
c
.
CodeStr
;
string
str
=
CodeManager
.
ReplaceCode
(
c
.
CodeStr
);
codeList
.
Add
(
str
);
r
=
r
+
"##"
+
str
;
}
LogUtil
.
debug
(
" 【"
+
cameraName
+
"】【"
+
codeType
+
"】扫码完成:"
+
r
);
LogUtil
.
debug
(
" 【"
+
cameraName
+
"】【"
+
codeType
+
"】扫码完成:"
+
r
);
}
LogUtil
.
info
(
" ["
+
cameraName
+
"] 扫码完成:"
+
r
);
...
...
@@ -230,8 +231,8 @@ namespace OnlineStore.DeviceLibrary
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"扫码出错:"
,
ex
);
}
LogUtil
.
error
(
"扫码出错:"
,
ex
);
}
return
codeList
;
}
...
...
@@ -255,7 +256,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
public
static
string
ReplaceCode
(
string
message
)
public
static
string
ReplaceCode
(
string
message
)
{
message
=
message
.
Trim
();
message
=
message
.
Replace
(
"\r"
,
""
);
...
...
@@ -276,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
if
(!
value
.
Equals
(
24
))
{
newBytes
.
Add
(
by
);
}
}
}
message
=
asciiEncoding
.
GetString
(
newBytes
.
ToArray
());
return
message
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论