Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6d2f5ddc
由
LN
编写于
2019-08-29 09:22:52 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
二维码更新
1 个父辈
8eb82344
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
84 行增加
和
27 行删除
dll/CodeLibrary.dll
source/ACSingleStore/FrmAxisDebug.cs
source/ACSingleStore/FrmIOStatus.Designer.cs
source/Common/Setting_Init.cs
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
source/LoadCVSLibrary/storeConfig/config/AUTO_SA_Config.cs
dll/CodeLibrary.dll
查看文件 @
6d2f5dd
此文件类型无法预览
source/ACSingleStore/FrmAxisDebug.cs
查看文件 @
6d2f5dd
...
...
@@ -25,7 +25,7 @@ namespace OnlineStore.AutoInOutStore
private
ConfigMoveAxis
inout
=
null
;
private
ConfigMoveAxis
auto
=
null
;
private
ConfigMoveAxis
comp
=
null
;
private
int
compress_Slv
=
0
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
FrmAxisDebug
(
AC_SA_BoxBean
boxBean
)
...
...
@@ -52,7 +52,7 @@ namespace OnlineStore.AutoInOutStore
txtInOutSpeed
.
Text
=
(
inout
.
TargetSpeed
/
5
).
ToString
();
txtUpDownSpeed
.
Text
=
(
updown
.
TargetSpeed
/
5
).
ToString
();
txtAutoSpeed
.
Text
=
(
auto
.
TargetSpeed
/
5
).
ToString
();
txtComSpeed
.
Text
=
(
comp
.
TargetSpeed
/
2
).
ToString
();
txtComSpeed
.
Text
=
(
comp
.
TargetSpeed
/
5
).
ToString
();
//timer1.Start();
UpdateMiddlePosition
();
UpdateInOutPosition
();
...
...
@@ -469,6 +469,7 @@ namespace OnlineStore.AutoInOutStore
UpdateInOutPosition
();
UpdateUpdownPosition
();
UpdateAutoPosition
();
UpdateCompPosition
();
// txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString();
}
}
...
...
source/ACSingleStore/FrmIOStatus.Designer.cs
查看文件 @
6d2f5dd
...
...
@@ -493,7 +493,7 @@
// button1
//
this
.
button1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
76
5
,
672
);
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
76
1
,
672
);
this
.
button1
.
Name
=
"button1"
;
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
115
,
34
);
this
.
button1
.
TabIndex
=
254
;
...
...
@@ -508,7 +508,7 @@
this
.
chbAutoRead
.
Checked
=
true
;
this
.
chbAutoRead
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
chbAutoRead
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbAutoRead
.
Location
=
new
System
.
Drawing
.
Point
(
6
41
,
677
);
this
.
chbAutoRead
.
Location
=
new
System
.
Drawing
.
Point
(
6
37
,
677
);
this
.
chbAutoRead
.
Name
=
"chbAutoRead"
;
this
.
chbAutoRead
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
21
);
this
.
chbAutoRead
.
TabIndex
=
244
;
...
...
@@ -573,7 +573,7 @@
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
9
71
,
721
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
9
67
,
721
);
this
.
Controls
.
Add
(
this
.
button1
);
this
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
Controls
.
Add
(
this
.
groupBox4
);
...
...
source/Common/Setting_Init.cs
查看文件 @
6d2f5dd
...
...
@@ -93,5 +93,7 @@ namespace OnlineStore.Common
/// 单盘入库默认PosID
/// </summary>
public
static
string
SinglePosId
=
"SinglePosId"
;
public
static
string
DeCodeType
=
"DeCodeType"
;
}
}
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
6d2f5dd
using
CodeLibrary
;
using
HalconDotNet
;
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -9,11 +8,12 @@ using System.Linq;
using
System.Runtime.ExceptionServices
;
using
System.Text
;
using
System.Windows.Forms
;
using
CodeLibrary
;
namespace
OnlineStore.DeviceLibrary
{
public
class
CodeManager
{
public
static
int
DeCodeType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DeCodeType
);
public
static
List
<
string
>
cameraNameList
=
new
List
<
string
>();
public
static
List
<
string
>
codeTypeList
=
new
List
<
string
>();
...
...
@@ -31,6 +31,7 @@ namespace OnlineStore.DeviceLibrary
{
cameraNameList
=
new
List
<
string
>();
codeTypeList
=
new
List
<
string
>();
HDLogUtil
.
LogName
=
"RollingLogFileAppender"
;
try
{
string
[]
nameArray
=
nameStr
.
Split
(
spiltChar
);
...
...
@@ -46,9 +47,9 @@ namespace OnlineStore.DeviceLibrary
codeTypeList
.
Add
(
str
.
Trim
());
}
LoadCamera
(
false
);
LoadCamera
(
false
);
CodeLibrary
.
HDCodeLearnHelper
.
LoadConfig
(
nameStr
,
codeStr
);
}
catch
(
Exception
ex
)
{
...
...
@@ -75,28 +76,58 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
"加载到Balser相机:"
+
name
);
}
}
public
static
void
CloseCamera
()
{
BaslerCamera
.
Instance
.
Close
();
HIKCamera
.
Instance
.
Close
();
}
public
static
Bitmap
GetCamerImage
(
string
cameraName
)
{
Bitmap
bitm
=
null
;
try
{
if
(
balserNameList
.
Contains
(
cameraName
))
{
BaslerCamera
.
Instance
.
Open
(
cameraName
);
bool
result
=
BaslerCamera
.
Instance
.
IsOpen
;
if
(!
result
)
{
result
=
BaslerCamera
.
Instance
.
Open
(
cameraName
);
LogUtil
.
info
(
"打开相机:"
+
cameraName
+
"("
+
result
+
")"
);
}
if
(
result
)
{
BaslerCamera
.
Instance
.
GrabOne
();
bitm
=
BaslerCamera
.
Instance
.
Image
;
BaslerCamera
.
Instance
.
Close
();
//BaslerCamera.Instance.Close();
}
else
{
LogUtil
.
error
(
"相机【"
+
cameraName
+
"】打开失败:"
+
BaslerCamera
.
Instance
.
ErrInfo
);
}
}
else
if
(
hikNameList
.
Contains
(
cameraName
))
{
HIKCamera
.
Instance
.
Open
(
cameraName
);
bool
result
=
HIKCamera
.
Instance
.
IsOpen
;
if
(!
result
)
{
result
=
HIKCamera
.
Instance
.
Open
(
cameraName
);
LogUtil
.
info
(
"打开相机:"
+
cameraName
+
"("
+
result
+
")"
);
}
if
(
result
)
{
HIKCamera
.
Instance
.
GrabOne
();
bitm
=
HIKCamera
.
Instance
.
Image
;
HIKCamera
.
Instance
.
Close
();
//HIKCamera.Instance.Close();
}
else
{
LogUtil
.
error
(
"相机【"
+
cameraName
+
"】打开失败:"
+
HIKCamera
.
Instance
.
ErrInfo
);
}
}
else
{
LogUtil
.
info
(
"未找到摄像
机【"
+
cameraName
+
"】无法获取图片"
);
LogUtil
.
info
(
"未找到相
机【"
+
cameraName
+
"】无法获取图片"
);
//若未加载到相机,需要重新加载相机
if
(
balserNameList
.
Count
<=
0
&&
hikNameList
.
Count
<=
0
)
{
...
...
@@ -104,13 +135,19 @@ namespace OnlineStore.DeviceLibrary
LoadCamera
(
true
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"从相机【"
+
cameraName
+
"】获取图片出错:"
+
ex
.
ToString
());
}
return
bitm
;
}
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
()
{
List
<
string
>
codeList
=
new
List
<
string
>();
List
<
CodeInfo
>
allCodeList
=
new
List
<
CodeInfo
>();
//
List<CodeInfo> allCodeList = new List<CodeInfo>();
try
{
...
...
@@ -120,13 +157,16 @@ namespace OnlineStore.DeviceLibrary
{
if
(
bitmap
==
null
)
{
LogUtil
.
info
(
" 摄像机【"
+
cameraName
+
"】获取图片失败"
);
LogUtil
.
error
(
" 摄像机【"
+
cameraName
+
"】获取图片失败,关闭相机"
);
CloseCamera
();
continue
;
}
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】获取图片完成"
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
if
(
DeCodeType
.
Equals
(
0
))
{
HalconDotNet
.
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
foreach
(
string
codeType
in
codeTypeList
)
...
...
@@ -140,8 +180,22 @@ namespace OnlineStore.DeviceLibrary
{
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
1
,
GetCodeParamFilePath
(
codeType
),
codeType
);
}
//LogUtil.info(" 摄像机【" + cameraName + "】【"+ codeType + "】扫码完成");
allCodeList
.
AddRange
(
cc
);
if
(
cc
.
Count
>
0
)
{
string
r
=
""
;
foreach
(
CodeInfo
c
in
cc
)
{
codeList
.
Add
(
c
.
CodeStr
);
r
=
r
+
"##"
+
c
.
CodeStr
;
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】【"
+
codeType
+
"】扫码完成:"
+
r
);
}
}
}
else
{
List
<
string
>
result
=
CodeLibrary
.
ZXingCodeHelper
.
DecodeQRCodes
(
bitmap
);
return
result
;
}
}
}
...
...
@@ -155,10 +209,6 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
"扫码出错:"
+
ex
.
ToString
());
}
foreach
(
CodeInfo
info
in
allCodeList
)
{
codeList
.
Add
(
info
.
CodeStr
);
}
return
codeList
;
}
...
...
@@ -177,6 +227,5 @@ namespace OnlineStore.DeviceLibrary
return
""
;
}
}
}
}
source/LoadCVSLibrary/storeConfig/config/AUTO_SA_Config.cs
查看文件 @
6d2f5dd
...
...
@@ -1058,6 +1058,11 @@ namespace OnlineStore.LoadCSVLibrary
Config
.
InOut_Axis
.
DefaultPosition
=
Config
.
InOutAxis_P1_Position
;
Config
.
UpDown_Axis
.
DefaultPosition
=
Config
.
UpDownAxis_Door_P7
;
Config
.
Comp_Axis
.
DefaultPosition
=
Config
.
CompressAxis_P1_Position
;
Config
.
Comp_Axis
.
CanErrorCountMax
=
1000
;
Config
.
Comp_Axis
.
CanErrorCountMin
=
10
;
Config
.
Comp_Axis
.
PositionMin
=
0
;
Config
.
Comp_Axis
.
PositionMax
=
0
;
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论