Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c9f8daa6
由
几米阳光
编写于
2019-02-21 14:15:45 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
扫码修改:条形码需要拼接后发给服务器
1 个父辈
bde15ec7
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
84 行增加
和
20 行删除
RC-29-32-ACSingleStore.sln → RC32-SZBOSCH-ACSingleStore.sln
dll/CodeLibrary.dll
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/记录.txt
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/halcon/CodeManager.cs
RC
-29-32
-ACSingleStore.sln
→
RC
32-SZBOSCH
-ACSingleStore.sln
查看文件 @
c9f8daa
文件被删除
dll/CodeLibrary.dll
查看文件 @
c9f8daa
此文件类型无法预览
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
c9f8daa
...
@@ -1013,6 +1013,14 @@ namespace OnlineStore.ACSingleStore
...
@@ -1013,6 +1013,14 @@ namespace OnlineStore.ACSingleStore
private
void
扫码测试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
扫码测试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
//List<string> acodeList = new List<string>();
//acodeList.Add("HCT546598.3");
//acodeList.Add("C18 / 22");
//acodeList.Add("R1");
//acodeList.Add("P1277016004");
//acodeList.Add("Q247");
//string result = CodeManager.ProcessBarcode(acodeList, 8);
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
message
=
""
;
string
message
=
""
;
string
outMsg
=
""
;
string
outMsg
=
""
;
...
...
source/ACSingleStore/记录.txt
查看文件 @
c9f8daa
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
RC32-1 1174631483
RC32-1 1174631483
RC32-2 1170697846
RC32-2 1170697846
新拉分支:RC32-SZBOSCH-ACSingleStore 作为RC32
珠海
博世料仓代码。
新拉分支:RC32-SZBOSCH-ACSingleStore 作为RC32
苏州
博世料仓代码。
苏州博世料仓修改RC32需要修改:
苏州博世料仓修改RC32需要修改:
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
c9f8daa
...
@@ -1483,27 +1483,28 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1483,27 +1483,28 @@ namespace OnlineStore.DeviceLibrary
DateTime
date
=
DateTime
.
Now
;
DateTime
date
=
DateTime
.
Now
;
scanTimer
.
Enabled
=
false
;
scanTimer
.
Enabled
=
false
;
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
outMsg
=
""
;
//
string outMsg = "";
string
message
=
""
;
string
message
=
""
;
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
if
(
codeList
.
Count
<=
0
)
message
=
CodeManager
.
ProcessBarcode
(
codeList
,
height
);
if
(
codeList
.
Count
<=
0
||
message
.
Equals
(
""
))
{
{
codeList
=
CodeManager
.
CameraScan
();
codeList
=
CodeManager
.
CameraScan
();
message
=
CodeManager
.
ProcessBarcode
(
codeList
,
height
);
}
}
//= 1 + 123.4x100.5 - 7x12 = CODE
//= 1 + 123.4x100.5 - 7x12 = CODE
foreach
(
string
str
in
codeList
)
//
foreach (string str in codeList)
{
//
{
string
code
=
str
;
//
string code = str;
code
=
"=1+0x0-7x"
+
height
+
"="
+
code
;
//
code = "=1+0x0-7x" + height + "=" + code;
message
=
message
+
code
+
spiltStr
;
//
message = message + code + spiltStr;
}
//
}
if
(!
outMsg
.
Equals
(
""
))
//
if (!outMsg.Equals(""))
{
//
{
CodeMsg
=
"盘尺寸错误,清理二维码【"
+
message
+
"】"
;
//
CodeMsg = "盘尺寸错误,清理二维码【" + message + "】";
LogUtil
.
error
(
"盘尺寸错误,清理二维码【"
+
message
+
"】"
);
//
LogUtil.error("盘尺寸错误,清理二维码【" + message + "】");
message
=
""
;
//
message = "";
}
//
}
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
onCodeReceived
(
message
);
onCodeReceived
(
message
);
}
}
...
...
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
c9f8daa
...
@@ -6,6 +6,7 @@ using System.Collections.Generic;
...
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using
System.Drawing
;
using
System.Drawing
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Runtime.ExceptionServices
;
using
System.Text
;
using
System.Text
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
...
@@ -90,8 +91,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -90,8 +91,8 @@ namespace OnlineStore.DeviceLibrary
}
}
return
bitm
;
return
bitm
;
}
}
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
(
)
public
static
List
<
string
>
CameraScan
()
{
{
List
<
string
>
codeList
=
new
List
<
string
>();
List
<
string
>
codeList
=
new
List
<
string
>();
List
<
CodeInfo
>
allCodeList
=
new
List
<
CodeInfo
>();
List
<
CodeInfo
>
allCodeList
=
new
List
<
CodeInfo
>();
...
@@ -122,14 +123,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -122,14 +123,20 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
allCodeList
.
AddRange
(
cc
);
allCodeList
.
AddRange
(
cc
);
bitmap
.
Dispose
();
}
}
}
}
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
"扫码出现AccessViolationException异常:"
+
e
.
ToString
());
GC
.
Collect
();
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"扫码出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"扫码出错:"
+
ex
.
ToString
());
}
}
foreach
(
CodeInfo
info
in
allCodeList
)
foreach
(
CodeInfo
info
in
allCodeList
)
{
{
codeList
.
Add
(
info
.
CodeStr
);
codeList
.
Add
(
info
.
CodeStr
);
}
}
...
@@ -150,7 +157,55 @@ namespace OnlineStore.DeviceLibrary
...
@@ -150,7 +157,55 @@ namespace OnlineStore.DeviceLibrary
{
{
return
""
;
return
""
;
}
}
}
}
public
static
string
ProcessBarcode
(
List
<
string
>
codeList
,
int
height
)
{
// 条码前面字母去掉之后用分号分割,最后不加分号
//P; H; Q
//code = "=1+0x0-7x" + height + "=" + code;
string
split
=
";"
;
string
result
=
""
;
try
{
List
<
string
>
rCodes
=
new
List
<
string
>();
rCodes
.
Add
(
GetCodeByStart
(
codeList
,
"P"
));
rCodes
.
Add
(
GetCodeByStart
(
codeList
,
"H"
));
rCodes
.
Add
(
GetCodeByStart
(
codeList
,
"Q"
));
foreach
(
string
s
in
rCodes
)
{
if
(!
s
.
Equals
(
""
))
{
if
(
result
.
Equals
(
""
))
{
result
=
s
;
}
else
{
result
=
result
+
split
+
s
;
}
}
}
if
(!
result
.
Equals
(
""
))
{
return
"=1+0x0-7x"
+
height
+
"="
+
result
;
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"处理二维码出错:"
+
ex
.
ToString
());
}
return
result
;
}
private
static
string
GetCodeByStart
(
List
<
string
>
codeList
,
string
start
)
{
List
<
string
>
pCode
=
(
from
m
in
codeList
where
m
.
StartsWith
(
start
)
select
m
).
ToList
<
string
>();
if
(
pCode
.
Count
>
0
)
{
return
pCode
[
0
].
Substring
(
1
,
pCode
[
0
].
Length
-
1
);
}
return
""
;
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论