Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1e5c7724
由
LN
编写于
2020-02-18 11:35:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加doorclose事件
1 个父辈
326a69ea
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
67 行增加
和
15 行删除
dll/Client.dll
dll/Client.xml
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Shelf.cs
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
dll/Client.dll
查看文件 @
1e5c772
此文件类型无法预览
dll/Client.xml
查看文件 @
1e5c772
...
...
@@ -240,6 +240,11 @@
小车已准备,对接完成
</summary>
</member>
<member
name=
"E:Asa.Client2.CloseDoor"
>
<summary>
关门
</summary>
</member>
<member
name=
"E:Asa.Client2.Log"
>
<summary>
日志
...
...
@@ -371,6 +376,11 @@
没有动作
</summary>
</member>
<member
name=
"F:Asa.ClientAction.CloseDoor"
>
<summary>
包装料仓关门
</summary>
</member>
<member
name=
"F:Asa.ClientAction.MayEnter"
>
<summary>
可以进入料架,Arrive事件使用,让小车开始对接
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean.cs
查看文件 @
1e5c772
...
...
@@ -262,11 +262,11 @@ namespace OnlineStore.DeviceLibrary
//开始复位动作
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H01_InOutBack
);
LogInfo
(
MoveInfo
.
MoveType
+
": 开始料架入库,线体停止,进出轴先原点返回,设置agv
状态
为None"
);
LogInfo
(
MoveInfo
.
MoveType
+
": 开始料架入库,线体停止,进出轴先原点返回,设置agv
"
+
Config
.
AgvNodeName
+
"
为None"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
LineStop
();
ACAxisHomeMove
(
Config
.
InOut_Axis
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
}
/// <summary>
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
查看文件 @
1e5c772
...
...
@@ -139,6 +139,17 @@ namespace OnlineStore.DeviceLibrary
//}
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W011_DoorCloseEvent
))
{
if
(
AgvClient
.
closeDoorTimeMap
.
ContainsKey
(
Config
.
AgvNodeName
))
{
DateTime
time
=
AgvClient
.
closeDoorTimeMap
[
Config
.
AgvNodeName
];
if
(
time
>=
MoveInfo
.
LastSetpTime
)
{
wait
.
IsEnd
=
true
;
}
}
}
if
(
wait
.
IsEnd
)
{
if
(
MoveInfo
.
OneWaitCanEndStep
)
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Shelf.cs
查看文件 @
1e5c772
...
...
@@ -58,7 +58,7 @@ namespace OnlineStore.DeviceLibrary
//{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_03_LineRun
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"调用AgvClient.MayEnter,线体正转,等待LineIn_Check信号"
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
""
,
ClientAction
.
MayEnter
,
ClientLevel
.
High
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
""
,
ClientAction
.
MayEnter
,
ClientLevel
.
High
,
true
);
LineRun
();
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LineIn_Check
,
IO_VALUE
.
HIGH
));
}
...
...
@@ -71,7 +71,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_05_LineStop
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"调用AgvClient.FinishEnter,取料位检测到信号,停止线体正转"
);
LineStop
();
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
""
,
ClientAction
.
FinishEnter
,
ClientLevel
.
High
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
""
,
ClientAction
.
FinishEnter
,
ClientLevel
.
High
,
true
);
if
(!
instoreShelf
)
{
...
...
@@ -203,7 +203,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
180000
));
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":再次调用 NeedLeave["
+
CurrShelfID
+
"],等待Agv "
+
Config
.
AgvNodeName
+
" Arrive ,最多等待180000"
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
CurrShelfID
,
ClientAction
.
NeedLeave
,
ClientLevel
.
Low
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
CurrShelfID
,
ClientAction
.
NeedLeave
,
ClientLevel
.
Low
,
true
);
//等待agv到达
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAgvAction
((
int
)
ClientAction
.
Arrive
));
}
...
...
@@ -231,7 +231,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_05_WaitReady
);
MoveInfo
.
TimeOutSeconds
=
120
;
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":移门已打开,调用MayLeave["
+
CurrShelfID
+
"],等待agv "
+
Config
.
AgvNodeName
+
" Ready"
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
CurrShelfID
,
ClientAction
.
MayLeave
,
ClientLevel
.
High
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
CurrShelfID
,
ClientAction
.
MayLeave
,
ClientLevel
.
High
,
true
);
//等待agv到达
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAgvAction
((
int
)
ClientAction
.
Ready
));
...
...
@@ -253,8 +253,8 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BS_07_WaitInLineSingle
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_08_WaitTime
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":再转动
3000时间
, 等待入料口无信号"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
30
00
));
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":再转动
1000
, 等待入料口无信号"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1
00
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LineIn_Check
,
IO_VALUE
.
LOW
));
//等到agv离开
//MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction(AGVAction.FinishOut));
...
...
@@ -262,9 +262,11 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BS_08_WaitTime
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_09_WaitAGVLeave
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":同时等待 AGV离开,最多等待5000 "
);
MoveInfo
.
TimeOutSeconds
=
180
;
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":等待DoorClose事件,最多等待180000 "
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
180000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitDoorClose
());
//MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction(action.FinishOut));
}
...
...
@@ -272,7 +274,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_10_CloseDoor
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":停止线体转动,关闭仓门 ,发送FinishLeave ,等待最少5000"
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
CurrShelfID
,
ClientAction
.
FinishLeave
,
ClientLevel
.
High
);
AgvClient
.
SetStatus
(
Config
.
AgvNodeName
,
""
,
CurrShelfID
,
ClientAction
.
FinishLeave
,
ClientLevel
.
High
,
true
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
LineStop
();
DoorBean
.
StartClose
(
MoveInfo
);
...
...
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
1e5c772
...
...
@@ -25,9 +25,8 @@ namespace OnlineStore.DeviceLibrary
agvClient
=
new
Asa
.
Client2
(
ServerIp
);
agvClient
.
Log
+=
AgvClient_Log
;
agvClient
.
Arrive
+=
AgvClient_Arrive
;
// agvClient.CanEnter += AgvClient_CanEnter;
agvClient
.
Ready
+=
AgvClient_Ready
;
// agvClient.GetRFID += AgvClient_GetRFID
;
agvClient
.
CloseDoor
+=
AgvClient_CloseDoor
;
}
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
foreach
(
string
key
in
NodeList
)
...
...
@@ -47,11 +46,25 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"初始化agvClient "
+
ServerIp
+
" 出错:"
+
ex
.
ToString
());
}
}
public
static
void
SetStatus
(
string
id
,
string
mark
=
""
,
string
shelfId
=
""
,
ClientAction
action
=
ClientAction
.
None
,
ClientLevel
level
=
ClientLevel
.
Low
)
public
static
Dictionary
<
string
,
DateTime
>
closeDoorTimeMap
=
new
Dictionary
<
string
,
DateTime
>();
private
static
void
AgvClient_CloseDoor
(
string
id
,
byte
[]
content
)
{
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_CloseDoor ["
+
id
+
"] ["
+
data
.
NumStr
()
+
"] "
);
if
(
closeDoorTimeMap
.
ContainsKey
(
id
))
{
closeDoorTimeMap
.
Remove
(
id
);
}
closeDoorTimeMap
.
Add
(
id
,
DateTime
.
Now
);
}
public
static
void
SetStatus
(
string
id
,
string
mark
=
""
,
string
shelfId
=
""
,
ClientAction
action
=
ClientAction
.
None
,
ClientLevel
level
=
ClientLevel
.
Low
,
bool
isMust
=
false
)
{
ClientAction
currA
=
GetAction
(
id
);
//相同状态就设置一次
if
(
currA
.
Equals
(
action
))
if
(
currA
.
Equals
(
action
)
&&(!
isMust
)
)
{
return
;
}
...
...
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
1e5c772
...
...
@@ -274,6 +274,12 @@ namespace OnlineStore.DeviceLibrary
wait
.
AgvAction
=
arrive
;
return
wait
;
}
public
static
WaitResultInfo
WaitDoorClose
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
WaitEnum
.
W011_DoorCloseEvent
;
return
wait
;
}
public
string
ToStr
()
{
if
(
WaitType
.
Equals
(
WaitEnum
.
W001_AxisMove
))
...
...
@@ -320,6 +326,9 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
WaitType
.
Equals
(
WaitEnum
.
W010_AgvStatus
))
{
return
"Agv状态:"
+
AgvAction
;
}
else
if
(
WaitType
.
Equals
(
WaitEnum
.
W011_DoorCloseEvent
))
{
return
"Agv状态:DoorClose"
;
}
else
{
...
...
@@ -373,6 +382,8 @@ namespace OnlineStore.DeviceLibrary
public
bool
IsEnd
{
get
;
set
;
}
public
int
AgvAction
=
0
;
}
internal
class
WaitEnum
{
...
...
@@ -416,6 +427,11 @@ namespace OnlineStore.DeviceLibrary
/// Agv状态
/// </summary>
internal
static
int
W010_AgvStatus
=
10
;
/// <summary>
/// 等待agvDoorClose事件
/// </summary>
internal
static
int
W011_DoorCloseEvent
=
11
;
}
public
enum
StoreMoveType
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论