Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20242OutBound
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 93e0e06e
由
LN
编写于
2023-07-04 13:12:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
bug修改
1 个父辈
44919ea1
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
120 行增加
和
100 行删除
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/DeviceLibrary/HttpServer.cs
DeviceLibrary/DeviceLibrary/agv/AgvClient.cs
DeviceLibrary/theMachine/InReelBean.cs
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
DeviceLibrary/theMachine/MainMachine_PutReel.cs
DeviceLibrary/theMachine/MoveInfo.cs
TheMachine/FormMain.cs
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
93e0e06
...
@@ -404,6 +404,10 @@ namespace DeviceLibrary
...
@@ -404,6 +404,10 @@ namespace DeviceLibrary
public
static
string
ProcessCode
(
List
<
CodeInfo
>
codeInfos
)
public
static
string
ProcessCode
(
List
<
CodeInfo
>
codeInfos
)
{
{
if
(
codeInfos
==
null
||
codeInfos
.
Count
<=
0
)
{
return
""
;
}
string
codeStr
=
""
;
string
codeStr
=
""
;
foreach
(
CodeInfo
code
in
codeInfos
)
foreach
(
CodeInfo
code
in
codeInfos
)
{
{
...
...
DeviceLibrary/DeviceLibrary/HttpServer.cs
查看文件 @
93e0e06
...
@@ -293,6 +293,10 @@ namespace DeviceLibrary
...
@@ -293,6 +293,10 @@ namespace DeviceLibrary
/// 已使用的真实料架号
/// 已使用的真实料架号
/// </summary>
/// </summary>
public
string
usedRfidList
=
""
;
public
string
usedRfidList
=
""
;
/// <summary>
/// 工单号,工单号为空表示紧急出料
/// </summary>
public
string
orderNo
=
""
;
public
string
getShelfLoc
(
string
name
)
public
string
getShelfLoc
(
string
name
)
{
{
...
...
DeviceLibrary/DeviceLibrary/agv/AgvClient.cs
查看文件 @
93e0e06
...
@@ -81,9 +81,14 @@ namespace DeviceLibrary
...
@@ -81,9 +81,14 @@ namespace DeviceLibrary
}
}
}
}
private
static
bool
preStatus
=
false
;
private
static
void
Client_ConnectedEvent
(
bool
status
)
private
static
void
Client_ConnectedEvent
(
bool
status
)
{
{
if
(
preStatus
.
Equals
(
status
))
{
return
;
}
preStatus
=
status
;
LogUtil
.
info
(
"Client_ConnectedEvent := "
+
status
);
LogUtil
.
info
(
"Client_ConnectedEvent := "
+
status
);
}
}
...
...
DeviceLibrary/theMachine/InReelBean.cs
查看文件 @
93e0e06
...
@@ -36,10 +36,10 @@ namespace DeviceLibrary
...
@@ -36,10 +36,10 @@ namespace DeviceLibrary
}
}
public
void
Reset
()
public
void
Reset
(
string
msg
=
""
)
{
{
MoveInfo
.
NewMove
(
MoveStep
.
Wait
);
MoveInfo
.
NewMove
(
MoveStep
.
Wait
);
MoveInfo
.
log
(
"执行重置,清理当前条码:"
+
LastCode
);
MoveInfo
.
log
(
$
"{msg} 执行重置,清理当前条码:"
+
CodeManager
.
ProcessCode
(
LastCode
)
);
LastCode
=
new
List
<
CodeLibrary
.
CodeInfo
>();
LastCode
=
new
List
<
CodeLibrary
.
CodeInfo
>();
SetWarnMsg
();
SetWarnMsg
();
}
}
...
@@ -54,10 +54,7 @@ namespace DeviceLibrary
...
@@ -54,10 +54,7 @@ namespace DeviceLibrary
}
}
public
void
ReelLeave
()
public
void
ReelLeave
()
{
{
MoveInfo
.
NewMove
(
MoveStep
.
Wait
);
Reset
(
"料盘已离开"
);
MoveInfo
.
log
(
"料盘已离开:执行重置,清理当前条码:"
+
LastCode
);
LastCode
=
new
List
<
CodeLibrary
.
CodeInfo
>
();
SetWarnMsg
();
}
}
bool
pause
=
false
;
bool
pause
=
false
;
...
@@ -164,8 +161,8 @@ namespace DeviceLibrary
...
@@ -164,8 +161,8 @@ namespace DeviceLibrary
else
else
{
{
SetWarnMsg
(
$
"{Name}: 扫码失败"
);
SetWarnMsg
(
$
"{Name}: 扫码失败"
);
MoveInfo
.
errlog
(
"扫码失败 , 等待
3
秒后重新扫码"
);
MoveInfo
.
errlog
(
"扫码失败 , 等待
2
秒后重新扫码"
);
Thread
.
Sleep
(
1
000
);
Thread
.
Sleep
(
2
000
);
}
}
}
}
});
});
...
@@ -193,7 +190,7 @@ namespace DeviceLibrary
...
@@ -193,7 +190,7 @@ namespace DeviceLibrary
{
{
while
(
MoveInfo
.
MoveStep
.
Equals
(
MoveStep
.
IN03_GetPos
))
while
(
MoveInfo
.
MoveStep
.
Equals
(
MoveStep
.
IN03_GetPos
))
{
{
string
shelfRfid
=
RobotManage
.
mainMachine
.
getReadyShelf
(
";"
);
string
shelfRfid
=
RobotManage
.
mainMachine
.
getReadyShelf
();
if
(
String
.
IsNullOrEmpty
(
shelfRfid
))
if
(
String
.
IsNullOrEmpty
(
shelfRfid
))
{
{
//无可用料架
//无可用料架
...
...
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
查看文件 @
93e0e06
...
@@ -212,7 +212,7 @@ namespace DeviceLibrary
...
@@ -212,7 +212,7 @@ namespace DeviceLibrary
Running
,
Running
,
SystemPause
,
SystemPause
,
THoutRangeOver30m
,
THoutRangeOver30m
,
//
THoutRange,
THoutRange
,
InOut
,
InOut
,
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine_PutReel.cs
查看文件 @
93e0e06
...
@@ -23,78 +23,81 @@ namespace DeviceLibrary
...
@@ -23,78 +23,81 @@ namespace DeviceLibrary
}
}
return
true
;
return
true
;
}
}
private
void
putReelProcess
()
void
StoreProcess
()
{
{
if
(
CheckWait
(
StoreMoveInfo
))
foreach
(
InReelBean
inReel
in
inReelBeans
)
return
;
switch
(
StoreMoveInfo
.
MoveStep
)
{
{
case
MoveStep
.
Wait
:
if
(
inReel
.
ReelReady
())
{
foreach
(
InReelBean
inReel
in
inReelBeans
)
TrayInfo
tray
=
inReel
.
CurrTray
;
//取料
if
(
tray
.
ngReel
)
{
{
if
(
inReel
.
ReelReady
())
//NG门关上再放料
if
(
IOManager
.
IOValue
(
IO_Type
.
Left_NGDoor_Close_Check
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
Right_NGDoor_Close_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
TrayInfo
tray
=
inReel
.
CurrTray
;
string
ngPos
=
getNextNgPos
(
tray
.
w
);
//取料
if
(
ngPos
==
""
)
if
(
tray
.
ngReel
)
{
{
//NG门关上再放料
//暂无NG空位
if
(
IOManager
.
IOValue
(
IO_Type
.
Left_NGDoor_Close_Check
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
Right_NGDoor_Close_Check
).
Equals
(
IO_VALUE
.
HIGH
))
Msg
.
add
(
"["
+
inReel
.
Name
+
"]获取NG库位号失败"
,
MsgLevel
.
warning
,
ErrInfo
.
Empty
);
{
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
string
ngPos
=
getNextNgPos
(
tray
.
w
);
if
(
ngPos
==
""
)
{
//暂无NG空位
Msg
.
add
(
"["
+
inReel
.
Name
+
"]获取NG库位号失败"
,
MsgLevel
.
warning
,
ErrInfo
.
Empty
);
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
}
else
{
//送料到NG
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
StoreMoveInfo
.
MoveParam
=
new
ReelParam
(
tray
.
barcode
,
tray
.
w
,
tray
.
h
,
inReel
.
PosName
,
ngPos
,
tray
.
ngReel
,
tray
.
ngMsg
);
StoreMoveInfo
.
MoveParam
.
ReelOnFixture
=
false
;
StoreMoveInfo
.
log
(
"NG料准备放料:"
+
StoreMoveInfo
.
MoveParam
.
ToStr
());
break
;
}
}
}
}
else
else
{
{
//获取料架
//送料到NG
string
pos
=
GetShelfPosId
(
tray
);
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
if
(
pos
!=
""
)
StoreMoveInfo
.
MoveParam
=
new
ReelParam
(
tray
.
barcode
,
tray
.
w
,
tray
.
h
,
inReel
.
PosName
,
ngPos
,
tray
.
ngReel
,
tray
.
ngMsg
);
{
StoreMoveInfo
.
MoveParam
.
ReelOnFixture
=
false
;
//送料到料架
StoreMoveInfo
.
log
(
"NG料准备放料:"
+
StoreMoveInfo
.
MoveParam
.
ToStr
());
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
break
;
StoreMoveInfo
.
MoveParam
=
new
ReelParam
(
tray
.
barcode
,
tray
.
w
,
tray
.
h
,
inReel
.
PosName
,
pos
,
tray
.
ngReel
,
tray
.
ngMsg
);
StoreMoveInfo
.
MoveParam
.
ReelOnFixture
=
false
;
StoreMoveInfo
.
log
(
"出库料准备放料:"
+
StoreMoveInfo
.
MoveParam
.
ToStr
());
break
;
}
else
{
string
msg
=
"["
+
inReel
.
Name
+
"]未找到匹配库位"
;
if
(
string
.
IsNullOrEmpty
(
tray
.
realRfid
))
{
msg
=
"["
+
inReel
.
Name
+
"]未找到匹配库位,需要新料架["
+
tray
.
rfid
+
"]"
;
}
else
{
msg
=
"["
+
inReel
.
Name
+
"]未找到匹配库位,找不到料架["
+
tray
.
realRfid
+
"]"
;
}
//暂无NG空位
Msg
.
add
(
"["
+
inReel
.
Name
+
"]未找到匹配库位["
+
tray
.
ToStr
()+
"]"
,
MsgLevel
.
warning
,
ErrInfo
.
Empty
);
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
}
}
}
}
}
}
}
else
{
//获取料架
string
pos
=
GetShelfPosId
(
tray
);
if
(
pos
!=
""
)
{
//送料到料架
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
StoreMoveInfo
.
MoveParam
=
new
ReelParam
(
tray
.
barcode
,
tray
.
w
,
tray
.
h
,
inReel
.
PosName
,
pos
,
tray
.
ngReel
,
tray
.
ngMsg
);
StoreMoveInfo
.
MoveParam
.
ReelOnFixture
=
false
;
StoreMoveInfo
.
log
(
"出库料准备放料:"
+
StoreMoveInfo
.
MoveParam
.
ToStr
());
break
;
}
else
{
string
msg
=
"["
+
inReel
.
Name
+
"]未找到匹配库位"
;
if
(
string
.
IsNullOrEmpty
(
tray
.
realRfid
))
{
msg
=
"["
+
inReel
.
Name
+
"]未找到匹配库位,需要新料架["
+
tray
.
rfid
+
"]"
;
}
else
{
msg
=
"["
+
inReel
.
Name
+
"]未找到匹配库位,找不到料架["
+
tray
.
realRfid
+
"]"
;
}
//暂无NG空位
Msg
.
add
(
"["
+
inReel
.
Name
+
"]未找到匹配库位["
+
tray
.
ToStr
()
+
"]"
,
MsgLevel
.
warning
,
ErrInfo
.
Empty
);
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
}
}
}
}
}
void
StoreProcess
()
{
if
(
CheckWait
(
StoreMoveInfo
))
return
;
switch
(
StoreMoveInfo
.
MoveStep
)
{
case
MoveStep
.
Wait
:
putReelProcess
();
break
;
break
;
// //放料,准备放料
// //放料,准备放料
// PutReel01_Ready,
// PutReel01_Ready,
...
...
DeviceLibrary/theMachine/MoveInfo.cs
查看文件 @
93e0e06
...
@@ -114,15 +114,15 @@ namespace DeviceLibrary
...
@@ -114,15 +114,15 @@ namespace DeviceLibrary
public
void
log
(
string
msg
)
{
public
void
log
(
string
msg
)
{
m
sg
=
$
"[{Name}][{moveStep}][{MoveParam.TargetPos}-{MoveParam.WareCode}]: {msg}"
;
string
logM
sg
=
$
"[{Name}][{moveStep}][{MoveParam.TargetPos}-{MoveParam.WareCode}]: {msg}"
;
if
(
MoveParam
.
TargetPos
.
Equals
(
""
)
&&
MoveParam
.
WareCode
.
Equals
(
""
))
if
(
MoveParam
.
TargetPos
.
Equals
(
""
)
&&
MoveParam
.
WareCode
.
Equals
(
""
))
{
{
m
sg
=
$
"[{Name}][{moveStep}]: {msg}"
;
logM
sg
=
$
"[{Name}][{moveStep}]: {msg}"
;
}
}
if
(
String
.
Compare
(
lastmsg
,
msg
,
StringComparison
.
Ordinal
)!=
0
)
if
(
String
.
Compare
(
lastmsg
,
msg
,
StringComparison
.
Ordinal
)!=
0
)
{
{
lastmsg
=
m
sg
;
lastmsg
=
logM
sg
;
LogUtil
.
info
(
m
sg
);
LogUtil
.
info
(
logM
sg
);
}
}
}
}
...
...
TheMachine/FormMain.cs
查看文件 @
93e0e06
...
@@ -660,6 +660,13 @@ namespace TheMachine
...
@@ -660,6 +660,13 @@ namespace TheMachine
}
}
private
void
outSheftReset
(
string
name
)
private
void
outSheftReset
(
string
name
)
{
{
//设备未复位
if
(
RobotManage
.
mainMachine
.
runStatus
.
Equals
(
RunStatus
.
Stop
))
{
MessageBox
.
Show
(
"设备还未启动,无法复位"
,
"提示"
);
return
;
}
OutShelfBean
outShelf
=
RobotManage
.
mainMachine
.
getOutShelf
(
name
);
OutShelfBean
outShelf
=
RobotManage
.
mainMachine
.
getOutShelf
(
name
);
DialogResult
result
=
MessageBox
.
Show
(
"确定复位出料机构"
+
name
+
"?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
,
MessageBoxDefaultButton
.
Button1
);
DialogResult
result
=
MessageBox
.
Show
(
"确定复位出料机构"
+
name
+
"?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
,
MessageBoxDefaultButton
.
Button1
);
if
(
result
.
Equals
(
DialogResult
.
OK
))
if
(
result
.
Equals
(
DialogResult
.
OK
))
...
@@ -715,30 +722,25 @@ namespace TheMachine
...
@@ -715,30 +722,25 @@ namespace TheMachine
private
void
btnUpScan_Click
(
object
sender
,
EventArgs
e
)
private
void
btnUpScan_Click
(
object
sender
,
EventArgs
e
)
{
{
string
[]
camers
=
Setting_Init
.
CameraScan_IN_1
;
string
[]
cameras
=
Setting_Init
.
CameraScan_IN_1
;
List
<
CodeLibrary
.
CodeInfo
>
codeInfos
=
CodeManager
.
CameraScan
(
camers
.
ToList
());
ScanTest
(
cameras
);
}
private
void
ScanTest
(
string
[]
cameras
)
{
List
<
CodeLibrary
.
CodeInfo
>
codeInfos
=
CodeManager
.
CameraScan
(
cameras
.
ToList
());
string
lastCode
=
""
;
string
lastCode
=
""
;
foreach
(
CodeLibrary
.
CodeInfo
ca
in
codeInfos
)
foreach
(
CodeLibrary
.
CodeInfo
ca
in
codeInfos
)
{
{
lastCode
+=
ca
.
CodeStr
+
"#"
;
lastCode
+=
ca
.
CodeStr
+
"#"
;
}
}
LogUtil
.
info
(
"["
+
String
.
Join
(
","
,
camer
s
)
+
"]扫码测试结果:\r\n"
+
lastCode
);
LogUtil
.
info
(
"["
+
String
.
Join
(
","
,
camera
s
)
+
"]扫码测试结果:\r\n"
+
lastCode
);
MessageBox
.
Show
(
"["
+
String
.
Join
(
","
,
camers
)
+
crc
.
GetString
(
"Res0109"
,
"]扫码测试结果:"
)
+
lastCode
);
MessageBox
.
Show
(
"["
+
String
.
Join
(
","
,
camer
a
s
)
+
crc
.
GetString
(
"Res0109"
,
"]扫码测试结果:"
)
+
lastCode
);
}
}
private
void
btnDownScan_Click
(
object
sender
,
EventArgs
e
)
private
void
btnDownScan_Click
(
object
sender
,
EventArgs
e
)
{
{
string
[]
camers
=
Setting_Init
.
CameraScan_IN_2
;
string
[]
camers
=
Setting_Init
.
CameraScan_IN_2
;
List
<
CodeLibrary
.
CodeInfo
>
codeInfos
=
CodeManager
.
CameraScan
(
camers
.
ToList
());
ScanTest
(
camers
);
string
lastCode
=
""
;
foreach
(
CodeLibrary
.
CodeInfo
ca
in
codeInfos
)
{
lastCode
+=
ca
.
CodeStr
+
"#"
;
}
LogUtil
.
info
(
"["
+
String
.
Join
(
","
,
camers
)
+
"]扫码测试结果:\r\n"
+
lastCode
);
MessageBox
.
Show
(
"["
+
String
.
Join
(
","
,
camers
)
+
crc
.
GetString
(
"Res0109"
,
"]扫码测试结果:"
)
+
lastCode
);
}
}
private
void
chbDIsAgv_CheckedChanged
(
object
sender
,
EventArgs
e
)
private
void
chbDIsAgv_CheckedChanged
(
object
sender
,
EventArgs
e
)
...
@@ -746,8 +748,8 @@ namespace TheMachine
...
@@ -746,8 +748,8 @@ namespace TheMachine
if
(
chbDIsAgv
.
Checked
.
Equals
(
AgvClient
.
DisAgv
))
if
(
chbDIsAgv
.
Checked
.
Equals
(
AgvClient
.
DisAgv
))
{
{
return
;
return
;
}
}
LogUtil
.
info
(
"勾选:"
+
chbDIsAgv
.
Text
+
" ="
+(
chbDIsAgv
.
Checked
?
"√"
:
"×"
));
LogUtil
.
info
(
"勾选:"
+
chbDIsAgv
.
Text
+
" ="
+
(
chbDIsAgv
.
Checked
?
"√"
:
"×"
));
AgvClient
.
setDisAgv
(
chbDIsAgv
.
Checked
);
AgvClient
.
setDisAgv
(
chbDIsAgv
.
Checked
);
}
}
...
@@ -755,23 +757,28 @@ namespace TheMachine
...
@@ -755,23 +757,28 @@ namespace TheMachine
private
void
btnClearNgPos_Click
(
object
sender
,
EventArgs
e
)
private
void
btnClearNgPos_Click
(
object
sender
,
EventArgs
e
)
{
{
LogUtil
.
info
(
"用户点击了【"
+
btnClearNgPos
.
Text
+
"】"
);
LogUtil
.
info
(
"用户点击了【"
+
btnClearNgPos
.
Text
+
"】"
);
RobotManage
.
mainMachine
.
ClearNgPos
();
}
}
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
{
{
string
name
=
"IN_1"
;
string
name
=
"IN_1"
;
InReelBean
InBean
=
RobotManage
.
mainMachine
.
getInReelBean
(
name
);
InBeanReset
(
name
);
DialogResult
result
=
MessageBox
.
Show
(
"确定复位"
+
name
+
"?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
,
MessageBoxDefaultButton
.
Button1
);
if
(
result
.
Equals
(
DialogResult
.
OK
))
{
LogUtil
.
info
(
"手动操作:"
+
name
+
"复位"
);
InBean
.
Reset
();
}
}
}
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
{
string
name
=
"IN_2"
;
string
name
=
"IN_2"
;
InBeanReset
(
name
);
}
private
void
InBeanReset
(
string
name
)
{
//设备未复位
if
(
RobotManage
.
mainMachine
.
runStatus
.
Equals
(
RunStatus
.
Stop
))
{
MessageBox
.
Show
(
"设备还未启动,无法复位"
,
"提示"
);
return
;
}
InReelBean
InBean
=
RobotManage
.
mainMachine
.
getInReelBean
(
name
);
InReelBean
InBean
=
RobotManage
.
mainMachine
.
getInReelBean
(
name
);
DialogResult
result
=
MessageBox
.
Show
(
"确定复位"
+
name
+
"?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
,
MessageBoxDefaultButton
.
Button1
);
DialogResult
result
=
MessageBox
.
Show
(
"确定复位"
+
name
+
"?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
,
MessageBoxDefaultButton
.
Button1
);
if
(
result
.
Equals
(
DialogResult
.
OK
))
if
(
result
.
Equals
(
DialogResult
.
OK
))
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论