Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20242OutBound
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d8c07ab2
由
LN
编写于
2023-05-11 08:57:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
接口修改
1 个父辈
36a8cd24
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
64 行增加
和
31 行删除
DeviceLibrary/DeviceLibrary/HttpServer.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_PutReel.cs
DeviceLibrary/theMachine/OutShelfBean.cs
TheMachine/app.manifest
DeviceLibrary/DeviceLibrary/HttpServer.cs
查看文件 @
d8c07ab
...
...
@@ -13,10 +13,10 @@ namespace DeviceLibrary
public
HttpServer
()
{
}
private
static
string
Addr_updateDeviceAlarmMsg
=
"/rest/api/
qisda/device
/updateDeviceAlarmMsg"
;
private
static
string
Addr_ShelfFinish
=
"/rest/api/
qisda/device
/putShelfFinished"
;
private
static
string
Addr_getLocation
=
"/rest/api/
qisda/device
/getLocation"
;
private
static
string
Addr_getShelfEmptySlot
=
"/rest/api/d
cs/device
/getShelfEmptySlot"
;
private
static
string
Addr_updateDeviceAlarmMsg
=
"/rest/api/
device/shelf
/updateDeviceAlarmMsg"
;
private
static
string
Addr_ShelfFinish
=
"/rest/api/
device/shelf
/putShelfFinished"
;
private
static
string
Addr_getLocation
=
"/rest/api/
device/shelf
/getLocation"
;
private
static
string
Addr_getShelfEmptySlot
=
"/rest/api/d
evice/shelf
/getShelfEmptySlot"
;
/// <summary>
/// rest/api/dcs/device/getShelfEmptySlot
/// 获取当前任务数及料架的剩余空位
...
...
@@ -152,7 +152,7 @@ namespace DeviceLibrary
/// <param name="rfidLoc"></param>
/// <param name="robotIndex"></param>
/// <returns></returns>
public
static
ShelfTaskInfo
ShelfFinish
(
string
rfid
,
string
barcode
=
""
,
string
rfidLoc
=
""
,
string
robotIndex
=
"1"
)
public
static
ShelfTaskInfo
ShelfFinish
(
string
rfid
,
string
barcode
=
""
,
string
rfidLoc
=
""
)
{
ShelfTaskInfo
task
=
new
ShelfTaskInfo
();
task
.
rfid
=
rfid
;
...
...
@@ -165,7 +165,7 @@ namespace DeviceLibrary
paramMap
.
Add
(
"barcode"
,
barcode
);
paramMap
.
Add
(
"rfid"
,
rfid
);
paramMap
.
Add
(
"rfidLoc"
,
rfidLoc
);
paramMap
.
Add
(
"robotIndex"
,
robotIndex
);
//
paramMap.Add("robotIndex", robotIndex);
//string url = httpAddr + api + "?barcode=" + barcode + "&rfid=" + rfid + "&rfidLoc=" + rfidLoc + "&robotIndex=" + robotIndex;
string
url
=
GetAddr
(
api
,
paramMap
);
LogUtil
.
debug
(
"http :URL:"
+
url
);
...
...
@@ -231,11 +231,20 @@ namespace DeviceLibrary
if
(
data
==
null
||
data
.
code
!=
0
)
{
tray
=
TrayInfo
.
newNgTray
(
barcode
,
data
.
msg
);
if
(
data
.
data
!=
null
)
{
int
h
=
getIntData
(
data
.
data
,
"h"
);
int
w
=
getIntData
(
data
.
data
,
"w"
);
tray
.
h
=
h
;
tray
.
w
=
w
;
}
return
tray
;
}
tray
=
JsonHelper
.
DeserializeJsonToObject
<
TrayInfo
>(
data
.
data
.
ToString
());
if
(
tray
==
null
||
tray
.
rfid
==
""
||
tray
.
shelfP
==
0
)
if
(
tray
==
null
||
tray
.
rfid
==
""
||
tray
.
rfidLoc
==
0
)
{
tray
=
TrayInfo
.
newNgTray
(
barcode
,
"获取位置失败"
);
return
tray
;
...
...
@@ -257,7 +266,7 @@ namespace DeviceLibrary
/// <summary>
/// 料架位置,1-31
/// </summary>
public
int
shelfP
=
0
;
public
int
rfidLoc
=
0
;
/// <summary>
/// 虚拟料架号
/// </summary>
...
...
@@ -265,7 +274,7 @@ namespace DeviceLibrary
/// <summary>
/// 真实料架号
/// </summary>
public
string
realR
FID
=
""
;
public
string
realR
fid
=
""
;
/// <summary>
/// 条码信息
/// </summary>
...
...
@@ -275,8 +284,8 @@ namespace DeviceLibrary
/// </summary>
public
string
usedRfidList
=
""
;
public
int
plateW
=
7
;
public
int
plageH
=
8
;
public
int
w
=
7
;
public
int
h
=
8
;
public
bool
ngReel
=
false
;
...
...
@@ -286,11 +295,11 @@ namespace DeviceLibrary
{
if
(
ngReel
)
{
return
"NGReel: ["
+
barcode
+
"] ["
+
ngMsg
+
"] ["
+
updateTime
.
ToLongTimeString
()
+
"]"
;
return
"NGReel: ["
+
barcode
+
"]
["
+
w
+
"X"
+
h
+
"]
["
+
ngMsg
+
"] ["
+
updateTime
.
ToLongTimeString
()
+
"]"
;
}
else
{
return
" ["
+
barcode
+
"] ["
+
shelfP
+
"] ["
+
rfid
+
"] ["
+
realRFID
+
"] ["
+
usedRfidList
+
"] ["
+
updateTime
.
ToLongTimeString
()
+
"]"
;
return
" ["
+
barcode
+
"] ["
+
w
+
"X"
+
h
+
"] ["
+
rfidLoc
+
"] ["
+
rfid
+
"] ["
+
realRfid
+
"] ["
+
usedRfidList
+
"] ["
+
updateTime
.
ToLongTimeString
()
+
"]"
;
}
}
public
DateTime
updateTime
=
DateTime
.
Now
;
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
d8c07ab
...
...
@@ -701,22 +701,23 @@ namespace DeviceLibrary
internal
string
GetShelfPosId
(
TrayInfo
tray
)
{
string
targetPosName
=
""
;
if
(
tray
!=
null
)
{
foreach
(
OutShelfBean
obj
in
outShelfBeans
.
Values
)
{
string
targetPosName
=
""
;
if
(
obj
.
IsRightShelf
(
tray
,
out
targetPosName
))
{
//料架对应位置存在的话使用料架对应位置
string
pName
=
targetPosName
+
"_"
+
tray
.
realR
FID
;
string
pName
=
targetPosName
+
"_"
+
tray
.
realR
fid
;
ACStorePosition
position
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
pName
);
if
(
position
==
null
)
{
//判断库位号是否存在
position
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
targetPosName
);
position
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
targetPosName
);
if
(
position
==
null
)
{
LogUtil
.
error
(
Name
+
" "
+
tray
.
ToStr
()
+
" 找到匹配料架,但未找到库位号:"
+
position
);
...
...
@@ -733,7 +734,10 @@ namespace DeviceLibrary
}
}
}
return
targetPosName
;
return
""
;
}
public
void
MsgEvent
(
List
<
Msg
>
msgs
)
...
...
DeviceLibrary/theMachine/MainMachine_PutReel.cs
查看文件 @
d8c07ab
...
...
@@ -43,7 +43,7 @@ namespace DeviceLibrary
//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
))
{
string
ngPos
=
getNextNgPos
(
tray
.
plateW
);
string
ngPos
=
getNextNgPos
(
tray
.
w
);
if
(
ngPos
==
""
)
{
//暂无NG空位
...
...
@@ -54,7 +54,7 @@ namespace DeviceLibrary
{
//送料到NG
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
StoreMoveInfo
.
MoveParam
=
new
ReelParam
(
tray
.
barcode
,
tray
.
plateW
,
tray
.
plageH
,
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
.
log
(
"NG料准备放料:"
+
StoreMoveInfo
.
MoveParam
.
ToStr
());
break
;
}
...
...
@@ -68,14 +68,24 @@ namespace DeviceLibrary
{
//送料到料架
StoreMoveInfo
.
NewMove
(
MoveStep
.
PutReel01_Ready
);
StoreMoveInfo
.
MoveParam
=
new
ReelParam
(
tray
.
barcode
,
tray
.
plateW
,
tray
.
plageH
,
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
.
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
+
"]未找到匹配库位"
,
MsgLevel
.
warning
,
ErrInfo
.
Empty
);
Msg
.
add
(
"["
+
inReel
.
Name
+
"]未找到匹配库位
["
+
tray
.
ToStr
()+
"]
"
,
MsgLevel
.
warning
,
ErrInfo
.
Empty
);
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
}
}
...
...
DeviceLibrary/theMachine/OutShelfBean.cs
查看文件 @
d8c07ab
...
...
@@ -65,22 +65,22 @@ namespace DeviceLibrary
}
if
(
ShelfValid
())
{
if
(
CurrShelf
.
realRFID
.
Equals
(
CurrTray
.
realR
FID
))
if
(
CurrShelf
.
realRFID
.
Equals
(
CurrTray
.
realR
fid
))
{
if
(
String
.
IsNullOrEmpty
(
CurrShelf
.
rfid
))
{
CurrShelf
.
rfid
=
CurrTray
.
rfid
;
LogUtil
.
info
(
Name
+
"增加虚拟料架号绑定:"
+
CurrShelf
.
ToStr
());
}
ShelfPosId
=
Name
+
"_"
+
+
CurrTray
.
shelfP
;
ShelfPosId
=
Name
+
"_"
+
+
CurrTray
.
rfidLoc
;
return
true
;
}
else
if
(
String
.
IsNullOrEmpty
(
CurrTray
.
realR
FID
))
else
if
(
String
.
IsNullOrEmpty
(
CurrTray
.
realR
fid
))
{
if
((!
CurrShelf
.
rfid
.
Equals
(
""
))
&&
CurrShelf
.
rfid
.
Equals
(
CurrTray
.
rfid
))
{
CurrTray
.
realR
FID
=
CurrShelf
.
realRFID
;
ShelfPosId
=
Name
+
"_"
+
+
CurrTray
.
shelfP
;
CurrTray
.
realR
fid
=
CurrShelf
.
realRFID
;
ShelfPosId
=
Name
+
"_"
+
+
CurrTray
.
rfidLoc
;
return
true
;
}
if
(!
String
.
IsNullOrEmpty
(
CurrTray
.
usedRfidList
))
...
...
@@ -95,9 +95,9 @@ namespace DeviceLibrary
if
(
CurrShelf
.
rfid
.
Equals
(
""
))
{
CurrShelf
.
rfid
=
CurrTray
.
rfid
;
CurrTray
.
realR
FID
=
CurrShelf
.
realRFID
;
CurrTray
.
realR
fid
=
CurrShelf
.
realRFID
;
LogUtil
.
info
(
Name
+
"增加虚拟料架号绑定:"
+
CurrShelf
.
ToStr
());
ShelfPosId
=
Name
+
"_"
+
CurrTray
.
shelfP
;
ShelfPosId
=
Name
+
"_"
+
CurrTray
.
rfidLoc
;
return
true
;
}
}
...
...
@@ -133,6 +133,16 @@ namespace DeviceLibrary
}
return
false
;
}
public
bool
HasShelf
()
{
if
(
MoveInfo
.
MoveStep
.
Equals
(
MoveStep
.
Wait
)&&
IOManager
.
IOValue
(
Shelf_Front_Check
).
Equals
(
IO_VALUE
.
LOW
)&&
IOManager
.
IOValue
(
Shelf_Back_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
return
false
;
}
return
true
;
}
public
bool
StartPutReel
()
{
if
(
ShelfReady
())
...
...
TheMachine/app.manifest
查看文件 @
d8c07ab
...
...
@@ -15,8 +15,8 @@
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<
!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />--
>
<
requestedExecutionLevel level="asInvoker" uiAccess="false" /
>
<
requestedExecutionLevel level="requireAdministrator" uiAccess="false" /
>
<
!--<requestedExecutionLevel level="asInvoker" uiAccess="false" />--
>
</requestedPrivileges>
</security>
</trustInfo>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论