Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO853-AutoCountMachine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4825c196
由
刘韬
编写于
2025-12-17 13:47:12 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
添加贴标后扫码验证
1 个父辈
7e49d1e3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
129 行增加
和
5 行删除
DeviceLibrary/AutoScan/LabelMachine.partial.cs
DeviceLibrary/AutoScan/LabelMachine.print.cs
DeviceLibrary/AutoScan/MoveStep.cs
DeviceLibrary/AutoScan/LabelMachine.partial.cs
查看文件 @
4825c19
...
@@ -47,6 +47,9 @@ namespace DeviceLibrary
...
@@ -47,6 +47,9 @@ namespace DeviceLibrary
Scan_QRCode_Fail
=
1
,
Scan_QRCode_Fail
=
1
,
Scan_Code_And_Print_are_different
=
2
,
Scan_Code_And_Print_are_different
=
2
,
Failed_to_extract_label
=
4
,
Failed_to_extract_label
=
4
,
Verify_Scan_Fail
=
8
,
Verify_PN_different
=
16
,
Verify_RI_equal
=
32
,
};
};
WaitCheckLabeltypeE
WaitCheckLabeltype
;
WaitCheckLabeltypeE
WaitCheckLabeltype
;
Task
printTask
=
null
;
Task
printTask
=
null
;
...
@@ -311,11 +314,37 @@ namespace DeviceLibrary
...
@@ -311,11 +314,37 @@ namespace DeviceLibrary
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
break
;
break
;
case
MoveStep
.
Lbl13
:
case
MoveStep
.
Lbl13
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
_BeginOut
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
15
);
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
.
ReelParam
.
LabelState
=
"Ok"
;
MoveInfo
.
ReelParam
.
LabelState
=
"Ok"
;
MoveInfo
.
log
(
"取标气缸上升."
);
MoveInfo
.
log
(
"取标气缸上升."
);
break
;
break
;
case
MoveStep
.
Lbl15
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl16
);
Label_X_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Label_X_P2
,
Config
.
Label_X_P2_speed
);
Label_Y_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Label_Y_P2
,
Config
.
Label_Y_P2_speed
);
Label_R_Axis
.
AbsMove
(
null
,
Config
.
Label_R_P2
,
Config
.
Label_R_P2_speed
);
break
;
case
MoveStep
.
Lbl16
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl17
);
ScanTask2
=
ScanCode3
();
break
;
case
MoveStep
.
Lbl17
:
if
(
ScanTask2
.
IsCompleted
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl18
);
MoveInfo
.
log
(
"标签验证完成."
);
}
else
if
(
MoveInfo
.
IsTimeOut
(
15
))
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitCheckLabel2
);
MoveInfo
.
log
(
$
"等待扫码超时,重新扫码"
);
WaitCheckLabeltype
=
WaitCheckLabeltypeE
.
Verify_Scan_Fail
;
}
break
;
case
MoveStep
.
Lbl18
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_BeginOut
);
break
;
case
MoveStep
.
Lbl_WaitCheckLabel
:
case
MoveStep
.
Lbl_WaitCheckLabel
:
if
((
WaitCheckLabeltype
&
WaitCheckLabeltypeE
.
Scan_QRCode_Fail
)
==
WaitCheckLabeltypeE
.
Scan_QRCode_Fail
)
if
((
WaitCheckLabeltype
&
WaitCheckLabeltypeE
.
Scan_QRCode_Fail
)
==
WaitCheckLabeltypeE
.
Scan_QRCode_Fail
)
Msg
.
add
(
crc
.
GetString
(
"label_scan_qrcode_fail"
,
"未识别到有效二维码"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"label_scan_qrcode_fail"
,
"未识别到有效二维码"
),
MsgLevel
.
warning
);
...
@@ -333,8 +362,24 @@ namespace DeviceLibrary
...
@@ -333,8 +362,24 @@ namespace DeviceLibrary
MoveInfo
.
log
(
"人工完成贴标."
);
MoveInfo
.
log
(
"人工完成贴标."
);
}
}
break
;
break
;
case
MoveStep
.
Lbl_WaitCheckLabel2
:
if
((
WaitCheckLabeltype
&
WaitCheckLabeltypeE
.
Verify_Scan_Fail
)
==
WaitCheckLabeltypeE
.
Verify_Scan_Fail
)
Msg
.
add
(
crc
.
GetString
(
"Verify_Scan_Fail"
,
"未识别到新贴标签的二维码,请取走料盘人工检查"
),
MsgLevel
.
warning
);
if
((
WaitCheckLabeltype
&
WaitCheckLabeltypeE
.
Verify_PN_different
)
==
WaitCheckLabeltypeE
.
Verify_PN_different
)
Msg
.
add
(
crc
.
GetString
(
"Verify_PN_different"
,
"新贴标签的PN与原标签不一致,请取走料盘人工检查"
),
MsgLevel
.
warning
);
if
((
WaitCheckLabeltype
&
WaitCheckLabeltypeE
.
Verify_RI_equal
)
==
WaitCheckLabeltypeE
.
Verify_RI_equal
)
Msg
.
add
(
crc
.
GetString
(
"Verify_RI_equal"
,
"新贴标签的IDNO与原标一致,请取走料盘人工检查"
),
MsgLevel
.
warning
);
MoveInfo
.
log
(
"Lbl_WaitCheckLabel:"
+
WaitCheckLabeltype
.
ToString
());
if
(
IOValue
(
IO_Label_Type
.
Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
MoveInfo
.
NewMove
(
MoveStep
.
Lbl_01_Wait_ATray
);
// IOMove(IO_Label_Type.LabelCylinder_Work, IO_VALUE.LOW);
//RobotManage.Line2.LineRun("label", 999, "Lbl_WaitCheckLabel");
MoveInfo
.
log
(
"人工取走料盘."
);
}
break
;
case
MoveStep
.
Lbl_BeginOut
:
case
MoveStep
.
Lbl_BeginOut
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
15
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
20
);
Label_X_Axis
.
AbsMove
(
null
,
Config
.
Label_X_P2
,
Config
.
Label_X_P2_speed
);
Label_X_Axis
.
AbsMove
(
null
,
Config
.
Label_X_P2
,
Config
.
Label_X_P2_speed
);
Label_Y_Axis
.
AbsMove
(
null
,
Config
.
Label_Y_P2
,
Config
.
Label_Y_P2_speed
);
Label_Y_Axis
.
AbsMove
(
null
,
Config
.
Label_Y_P2
,
Config
.
Label_Y_P2_speed
);
Label_R_Axis
.
AbsMove
(
null
,
Config
.
Label_R_P2
,
Config
.
Label_R_P2_speed
);
Label_R_Axis
.
AbsMove
(
null
,
Config
.
Label_R_P2
,
Config
.
Label_R_P2_speed
);
...
@@ -346,20 +391,20 @@ namespace DeviceLibrary
...
@@ -346,20 +391,20 @@ namespace DeviceLibrary
}
}
MoveInfo
.
log
(
"Label_XYR转到取标点,待机"
);
MoveInfo
.
log
(
"Label_XYR转到取标点,待机"
);
break
;
break
;
case
MoveStep
.
Lbl
15
:
case
MoveStep
.
Lbl
20
:
if
(
MoveInfo
.
ReelParam
.
WareCode
==
"testlabel"
)
{
if
(
MoveInfo
.
ReelParam
.
WareCode
==
"testlabel"
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
L30_LabelFinish
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
L30_LabelFinish
);
MoveInfo
.
log
(
"贴标测试结束."
);
MoveInfo
.
log
(
"贴标测试结束."
);
}
}
else
else
{
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
16
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
21
);
CylinderMove
(
null
,
IO_Label_Type
.
Label_Stop_Down
,
IO_Label_Type
.
Label_Stop_Up
,
IO_VALUE
.
HIGH
);
CylinderMove
(
null
,
IO_Label_Type
.
Label_Stop_Down
,
IO_Label_Type
.
Label_Stop_Up
,
IO_VALUE
.
HIGH
);
CylinderMove
(
MoveInfo
,
IO_Label_Type
.
TrayStop_Down
,
IO_Label_Type
.
TrayStop_Up
,
IO_VALUE
.
LOW
);
CylinderMove
(
MoveInfo
,
IO_Label_Type
.
TrayStop_Down
,
IO_Label_Type
.
TrayStop_Up
,
IO_VALUE
.
LOW
);
MoveInfo
.
log
(
"贴标阻挡上升."
);
MoveInfo
.
log
(
"贴标阻挡上升."
);
}
}
break
;
break
;
case
MoveStep
.
Lbl
16
:
case
MoveStep
.
Lbl
21
:
if
(
SendOutMoveInfo
.
MoveStep
==
MoveStep
.
Wait
&&
RobotManage
.
filterMachine
.
isWaitReel
)
if
(
SendOutMoveInfo
.
MoveStep
==
MoveStep
.
Wait
&&
RobotManage
.
filterMachine
.
isWaitReel
)
{
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
L30_LabelFinish
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
L30_LabelFinish
);
...
...
DeviceLibrary/AutoScan/LabelMachine.print.cs
查看文件 @
4825c19
...
@@ -176,5 +176,77 @@ namespace DeviceLibrary
...
@@ -176,5 +176,77 @@ namespace DeviceLibrary
}
}
}));
}));
}
}
Task
<(
Point
,
double
,
bool
)>
ScanCode3
()
{
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
(
1000
).
Wait
();
LastCodeList
=
CodeManager
.
CameraScan
(
new
List
<
string
>
{
Config
.
CameraName
},
out
bitmap
);
}
if
(
LastCodeList
.
Count
==
0
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitCheckLabel2
);
MoveInfo
.
log
(
$
"未识别到有效二维码"
);
WaitCheckLabeltype
=
WaitCheckLabeltypeE
.
Verify_Scan_Fail
;
}
else
{
var
w
=
LastCodeList
[
0
].
CodeStr
.
Split
(
'|'
);
string
PN
=
string
.
Empty
,
ReeID
=
string
.
Empty
;
if
(
w
.
Length
==
5
)
{
PN
=
w
[
0
];
ReeID
=
w
[
3
];
}
if
(
MoveInfo
.
ReelParam
.
PN
!=
PN
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitCheckLabel2
);
//Msg.add(crc.GetString("label_qrcode_different", "扫描到的Reelid与发出打印的可能不一致"), MsgLevel.warning);
MoveInfo
.
log
(
$
"扫描到的PN与贴标不一致,系统:{MoveInfo.ReelParam.WareCode},实际:{LastCodeList[0].CodeStr}"
);
WaitCheckLabeltype
=
WaitCheckLabeltypeE
.
Verify_PN_different
;
//MoveInfo.ReelParam.IsNg = true;
//MoveInfo.ReelParam.NgMsg = "扫描到的Reelid与发出打印的不一致";
//MoveInfo.ReelParam.logresult();
}
if
(
MoveInfo
.
ReelParam
.
ReeID
==
ReeID
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitCheckLabel2
);
//Msg.add(crc.GetString("label_qrcode_different", "扫描到的Reelid与发出打印的可能不一致"), MsgLevel.warning);
MoveInfo
.
log
(
$
"扫描到的RI与与原标签一致,系统:{MoveInfo.ReelParam.WareCode},实际:{LastCodeList[0].CodeStr}"
);
WaitCheckLabeltype
=
WaitCheckLabeltypeE
.
Verify_RI_equal
;
//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
();
}
return
(
Point
.
Empty
,
0
,
false
);
}
return
(
Point
.
Empty
,
0
,
false
);
}
catch
{
return
(
Point
.
Empty
,
0
,
false
);
}
}));
}
}
}
}
}
DeviceLibrary/AutoScan/MoveStep.cs
查看文件 @
4825c19
...
@@ -39,6 +39,7 @@ namespace DeviceLibrary
...
@@ -39,6 +39,7 @@ namespace DeviceLibrary
Lbl_06_Get_Reelinfo
,
Lbl_06_Get_Reelinfo
,
//Lbl_01_StartPrint,
//Lbl_01_StartPrint,
Lbl_WaitCheckLabel
,
Lbl_WaitCheckLabel
,
Lbl_WaitCheckLabel2
,
Lbl_WaitPrint
,
Lbl_WaitPrint
,
Lbl_Printted
,
Lbl_Printted
,
Lbl01
,
Lbl01
,
...
@@ -55,6 +56,12 @@ namespace DeviceLibrary
...
@@ -55,6 +56,12 @@ namespace DeviceLibrary
Lbl_BeginOut
,
Lbl_BeginOut
,
Lbl15
,
Lbl15
,
Lbl16
,
Lbl16
,
Lbl17
,
Lbl18
,
Lbl19
,
Lbl20
,
Lbl21
,
Lbl22
,
L30_LabelFinish
,
L30_LabelFinish
,
Shelf_EmptyIn_WaitWorkLeave
,
Shelf_EmptyIn_WaitWorkLeave
,
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论