Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 13d512f3
由
刘韬
编写于
2021-10-20 09:13:08 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
添加监控相机显示
1 个父辈
92694de8
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
310 行增加
和
71 行删除
source/ACSingleStore/App.config
source/ACSingleStore/AutoInOutStore.csproj
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/userControl/uc_boxdebug.cs
source/ACSingleStore/userControl/uc_boxdebug.designer.cs
source/Common/Common.csproj
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/StoreConfig/AC/linePositions.csv
source/DeviceLibrary/store/Camera.cs
source/LoadCVSLibrary/LoadCSVLibrary.csproj
source/ACSingleStore/App.config
查看文件 @
13d512f
...
@@ -95,6 +95,10 @@
...
@@ -95,6 +95,10 @@
<
level
value
=
"Info"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"AIOBOX"
/>
<
appender
-
ref
ref
=
"AIOBOX"
/>
</
logger
>
</
logger
>
<
logger
name
=
"HIK.IPCamera"
additivity
=
"false"
>
<
level
value
=
"All"
/>
<
appender
-
ref
ref
=
"Camera"
/>
</
logger
>
<
root
>
<
root
>
<
level
value
=
"INFO"
/>
<
level
value
=
"INFO"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
...
@@ -135,4 +139,12 @@
...
@@ -135,4 +139,12 @@
</
serviceBehaviors
>
</
serviceBehaviors
>
</
behaviors
>
</
behaviors
>
</
system
.
serviceModel
>
</
system
.
serviceModel
>
<
runtime
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"log4net"
culture
=
"neutral"
publicKeyToken
=
"669e0ddf0bb1aa2a"
Retargetable
=
"Yes"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-9.9.9.0"
newVersion
=
"2.0.12.0"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
</
configuration
>
</
configuration
>
\ No newline at end of file
\ No newline at end of file
source/ACSingleStore/AutoInOutStore.csproj
查看文件 @
13d512f
...
@@ -38,14 +38,16 @@
...
@@ -38,14 +38,16 @@
<ApplicationIcon>box.ico</ApplicationIcon>
<ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="CodeLibrary">
<Reference Include="CodeLibrary, Version=1.0.7844.17688, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
</Reference>
<Reference Include="halcondotnet">
<Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
</Reference>
<Reference Include="log4net">
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\dll\log4net.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Core" />
...
...
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
13d512f
...
@@ -61,6 +61,7 @@
...
@@ -61,6 +61,7 @@
this
.
richTextBox1
=
new
System
.
Windows
.
Forms
.
RichTextBox
();
this
.
richTextBox1
=
new
System
.
Windows
.
Forms
.
RichTextBox
();
this
.
btnClearLog
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnClearLog
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tabPage5
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage5
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
pictureBox1
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
chbDebug
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
chbDebug
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
lblThisSta
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblThisSta
=
new
System
.
Windows
.
Forms
.
Label
();
...
@@ -159,6 +160,8 @@
...
@@ -159,6 +160,8 @@
this
.
btnUpDownP6
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnUpDownP6
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnUpDownP3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnUpDownP3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnUpDownP4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnUpDownP4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tabPage6
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
uc_boxdebug1
=
new
OnlineStore
.
ACSingleStore
.
useControl
.
uc_boxdebug
();
this
.
menuStrip1
=
new
System
.
Windows
.
Forms
.
MenuStrip
();
this
.
menuStrip1
=
new
System
.
Windows
.
Forms
.
MenuStrip
();
this
.
料仓操作
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
料仓操作
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
启动
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
启动
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
...
@@ -212,14 +215,13 @@
...
@@ -212,14 +215,13 @@
this
.
英文
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
英文
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator22
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripSeparator22
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripMenuItem6
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripMenuItem6
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
tabPage6
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
uc_boxdebug1
=
new
OnlineStore
.
ACSingleStore
.
useControl
.
uc_boxdebug
();
this
.
contextMenuStrip1
.
SuspendLayout
();
this
.
contextMenuStrip1
.
SuspendLayout
();
this
.
groupAuto
.
SuspendLayout
();
this
.
groupAuto
.
SuspendLayout
();
this
.
groupBox6
.
SuspendLayout
();
this
.
groupBox6
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage4
.
SuspendLayout
();
this
.
tabPage4
.
SuspendLayout
();
this
.
tabPage5
.
SuspendLayout
();
this
.
tabPage5
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
pictureBox1
)).
BeginInit
();
this
.
groupBox3
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
picAxis4
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
picAxis4
)).
BeginInit
();
...
@@ -227,8 +229,8 @@
...
@@ -227,8 +229,8 @@
this
.
groupBox7
.
SuspendLayout
();
this
.
groupBox7
.
SuspendLayout
();
this
.
groupAxis
.
SuspendLayout
();
this
.
groupAxis
.
SuspendLayout
();
this
.
groupInout
.
SuspendLayout
();
this
.
groupInout
.
SuspendLayout
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
tabPage6
.
SuspendLayout
();
this
.
tabPage6
.
SuspendLayout
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// timer1
// timer1
...
@@ -463,7 +465,7 @@
...
@@ -463,7 +465,7 @@
this
.
groupBox6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox6
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
119
);
this
.
groupBox6
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
119
);
this
.
groupBox6
.
Name
=
"groupBox6"
;
this
.
groupBox6
.
Name
=
"groupBox6"
;
this
.
groupBox6
.
Size
=
new
System
.
Drawing
.
Size
(
1230
,
2
8
6
);
this
.
groupBox6
.
Size
=
new
System
.
Drawing
.
Size
(
1230
,
2
7
6
);
this
.
groupBox6
.
TabIndex
=
302
;
this
.
groupBox6
.
TabIndex
=
302
;
this
.
groupBox6
.
TabStop
=
false
;
this
.
groupBox6
.
TabStop
=
false
;
this
.
groupBox6
.
Text
=
"批量上下料操作"
;
this
.
groupBox6
.
Text
=
"批量上下料操作"
;
...
@@ -656,6 +658,7 @@
...
@@ -656,6 +658,7 @@
//
//
// tabPage5
// tabPage5
//
//
this
.
tabPage5
.
Controls
.
Add
(
this
.
pictureBox1
);
this
.
tabPage5
.
Controls
.
Add
(
this
.
groupBox6
);
this
.
tabPage5
.
Controls
.
Add
(
this
.
groupBox6
);
this
.
tabPage5
.
Controls
.
Add
(
this
.
groupBox3
);
this
.
tabPage5
.
Controls
.
Add
(
this
.
groupBox3
);
this
.
tabPage5
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
this
.
tabPage5
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
...
@@ -665,6 +668,19 @@
...
@@ -665,6 +668,19 @@
this
.
tabPage5
.
Text
=
"设备信息"
;
this
.
tabPage5
.
Text
=
"设备信息"
;
this
.
tabPage5
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage5
.
UseVisualStyleBackColor
=
true
;
//
//
// pictureBox1
//
this
.
pictureBox1
.
BackColor
=
System
.
Drawing
.
Color
.
Gainsboro
;
this
.
pictureBox1
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
401
);
this
.
pictureBox1
.
Name
=
"pictureBox1"
;
this
.
pictureBox1
.
Size
=
new
System
.
Drawing
.
Size
(
411
,
234
);
this
.
pictureBox1
.
SizeMode
=
System
.
Windows
.
Forms
.
PictureBoxSizeMode
.
Zoom
;
this
.
pictureBox1
.
TabIndex
=
303
;
this
.
pictureBox1
.
TabStop
=
false
;
this
.
pictureBox1
.
Visible
=
false
;
this
.
pictureBox1
.
DoubleClick
+=
new
System
.
EventHandler
(
this
.
pictureBox1_DoubleClick
);
this
.
pictureBox1
.
MouseDown
+=
new
System
.
Windows
.
Forms
.
MouseEventHandler
(
this
.
pictureBox1_Click
);
//
// groupBox3
// groupBox3
//
//
this
.
groupBox3
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
this
.
groupBox3
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
...
@@ -1986,6 +2002,25 @@
...
@@ -1986,6 +2002,25 @@
this
.
btnUpDownP4
.
UseVisualStyleBackColor
=
true
;
this
.
btnUpDownP4
.
UseVisualStyleBackColor
=
true
;
this
.
btnUpDownP4
.
Click
+=
new
System
.
EventHandler
(
this
.
btnUpDownP4_Click
);
this
.
btnUpDownP4
.
Click
+=
new
System
.
EventHandler
(
this
.
btnUpDownP4_Click
);
//
//
// tabPage6
//
this
.
tabPage6
.
Controls
.
Add
(
this
.
uc_boxdebug1
);
this
.
tabPage6
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
tabPage6
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
this
.
tabPage6
.
Name
=
"tabPage6"
;
this
.
tabPage6
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage6
.
Size
=
new
System
.
Drawing
.
Size
(
1249
,
659
);
this
.
tabPage6
.
TabIndex
=
6
;
this
.
tabPage6
.
Text
=
"库位调试"
;
this
.
tabPage6
.
UseVisualStyleBackColor
=
true
;
//
// uc_boxdebug1
//
this
.
uc_boxdebug1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
6
);
this
.
uc_boxdebug1
.
Name
=
"uc_boxdebug1"
;
this
.
uc_boxdebug1
.
Size
=
new
System
.
Drawing
.
Size
(
1076
,
596
);
this
.
uc_boxdebug1
.
TabIndex
=
0
;
//
// menuStrip1
// menuStrip1
//
//
this
.
menuStrip1
.
Font
=
new
System
.
Drawing
.
Font
(
"Microsoft YaHei UI"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
menuStrip1
.
Font
=
new
System
.
Drawing
.
Font
(
"Microsoft YaHei UI"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
...
@@ -2368,25 +2403,6 @@
...
@@ -2368,25 +2403,6 @@
this
.
toolStripMenuItem6
.
Text
=
"日语"
;
this
.
toolStripMenuItem6
.
Text
=
"日语"
;
this
.
toolStripMenuItem6
.
Click
+=
new
System
.
EventHandler
(
this
.
toolStripMenuItem6_Click
);
this
.
toolStripMenuItem6
.
Click
+=
new
System
.
EventHandler
(
this
.
toolStripMenuItem6_Click
);
//
//
// tabPage6
//
this
.
tabPage6
.
Controls
.
Add
(
this
.
uc_boxdebug1
);
this
.
tabPage6
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
tabPage6
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
this
.
tabPage6
.
Name
=
"tabPage6"
;
this
.
tabPage6
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage6
.
Size
=
new
System
.
Drawing
.
Size
(
1249
,
659
);
this
.
tabPage6
.
TabIndex
=
6
;
this
.
tabPage6
.
Text
=
"库位调试"
;
this
.
tabPage6
.
UseVisualStyleBackColor
=
true
;
//
// uc_boxdebug1
//
this
.
uc_boxdebug1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
6
);
this
.
uc_boxdebug1
.
Name
=
"uc_boxdebug1"
;
this
.
uc_boxdebug1
.
Size
=
new
System
.
Drawing
.
Size
(
1076
,
596
);
this
.
uc_boxdebug1
.
TabIndex
=
0
;
//
// FrmStoreBox
// FrmStoreBox
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
...
@@ -2412,6 +2428,7 @@
...
@@ -2412,6 +2428,7 @@
this
.
tabControl1
.
ResumeLayout
(
false
);
this
.
tabControl1
.
ResumeLayout
(
false
);
this
.
tabPage4
.
ResumeLayout
(
false
);
this
.
tabPage4
.
ResumeLayout
(
false
);
this
.
tabPage5
.
ResumeLayout
(
false
);
this
.
tabPage5
.
ResumeLayout
(
false
);
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
pictureBox1
)).
EndInit
();
this
.
groupBox3
.
ResumeLayout
(
false
);
this
.
groupBox3
.
ResumeLayout
(
false
);
this
.
groupBox3
.
PerformLayout
();
this
.
groupBox3
.
PerformLayout
();
this
.
tabPage2
.
ResumeLayout
(
false
);
this
.
tabPage2
.
ResumeLayout
(
false
);
...
@@ -2424,9 +2441,9 @@
...
@@ -2424,9 +2441,9 @@
this
.
groupAxis
.
PerformLayout
();
this
.
groupAxis
.
PerformLayout
();
this
.
groupInout
.
ResumeLayout
(
false
);
this
.
groupInout
.
ResumeLayout
(
false
);
this
.
groupInout
.
PerformLayout
();
this
.
groupInout
.
PerformLayout
();
this
.
tabPage6
.
ResumeLayout
(
false
);
this
.
menuStrip1
.
ResumeLayout
(
false
);
this
.
menuStrip1
.
ResumeLayout
(
false
);
this
.
menuStrip1
.
PerformLayout
();
this
.
menuStrip1
.
PerformLayout
();
this
.
tabPage6
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
this
.
PerformLayout
();
...
@@ -2628,6 +2645,7 @@
...
@@ -2628,6 +2645,7 @@
private
System
.
Windows
.
Forms
.
CheckBox
chbDebug
;
private
System
.
Windows
.
Forms
.
CheckBox
chbDebug
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage6
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage6
;
private
ACSingleStore
.
useControl
.
uc_boxdebug
uc_boxdebug1
;
private
ACSingleStore
.
useControl
.
uc_boxdebug
uc_boxdebug1
;
private
System
.
Windows
.
Forms
.
PictureBox
pictureBox1
;
}
}
}
}
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
13d512f
...
@@ -25,6 +25,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -25,6 +25,7 @@ namespace OnlineStore.AutoInOutStore
private
AC_SA_BoxBean
store
;
private
AC_SA_BoxBean
store
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
HIKCamera
camera
=
new
HIKCamera
();
public
FrmStoreBox
()
public
FrmStoreBox
()
{
{
Control
.
CheckForIllegalCrossThreadCalls
=
false
;
Control
.
CheckForIllegalCrossThreadCalls
=
false
;
...
@@ -39,6 +40,15 @@ namespace OnlineStore.AutoInOutStore
...
@@ -39,6 +40,15 @@ namespace OnlineStore.AutoInOutStore
private
void
initValue
()
private
void
initValue
()
{
{
InitStoreValue
();
InitStoreValue
();
camera
.
camera_event
+=
Camera_camera_event
;
camera
.
LoadCameraConfig
();
}
private
void
Camera_camera_event
(
object
sender
,
Bitmap
e
)
{
this
.
Invoke
((
EventHandler
<
Bitmap
>)
delegate
{
pictureBox1
.
Visible
=
true
;
pictureBox1
.
Image
=
e
;
},
sender
,
e
);
}
}
private
void
InitStoreValue
()
private
void
InitStoreValue
()
{
{
...
@@ -207,7 +217,6 @@ namespace OnlineStore.AutoInOutStore
...
@@ -207,7 +217,6 @@ namespace OnlineStore.AutoInOutStore
启动
ToolStripMenuItem
.
Enabled
=
!
isOpen
;
启动
ToolStripMenuItem
.
Enabled
=
!
isOpen
;
停止
ToolStripMenuItem
.
Enabled
=
isOpen
;
停止
ToolStripMenuItem
.
Enabled
=
isOpen
;
复位
ToolStripMenuItem
.
Enabled
=
isOpen
;
复位
ToolStripMenuItem
.
Enabled
=
isOpen
;
}
}
private
bool
LoadOk
=
false
;
private
bool
LoadOk
=
false
;
private
void
FrmTest_Load
(
object
sender
,
EventArgs
e
)
private
void
FrmTest_Load
(
object
sender
,
EventArgs
e
)
...
@@ -229,7 +238,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -229,7 +238,7 @@ namespace OnlineStore.AutoInOutStore
this
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_Title
);
this
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_Title
);
HideForm
();
HideForm
();
initValue
();
initValue
();
CodeManager
.
LoadConfig
();
this
.
toolStripMenuItem4
.
Visible
=
StoreManager
.
HasDisableDoorControl
;
this
.
toolStripMenuItem4
.
Visible
=
StoreManager
.
HasDisableDoorControl
;
this
.
toolStripMenuItem5
.
Visible
=
StoreManager
.
HasDisableDoorControl
;
this
.
toolStripMenuItem5
.
Visible
=
StoreManager
.
HasDisableDoorControl
;
this
.
toolStripSeparator16
.
Visible
=
StoreManager
.
HasDisableDoorControl
;
this
.
toolStripSeparator16
.
Visible
=
StoreManager
.
HasDisableDoorControl
;
...
@@ -1266,7 +1275,8 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1266,7 +1275,8 @@ namespace OnlineStore.AutoInOutStore
return
;
return
;
}
}
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
CodeLibrary
.
FrmCodeDecode
frm
=
new
FrmCodeDecode
(
false
,
false
);
CodeLibrary
.
FrmCodeDecode
frm
=
new
FrmCodeDecode
();
frm
.
chbZxing
.
Checked
=
false
;
frm
.
ShowDialog
();
frm
.
ShowDialog
();
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
}
...
@@ -1719,5 +1729,24 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1719,5 +1729,24 @@ namespace OnlineStore.AutoInOutStore
StoreManager
.
UpdateBoxConfig
(
store
.
Config
);
StoreManager
.
UpdateBoxConfig
(
store
.
Config
);
}
}
}
}
private
void
pictureBox1_DoubleClick
(
object
sender
,
EventArgs
e
)
{
var
obj
=
sender
as
PictureBox
;
if
(
obj
.
Dock
==
DockStyle
.
Fill
)
obj
.
Dock
=
DockStyle
.
None
;
else
{
obj
.
BringToFront
();
obj
.
Dock
=
DockStyle
.
Fill
;
}
}
private
void
pictureBox1_Click
(
object
sender
,
MouseEventArgs
e
)
{
var
obj
=
sender
as
PictureBox
;
if
(
obj
.
Dock
==
DockStyle
.
Fill
)
obj
.
Dock
=
DockStyle
.
None
;
}
}
}
}
}
source/ACSingleStore/userControl/uc_boxdebug.cs
查看文件 @
13d512f
...
@@ -13,6 +13,7 @@ using System.IO;
...
@@ -13,6 +13,7 @@ using System.IO;
using
System.Linq
;
using
System.Linq
;
using
System.Reflection
;
using
System.Reflection
;
using
System.Text
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
...
@@ -118,12 +119,12 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -118,12 +119,12 @@ namespace OnlineStore.ACSingleStore.useControl
string
[]
pa
=
a
.
Split
(
'_'
);
string
[]
pa
=
a
.
Split
(
'_'
);
string
[]
pb
=
b
.
Split
(
'_'
);
string
[]
pb
=
b
.
Split
(
'_'
);
if
(
pa
[
1
].
Length
==
1
)
if
(
int
.
TryParse
(
pa
[
1
],
out
_
)
)
pa
[
1
]
+=
"A"
;
pa
[
1
]
+=
"A"
;
if
(
pb
[
1
].
Length
==
1
)
if
(
int
.
TryParse
(
pb
[
1
],
out
_
)
)
pb
[
1
]
+=
"A"
;
pb
[
1
]
+=
"A"
;
var
isa
=
pa
[
1
][
0
]
+(
pa
[
1
][
1
].
Equals
(
'A'
)
?
"1"
:
"2"
)
+
pa
[
2
][
0
]
+
pa
[
3
].
PadLeft
(
2
,
'0'
);
var
isa
=
Regex
.
Replace
(
pa
[
1
],
@"[^\d]*"
,
""
)
+(
pa
[
1
][
1
].
Equals
(
'A'
)
?
"1"
:
"2"
)
+
pa
[
2
][
0
]
+
pa
[
3
].
PadLeft
(
2
,
'0'
);
var
isb
=
pb
[
1
][
0
]+
(
pb
[
1
][
1
].
Equals
(
'A'
)
?
"1"
:
"2"
)
+
pb
[
2
][
0
]
+
pb
[
3
].
PadLeft
(
2
,
'0'
);
var
isb
=
Regex
.
Replace
(
pb
[
1
],
@"[^\d]*"
,
""
)
+
(
pb
[
1
][
1
].
Equals
(
'A'
)
?
"1"
:
"2"
)
+
pb
[
2
][
0
]
+
pb
[
3
].
PadLeft
(
2
,
'0'
);
if
(
int
.
Parse
(
isa
)
==
int
.
Parse
(
isb
))
if
(
int
.
Parse
(
isa
)
==
int
.
Parse
(
isb
))
...
@@ -181,7 +182,7 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -181,7 +182,7 @@ namespace OnlineStore.ACSingleStore.useControl
//store.PositionNumList.Reverse();
//store.PositionNumList.Reverse();
string
[]
posstr
=
store
.
PositionNumList
[
store
.
PositionNumList
.
Count
-
1
].
Split
(
'_'
);
string
[]
posstr
=
store
.
PositionNumList
[
store
.
PositionNumList
.
Count
-
1
].
Split
(
'_'
);
int
colcount
=
int
.
Parse
(
posstr
[
1
][
0
].
ToString
(
))+
1
;
int
colcount
=
int
.
Parse
(
Regex
.
Replace
(
posstr
[
1
],
@"[^\d]*"
,
""
))+
1
;
for
(
int
i
=
0
;
i
<
colcount
;
i
++)
for
(
int
i
=
0
;
i
<
colcount
;
i
++)
{
{
dataGridView1
.
Columns
.
Add
(
"Col"
+
i
+
"_A"
,
"Col"
+
i
+
"_A"
);
dataGridView1
.
Columns
.
Add
(
"Col"
+
i
+
"_A"
,
"Col"
+
i
+
"_A"
);
...
@@ -206,7 +207,7 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -206,7 +207,7 @@ namespace OnlineStore.ACSingleStore.useControl
int
ci
=
store
.
PositionNumList
.
Count
-
1
-
i
;
int
ci
=
store
.
PositionNumList
.
Count
-
1
-
i
;
string
posname
=
store
.
PositionNumList
[
ci
];
string
posname
=
store
.
PositionNumList
[
ci
];
string
[]
_posstr
=
posname
.
Split
(
'_'
);
string
[]
_posstr
=
posname
.
Split
(
'_'
);
int
col
=
int
.
Parse
(
_posstr
[
1
][
0
].
ToString
(
));
int
col
=
int
.
Parse
(
Regex
.
Replace
(
_posstr
[
1
],
@"[^\d]*"
,
""
));
string
ab
=
"A"
;
string
ab
=
"A"
;
if
(
_posstr
[
1
].
Length
>
1
)
if
(
_posstr
[
1
].
Length
>
1
)
ab
=
_posstr
[
1
][
1
].
ToString
();
ab
=
_posstr
[
1
][
1
].
ToString
();
...
@@ -234,10 +235,12 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -234,10 +235,12 @@ namespace OnlineStore.ACSingleStore.useControl
currentRowIndex
++;
currentRowIndex
++;
}
}
dataGridView1
.
Rows
.
RemoveAt
(
dataGridView1
.
Rows
.
Count
-
1
);
dataGridView1
.
Rows
.
RemoveAt
(
dataGridView1
.
Rows
.
Count
-
1
);
setData
(
store
.
PositionNumList
.
Last
());
}
}
void
setData
(
string
posid
)
{
void
setData
(
string
posid
)
{
AutoStorePosition
ktkPosition
=
CSVPositionReader
<
AutoStorePosition
>.
GetPositon
(
posid
);
AutoStorePosition
ktkPosition
=
CSVPositionReader
<
AutoStorePosition
>.
GetPositon
(
posid
);
cmbPosition
.
Text
=
posid
;
cmbPosition
.
Text
=
posid
;
label_size
.
Text
=
$
"[{ktkPosition.BagWidth}x{ktkPosition.BagHeight}]"
;
if
(
ktkPosition
!=
null
)
if
(
ktkPosition
!=
null
)
{
{
txtMiddleP2
.
Text
=
ktkPosition
.
MiddleAxis_Position_P2
.
ToString
();
txtMiddleP2
.
Text
=
ktkPosition
.
MiddleAxis_Position_P2
.
ToString
();
...
...
source/ACSingleStore/userControl/uc_boxdebug.designer.cs
查看文件 @
13d512f
...
@@ -63,6 +63,7 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -63,6 +63,7 @@ namespace OnlineStore.ACSingleStore.useControl
this
.
btnCycleOut
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnCycleOut
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupAuto
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupAuto
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnSavePosition
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnSavePosition
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label_size
=
new
System
.
Windows
.
Forms
.
Label
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
dataGridView1
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
dataGridView1
)).
BeginInit
();
this
.
groupAuto
.
SuspendLayout
();
this
.
groupAuto
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
...
@@ -456,9 +457,9 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -456,9 +457,9 @@ namespace OnlineStore.ACSingleStore.useControl
//
//
// cmbPosition
// cmbPosition
//
//
this
.
cmbPosition
.
Location
=
new
System
.
Drawing
.
Point
(
39
,
34
);
this
.
cmbPosition
.
Location
=
new
System
.
Drawing
.
Point
(
68
,
34
);
this
.
cmbPosition
.
Name
=
"cmbPosition"
;
this
.
cmbPosition
.
Name
=
"cmbPosition"
;
this
.
cmbPosition
.
Size
=
new
System
.
Drawing
.
Size
(
1
57
,
23
);
this
.
cmbPosition
.
Size
=
new
System
.
Drawing
.
Size
(
1
28
,
23
);
this
.
cmbPosition
.
TabIndex
=
286
;
this
.
cmbPosition
.
TabIndex
=
286
;
this
.
cmbPosition
.
Text
=
"label1"
;
this
.
cmbPosition
.
Text
=
"label1"
;
//
//
...
@@ -535,6 +536,7 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -535,6 +536,7 @@ namespace OnlineStore.ACSingleStore.useControl
this
.
groupAuto
.
Controls
.
Add
(
this
.
btnBatchOutTest
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
btnBatchOutTest
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
btnCycleOut
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
btnCycleOut
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
btnStart
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
btnStart
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
label_size
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
cmbPosition
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
cmbPosition
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
btnOutStore
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
btnOutStore
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
label30
);
this
.
groupAuto
.
Controls
.
Add
(
this
.
label30
);
...
@@ -557,6 +559,14 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -557,6 +559,14 @@ namespace OnlineStore.ACSingleStore.useControl
this
.
btnSavePosition
.
UseVisualStyleBackColor
=
true
;
this
.
btnSavePosition
.
UseVisualStyleBackColor
=
true
;
this
.
btnSavePosition
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSavePosition_Click
);
this
.
btnSavePosition
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSavePosition_Click
);
//
//
// label_size
//
this
.
label_size
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
34
);
this
.
label_size
.
Name
=
"label_size"
;
this
.
label_size
.
Size
=
new
System
.
Drawing
.
Size
(
51
,
23
);
this
.
label_size
.
TabIndex
=
286
;
this
.
label_size
.
Text
=
"label1"
;
//
// uc_boxdebug
// uc_boxdebug
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
@@ -629,5 +639,6 @@ namespace OnlineStore.ACSingleStore.useControl
...
@@ -629,5 +639,6 @@ namespace OnlineStore.ACSingleStore.useControl
private
System
.
Windows
.
Forms
.
Button
btnCycleOut
;
private
System
.
Windows
.
Forms
.
Button
btnCycleOut
;
private
System
.
Windows
.
Forms
.
GroupBox
groupAuto
;
private
System
.
Windows
.
Forms
.
GroupBox
groupAuto
;
private
System
.
Windows
.
Forms
.
Button
btnSavePosition
;
private
System
.
Windows
.
Forms
.
Button
btnSavePosition
;
private
System
.
Windows
.
Forms
.
Label
label_size
;
}
}
}
}
source/Common/Common.csproj
查看文件 @
13d512f
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace>
<RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>Common</AssemblyName>
<AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</PropertyGroup>
</PropertyGroup>
...
@@ -33,9 +33,9 @@
...
@@ -33,9 +33,9 @@
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="log4net, Version=
1.2.15
.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=
2.0.8
.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\
dll
\log4net.dll</HintPath>
<HintPath>..\..\
..\增广夹爪\Rmaxis\bin\Debug
\log4net.dll</HintPath>
</Reference>
</Reference>
<Reference Include="Newtonsoft.Json">
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath>
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
13d512f
...
@@ -36,19 +36,23 @@
...
@@ -36,19 +36,23 @@
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="Asa.Camera.VisionLib">
<HintPath>..\..\..\camera\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="Asa.IOModule.AIOBOX, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Asa.IOModule.AIOBOX, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
</Reference>
<Reference Include="CodeLibrary">
<Reference Include="CodeLibrary, Version=1.0.7844.17688, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
</Reference>
<Reference Include="halcondotnet">
<Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
</Reference>
<Reference Include="log4net, Version=
1.2.15
.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=
2.0.8
.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\
dll
\log4net.dll</HintPath>
<HintPath>..\..\
..\增广夹爪\Rmaxis\bin\Debug
\log4net.dll</HintPath>
</Reference>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Core" />
...
@@ -76,6 +80,7 @@
...
@@ -76,6 +80,7 @@
<Compile Include="DeviceLibrary\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="DeviceLibrary\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="DeviceLibrary\PanasonicServo\BatchAxisController.cs" />
<Compile Include="DeviceLibrary\PanasonicServo\BatchAxisController.cs" />
<Compile Include="ResourceControl.cs" />
<Compile Include="ResourceControl.cs" />
<Compile Include="store\Camera.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
<SubType>Code</SubType>
...
...
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
13d512f
...
@@ -48,6 +48,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -48,6 +48,7 @@ namespace OnlineStore.DeviceLibrary
continue
;
continue
;
}
}
//LogUtil.info("加载到配置摄像机名称:" + str.Trim());
//LogUtil.info("加载到配置摄像机名称:" + str.Trim());
if
(!
cameraNameList
.
Contains
(
str
.
Trim
()))
cameraNameList
.
Add
(
str
.
Trim
());
cameraNameList
.
Add
(
str
.
Trim
());
}
}
string
[]
codeArray
=
codeStr
.
Split
(
spiltChar
);
string
[]
codeArray
=
codeStr
.
Split
(
spiltChar
);
...
@@ -99,6 +100,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -99,6 +100,7 @@ namespace OnlineStore.DeviceLibrary
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"加载HIK相机出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"加载HIK相机出错:"
+
ex
.
ToString
());
return
;
}
}
}
}
string
[]
names
=
Camera
.
_cam
.
Name
;
string
[]
names
=
Camera
.
_cam
.
Name
;
...
@@ -167,16 +169,39 @@ namespace OnlineStore.DeviceLibrary
...
@@ -167,16 +169,39 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
LogUtil
.
info
(
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
string
r
=
""
;
string
r
=
""
;
foreach
(
string
codeType
in
codeTypeList
)
//foreach (string codeType in codeTypeList)
{
//{
//判断是否是一维码
// //判断是否是一维码
if
(
codeType
.
ToLower
().
Equals
(
"barcode"
))
// if (codeType.ToLower().Equals("barcode"))
{
// {
cc
=
HDCodeHelper
.
DecodeBarCode
(
ho_Image
);
// cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
// }
else
// else
{
// {
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
codeType
,
GetCodeParamFilePath
(
codeType
),
codeCount
,
2000
);
// cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000);
// }
// foreach (CodeInfo c in cc)
// {
// string str = CodeManager.ReplaceCode(c.CodeStr);
// if (!codeList.Contains(str))
// {
// codeList.Add(str);
// r = r + "##" + str;
// }
// }
//}
RemoteDecodeHelper
.
RemoteDecodeParam
remoteDecodeParam
=
new
RemoteDecodeHelper
.
RemoteDecodeParam
{
codeTypeList
=
codeTypeList
.
ToArray
(),
codeCount
=
QRCodeCount
,
timeout
=
3000
};
cc
=
RemoteDecodeHelper
.
DecodeRequest
(
ho_Image
,
remoteDecodeParam
);
if
(
cc
==
null
)
{
cc
=
new
List
<
CodeInfo
>();
// SaveImageToFile(deviceName, cameraName, bit);
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
" 扫码失败"
);
}
}
foreach
(
CodeInfo
c
in
cc
)
foreach
(
CodeInfo
c
in
cc
)
{
{
...
@@ -187,11 +212,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -187,11 +212,6 @@ namespace OnlineStore.DeviceLibrary
r
=
r
+
"##"
+
str
;
r
=
r
+
"##"
+
str
;
}
}
}
}
}
if
(
String
.
IsNullOrEmpty
(
r
))
{
// SaveImageToFile(deviceName, cameraName, bit);
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
" 扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
" 扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
}
}
catch
(
AccessViolationException
e
)
catch
(
AccessViolationException
e
)
...
...
source/DeviceLibrary/StoreConfig/AC/linePositions.csv
查看文件 @
13d512f
...
@@ -505,10 +505,10 @@
...
@@ -505,10 +505,10 @@
1#AC1_9_3_14,10,8,7,1,1,173300,971572,977672,977672,971572,77000,417100,358300,101000,87000,,,,,,,
1#AC1_9_3_14,10,8,7,1,1,173300,971572,977672,977672,971572,77000,417100,358300,101000,87000,,,,,,,
1#AC1_9_3_15,9,8,7,1,1,173300,987881,993981,993981,987881,77000,417100,358300,101000,87000,,,,,,,
1#AC1_9_3_15,9,8,7,1,1,173300,987881,993981,993981,987881,77000,417100,358300,101000,87000,,,,,,,
1#AC1_9_3_16,8,8,7,1,1,173300,1003981,1010081,1010081,1003981,77000,417100,358300,101000,87000,,,,,,,
1#AC1_9_3_16,8,8,7,1,1,173300,1003981,1010081,1010081,1003981,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
9
_3_17,7,8,7,1,1,173300,1021500,1027600,1027600,1021500,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
10
_3_17,7,8,7,1,1,173300,1021500,1027600,1027600,1021500,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
9
_3_18,6,8,7,1,1,173300,1037899,1043999,1043999,1037899,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
10
_3_18,6,8,7,1,1,173300,1037899,1043999,1043999,1037899,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
9
_3_19,5,8,7,1,1,173300,1054258,1060358,1060358,1054258,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
10
_3_19,5,8,7,1,1,173300,1054258,1060358,1060358,1054258,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
9
_3_20,4,8,7,1,1,173300,1071046,1077146,1077146,1071046,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
10
_3_20,4,8,7,1,1,173300,1071046,1077146,1077146,1071046,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
9
_3_21,3,8,7,1,1,173300,1087092,1093192,1093192,1087092,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
10
_3_21,3,8,7,1,1,173300,1087092,1093192,1093192,1087092,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
9
_3_22,2,8,7,1,1,173300,1103500,1109600,1109600,1103500,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
10
_3_22,2,8,7,1,1,173300,1103500,1109600,1109600,1103500,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
9
_3_23,1,8,7,1,1,173300,1119409,1125509,1125509,1119409,77000,417100,358300,101000,87000,,,,,,,
1#AC1_
10
_3_23,1,8,7,1,1,173300,1119409,1125509,1125509,1119409,77000,417100,358300,101000,87000,,,,,,,
source/DeviceLibrary/store/Camera.cs
0 → 100644
查看文件 @
13d512f
using
Asa.Camera
;
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore
{
public
class
HIKCamera
{
Thread
camerathread
;
Asa
.
Camera
.
VisionLib
camera
;
public
string
Name
=
""
;
public
event
EventHandler
<
Bitmap
>
camera_event
;
public
string
DeviceName
=
"monitor1"
;
public
void
LoadCameraConfig
()
{
string
path
=
@".\StoreConfig\Camera.json"
;
if
(!
File
.
Exists
(
path
))
{
LogUtil
.
error
(
Name
+
"找不到监控相机配置文件"
+
path
);
return
;
}
try
{
var
configtxt
=
File
.
ReadAllText
(
path
);
if
(
configtxt
.
IndexOf
(
"Pwd"
)
>
0
)
{
configtxt
=
configtxt
.
Replace
(
"Pwd"
,
"Password"
);
configtxt
=
configtxt
.
Replace
(
"\"8000\""
,
"8000"
);
File
.
WriteAllText
(
path
,
configtxt
);
}
var
m
=
Regex
.
Match
(
configtxt
,
"name\".*?\"(.+)\""
,
RegexOptions
.
IgnoreCase
);
DeviceName
=
m
.
Groups
[
1
].
Value
;
camera
=
new
VisionLib
(
path
,
"HIK.IPCamera"
);
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
Name
+
"加载监控相机配置文件失败:"
+
e
.
ToString
());
return
;
}
camera
.
Open
(
DeviceName
);
Bitmap
bmp
=
camera
.
GetImage
(
DeviceName
);
if
(
bmp
==
null
)
{
LogUtil
.
error
(
Name
+
$
"监控相机打开失败"
);
}
camerathread
=
new
Thread
(
new
ThreadStart
(
startCamera
));
camerathread
.
Start
();
GC
.
KeepAlive
(
camerathread
);
}
int
errortimes
=
0
;
void
startCamera
()
{
while
(
true
)
{
try
{
Bitmap
bmp
=
camera
.
GetImage
(
DeviceName
);
if
(
bmp
!=
null
)
{
errortimes
=
0
;
camera_event
?.
Invoke
(
this
,
bmp
);
}
else
if
(
bmp
==
null
&&
errortimes
<
5
)
{
errortimes
++;
LogUtil
.
error
(
Name
+
$
"相机获取图像出错,{errortimes}"
);
}
else
if
(
errortimes
==
5
)
{
camera
.
Open
();
errortimes
++;
LogUtil
.
error
(
Name
+
$
"相机错误次数过多,重新打开,{errortimes}"
);
}
else
if
(
errortimes
==
6
)
{
LogUtil
.
error
(
Name
+
$
"相机连接失败, 相机线程退出,{errortimes}"
);
break
;
}
Thread
.
Sleep
(
1000
/
7
);
}
catch
{
errortimes
++;
}
}
camera
.
Close
();
camera
.
Dispose
();
}
void
CameraGrabOne
(
string
filename
)
{
try
{
LogUtil
.
info
(
Name
+
"库位文件名:"
+
filename
);
Bitmap
bmp
=
camera
.
GetImage
(
DeviceName
);
if
(
bmp
!=
null
)
{
if
(
File
.
Exists
(
filename
))
File
.
Delete
(
filename
);
bmp
.
Save
(
filename
,
ImageFormat
.
Jpeg
);
bmp
.
Dispose
();
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
Name
+
e
.
ToString
());
}
}
string
GetFixtureStateFilename
(
InOutStoreParam
inOutParam
,
StoreMoveType
storeMoveType
,
FixtureState
fixtureState
)
{
string
dir
=
$
"\\image\\Fixture\\{storeMoveType}\\{inOutParam.PositionNum}\\"
;
Directory
.
CreateDirectory
(
dir
);
string
filename
=
$
"{inOutParam.WareNumber}@@{fixtureState}.jpg"
;
foreach
(
var
x
in
Path
.
GetInvalidFileNameChars
())
{
filename
=
filename
.
Replace
(
x
.
ToString
(),
""
);
}
return
dir
+
filename
;
}
enum
FixtureState
{
In
,
Up
,
Down
,
Out
}
}
}
source/LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
13d512f
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName>
<AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</PropertyGroup>
</PropertyGroup>
...
@@ -33,9 +33,9 @@
...
@@ -33,9 +33,9 @@
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="log4net, Version=
1.2.15
.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=
2.0.8
.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\
dll
\log4net.dll</HintPath>
<HintPath>..\..\
..\增广夹爪\Rmaxis\bin\Debug
\log4net.dll</HintPath>
</Reference>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Core" />
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论