Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 16b526af
由
LN
编写于
2019-11-02 11:01:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加软件编号显示
1 个父辈
ed527de1
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
76 行增加
和
29 行删除
source/ACSingleStore/App.config
source/ACSingleStore/FrmAbout.Designer.cs
source/ACSingleStore/FrmAbout.cs
source/ACSingleStore/FrmBase.cs
source/ACSingleStore/FrmStoreBox.cs
source/DeviceLibrary/halcon/CodeManager.cs
source/ACSingleStore/App.config
查看文件 @
16b526a
...
...
@@ -43,7 +43,7 @@
<
add
key
=
"LineServerIp"
value
=
"192.168.200.69"
/>
<
add
key
=
"LineServerPort"
value
=
"1234"
/>
<!--解码方式,
0
=
halcon
解码,
1
=西安料仓 使用
zxing
解码,
2
=成都料仓-->
<
add
key
=
"DeCodeType"
value
=
"
1
"
/>
<
add
key
=
"DeCodeType"
value
=
"
2
"
/>
<
add
key
=
"DefaultPWD"
value
=
"123456"
/>
</
appSettings
>
<
log4net
>
...
...
source/ACSingleStore/FrmAbout.Designer.cs
查看文件 @
16b526a
...
...
@@ -29,8 +29,10 @@
private
void
InitializeComponent
()
{
this
.
btnNext
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblVersion
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnCopy
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblCodeName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblTime
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblVersion
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
SuspendLayout
();
//
// btnNext
...
...
@@ -38,7 +40,7 @@
this
.
btnNext
.
Anchor
=
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
;
this
.
btnNext
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnNext
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
14.25F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnNext
.
Location
=
new
System
.
Drawing
.
Point
(
152
,
113
);
this
.
btnNext
.
Location
=
new
System
.
Drawing
.
Point
(
210
,
175
);
this
.
btnNext
.
Name
=
"btnNext"
;
this
.
btnNext
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
45
);
this
.
btnNext
.
TabIndex
=
275
;
...
...
@@ -46,33 +48,56 @@
this
.
btnNext
.
UseVisualStyleBackColor
=
false
;
this
.
btnNext
.
Click
+=
new
System
.
EventHandler
(
this
.
btnNext_Click
);
//
//
lblVersion
//
btnCopy
//
this
.
lblVersion
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
this
.
btnCopy
.
Location
=
new
System
.
Drawing
.
Point
(
465
,
78
);
this
.
btnCopy
.
Name
=
"btnCopy"
;
this
.
btnCopy
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
25
);
this
.
btnCopy
.
TabIndex
=
283
;
this
.
btnCopy
.
Text
=
"复制编号"
;
this
.
btnCopy
.
UseVisualStyleBackColor
=
true
;
this
.
btnCopy
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCopy_Click
);
//
// lblCodeName
//
this
.
lblCodeName
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lbl
Version
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
33
);
this
.
lbl
Version
.
Name
=
"lblVersion
"
;
this
.
lbl
Version
.
Size
=
new
System
.
Drawing
.
Size
(
413
,
23
);
this
.
lbl
Version
.
TabIndex
=
276
;
this
.
lbl
Version
.
Text
=
"版本号:1.1.0000.0000
"
;
this
.
lbl
Version
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
this
.
lbl
CodeName
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
114
);
this
.
lbl
CodeName
.
Name
=
"lblCodeName
"
;
this
.
lbl
CodeName
.
Size
=
new
System
.
Drawing
.
Size
(
529
,
23
);
this
.
lbl
CodeName
.
TabIndex
=
282
;
this
.
lbl
CodeName
.
Text
=
"编号:43 6F 64 65 4C 69 62 72 61 72 79 50 72 6F 6A 65 63 74
"
;
this
.
lbl
CodeName
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// lblTime
//
this
.
lblTime
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lblTime
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
63
);
this
.
lblTime
.
Location
=
new
System
.
Drawing
.
Point
(
80
,
80
);
this
.
lblTime
.
Name
=
"lblTime"
;
this
.
lblTime
.
Size
=
new
System
.
Drawing
.
Size
(
413
,
23
);
this
.
lblTime
.
TabIndex
=
2
77
;
this
.
lblTime
.
Size
=
new
System
.
Drawing
.
Size
(
379
,
23
);
this
.
lblTime
.
TabIndex
=
2
81
;
this
.
lblTime
.
Text
=
"更新时间:0000-00-00 00:00:00"
;
this
.
lblTime
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// lblVersion
//
this
.
lblVersion
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lblVersion
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
50
);
this
.
lblVersion
.
Name
=
"lblVersion"
;
this
.
lblVersion
.
Size
=
new
System
.
Drawing
.
Size
(
529
,
23
);
this
.
lblVersion
.
TabIndex
=
280
;
this
.
lblVersion
.
Text
=
"版本号:1.1.0000.0000"
;
this
.
lblVersion
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// FrmAbout
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
437
,
186
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
564
,
250
);
this
.
Controls
.
Add
(
this
.
btnCopy
);
this
.
Controls
.
Add
(
this
.
lblCodeName
);
this
.
Controls
.
Add
(
this
.
lblTime
);
this
.
Controls
.
Add
(
this
.
lblVersion
);
this
.
Controls
.
Add
(
this
.
btnNext
);
...
...
@@ -87,7 +112,9 @@
#
endregion
private
System
.
Windows
.
Forms
.
Button
btnNext
;
private
System
.
Windows
.
Forms
.
Label
lblVersion
;
private
System
.
Windows
.
Forms
.
Button
btnCopy
;
private
System
.
Windows
.
Forms
.
Label
lblCodeName
;
private
System
.
Windows
.
Forms
.
Label
lblTime
;
private
System
.
Windows
.
Forms
.
Label
lblVersion
;
}
}
\ No newline at end of file
source/ACSingleStore/FrmAbout.cs
查看文件 @
16b526a
...
...
@@ -24,11 +24,17 @@ namespace OnlineStore.ACSingleStore
this
.
DialogResult
=
DialogResult
.
None
;
lblTime
.
Text
=
"更新时间:"
+
GetVersion
();
lblVersion
.
Text
=
"版本号:"
+
System
.
Reflection
.
Assembly
.
GetExecutingAssembly
().
GetName
().
Version
.
ToString
();
lblCodeName
.
Text
=
"软件编号:"
+
GetCodeNum
();
}
private
void
btnNext_Click
(
object
sender
,
EventArgs
e
)
{
this
.
Close
();
}
private
void
btnCopy_Click
(
object
sender
,
EventArgs
e
)
{
Clipboard
.
SetDataObject
(
GetCodeNum
(),
true
);
}
}
}
source/ACSingleStore/FrmBase.cs
查看文件 @
16b526a
...
...
@@ -13,14 +13,14 @@ namespace OnlineStore.ACSingleStore
{
public
partial
class
FrmBase
:
Form
{
public
static
string
GetVersion
()
internal
static
string
GetVersion
()
{
string
str
=
""
;
string
version
=
""
;
DateTime
newData
=
DateTime
.
Parse
(
"2000-01-01"
);
try
{
System
.
Reflection
.
AssemblyName
assemblyName
=
System
.
Reflection
.
Assembly
.
GetExecutingAssembly
().
GetName
();
System
.
Reflection
.
AssemblyName
assemblyName
=
System
.
Reflection
.
Assembly
.
GetExecutingAssembly
().
GetName
();
version
=
assemblyName
.
Version
.
ToString
();
string
[]
strArray
=
version
.
Split
(
'.'
);
if
(
strArray
.
Length
.
Equals
(
4
))
...
...
@@ -38,9 +38,16 @@ namespace OnlineStore.ACSingleStore
str
=
version
;
LogUtil
.
error
(
"解析版本号【"
+
str
+
"】出错:"
+
ex
.
ToString
());
}
LogUtil
.
info
(
"版本号["
+
version
+
"]["
+
str
+
"]"
);
LogUtil
.
info
(
"版本号["
+
version
+
"]["
+
str
+
"]
["
+
GetCodeNum
()
+
"]
"
);
return
str
;
}
internal
static
string
GetCodeNum
(
string
codeName
=
"RC-29-32-ACSingleStore"
)
{
byte
[]
byteArray
=
System
.
Text
.
Encoding
.
ASCII
.
GetBytes
(
codeName
);
string
result
=
""
;
result
=
AcSerialBean
.
ByteToString
(
byteArray
);
return
result
;
}
public
FrmBase
()
{
InitializeComponent
();
...
...
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
16b526a
...
...
@@ -166,13 +166,14 @@ namespace OnlineStore.ACSingleStore
{
groupHistory
.
Visible
=
false
;
}
if
(
CodeManager
.
DeCodeType
.
Equals
(
0
))
if
(
CodeManager
.
DeCodeType
.
Equals
(
1
))
{
groupCode
.
Visible
=
false
;
groupCode
.
Visible
=
true
;
;
}
else
{
groupCode
.
Visible
=
tru
e
;
groupCode
.
Visible
=
fals
e
;
}
}
private
DateTime
preReadModblsTime
=
DateTime
.
Now
;
...
...
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
16b526a
...
...
@@ -207,7 +207,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】获取图片完成"
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
if
(
DeCodeType
.
Equals
(
0
))
if
(
DeCodeType
.
Equals
(
1
))
{
List
<
string
>
result
=
CodeLibrary
.
ZXingCodeHelper
.
DecodeQRCodes
(
bitmap
);
return
result
;
}
else
{
HalconDotNet
.
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
...
...
@@ -234,11 +239,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
" 【"
+
cameraName
+
"】【"
+
codeType
+
"】扫码完成:"
+
r
);
}
}
}
else
{
List
<
string
>
result
=
CodeLibrary
.
ZXingCodeHelper
.
DecodeQRCodes
(
bitmap
);
return
result
;
}
}
}
...
...
@@ -347,7 +348,12 @@ namespace OnlineStore.DeviceLibrary
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
);
int
subCount
=
start
.
Length
;
if
(
pCode
[
0
].
Substring
(
start
.
Length
,
1
).
Equals
(
":"
))
{
subCount
=
start
.
Length
+
1
;
}
return
pCode
[
0
].
Substring
(
subCount
,
pCode
[
0
].
Length
-
subCount
);
}
return
""
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论