Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO853-AutoCountMachine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0aebf51b
由
刘韬
编写于
2021-07-12 14:37:13 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
OCR贴标稳定版
1 个父辈
4a15362d
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
378 行增加
和
90 行删除
DeviceLibrary/AutoScan/LabelMachine.claclabel.cs
DeviceLibrary/AutoScan/LabelMachine.partial.cs
DeviceLibrary/AutoScan/LabelMachine.print.cs
DeviceLibrary/AutoScan/MachineBase.cs
DeviceLibrary/AutoScan/MoveStep.cs
DeviceLibrary/AutoScan/RobotManage.cs
DeviceLibrary/AutoScan/T1Machine.Ledprocess.cs
DeviceLibrary/AutoScan/T1Machine.partial.cs
DeviceLibrary/AutoScan/XRayMachine.Feeding.cs
DeviceLibrary/AutoScan/XRayMachine.Ledprocess.cs
DeviceLibrary/AutoScan/XRayMachine.cs
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/DeviceLibrary/AlarmBuzzer.cs
DeviceLibrary/DeviceLibrary/IOMonitor.cs
SO853-AutoCountMachine/Form1.Designer.cs
SO853-AutoCountMachine/Form1.cs
SO853-AutoCountMachine/Program.cs
SO853-AutoCountMachine/T1Control.Designer.cs
SO853-AutoCountMachine/T1Control.cs
DeviceLibrary/AutoScan/LabelMachine.claclabel.cs
查看文件 @
0aebf51
...
@@ -93,10 +93,10 @@ namespace DeviceLibrary
...
@@ -93,10 +93,10 @@ namespace DeviceLibrary
MoveInfo
.
log
(
$
"计算结果,图像像素中心{Center_Pix_Point},二维码像素坐标{Label_Pix_Point},角度{angle},贴标角度{labelCenterAngle},贴标像素点位为{AxisPixPoint},轴点位为{p1},R轴{labelAxisPos},盘宽{MoveInfo.ReelParam.PlateW}"
);
MoveInfo
.
log
(
$
"计算结果,图像像素中心{Center_Pix_Point},二维码像素坐标{Label_Pix_Point},角度{angle},贴标角度{labelCenterAngle},贴标像素点位为{AxisPixPoint},轴点位为{p1},R轴{labelAxisPos},盘宽{MoveInfo.ReelParam.PlateW}"
);
if
(
saveLabelDebugBmp
)
if
(
saveLabelDebugBmp
)
{
{
IOMove
(
IO_Label_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
//
IOMove(IO_Label_Type.Camera_Led, IO_VALUE.HIGH);
Task
.
Delay
(
10
).
Wait
();
//
Task.Delay(10).Wait();
Bitmap
bitmap
=
Camera
.
_cam
.
GrabOneImage
(
Config
.
CameraName
);
Bitmap
bitmap
=
Camera
.
_cam
.
GrabOneImage
(
Config
.
CameraName
);
IOMove
(
IO_Label_Type
.
Camera_Led
,
IO_VALUE
.
LOW
);
//
IOMove(IO_Label_Type.Camera_Led, IO_VALUE.LOW);
bitmap
.
RotateFlip
(
RotateFlipType
.
Rotate180FlipNone
);
bitmap
.
RotateFlip
(
RotateFlipType
.
Rotate180FlipNone
);
//Bitmap bitmap = new Bitmap("d:\\出料模块-20210424-043753-0162.bmp");
//Bitmap bitmap = new Bitmap("d:\\出料模块-20210424-043753-0162.bmp");
printLabelDebugBitmap
(
bitmap
,
Label_Pix_Point
,
Center_Pix_Point
,
AxisPixPoint
,
angle
,
p1
,
labelCenterAngle
,
labelAxisPos
,
labelCenter
);
printLabelDebugBitmap
(
bitmap
,
Label_Pix_Point
,
Center_Pix_Point
,
AxisPixPoint
,
angle
,
p1
,
labelCenterAngle
,
labelAxisPos
,
labelCenter
);
...
...
DeviceLibrary/AutoScan/LabelMachine.partial.cs
查看文件 @
0aebf51
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Drawing
;
using
System.Drawing
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
...
@@ -34,6 +35,18 @@ namespace DeviceLibrary
...
@@ -34,6 +35,18 @@ namespace DeviceLibrary
//对射检测
//对射检测
//get=> IOValue(IO_Label_Type.Line_HasTray_Check);
//get=> IOValue(IO_Label_Type.Line_HasTray_Check);
}
}
/// <summary>
/// 0=扫码失败,1=打印与实际二维码不一致
/// </summary>
[
Flags
]
enum
WaitCheckLabeltypeE
{
None
=
0
,
Scan_QRCode_Fail
=
1
,
Scan_Code_And_Print_are_different
=
2
,
Failed_to_extract_label
=
4
,
};
WaitCheckLabeltypeE
WaitCheckLabeltype
;
Task
printTask
=
null
;
Task
printTask
=
null
;
int
reelcount
=
0
;
int
reelcount
=
0
;
void
WorkProcess
()
void
WorkProcess
()
...
@@ -168,8 +181,10 @@ namespace DeviceLibrary
...
@@ -168,8 +181,10 @@ namespace DeviceLibrary
CylinderMove
(
MoveInfo
,
IO_Label_Type
.
Label_Stop_Down
,
IO_Label_Type
.
Label_Stop_Up
,
IO_VALUE
.
HIGH
);
CylinderMove
(
MoveInfo
,
IO_Label_Type
.
Label_Stop_Down
,
IO_Label_Type
.
Label_Stop_Up
,
IO_VALUE
.
HIGH
);
break
;
break
;
case
MoveStep
.
Lbl_05_ScanCode
:
case
MoveStep
.
Lbl_05_ScanCode
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_06_Get_Reelinfo
);
//MoveInfo.NextMoveStep(MoveStep.Lbl_06_Get_Reelinfo);
ScanTask
=
ScanCode
();
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_Printted
);
WaitCheckLabeltype
=
WaitCheckLabeltypeE
.
None
;
ScanTask2
=
ScanCode2
();
break
;
break
;
case
MoveStep
.
Lbl_06_Get_Reelinfo
:
case
MoveStep
.
Lbl_06_Get_Reelinfo
:
if
(
ScanTask
.
IsCompleted
)
if
(
ScanTask
.
IsCompleted
)
...
@@ -248,10 +263,39 @@ namespace DeviceLibrary
...
@@ -248,10 +263,39 @@ namespace DeviceLibrary
MoveInfo
.
log
(
"等待."
);
MoveInfo
.
log
(
"等待."
);
break
;
break
;
case
MoveStep
.
Lbl03
:
case
MoveStep
.
Lbl03
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
10
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
04
);
Label_Z_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Label_Z_P2
,
Config
.
Label_Z_P2_speed
);
Label_Z_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Label_Z_P2
,
Config
.
Label_Z_P2_speed
);
MoveInfo
.
log
(
"标签打印完毕,取标气缸上升,取起标签."
);
MoveInfo
.
log
(
"标签打印完毕,取标气缸上升,取起标签."
);
break
;
break
;
case
MoveStep
.
Lbl04
:
Thread
.
Sleep
(
500
);
if
(
IOValue
(
IO_Label_Type
.
Label_Cylinder_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitCheckLabel
);
MoveInfo
.
log
(
"吸标失败."
);
WaitCheckLabeltype
=
WaitCheckLabeltypeE
.
Failed_to_extract_label
;
}
else
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl05
);
break
;
case
MoveStep
.
Lbl05
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl06
);
Label_X_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Label_X_Base
,
Config
.
Label_X_Base_speed
);
Label_Y_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Label_Y_Base
,
Config
.
Label_X_Base_speed
);
Label_Z_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Label_Z_P4
,
Config
.
Label_Z_P4_speed
);
MoveInfo
.
log
(
"Label_XYZ转到贴标准备点."
);
break
;
case
MoveStep
.
Lbl06
:
if
(
ScanTask2
.
IsCompleted
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl10
);
}
else
if
(
MoveInfo
.
IsTimeOut
(
10
))
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_04_LineStop
);
MoveInfo
.
log
(
$
"等待扫码超时,重新扫码"
);
}
break
;
case
MoveStep
.
Lbl10
:
case
MoveStep
.
Lbl10
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl11_wait
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl11_wait
);
Label_X_Axis
.
AbsMove
(
MoveInfo
,
p1
.
X
,
Config
.
Label_X_Base_speed
);
Label_X_Axis
.
AbsMove
(
MoveInfo
,
p1
.
X
,
Config
.
Label_X_Base_speed
);
...
@@ -285,9 +329,16 @@ namespace DeviceLibrary
...
@@ -285,9 +329,16 @@ namespace DeviceLibrary
MoveInfo
.
log
(
"取标气缸上升."
);
MoveInfo
.
log
(
"取标气缸上升."
);
break
;
break
;
case
MoveStep
.
Lbl_WaitCheckLabel
:
case
MoveStep
.
Lbl_WaitCheckLabel
:
if
((
WaitCheckLabeltype
&
WaitCheckLabeltypeE
.
Scan_QRCode_Fail
)==
WaitCheckLabeltypeE
.
Scan_QRCode_Fail
)
Msg
.
add
(
"未识别到有效二维码"
,
MsgLevel
.
warning
);
Msg
.
add
(
"未识别到有效二维码"
,
MsgLevel
.
warning
);
if
((
WaitCheckLabeltype
&
WaitCheckLabeltypeE
.
Scan_Code_And_Print_are_different
)
==
WaitCheckLabeltypeE
.
Scan_Code_And_Print_are_different
)
Msg
.
add
(
"扫描到的Reelid与发出打印的可能不一致"
,
MsgLevel
.
warning
);
if
((
WaitCheckLabeltype
&
WaitCheckLabeltypeE
.
Failed_to_extract_label
)
==
WaitCheckLabeltypeE
.
Failed_to_extract_label
)
Msg
.
add
(
"标签吸取失败"
,
MsgLevel
.
warning
);
if
(
IOValue
(
IO_Label_Type
.
Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
IOValue
(
IO_Label_Type
.
Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_BeginOut
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_BeginOut
);
IOMove
(
IO_Label_Type
.
LabelCylinder_Work
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Label_Type
.
Line2_Run
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Label_Type
.
Line2_Run
,
IO_VALUE
.
HIGH
);
MoveInfo
.
log
(
"人工完成贴标."
);
MoveInfo
.
log
(
"人工完成贴标."
);
}
}
...
...
DeviceLibrary/AutoScan/LabelMachine.print.cs
查看文件 @
0aebf51
...
@@ -81,6 +81,7 @@ namespace DeviceLibrary
...
@@ -81,6 +81,7 @@ namespace DeviceLibrary
/// 扫码线程
/// 扫码线程
/// </summary>
/// </summary>
Task
<(
List
<
CodeInfo
>,
Bitmap
)>
ScanTask
;
Task
<(
List
<
CodeInfo
>,
Bitmap
)>
ScanTask
;
Task
<(
Point
,
double
,
bool
)>
ScanTask2
;
Task
<(
List
<
CodeInfo
>,
Bitmap
)>
ScanCode
()
Task
<(
List
<
CodeInfo
>,
Bitmap
)>
ScanCode
()
{
{
MoveInfo
.
log
(
"开始贴标扫码线程"
);
MoveInfo
.
log
(
"开始贴标扫码线程"
);
...
@@ -106,7 +107,72 @@ namespace DeviceLibrary
...
@@ -106,7 +107,72 @@ namespace DeviceLibrary
return
(
new
List
<
CodeInfo
>(),
null
);
return
(
new
List
<
CodeInfo
>(),
null
);
}
}
}));
}));
}
Task
<(
Point
,
double
,
bool
)>
ScanCode2
()
{
MoveInfo
.
log
(
"开始贴标扫码线程"
);
return
Task
.
Run
(
new
Func
<(
Point
,
double
,
bool
)>(()
=>
{
try
{
Bitmap
bitmap
;
List
<
CodeInfo
>
LastCodeList
=
CodeManager
.
CameraScan
(
new
List
<
string
>
{
Config
.
CameraName
},
out
bitmap
);
if
(
LastCodeList
.
Count
<=
0
)
{
Task
.
Delay
(
500
).
Wait
();
LastCodeList
=
CodeManager
.
CameraScan
(
new
List
<
string
>
{
Config
.
CameraName
});
}
if
(
LastCodeList
.
Count
==
0
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitCheckLabel
);
MoveInfo
.
log
(
$
"未识别到有效二维码"
);
WaitCheckLabeltype
=
WaitCheckLabeltypeE
.
Scan_QRCode_Fail
;
}
else
{
if
(
MoveInfo
.
ReelParam
.
WareCode
!=
LastCodeList
[
0
].
CodeStr
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitCheckLabel
);
Msg
.
add
(
$
"扫描到的Reelid与发出打印的不一致,系统:{MoveInfo.ReelParam.WareCode},实际:{LastCodeList[0].CodeStr}"
,
MsgLevel
.
warning
);
MoveInfo
.
log
(
$
"扫描到的Reelid与发出打印的不一致,系统:{MoveInfo.ReelParam.WareCode},实际:{LastCodeList[0].CodeStr}"
);
WaitCheckLabeltype
=
WaitCheckLabeltypeE
.
Scan_Code_And_Print_are_different
;
//MoveInfo.ReelParam.IsNg = true;
//MoveInfo.ReelParam.NgMsg = "扫描到的Reelid与发出打印的不一致";
//MoveInfo.ReelParam.logresult();
}
else
{
//MoveInfo.NextMoveStep(MoveStep.Lbl_Printted);
MoveInfo
.
ReelParam
.
codeInfos
=
LastCodeList
;
MoveInfo
.
log
(
$
"已完成扫码, Count={LastCodeList.Count}"
);
MoveInfo
.
ReelParam
.
logresult
();
}
MoveInfo
.
ReelParam
.
logresult
();
//标签坐标
Point
Label_Pix_Point
=
new
Point
(
MoveInfo
.
ReelParam
.
codeInfos
[
0
].
X
,
MoveInfo
.
ReelParam
.
codeInfos
[
0
].
Y
);
//照片坐标反转180度
var
x
=
5472
-
Label_Pix_Point
.
X
;
var
y
=
3648
-
Label_Pix_Point
.
Y
;
Label_Pix_Point
.
X
=
x
;
Label_Pix_Point
.
Y
=
y
;
//图像也旋转180度
bitmap
.
RotateFlip
(
RotateFlipType
.
Rotate180FlipNone
);
(
p1
,
labelRAxisPos
,
ReverseLabel
)
=
ClacLabel2
(
Label_Pix_Point
,
bitmap
,
MoveInfo
.
ReelParam
);
return
(
p1
,
labelRAxisPos
,
ReverseLabel
);
}
return
(
Point
.
Empty
,
0
,
false
);
}
catch
{
return
(
Point
.
Empty
,
0
,
false
);
}
}));
}
}
}
}
}
}
DeviceLibrary/AutoScan/MachineBase.cs
查看文件 @
0aebf51
...
@@ -79,7 +79,7 @@ namespace DeviceLibrary
...
@@ -79,7 +79,7 @@ namespace DeviceLibrary
/// <summary>
/// <summary>
/// 是否再报警中
/// 是否再报警中
/// </summary>
/// </summary>
p
rotected
AlarmType
alarmType
=
AlarmType
.
None
;
p
ublic
AlarmType
alarmType
=
AlarmType
.
None
;
protected
DateTime
LastAlarmTime
=
DateTime
.
Now
;
protected
DateTime
LastAlarmTime
=
DateTime
.
Now
;
protected
DateTime
checkAlarmTime
=
DateTime
.
Now
;
protected
DateTime
checkAlarmTime
=
DateTime
.
Now
;
protected
void
Alarm
(
AlarmType
alarmType
,
string
alarmMsg
=
""
)
protected
void
Alarm
(
AlarmType
alarmType
,
string
alarmMsg
=
""
)
...
...
DeviceLibrary/AutoScan/MoveStep.cs
查看文件 @
0aebf51
...
@@ -45,6 +45,7 @@ namespace DeviceLibrary
...
@@ -45,6 +45,7 @@ namespace DeviceLibrary
Lbl03
,
Lbl03
,
Lbl04
,
Lbl04
,
Lbl05
,
Lbl05
,
Lbl06
,
Lbl10
,
Lbl10
,
Lbl11_wait
,
Lbl11_wait
,
Lbl11
,
Lbl11
,
...
...
DeviceLibrary/AutoScan/RobotManage.cs
查看文件 @
0aebf51
...
@@ -75,7 +75,7 @@ namespace DeviceLibrary
...
@@ -75,7 +75,7 @@ namespace DeviceLibrary
Thread
.
Sleep
(
500
);
Thread
.
Sleep
(
500
);
if
(
XRay
.
SetVC
(
ConfigHelper
.
Config
.
Get
(
"XRay_Voltage"
),
ConfigHelper
.
Config
.
Get
(
"XRay_Current"
)))
if
(
!
XRay
.
SetVC
(
ConfigHelper
.
Config
.
Get
(
"XRay_Voltage"
),
ConfigHelper
.
Config
.
Get
(
"XRay_Current"
)))
{
{
msgs
+=
$
"X光电压电流设置失败:{ConfigHelper.Config.Get("
XRay_Voltage
")},{ConfigHelper.Config.Get("
XRay_Current
")}\n"
;
msgs
+=
$
"X光电压电流设置失败:{ConfigHelper.Config.Get("
XRay_Voltage
")},{ConfigHelper.Config.Get("
XRay_Current
")}\n"
;
IsLoadOk
=
false
;
IsLoadOk
=
false
;
...
...
DeviceLibrary/AutoScan/T1Machine.Ledprocess.cs
查看文件 @
0aebf51
...
@@ -46,7 +46,7 @@ namespace DeviceLibrary
...
@@ -46,7 +46,7 @@ namespace DeviceLibrary
RunningLed
.
LedState
=
LedState
.
blink
;
RunningLed
.
LedState
=
LedState
.
blink
;
}
}
if
(
alarmType
!=
AlarmType
.
None
)
if
(
alarmType
!=
AlarmType
.
None
||
RobotManage
.
filterMachine
.
alarmType
!=
AlarmType
.
None
)
{
{
AlarmLed
.
LedState
=
LedState
.
on
;
AlarmLed
.
LedState
=
LedState
.
on
;
}
}
...
...
DeviceLibrary/AutoScan/T1Machine.partial.cs
查看文件 @
0aebf51
...
@@ -231,7 +231,11 @@ namespace DeviceLibrary
...
@@ -231,7 +231,11 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
Shelf_17_EmptyIn_CheckLocation
:
case
MoveStep
.
Shelf_17_EmptyIn_CheckLocation
:
ShelfOutMoveInfo
.
log
(
"计算料串中心位置"
);
ShelfOutMoveInfo
.
log
(
"计算料串中心位置"
);
var
(
Bitmap
,
distance
,
debugstring
)
=
GetStringCenter
(
true
);
bool
isFirst
=
true
;
if
(
Math
.
Abs
(
Config
.
BatchAxis_P2
-
T_Batch_Axis
.
GetAclPosition
())
>
Config
.
BatchAxis_ChangeValue
*
4
)
isFirst
=
false
;
var
(
Bitmap
,
distance
,
debugstring
)
=
GetStringCenter
(
isFirst
);
Lastdistance
=
distance
;
Lastdistance
=
distance
;
TrayStringLocation
?.
Invoke
(
this
,
Bitmap
);
TrayStringLocation
?.
Invoke
(
this
,
Bitmap
);
if
(
Lastdistance
>
Config
.
String_Offset_Range_Px
)
if
(
Lastdistance
>
Config
.
String_Offset_Range_Px
)
...
@@ -440,10 +444,10 @@ namespace DeviceLibrary
...
@@ -440,10 +444,10 @@ namespace DeviceLibrary
//创建扫描区域
//创建扫描区域
EyemRect
eyemRect
=
new
EyemRect
();
EyemRect
eyemRect
=
new
EyemRect
();
eyemRect
.
iXs
=
Config
.
String_Center_X
-
200
;
eyemRect
.
iXs
=
Config
.
String_Center_X
-
175
;
eyemRect
.
iYs
=
Config
.
String_Center_Y
-
200
;
eyemRect
.
iYs
=
Config
.
String_Center_Y
-
175
;
eyemRect
.
iWidth
=
400
;
eyemRect
.
iWidth
=
175
*
2
;
eyemRect
.
iHeight
=
400
;
eyemRect
.
iHeight
=
175
*
2
;
eyemlib
.
EyemOcsFXYR
eyemOcsFXYR
=
new
eyemlib
.
EyemOcsFXYR
();
eyemlib
.
EyemOcsFXYR
eyemOcsFXYR
=
new
eyemlib
.
EyemOcsFXYR
();
...
@@ -462,10 +466,11 @@ namespace DeviceLibrary
...
@@ -462,10 +466,11 @@ namespace DeviceLibrary
graphics
.
DrawImage
(
bmap
,
new
PointF
(
0
,
0
));
graphics
.
DrawImage
(
bmap
,
new
PointF
(
0
,
0
));
graphics
.
SmoothingMode
=
System
.
Drawing
.
Drawing2D
.
SmoothingMode
.
AntiAlias
;
graphics
.
SmoothingMode
=
System
.
Drawing
.
Drawing2D
.
SmoothingMode
.
AntiAlias
;
Pen
greenpen
=
new
Pen
(
Color
.
Green
,
15
);
Pen
greenpen
=
new
Pen
(
Color
.
Green
,
15
);
Pen
redpen
=
new
Pen
(
Color
.
FromArgb
(
255
,
Color
.
Red
),
10
);
int
r
=
102
;
int
r
=
102
;
graphics
.
DrawEllipse
(
greenpen
,
Config
.
String_Center_X
-
r
,
Config
.
String_Center_Y
-
r
,
r
*
2
,
r
*
2
);
graphics
.
DrawEllipse
(
greenpen
,
Config
.
String_Center_X
-
r
,
Config
.
String_Center_Y
-
r
,
r
*
2
,
r
*
2
);
graphics
.
DrawEllipse
(
greenpen
,
Config
.
String_Center_X
-
8
,
Config
.
String_Center_Y
-
8
,
8
*
2
,
8
*
2
);
graphics
.
DrawEllipse
(
greenpen
,
Config
.
String_Center_X
-
8
,
Config
.
String_Center_Y
-
8
,
8
*
2
,
8
*
2
);
Pen
redpen
=
new
Pen
(
Color
.
FromArgb
(
255
,
Color
.
Red
),
10
);
graphics
.
DrawEllipse
(
redpen
,
eyemOcsFXYR
.
fX
-
eyemOcsFXYR
.
fR
,
eyemOcsFXYR
.
fY
-
eyemOcsFXYR
.
fR
,
eyemOcsFXYR
.
fR
*
2
,
eyemOcsFXYR
.
fR
*
2
);
graphics
.
DrawEllipse
(
redpen
,
eyemOcsFXYR
.
fX
-
eyemOcsFXYR
.
fR
,
eyemOcsFXYR
.
fY
-
eyemOcsFXYR
.
fR
,
eyemOcsFXYR
.
fR
*
2
,
eyemOcsFXYR
.
fR
*
2
);
graphics
.
DrawEllipse
(
redpen
,
eyemOcsFXYR
.
fX
-
5
,
eyemOcsFXYR
.
fY
-
5
,
5
*
2
,
5
*
2
);
graphics
.
DrawEllipse
(
redpen
,
eyemOcsFXYR
.
fX
-
5
,
eyemOcsFXYR
.
fY
-
5
,
5
*
2
,
5
*
2
);
...
@@ -492,25 +497,28 @@ namespace DeviceLibrary
...
@@ -492,25 +497,28 @@ namespace DeviceLibrary
//return (null, 0, "调试屏蔽");
//return (null, 0, "调试屏蔽");
var
centerpos
=
new
Point
(
Config
.
String_Center_X
,
Config
.
String_Center_Y
);
var
centerpos
=
new
Point
(
Config
.
String_Center_X
,
Config
.
String_Center_Y
);
Bitmap
bmap
=
Camera
.
_cam
.
GrabOneImage
(
RobotManage
.
t1Machine
.
Config
.
String_Camera
);
Bitmap
bmap
=
Camera
.
_cam
.
GrabOneImage
(
RobotManage
.
t1Machine
.
Config
.
String_Camera
);
Bitmap
newbitmap
=
new
Bitmap
(
640
,
640
);
Rectangle
rectangle
=
new
Rectangle
(
centerpos
.
X
-
640
/
2
,
centerpos
.
Y
-
640
/
2
,
640
,
640
);
Graphics
g
=
Graphics
.
FromImage
(
newbitmap
);
Rectangle
rectangle
=
new
Rectangle
(
centerpos
.
X
-
newbitmap
.
Width
/
2
,
centerpos
.
Y
-
newbitmap
.
Height
/
2
,
newbitmap
.
Width
,
newbitmap
.
Height
);
Bitmap
newbitmap
=
Common
.
ImageCrop
(
bmap
,
rectangle
);
g
.
DrawImage
(
bmap
,
rectangle
);
bmap
.
Dispose
();
g
.
Save
();
g
.
Dispose
();
string
filename
=
"\\image\\TrayString\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd-HH-mm-ss"
)
+
".jpg"
;
string
filename
=
"\\image\\TrayString\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd-HH-mm-ss"
)
+
".jpg"
;
newbitmap
.
Save
(
filename
,
ImageFormat
.
Jpeg
);
newbitmap
.
Save
(
filename
,
ImageFormat
.
Jpeg
);
//newbitmap.Dispose();
bmap
.
Dispose
();
float
fx
=
0
,
fy
=
0
;
float
fx
=
0
,
fy
=
0
;
int
r
=
centerDetector
(
filename
,
ref
fx
,
ref
fy
);
int
r
=
centerDetector
(
filename
,
ref
fx
,
ref
fy
);
LogUtil
.
info
(
$
"centerDetector r:{r},x:{fx},y:{fy}"
);
LogUtil
.
info
(
$
"centerDetector r:{r},x:{fx},y:{fy}"
);
var
debugtxt
=
$
"centerDetector:\nresult:{r}\nfX:{fx}\nfY:{fy}"
;
var
debugtxt
=
$
"centerDetector:\nresult:{r}\nfX:{fx}\nfY:{fy}"
;
var
currpos
=
new
Point
((
int
)
fx
+
rectangle
.
X
,
(
int
)
fy
+
rectangle
.
Y
);
var
currpos
=
new
Point
((
int
)
fx
+
rectangle
.
X
,
(
int
)
fy
+
rectangle
.
Y
);
var
distance
=
(
int
)
Common
.
distance
(
centerpos
,
currpos
);
var
distance
=
(
int
)
Common
.
distance
(
centerpos
,
currpos
);
Pen
greenpen
=
new
Pen
(
Color
.
Green
,
15
);
Pen
redpen
=
new
Pen
(
Color
.
FromArgb
(
255
,
Color
.
Red
),
10
);
Graphics
graphics
=
Graphics
.
FromImage
(
newbitmap
);
graphics
.
DrawEllipse
(
greenpen
,
Config
.
String_Center_X
-
8
,
Config
.
String_Center_Y
-
8
,
8
*
2
,
8
*
2
);
graphics
.
DrawEllipse
(
redpen
,
(
int
)
fx
-
5
,
(
int
)
fy
-
5
,
5
*
2
,
5
*
2
);
graphics
.
Save
();
return
(
newbitmap
,
distance
,
debugtxt
);
return
(
newbitmap
,
distance
,
debugtxt
);
}
}
[
DllImport
(
"yolov5.dll"
,
CharSet
=
CharSet
.
None
)]
[
DllImport
(
"yolov5.dll"
,
CharSet
=
CharSet
.
Ansi
)]
public
static
extern
int
centerDetector
([
MarshalAs
(
UnmanagedType
.
LPStr
)]
string
filename
,
ref
float
x
,
ref
float
y
);
public
static
extern
int
centerDetector
([
MarshalAs
(
UnmanagedType
.
LPStr
)]
string
filename
,
ref
float
x
,
ref
float
y
);
}
}
}
}
DeviceLibrary/AutoScan/XRayMachine.Feeding.cs
查看文件 @
0aebf51
...
@@ -142,10 +142,10 @@ namespace DeviceLibrary
...
@@ -142,10 +142,10 @@ namespace DeviceLibrary
{
{
ScanTask
=
Task
.
Run
(
new
Func
<
List
<
CodeInfo
>>(()
=>
ScanTask
=
Task
.
Run
(
new
Func
<
List
<
CodeInfo
>>(()
=>
{
{
IOMove
(
IO_XRay_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
//
IOMove(IO_XRay_Type.Camera_Led, IO_VALUE.HIGH);
Task
.
Delay
(
10
).
Wait
();
//
Task.Delay(10).Wait();
List
<
CodeInfo
>
LastCodeList
=
CodeManager
.
CameraScan
(
new
List
<
string
>
{
Config
.
CameraName
});
List
<
CodeInfo
>
LastCodeList
=
CodeManager
.
CameraScan
(
new
List
<
string
>
{
Config
.
CameraName
});
IOMove
(
IO_XRay_Type
.
Camera_Led
,
IO_VALUE
.
LOW
);
//
IOMove(IO_XRay_Type.Camera_Led, IO_VALUE.LOW);
return
LastCodeList
;
return
LastCodeList
;
}));
}));
}
}
...
...
DeviceLibrary/AutoScan/XRayMachine.Ledprocess.cs
查看文件 @
0aebf51
...
@@ -72,6 +72,17 @@ namespace DeviceLibrary
...
@@ -72,6 +72,17 @@ namespace DeviceLibrary
AlarmLed
.
LedState
=
LedState
.
on
;
AlarmLed
.
LedState
=
LedState
.
on
;
}
}
if
(
alarmType
!=
AlarmType
.
None
||
RobotManage
.
labelMachine
.
alarmType
!=
AlarmType
.
None
||
RobotManage
.
filterMachine
.
alarmType
!=
AlarmType
.
None
||
RobotManage
.
t1Machine
.
alarmType
!=
AlarmType
.
None
)
{
AlarmBuzzer
.
ON
();
}
else
{
AlarmBuzzer
.
OFF
();
}
Led
.
LedGroup
[
DeviceName
].
ForEach
((
x
)
=>
{
x
.
run
();
});
Led
.
LedGroup
[
DeviceName
].
ForEach
((
x
)
=>
{
x
.
run
();
});
}
}
}
}
...
...
DeviceLibrary/AutoScan/XRayMachine.cs
查看文件 @
0aebf51
...
@@ -53,7 +53,7 @@ namespace DeviceLibrary
...
@@ -53,7 +53,7 @@ namespace DeviceLibrary
LedProcessInit
();
LedProcessInit
();
IOMonitor
.
RegisterIO
(
IO_XRay_Type
.
Exit_Open
,
Config
,
IO_VALUE
.
LOW
,
delegate
()
{
XRayDoorOpen
();
});
IOMonitor
.
RegisterIO
(
IO_XRay_Type
.
Exit_Open
,
Config
,
IO_VALUE
.
LOW
,
delegate
()
{
XRayDoorOpen
();
});
IOMonitor
.
RegisterIO
(
IO_XRay_Type
.
Entry_Open
,
Config
,
IO_VALUE
.
LOW
,
delegate
()
{
XRayDoorOpen
();
});
IOMonitor
.
RegisterIO
(
IO_XRay_Type
.
Entry_Open
,
Config
,
IO_VALUE
.
LOW
,
delegate
()
{
XRayDoorOpen
();
});
AlarmBuzzer
.
SetOnOffAction
(()
=>
{
IOMove
(
IO_XRay_Type
.
Alarm_Buzzer
,
IO_VALUE
.
HIGH
);
},
()
=>
{
IOMove
(
IO_XRay_Type
.
Alarm_Buzzer
,
IO_VALUE
.
LOW
);
});
LogUtil
.
info
(
DeviceName
+
" init end"
);
LogUtil
.
info
(
DeviceName
+
" init end"
);
}
}
catch
(
Exception
e
){
catch
(
Exception
e
){
...
...
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
0aebf51
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
<Compile Include="AutoScan\T1Machine.Ledprocess.cs" />
<Compile Include="AutoScan\T1Machine.Ledprocess.cs" />
<Compile Include="AutoScan\XRayMachine.XRay.cs" />
<Compile Include="AutoScan\XRayMachine.XRay.cs" />
<Compile Include="AutoScan\XRayMachine.Feeding.cs" />
<Compile Include="AutoScan\XRayMachine.Feeding.cs" />
<Compile Include="DeviceLibrary\AlarmBuzzer.cs" />
<Compile Include="DeviceLibrary\CodeManager.cs" />
<Compile Include="DeviceLibrary\CodeManager.cs" />
<Compile Include="AutoScan\RobotManage.cs" />
<Compile Include="AutoScan\RobotManage.cs" />
<Compile Include="AutoScan\common\IRobot.cs" />
<Compile Include="AutoScan\common\IRobot.cs" />
...
...
DeviceLibrary/DeviceLibrary/AlarmBuzzer.cs
0 → 100644
查看文件 @
0aebf51
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
DeviceLibrary
{
public
class
AlarmBuzzer
{
delegate
void
on
();
static
on
ondelegate
;
static
on
offdelegate
;
static
bool
enable
=
false
;
public
static
bool
Enable
{
get
=>
enable
;
set
{
enable
=
value
;
if
(!
value
)
{
OFF
();
}
}
}
static
AlarmBuzzerState
State
=
AlarmBuzzerState
.
OFF
;
public
static
event
EventHandler
<
bool
>
BuzzerStateChange
;
public
static
void
SetOnOffAction
(
Action
ona
,
Action
offa
)
{
ondelegate
=
new
on
(
ona
);
offdelegate
=
new
on
(
offa
);
}
public
static
void
ON
(
bool
force
=
false
)
{
if
(!
Enable
)
return
;
if
(
force
||
(
State
!=
AlarmBuzzerState
.
ON
&&
State
!=
AlarmBuzzerState
.
MuteOnce
))
{
State
=
AlarmBuzzerState
.
ON
;
ondelegate
();
BuzzerStateChange
?.
Invoke
(
null
,
true
);
}
}
public
static
void
OFF
()
{
State
=
AlarmBuzzerState
.
OFF
;
offdelegate
();
BuzzerStateChange
?.
Invoke
(
null
,
false
);
}
public
static
void
MuteOnce
()
{
if
(
State
==
AlarmBuzzerState
.
ON
)
{
State
=
AlarmBuzzerState
.
MuteOnce
;
offdelegate
();
BuzzerStateChange
?.
Invoke
(
null
,
false
);
}
}
}
enum
AlarmBuzzerState
{
ON
,
OFF
,
MuteOnce
}
}
DeviceLibrary/DeviceLibrary/IOMonitor.cs
查看文件 @
0aebf51
...
@@ -37,7 +37,7 @@ namespace DeviceLibrary
...
@@ -37,7 +37,7 @@ namespace DeviceLibrary
continue
;
continue
;
}
}
LogUtil
.
OutputDebugString
(
$
"IOMonitor: {timediff.TotalMilliseconds},{iOMonitorStrut.Interval},last_iO_VALUE:{iOMonitorStrut.last_iO_VALUE},IOVALUE:{current_iovalue},Need:{iOMonitorStrut.iO_VALUE}"
);
//
LogUtil.OutputDebugString($"IOMonitor: {timediff.TotalMilliseconds},{iOMonitorStrut.Interval},last_iO_VALUE:{iOMonitorStrut.last_iO_VALUE},IOVALUE:{current_iovalue},Need:{iOMonitorStrut.iO_VALUE}");
if
(
timediff
.
TotalMilliseconds
>
iOMonitorStrut
.
Interval
&&
iOMonitorStrut
.
last_iO_VALUE
!=
current_iovalue
&&
current_iovalue
==
iOMonitorStrut
.
iO_VALUE
)
if
(
timediff
.
TotalMilliseconds
>
iOMonitorStrut
.
Interval
&&
iOMonitorStrut
.
last_iO_VALUE
!=
current_iovalue
&&
current_iovalue
==
iOMonitorStrut
.
iO_VALUE
)
{
{
...
...
SO853-AutoCountMachine/Form1.Designer.cs
查看文件 @
0aebf51
...
@@ -41,6 +41,7 @@ namespace AutoCountMachine
...
@@ -41,6 +41,7 @@ namespace AutoCountMachine
this
.
退出
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
退出
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
boxResetControl1
=
new
AutoCountMachine
.
BoxResetControl
();
this
.
cmb_runmode
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
cmb_runmode
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
btn_releaseshelf
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_releaseshelf
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
...
@@ -50,12 +51,15 @@ namespace AutoCountMachine
...
@@ -50,12 +51,15 @@ namespace AutoCountMachine
this
.
btn_stop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_stop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_run
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_run
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
boxResetControl1
=
new
AutoCountMachine
.
BoxResetControl
();
this
.
btn_PauseBuzzer
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tabPage2
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
cb_EnableBuzzer
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// menuStrip1
// menuStrip1
...
@@ -134,6 +138,7 @@ namespace AutoCountMachine
...
@@ -134,6 +138,7 @@ namespace AutoCountMachine
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage1
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage1
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage2
);
this
.
tabControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
tabControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
90
);
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
90
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
Name
=
"tabControl1"
;
...
@@ -143,6 +148,7 @@ namespace AutoCountMachine
...
@@ -143,6 +148,7 @@ namespace AutoCountMachine
//
//
// tabPage1
// tabPage1
//
//
this
.
tabPage1
.
Controls
.
Add
(
this
.
btn_PauseBuzzer
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
boxResetControl1
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
boxResetControl1
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
cmb_runmode
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
cmb_runmode
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
btn_releaseshelf
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
btn_releaseshelf
);
...
@@ -155,6 +161,15 @@ namespace AutoCountMachine
...
@@ -155,6 +161,15 @@ namespace AutoCountMachine
this
.
tabPage1
.
Text
=
"信息"
;
this
.
tabPage1
.
Text
=
"信息"
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
//
//
// boxResetControl1
//
this
.
boxResetControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
boxResetControl1
.
Location
=
new
System
.
Drawing
.
Point
(
731
,
202
);
this
.
boxResetControl1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
5
);
this
.
boxResetControl1
.
Name
=
"boxResetControl1"
;
this
.
boxResetControl1
.
Size
=
new
System
.
Drawing
.
Size
(
264
,
353
);
this
.
boxResetControl1
.
TabIndex
=
5
;
//
// cmb_runmode
// cmb_runmode
//
//
this
.
cmb_runmode
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cmb_runmode
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
...
@@ -165,17 +180,17 @@ namespace AutoCountMachine
...
@@ -165,17 +180,17 @@ namespace AutoCountMachine
"MSD"
,
"MSD"
,
"PAPER"
,
"PAPER"
,
"TOWER"
});
"TOWER"
});
this
.
cmb_runmode
.
Location
=
new
System
.
Drawing
.
Point
(
7
83
,
96
);
this
.
cmb_runmode
.
Location
=
new
System
.
Drawing
.
Point
(
7
67
,
153
);
this
.
cmb_runmode
.
Name
=
"cmb_runmode"
;
this
.
cmb_runmode
.
Name
=
"cmb_runmode"
;
this
.
cmb_runmode
.
Size
=
new
System
.
Drawing
.
Size
(
1
59
,
29
);
this
.
cmb_runmode
.
Size
=
new
System
.
Drawing
.
Size
(
1
75
,
29
);
this
.
cmb_runmode
.
TabIndex
=
4
;
this
.
cmb_runmode
.
TabIndex
=
4
;
this
.
cmb_runmode
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
cmb_runmode_SelectedIndexChanged
);
this
.
cmb_runmode
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
cmb_runmode_SelectedIndexChanged
);
//
//
// btn_releaseshelf
// btn_releaseshelf
//
//
this
.
btn_releaseshelf
.
Location
=
new
System
.
Drawing
.
Point
(
7
83
,
29
);
this
.
btn_releaseshelf
.
Location
=
new
System
.
Drawing
.
Point
(
7
67
,
29
);
this
.
btn_releaseshelf
.
Name
=
"btn_releaseshelf"
;
this
.
btn_releaseshelf
.
Name
=
"btn_releaseshelf"
;
this
.
btn_releaseshelf
.
Size
=
new
System
.
Drawing
.
Size
(
1
59
,
37
);
this
.
btn_releaseshelf
.
Size
=
new
System
.
Drawing
.
Size
(
1
75
,
37
);
this
.
btn_releaseshelf
.
TabIndex
=
3
;
this
.
btn_releaseshelf
.
TabIndex
=
3
;
this
.
btn_releaseshelf
.
Text
=
"强制释放料架"
;
this
.
btn_releaseshelf
.
Text
=
"强制释放料架"
;
this
.
btn_releaseshelf
.
UseVisualStyleBackColor
=
true
;
this
.
btn_releaseshelf
.
UseVisualStyleBackColor
=
true
;
...
@@ -264,14 +279,39 @@ namespace AutoCountMachine
...
@@ -264,14 +279,39 @@ namespace AutoCountMachine
this
.
listView1
.
TabIndex
=
7
;
this
.
listView1
.
TabIndex
=
7
;
this
.
listView1
.
UseCompatibleStateImageBehavior
=
false
;
this
.
listView1
.
UseCompatibleStateImageBehavior
=
false
;
//
//
// boxResetControl1
// btn_PauseBuzzer
//
//
this
.
boxResetControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btn_PauseBuzzer
.
BackColor
=
System
.
Drawing
.
Color
.
OrangeRed
;
this
.
boxResetControl1
.
Location
=
new
System
.
Drawing
.
Point
(
731
,
202
);
this
.
btn_PauseBuzzer
.
Location
=
new
System
.
Drawing
.
Point
(
767
,
88
);
this
.
boxResetControl1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
5
);
this
.
btn_PauseBuzzer
.
Name
=
"btn_PauseBuzzer"
;
this
.
boxResetControl1
.
Name
=
"boxResetControl1"
;
this
.
btn_PauseBuzzer
.
Size
=
new
System
.
Drawing
.
Size
(
175
,
40
);
this
.
boxResetControl1
.
Size
=
new
System
.
Drawing
.
Size
(
264
,
353
);
this
.
btn_PauseBuzzer
.
TabIndex
=
7
;
this
.
boxResetControl1
.
TabIndex
=
5
;
this
.
btn_PauseBuzzer
.
Text
=
"本次暂停警报器响声"
;
this
.
btn_PauseBuzzer
.
UseVisualStyleBackColor
=
false
;
this
.
btn_PauseBuzzer
.
Visible
=
false
;
this
.
btn_PauseBuzzer
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_PauseBuzzer_Click
);
//
// tabPage2
//
this
.
tabPage2
.
Controls
.
Add
(
this
.
cb_EnableBuzzer
);
this
.
tabPage2
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
30
);
this
.
tabPage2
.
Name
=
"tabPage2"
;
this
.
tabPage2
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
1000
,
565
);
this
.
tabPage2
.
TabIndex
=
1
;
this
.
tabPage2
.
Text
=
"设置"
;
this
.
tabPage2
.
UseVisualStyleBackColor
=
true
;
//
// cb_EnableBuzzer
//
this
.
cb_EnableBuzzer
.
AutoSize
=
true
;
this
.
cb_EnableBuzzer
.
Location
=
new
System
.
Drawing
.
Point
(
21
,
44
);
this
.
cb_EnableBuzzer
.
Name
=
"cb_EnableBuzzer"
;
this
.
cb_EnableBuzzer
.
Size
=
new
System
.
Drawing
.
Size
(
109
,
25
);
this
.
cb_EnableBuzzer
.
TabIndex
=
6
;
this
.
cb_EnableBuzzer
.
Text
=
"使用蜂鸣器"
;
this
.
cb_EnableBuzzer
.
UseVisualStyleBackColor
=
true
;
this
.
cb_EnableBuzzer
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
cb_EnableBuzzer_CheckedChanged
);
//
//
// Form1
// Form1
//
//
...
@@ -296,6 +336,8 @@ namespace AutoCountMachine
...
@@ -296,6 +336,8 @@ namespace AutoCountMachine
this
.
tabPage1
.
ResumeLayout
(
false
);
this
.
tabPage1
.
ResumeLayout
(
false
);
this
.
groupBox2
.
ResumeLayout
(
false
);
this
.
groupBox2
.
ResumeLayout
(
false
);
this
.
groupBox1
.
ResumeLayout
(
false
);
this
.
groupBox1
.
ResumeLayout
(
false
);
this
.
tabPage2
.
ResumeLayout
(
false
);
this
.
tabPage2
.
PerformLayout
();
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
this
.
PerformLayout
();
...
@@ -324,6 +366,9 @@ namespace AutoCountMachine
...
@@ -324,6 +366,9 @@ namespace AutoCountMachine
private
System
.
Windows
.
Forms
.
Button
btn_releaseshelf
;
private
System
.
Windows
.
Forms
.
Button
btn_releaseshelf
;
private
System
.
Windows
.
Forms
.
ComboBox
cmb_runmode
;
private
System
.
Windows
.
Forms
.
ComboBox
cmb_runmode
;
private
BoxResetControl
boxResetControl1
;
private
BoxResetControl
boxResetControl1
;
private
System
.
Windows
.
Forms
.
Button
btn_PauseBuzzer
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage2
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_EnableBuzzer
;
}
}
}
}
SO853-AutoCountMachine/Form1.cs
查看文件 @
0aebf51
using
CodeLibrary
;
using
CodeLibrary
;
using
ConfigHelper
;
using
DeviceLibrary
;
using
DeviceLibrary
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
...
@@ -170,7 +171,9 @@ namespace AutoCountMachine
...
@@ -170,7 +171,9 @@ namespace AutoCountMachine
LogUtil
.
info
(
"开始初始化"
);
LogUtil
.
info
(
"开始初始化"
);
cb_EnableBuzzer
.
Checked
=
Config
.
Get
(
"EnableBuzzer"
,
true
);
AlarmBuzzer
.
BuzzerStateChange
+=
AlarmBuzzer_BuzzerStateChange
;
RobotManage
.
LoadFinishEvent
+=
RobotManage_LoadFinishEvent
;
RobotManage
.
LoadFinishEvent
+=
RobotManage_LoadFinishEvent
;
RobotManage
.
LoadFinishEvent
+=
RobotManage_LoadFinishEvent
;
//RobotManage.Init();
//RobotManage.Init();
...
@@ -184,6 +187,10 @@ namespace AutoCountMachine
...
@@ -184,6 +187,10 @@ namespace AutoCountMachine
Device_ProcessMsgEvent
(
null
,
lm
);
Device_ProcessMsgEvent
(
null
,
lm
);
cmb_runmode
.
Text
=
"ONLINE"
;
cmb_runmode
.
Text
=
"ONLINE"
;
}
}
private
void
AlarmBuzzer_BuzzerStateChange
(
object
sender
,
bool
e
)
{
btn_PauseBuzzer
.
Visible
=
e
;
}
private
void
listView_ColumnWidthChanging
(
object
sender
,
ColumnWidthChangingEventArgs
e
)
private
void
listView_ColumnWidthChanging
(
object
sender
,
ColumnWidthChangingEventArgs
e
)
{
{
e
.
NewWidth
=
(
sender
as
ListView
).
Columns
[
e
.
ColumnIndex
].
Width
;
e
.
NewWidth
=
(
sender
as
ListView
).
Columns
[
e
.
ColumnIndex
].
Width
;
...
@@ -347,7 +354,7 @@ namespace AutoCountMachine
...
@@ -347,7 +354,7 @@ namespace AutoCountMachine
CodeLibrary
.
FrmCodeDecode
frm
=
new
CodeLibrary
.
FrmCodeDecode
();
CodeLibrary
.
FrmCodeDecode
frm
=
new
CodeLibrary
.
FrmCodeDecode
();
frm
.
ShowDialog
();
frm
.
ShowDialog
();
frm
.
Dispose
();
frm
.
Dispose
();
IOManager
.
IOMove
(
IO_XRay_Type
.
Camera_Led
,
IO_VALUE
.
LOW
,
RobotManage
.
xrayMachine
.
Config
);
//
IOManager.IOMove(IO_XRay_Type.Camera_Led, IO_VALUE.LOW, RobotManage.xrayMachine.Config);
}
}
private
void
点料算法匹配
toolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
点料算法匹配
toolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
@@ -396,5 +403,17 @@ namespace AutoCountMachine
...
@@ -396,5 +403,17 @@ namespace AutoCountMachine
}
}
}
}
private
void
cb_EnableBuzzer_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
Config
.
Set
(
"EnableBuzzer"
,
cb_EnableBuzzer
.
Checked
);
Config
.
SaveChange
();
AlarmBuzzer
.
Enable
=
cb_EnableBuzzer
.
Checked
;
}
private
void
btn_PauseBuzzer_Click
(
object
sender
,
EventArgs
e
)
{
AlarmBuzzer
.
MuteOnce
();
}
}
}
}
}
SO853-AutoCountMachine/Program.cs
查看文件 @
0aebf51
...
@@ -16,6 +16,8 @@ namespace AutoCountMachine
...
@@ -16,6 +16,8 @@ namespace AutoCountMachine
{
{
static
class
Program
static
class
Program
{
{
/// <summary>
/// <summary>
/// 应用程序的主入口点。
/// 应用程序的主入口点。
/// </summary>
/// </summary>
...
@@ -25,6 +27,7 @@ namespace AutoCountMachine
...
@@ -25,6 +27,7 @@ namespace AutoCountMachine
//OcrProcess.Run();
//OcrProcess.Run();
//ServerConn.inputCounterDataByXRayMachine("20.K0784.008-615313|1KQ-2111|5000|A2061531315212446|PANASONIC", 9);
//ServerConn.inputCounterDataByXRayMachine("20.K0784.008-615313|1KQ-2111|5000|A2061531315212446|PANASONIC", 9);
//return;
//return;
_
=
new
Mutex
(
true
,
Application
.
ProductName
,
out
bool
ret
);
_
=
new
Mutex
(
true
,
Application
.
ProductName
,
out
bool
ret
);
if
(!
ret
)
if
(!
ret
)
{
{
...
...
SO853-AutoCountMachine/T1Control.Designer.cs
查看文件 @
0aebf51
...
@@ -31,6 +31,10 @@ namespace AutoCountMachine
...
@@ -31,6 +31,10 @@ namespace AutoCountMachine
{
{
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
btn_Full_Linestop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Full_Linerun
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Empty_Linestop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Empty_Linerun
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Reset
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Reset
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_release
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_release
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_clamp
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_clamp
=
new
System
.
Windows
.
Forms
.
Button
();
...
@@ -55,10 +59,7 @@ namespace AutoCountMachine
...
@@ -55,10 +59,7 @@ namespace AutoCountMachine
this
.
label_eyemMulFuncTool
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label_eyemMulFuncTool
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btn_eyemMulFuncTool
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_eyemMulFuncTool
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
pictureBox1
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
pictureBox1
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
btn_Empty_Linerun
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Empty_Linestop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Full_Linerun
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn_Full_Linestop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
...
@@ -110,6 +111,46 @@ namespace AutoCountMachine
...
@@ -110,6 +111,46 @@ namespace AutoCountMachine
this
.
tabPage1
.
Text
=
"I/O控制"
;
this
.
tabPage1
.
Text
=
"I/O控制"
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
//
//
// btn_Full_Linestop
//
this
.
btn_Full_Linestop
.
Location
=
new
System
.
Drawing
.
Point
(
658
,
249
);
this
.
btn_Full_Linestop
.
Name
=
"btn_Full_Linestop"
;
this
.
btn_Full_Linestop
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btn_Full_Linestop
.
TabIndex
=
305
;
this
.
btn_Full_Linestop
.
Text
=
"满料串线体关"
;
this
.
btn_Full_Linestop
.
UseVisualStyleBackColor
=
true
;
this
.
btn_Full_Linestop
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_Full_Linestop_Click
);
//
// btn_Full_Linerun
//
this
.
btn_Full_Linerun
.
Location
=
new
System
.
Drawing
.
Point
(
545
,
249
);
this
.
btn_Full_Linerun
.
Name
=
"btn_Full_Linerun"
;
this
.
btn_Full_Linerun
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btn_Full_Linerun
.
TabIndex
=
305
;
this
.
btn_Full_Linerun
.
Text
=
"满料串线体开"
;
this
.
btn_Full_Linerun
.
UseVisualStyleBackColor
=
true
;
this
.
btn_Full_Linerun
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_Full_Linerun_Click
);
//
// btn_Empty_Linestop
//
this
.
btn_Empty_Linestop
.
Location
=
new
System
.
Drawing
.
Point
(
658
,
209
);
this
.
btn_Empty_Linestop
.
Name
=
"btn_Empty_Linestop"
;
this
.
btn_Empty_Linestop
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btn_Empty_Linestop
.
TabIndex
=
305
;
this
.
btn_Empty_Linestop
.
Text
=
"空料串线体关"
;
this
.
btn_Empty_Linestop
.
UseVisualStyleBackColor
=
true
;
this
.
btn_Empty_Linestop
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_Empty_Linestop_Click
);
//
// btn_Empty_Linerun
//
this
.
btn_Empty_Linerun
.
Location
=
new
System
.
Drawing
.
Point
(
545
,
209
);
this
.
btn_Empty_Linerun
.
Name
=
"btn_Empty_Linerun"
;
this
.
btn_Empty_Linerun
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btn_Empty_Linerun
.
TabIndex
=
305
;
this
.
btn_Empty_Linerun
.
Text
=
"空料串线体开"
;
this
.
btn_Empty_Linerun
.
UseVisualStyleBackColor
=
true
;
this
.
btn_Empty_Linerun
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_Empty_Linerun_Click
);
//
// btn_Reset
// btn_Reset
//
//
this
.
btn_Reset
.
Location
=
new
System
.
Drawing
.
Point
(
545
,
475
);
this
.
btn_Reset
.
Location
=
new
System
.
Drawing
.
Point
(
545
,
475
);
...
@@ -347,6 +388,7 @@ namespace AutoCountMachine
...
@@ -347,6 +388,7 @@ namespace AutoCountMachine
// tabPage3
// tabPage3
//
//
this
.
tabPage3
.
Controls
.
Add
(
this
.
label_eyemMulFuncTool
);
this
.
tabPage3
.
Controls
.
Add
(
this
.
label_eyemMulFuncTool
);
this
.
tabPage3
.
Controls
.
Add
(
this
.
button1
);
this
.
tabPage3
.
Controls
.
Add
(
this
.
btn_eyemMulFuncTool
);
this
.
tabPage3
.
Controls
.
Add
(
this
.
btn_eyemMulFuncTool
);
this
.
tabPage3
.
Controls
.
Add
(
this
.
pictureBox1
);
this
.
tabPage3
.
Controls
.
Add
(
this
.
pictureBox1
);
this
.
tabPage3
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
tabPage3
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
...
@@ -360,7 +402,7 @@ namespace AutoCountMachine
...
@@ -360,7 +402,7 @@ namespace AutoCountMachine
//
//
// label_eyemMulFuncTool
// label_eyemMulFuncTool
//
//
this
.
label_eyemMulFuncTool
.
Location
=
new
System
.
Drawing
.
Point
(
83
2
,
7
1
);
this
.
label_eyemMulFuncTool
.
Location
=
new
System
.
Drawing
.
Point
(
83
1
,
19
1
);
this
.
label_eyemMulFuncTool
.
Name
=
"label_eyemMulFuncTool"
;
this
.
label_eyemMulFuncTool
.
Name
=
"label_eyemMulFuncTool"
;
this
.
label_eyemMulFuncTool
.
Size
=
new
System
.
Drawing
.
Size
(
128
,
173
);
this
.
label_eyemMulFuncTool
.
Size
=
new
System
.
Drawing
.
Size
(
128
,
173
);
this
.
label_eyemMulFuncTool
.
TabIndex
=
2
;
this
.
label_eyemMulFuncTool
.
TabIndex
=
2
;
...
@@ -370,9 +412,9 @@ namespace AutoCountMachine
...
@@ -370,9 +412,9 @@ namespace AutoCountMachine
//
//
this
.
btn_eyemMulFuncTool
.
Location
=
new
System
.
Drawing
.
Point
(
831
,
6
);
this
.
btn_eyemMulFuncTool
.
Location
=
new
System
.
Drawing
.
Point
(
831
,
6
);
this
.
btn_eyemMulFuncTool
.
Name
=
"btn_eyemMulFuncTool"
;
this
.
btn_eyemMulFuncTool
.
Name
=
"btn_eyemMulFuncTool"
;
this
.
btn_eyemMulFuncTool
.
Size
=
new
System
.
Drawing
.
Size
(
1
2
6
,
40
);
this
.
btn_eyemMulFuncTool
.
Size
=
new
System
.
Drawing
.
Size
(
1
3
6
,
40
);
this
.
btn_eyemMulFuncTool
.
TabIndex
=
1
;
this
.
btn_eyemMulFuncTool
.
TabIndex
=
1
;
this
.
btn_eyemMulFuncTool
.
Text
=
"料串中心检测"
;
this
.
btn_eyemMulFuncTool
.
Text
=
"料串中心检测
(无料盘)
"
;
this
.
btn_eyemMulFuncTool
.
UseVisualStyleBackColor
=
true
;
this
.
btn_eyemMulFuncTool
.
UseVisualStyleBackColor
=
true
;
this
.
btn_eyemMulFuncTool
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
this
.
btn_eyemMulFuncTool
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
//
//
...
@@ -385,45 +427,15 @@ namespace AutoCountMachine
...
@@ -385,45 +427,15 @@ namespace AutoCountMachine
this
.
pictureBox1
.
TabIndex
=
0
;
this
.
pictureBox1
.
TabIndex
=
0
;
this
.
pictureBox1
.
TabStop
=
false
;
this
.
pictureBox1
.
TabStop
=
false
;
//
//
// btn_Empty_Linerun
// button1
//
this
.
btn_Empty_Linerun
.
Location
=
new
System
.
Drawing
.
Point
(
545
,
209
);
this
.
btn_Empty_Linerun
.
Name
=
"btn_Empty_Linerun"
;
this
.
btn_Empty_Linerun
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btn_Empty_Linerun
.
TabIndex
=
305
;
this
.
btn_Empty_Linerun
.
Text
=
"空料串线体开"
;
this
.
btn_Empty_Linerun
.
UseVisualStyleBackColor
=
true
;
this
.
btn_Empty_Linerun
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_Empty_Linerun_Click
);
//
// btn_Empty_Linestop
//
//
this
.
btn_Empty_Linestop
.
Location
=
new
System
.
Drawing
.
Point
(
658
,
209
);
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
831
,
52
);
this
.
btn_Empty_Linestop
.
Name
=
"btn_Empty_Linestop"
;
this
.
button1
.
Name
=
"button1"
;
this
.
btn_Empty_Linestop
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
136
,
40
);
this
.
btn_Empty_Linestop
.
TabIndex
=
305
;
this
.
button1
.
TabIndex
=
1
;
this
.
btn_Empty_Linestop
.
Text
=
"空料串线体关"
;
this
.
button1
.
Text
=
"料串中心检测(有料盘)"
;
this
.
btn_Empty_Linestop
.
UseVisualStyleBackColor
=
true
;
this
.
button1
.
UseVisualStyleBackColor
=
true
;
this
.
btn_Empty_Linestop
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_Empty_Linestop_Click
);
this
.
button1
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click_1
);
//
// btn_Full_Linerun
//
this
.
btn_Full_Linerun
.
Location
=
new
System
.
Drawing
.
Point
(
545
,
249
);
this
.
btn_Full_Linerun
.
Name
=
"btn_Full_Linerun"
;
this
.
btn_Full_Linerun
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btn_Full_Linerun
.
TabIndex
=
305
;
this
.
btn_Full_Linerun
.
Text
=
"满料串线体开"
;
this
.
btn_Full_Linerun
.
UseVisualStyleBackColor
=
true
;
this
.
btn_Full_Linerun
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_Full_Linerun_Click
);
//
// btn_Full_Linestop
//
this
.
btn_Full_Linestop
.
Location
=
new
System
.
Drawing
.
Point
(
658
,
249
);
this
.
btn_Full_Linestop
.
Name
=
"btn_Full_Linestop"
;
this
.
btn_Full_Linestop
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btn_Full_Linestop
.
TabIndex
=
305
;
this
.
btn_Full_Linestop
.
Text
=
"满料串线体关"
;
this
.
btn_Full_Linestop
.
UseVisualStyleBackColor
=
true
;
this
.
btn_Full_Linestop
.
Click
+=
new
System
.
EventHandler
(
this
.
btn_Full_Linestop_Click
);
//
//
// T1Control
// T1Control
//
//
...
@@ -474,5 +486,6 @@ namespace AutoCountMachine
...
@@ -474,5 +486,6 @@ namespace AutoCountMachine
private
System
.
Windows
.
Forms
.
Button
btn_Full_Linerun
;
private
System
.
Windows
.
Forms
.
Button
btn_Full_Linerun
;
private
System
.
Windows
.
Forms
.
Button
btn_Empty_Linestop
;
private
System
.
Windows
.
Forms
.
Button
btn_Empty_Linestop
;
private
System
.
Windows
.
Forms
.
Button
btn_Empty_Linerun
;
private
System
.
Windows
.
Forms
.
Button
btn_Empty_Linerun
;
private
System
.
Windows
.
Forms
.
Button
button1
;
}
}
}
}
SO853-AutoCountMachine/T1Control.cs
查看文件 @
0aebf51
...
@@ -78,7 +78,7 @@ namespace AutoCountMachine
...
@@ -78,7 +78,7 @@ namespace AutoCountMachine
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
{
{
var
(
bitmap
,
distance
,
debugtxt
)
=
RobotManage
.
t1Machine
.
GetStringCenter
();
var
(
bitmap
,
distance
,
debugtxt
)
=
RobotManage
.
t1Machine
.
GetStringCenter
A
();
label_eyemMulFuncTool
.
Text
=
debugtxt
+
$
"\ndistance:{distance}\nLocation:{(distance< RobotManage.t1Machine.Config.String_Offset_Range_Px?"
OK
":"
NG
")}"
;
label_eyemMulFuncTool
.
Text
=
debugtxt
+
$
"\ndistance:{distance}\nLocation:{(distance< RobotManage.t1Machine.Config.String_Offset_Range_Px?"
OK
":"
NG
")}"
;
...
@@ -104,5 +104,14 @@ namespace AutoCountMachine
...
@@ -104,5 +104,14 @@ namespace AutoCountMachine
{
{
RobotManage
.
t1Machine
.
ShelfOutLine
.
LineStop
(
"n"
);
RobotManage
.
t1Machine
.
ShelfOutLine
.
LineStop
(
"n"
);
}
}
private
void
button1_Click_1
(
object
sender
,
EventArgs
e
)
{
var
(
bitmap
,
distance
,
debugtxt
)
=
RobotManage
.
t1Machine
.
GetStringCenterB
();
label_eyemMulFuncTool
.
Text
=
debugtxt
+
$
"\ndistance:{distance}\nLocation:{(distance < RobotManage.t1Machine.Config.String_Offset_Range_Px ? "
OK
" : "
NG
")}"
;
pictureBox1
.
Image
=
bitmap
;
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论