Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20242OutBound
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c5000a07
由
LN
编写于
2023-07-02 15:20:32 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
79191892
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
44 行增加
和
27 行删除
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/DeviceLibrary/HttpServer.cs
DeviceLibrary/DeviceLibrary/ReelParam.cs
DeviceLibrary/theMachine/InReelBean.cs
DeviceLibrary/theMachine/LabelParam.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_PutReel.cs
DeviceLibrary/theMachine/OutShelfBean.cs
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
c5000a0
...
@@ -297,7 +297,7 @@ namespace DeviceLibrary
...
@@ -297,7 +297,7 @@ namespace DeviceLibrary
Task
.
Delay
(
ii
*
700
).
Wait
();
Task
.
Delay
(
ii
*
700
).
Wait
();
}
}
while
(!
cameraTask
[
0
].
IsCompleted
||
!
cameraTask
[
1
].
IsCompleted
)
while
(!
cameraTask
[
0
].
IsCompleted
)
{
{
Application
.
DoEvents
();
Application
.
DoEvents
();
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
...
...
DeviceLibrary/DeviceLibrary/HttpServer.cs
查看文件 @
c5000a0
...
@@ -14,9 +14,9 @@ namespace DeviceLibrary
...
@@ -14,9 +14,9 @@ namespace DeviceLibrary
{
{
}
}
private
static
string
Addr_updateDeviceAlarmMsg
=
"/rest/api/device/shelf/updateDeviceAlarmMsg"
;
private
static
string
Addr_updateDeviceAlarmMsg
=
"/rest/api/device/shelf/updateDeviceAlarmMsg"
;
private
static
string
Addr_ShelfFinish
=
"/rest/api/
device/
shelf/putShelfFinished"
;
private
static
string
Addr_ShelfFinish
=
"/rest/api/shelf/putShelfFinished"
;
private
static
string
Addr_getLocation
=
"/rest/api/
device/
shelf/getLocation"
;
private
static
string
Addr_getLocation
=
"/rest/api/shelf/getLocation"
;
private
static
string
Addr_getShelfEmptySlot
=
"/rest/api/
device/
shelf/getShelfEmptySlot"
;
private
static
string
Addr_getShelfEmptySlot
=
"/rest/api/shelf/getShelfEmptySlot"
;
/// <summary>
/// <summary>
/// rest/api/dcs/device/getShelfEmptySlot
/// rest/api/dcs/device/getShelfEmptySlot
/// 获取当前任务数及料架的剩余空位
/// 获取当前任务数及料架的剩余空位
...
@@ -110,7 +110,7 @@ namespace DeviceLibrary
...
@@ -110,7 +110,7 @@ namespace DeviceLibrary
}
}
public
static
string
GetAddr
(
string
addr
,
Dictionary
<
string
,
string
>
paramsMap
)
public
static
string
GetAddr
(
string
addr
,
Dictionary
<
string
,
string
>
paramsMap
)
{
{
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Device_Server_Address
)
;
string
server
=
Setting_Init
.
Device_Server_Address
;
if
(
server
.
EndsWith
(
"/"
))
if
(
server
.
EndsWith
(
"/"
))
{
{
server
=
server
.
Substring
(
0
,
server
.
Length
-
1
);
server
=
server
.
Substring
(
0
,
server
.
Length
-
1
);
...
@@ -236,8 +236,10 @@ namespace DeviceLibrary
...
@@ -236,8 +236,10 @@ namespace DeviceLibrary
{
{
int
h
=
getIntData
(
data
.
data
,
"h"
);
int
h
=
getIntData
(
data
.
data
,
"h"
);
int
w
=
getIntData
(
data
.
data
,
"w"
);
int
w
=
getIntData
(
data
.
data
,
"w"
);
string
nBarcode
=
getData
(
data
.
data
,
"barcode"
);
tray
.
h
=
h
;
tray
.
h
=
h
;
tray
.
w
=
w
;
tray
.
w
=
w
;
tray
.
barcode
=
nBarcode
;
}
}
return
tray
;
return
tray
;
...
...
DeviceLibrary/DeviceLibrary/ReelParam.cs
查看文件 @
c5000a0
...
@@ -120,12 +120,12 @@ public class ReelParam
...
@@ -120,12 +120,12 @@ public class ReelParam
{
{
if
(
IsNg
)
if
(
IsNg
)
{
{
return
$
":
{NgMsg}
[{WareCode}][{RFID}][{PlateW}x{PlateH}]"
;
return
$
":
NG[{NgMsg}][{StartPos}->{TargetPos}]
[{WareCode}][{RFID}][{PlateW}x{PlateH}]"
;
}
}
else
else
{
{
return
$
":[{TargetPos}][{WareCode}][{RFID}][{PlateW}x{PlateH}]"
;
return
$
":[{
StartPos}->{
TargetPos}][{WareCode}][{RFID}][{PlateW}x{PlateH}]"
;
}
}
}
}
bool
islog
=
false
;
bool
islog
=
false
;
...
...
DeviceLibrary/theMachine/InReelBean.cs
查看文件 @
c5000a0
...
@@ -159,6 +159,7 @@ namespace DeviceLibrary
...
@@ -159,6 +159,7 @@ namespace DeviceLibrary
if
(
LastCode
.
Count
>
0
)
if
(
LastCode
.
Count
>
0
)
{
{
MoveInfo
.
log
(
"扫码完成:"
+
CodeManager
.
ProcessCode
(
LastCode
));
MoveInfo
.
log
(
"扫码完成:"
+
CodeManager
.
ProcessCode
(
LastCode
));
break
;
}
}
else
else
{
{
...
@@ -192,7 +193,7 @@ namespace DeviceLibrary
...
@@ -192,7 +193,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/LabelParam.cs
查看文件 @
c5000a0
...
@@ -57,18 +57,18 @@ namespace DeviceLibrary
...
@@ -57,18 +57,18 @@ namespace DeviceLibrary
if
(
FixtureConfig
.
GetFixtureHeight
(
aCStorePosition
.
BagWidth
,
aCStorePosition
.
BagHigh
,
out
int
actualheight
))
if
(
FixtureConfig
.
GetFixtureHeight
(
aCStorePosition
.
BagWidth
,
aCStorePosition
.
BagHigh
,
out
int
actualheight
))
BagHigh
=
actualheight
;
BagHigh
=
actualheight
;
Comp_PH
=
Config
.
Comp_P2
-
Config
.
Comp_PoToMM
*
(
BagHigh
-
70
+
Config
.
Comp_PH_MM
);
Comp_PH
=
Config
.
Comp_P2
-
Config
.
Comp_PoToMM
*
(
BagHigh
-
8
+
Config
.
Comp_PH_MM
);
int
ReelHeight
=
reel
.
PlateH
;
int
ReelHeight
=
reel
.
PlateH
;
if
(
FixtureConfig
.
GetFixtureHeight
(
reel
.
PlateW
,
reel
.
PlateH
,
out
int
actualheight1
))
if
(
FixtureConfig
.
GetFixtureHeight
(
reel
.
PlateW
,
reel
.
PlateH
,
out
int
actualheight1
))
ReelHeight
=
actualheight1
;
ReelHeight
=
actualheight1
;
Comp_PL
=
Config
.
Comp_P2
-
Config
.
Comp_PoToMM
*
(
ReelHeight
-
70
);
Comp_PL
=
Config
.
Comp_P2
-
Config
.
Comp_PoToMM
*
(
ReelHeight
-
8
);
Comp_PH
=
Comp_PH
<
0
?
0
:
Comp_PH
;
Comp_PH
=
Comp_PH
<
0
?
0
:
Comp_PH
;
Comp_PL
=
Comp_PL
<
0
?
0
:
Comp_PL
;
Comp_PL
=
Comp_PL
<
0
?
0
:
Comp_PL
;
posid
=
aCStorePosition
.
PositionNum
;
posid
=
aCStorePosition
.
PositionNum
;
Reel
=
reel
.
clone
();
Reel
=
reel
.
clone
();
LogUtil
.
info
(
$
"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({BagHigh}-{
70
}+{Config.Comp_PH_MM})*{Config.Comp_PoToMM},Comp_PL:{Comp_PL}={ReelHeight},{JsonHelper.SerializeObject(this)}"
);
LogUtil
.
info
(
$
"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({BagHigh}-{
8
}+{Config.Comp_PH_MM})*{Config.Comp_PoToMM},Comp_PL:{Comp_PL}={ReelHeight},{JsonHelper.SerializeObject(this)}"
);
}
}
//public const string ngdoor = "单料口";
//public const string ngdoor = "单料口";
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
c5000a0
...
@@ -663,9 +663,13 @@ namespace DeviceLibrary
...
@@ -663,9 +663,13 @@ namespace DeviceLibrary
{
{
if
(
bean
.
ShelfValid
())
if
(
bean
.
ShelfValid
())
{
{
rfid
+=
bean
.
CurrShelf
.
realRFID
;
rfid
+=
bean
.
CurrShelf
.
realRFID
+
split
;
}
}
}
}
if
(
rfid
.
EndsWith
(
split
))
{
rfid
=
rfid
.
Substring
(
0
,
rfid
.
Length
-
1
);
}
return
rfid
;
return
rfid
;
}
}
private
DateTime
lastEmptyTime
=
DateTime
.
Now
;
private
DateTime
lastEmptyTime
=
DateTime
.
Now
;
...
@@ -696,7 +700,7 @@ namespace DeviceLibrary
...
@@ -696,7 +700,7 @@ namespace DeviceLibrary
ShelfInfo
shelf
=
outShelfBeans
[
key
].
CurrShelf
;
ShelfInfo
shelf
=
outShelfBeans
[
key
].
CurrShelf
;
if
(
outShelfBeans
[
key
].
ShelfValid
())
if
(
outShelfBeans
[
key
].
ShelfValid
())
{
{
string
realRfid
=
outShelfBeans
[
key
].
CurrShelf
.
r
fid
;
string
realRfid
=
outShelfBeans
[
key
].
CurrShelf
.
r
ealRFID
;
if
(
emptyMap
.
TryGetValue
(
realRfid
,
out
int
emptyP
))
if
(
emptyMap
.
TryGetValue
(
realRfid
,
out
int
emptyP
))
{
{
outShelfBeans
[
key
].
CurrShelf
.
EmptyPos
=
emptyP
;
outShelfBeans
[
key
].
CurrShelf
.
EmptyPos
=
emptyP
;
...
...
DeviceLibrary/theMachine/MainMachine_PutReel.cs
查看文件 @
c5000a0
...
@@ -56,6 +56,7 @@ namespace DeviceLibrary
...
@@ -56,6 +56,7 @@ namespace DeviceLibrary
//送料到NG
//送料到NG
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
StoreMoveInfo
.
MoveParam
=
new
ReelParam
(
tray
.
barcode
,
tray
.
w
,
tray
.
h
,
inReel
.
PosName
,
ngPos
,
tray
.
ngReel
,
tray
.
ngMsg
);
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
.
log
(
"NG料准备放料:"
+
StoreMoveInfo
.
MoveParam
.
ToStr
());
break
;
break
;
}
}
...
@@ -70,6 +71,7 @@ namespace DeviceLibrary
...
@@ -70,6 +71,7 @@ namespace DeviceLibrary
//送料到料架
//送料到料架
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
StoreMoveInfo
.
MoveParam
=
new
ReelParam
(
tray
.
barcode
,
tray
.
w
,
tray
.
h
,
inReel
.
PosName
,
pos
,
tray
.
ngReel
,
tray
.
ngMsg
);
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
());
StoreMoveInfo
.
log
(
"出库料准备放料:"
+
StoreMoveInfo
.
MoveParam
.
ToStr
());
break
;
break
;
}
}
...
...
DeviceLibrary/theMachine/OutShelfBean.cs
查看文件 @
c5000a0
...
@@ -85,9 +85,9 @@ namespace DeviceLibrary
...
@@ -85,9 +85,9 @@ namespace DeviceLibrary
{
{
if
(
CurrShelf
.
realRFID
.
Equals
(
CurrTray
.
realRfid
))
if
(
CurrShelf
.
realRFID
.
Equals
(
CurrTray
.
realRfid
))
{
{
if
(
String
.
IsNullOrEmpty
(
CurrShelf
.
r
fid
))
if
(
String
.
IsNullOrEmpty
(
CurrShelf
.
xnR
fid
))
{
{
CurrShelf
.
r
fid
=
CurrTray
.
rfid
;
CurrShelf
.
xnR
fid
=
CurrTray
.
rfid
;
LogUtil
.
info
(
Name
+
"增加虚拟料架号绑定:"
+
CurrShelf
.
ToStr
());
LogUtil
.
info
(
Name
+
"增加虚拟料架号绑定:"
+
CurrShelf
.
ToStr
());
}
}
ShelfPosId
=
CurrTray
.
getShelfLoc
(
Name
);
ShelfPosId
=
CurrTray
.
getShelfLoc
(
Name
);
...
@@ -95,7 +95,7 @@ namespace DeviceLibrary
...
@@ -95,7 +95,7 @@ namespace DeviceLibrary
}
}
else
if
(
String
.
IsNullOrEmpty
(
CurrTray
.
realRfid
))
else
if
(
String
.
IsNullOrEmpty
(
CurrTray
.
realRfid
))
{
{
if
((!
CurrShelf
.
rfid
.
Equals
(
""
))
&&
CurrShelf
.
r
fid
.
Equals
(
CurrTray
.
rfid
))
if
((!
CurrShelf
.
xnRfid
.
Equals
(
""
))
&&
CurrShelf
.
xnR
fid
.
Equals
(
CurrTray
.
rfid
))
{
{
CurrTray
.
realRfid
=
CurrShelf
.
realRFID
;
CurrTray
.
realRfid
=
CurrShelf
.
realRFID
;
ShelfPosId
=
CurrTray
.
getShelfLoc
(
Name
);
ShelfPosId
=
CurrTray
.
getShelfLoc
(
Name
);
...
@@ -110,9 +110,9 @@ namespace DeviceLibrary
...
@@ -110,9 +110,9 @@ namespace DeviceLibrary
return
false
;
return
false
;
}
}
}
}
if
(
CurrShelf
.
r
fid
.
Equals
(
""
))
if
(
CurrShelf
.
xnR
fid
.
Equals
(
""
))
{
{
CurrShelf
.
r
fid
=
CurrTray
.
rfid
;
CurrShelf
.
xnR
fid
=
CurrTray
.
rfid
;
CurrTray
.
realRfid
=
CurrShelf
.
realRFID
;
CurrTray
.
realRfid
=
CurrShelf
.
realRFID
;
LogUtil
.
info
(
Name
+
"增加虚拟料架号绑定:"
+
CurrShelf
.
ToStr
());
LogUtil
.
info
(
Name
+
"增加虚拟料架号绑定:"
+
CurrShelf
.
ToStr
());
ShelfPosId
=
CurrTray
.
getShelfLoc
(
Name
);
ShelfPosId
=
CurrTray
.
getShelfLoc
(
Name
);
...
@@ -186,10 +186,11 @@ namespace DeviceLibrary
...
@@ -186,10 +186,11 @@ namespace DeviceLibrary
{
{
if
(
taskInfo
.
smallEmpty
==
0
&&
taskInfo
.
bigEmpty
==
0
)
if
(
taskInfo
.
smallEmpty
==
0
&&
taskInfo
.
bigEmpty
==
0
)
{
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
S10_ShelfReady
);
//MoveInfo.NextMoveStep(MoveStep.S10_ShelfReady);
//CurrShelf.IsNeedLeave = true;
//当前工单任务已完成,直接送料架离开
//当前工单任务已完成,直接送料架离开
MoveInfo
.
log
(
"放料完成,当前工单任务已完成,
更改料架为需要离开状态
:"
+
taskInfo
.
ToStr
());
MoveInfo
.
log
(
"放料完成,当前工单任务已完成,
剩余空位=0,料架需要离开
:"
+
taskInfo
.
ToStr
());
CurrShelf
.
IsNeedLeave
=
true
;
S21_ShelfNeedLeave
(
"剩余空位=0"
)
;
}
}
else
else
{
{
...
@@ -213,7 +214,12 @@ namespace DeviceLibrary
...
@@ -213,7 +214,12 @@ namespace DeviceLibrary
else
if
(
locationCylinder
.
IsLow
())
else
if
(
locationCylinder
.
IsLow
())
{
{
if
(
CheckShelf
(
IO_VALUE
.
HIGH
))
//如果是料架等待离开
if
(
CurrShelf
!=
null
&&
CurrShelf
.
IsNeedLeave
)
{
}
else
if
(
CheckShelf
(
IO_VALUE
.
HIGH
))
{
{
//料架已到位
//料架已到位
MoveInfo
.
NewMove
(
MoveStep
.
S04_WaitTime
);
MoveInfo
.
NewMove
(
MoveStep
.
S04_WaitTime
);
...
@@ -317,7 +323,7 @@ namespace DeviceLibrary
...
@@ -317,7 +323,7 @@ namespace DeviceLibrary
case
MoveStep
.
S21_ShelfNeedLeave
:
case
MoveStep
.
S21_ShelfNeedLeave
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
S22_WaitAGV
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
S22_WaitAGV
);
AgvClient
.
NeedLeave
(
agvId
,
agvName
,
CurrShelf
.
r
fid
);
AgvClient
.
NeedLeave
(
agvId
,
agvName
,
CurrShelf
.
r
ealRFID
);
MoveInfo
.
log
(
"呼叫AGV小车,结束"
);
MoveInfo
.
log
(
"呼叫AGV小车,结束"
);
MoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
break
;
break
;
...
@@ -386,7 +392,7 @@ namespace DeviceLibrary
...
@@ -386,7 +392,7 @@ namespace DeviceLibrary
MoveInfo
.
log
(
"读取RFID"
);
MoveInfo
.
log
(
"读取RFID"
);
if
(
ReadShelfId
())
if
(
ReadShelfId
())
{
{
if
(
CurrShelf
.
r
fid
==
""
)
if
(
CurrShelf
.
r
ealRFID
==
""
)
{
{
S21_ShelfNeedLeave
(
"未读取到RFID"
);
S21_ShelfNeedLeave
(
"未读取到RFID"
);
}
}
...
@@ -407,6 +413,7 @@ namespace DeviceLibrary
...
@@ -407,6 +413,7 @@ namespace DeviceLibrary
{
{
MoveInfo
.
NewMove
(
MoveStep
.
S21_ShelfNeedLeave
);
MoveInfo
.
NewMove
(
MoveStep
.
S21_ShelfNeedLeave
);
locationCylinder
.
ToLow
(
MoveInfo
);
locationCylinder
.
ToLow
(
MoveInfo
);
CurrShelf
.
IsNeedLeave
=
true
;
MoveInfo
.
log
(
"料架["
+
CurrShelf
.
ToStr
()
+
"]需要离开:"
+
leaveMsg
+
",定位气缸下降"
);
MoveInfo
.
log
(
"料架["
+
CurrShelf
.
ToStr
()
+
"]需要离开:"
+
leaveMsg
+
",定位气缸下降"
);
}
}
private
bool
ReadShelfId
()
private
bool
ReadShelfId
()
...
@@ -536,8 +543,9 @@ namespace DeviceLibrary
...
@@ -536,8 +543,9 @@ namespace DeviceLibrary
public
class
ShelfInfo
public
class
ShelfInfo
{
{
//public ShelfTaskInfo TaskInfo = null;
//public ShelfTaskInfo TaskInfo = null;
public
string
realRFID
=
""
;
public
string
realRFID
=
""
;
public
string
r
fid
=
""
;
public
string
xnR
fid
=
""
;
public
bool
IsNeedLeave
=
false
;
public
bool
IsNeedLeave
=
false
;
public
bool
IsBusy
=
false
;
public
bool
IsBusy
=
false
;
public
int
EmptyPos
=
100
;
public
int
EmptyPos
=
100
;
...
@@ -545,14 +553,14 @@ namespace DeviceLibrary
...
@@ -545,14 +553,14 @@ namespace DeviceLibrary
public
ShelfInfo
(
string
shelfId
=
""
,
string
xnId
=
""
,
bool
needLeave
=
false
,
bool
busy
=
false
)
public
ShelfInfo
(
string
shelfId
=
""
,
string
xnId
=
""
,
bool
needLeave
=
false
,
bool
busy
=
false
)
{
{
this
.
realRFID
=
shelfId
;
this
.
realRFID
=
shelfId
;
this
.
r
fid
=
xnId
;
this
.
xnR
fid
=
xnId
;
this
.
IsNeedLeave
=
needLeave
;
this
.
IsNeedLeave
=
needLeave
;
this
.
IsBusy
=
busy
;
this
.
IsBusy
=
busy
;
EmptyPos
=
100
;
EmptyPos
=
100
;
}
}
public
string
ToStr
()
public
string
ToStr
()
{
{
string
result
=
"["
+
realRFID
+
"_"
+
r
fid
+
"]"
;
string
result
=
"["
+
realRFID
+
"_"
+
xnR
fid
+
"]"
;
result
+=
"[空位 "
+
EmptyPos
+
"]"
;
result
+=
"[空位 "
+
EmptyPos
+
"]"
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论