Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-VMILineClient
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f18c2fa9
由
LN
编写于
2020-02-14 08:58:41 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
放行料架需要阻挡下降2秒
1 个父辈
b52de064
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
105 行增加
和
35 行删除
dll/Client.dll
dll/Client.xml
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/acVmiLine/VMILineBean.cs
source/DeviceLibrary/acVmiLine/VMILineBean_Partial.cs
source/DeviceLibrary/acVmiLine/WaitUtil.cs
source/DeviceLibrary/agvClient/AgvClient.cs
source/VMILineClient/记录.txt
dll/Client.dll
查看文件 @
f18c2fa
此文件类型无法预览
dll/Client.xml
查看文件 @
f18c2fa
...
...
@@ -230,11 +230,6 @@
</summary>
<param
name=
"s"
></param>
</member>
<member
name=
"E:Asa.Client2.GetRFID"
>
<summary>
服务端发送的RFID
</summary>
</member>
<member
name=
"E:Asa.Client2.Arrive"
>
<summary>
小车到达,仅包装料仓
...
...
@@ -385,12 +380,12 @@
</member>
<member
name=
"F:Asa.ClientAction.MayEnter"
>
<summary>
可以进入料架
(包装料仓)
可以进入料架
,Arrive事件使用,让小车开始对接
</summary>
</member>
<member
name=
"F:Asa.ClientAction.MayLeave"
>
<summary>
可以出去料架
(包装料仓)
可以出去料架
,Arrive事件使用,让小车开始对接
</summary>
</member>
<member
name=
"F:Asa.ClientAction.NeedEnter"
>
...
...
@@ -415,12 +410,12 @@
</member>
<member
name=
"F:Asa.ClientAction.Arrive"
>
<summary>
小车到达
小车到达
,到达包装料仓门口,等待开门
</summary>
</member>
<member
name=
"F:Asa.ClientAction.Ready"
>
<summary>
小车已准备
好
小车已准备
,已对接上流水线
</summary>
</member>
<member
name=
"T:Asa.ClientLevel"
>
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
f18c2fa
...
...
@@ -71,6 +71,7 @@
<Compile Include="acVmiLine\VMILineBean.cs" />
<Compile Include="acVmiLine\VMILineBean_Partial.cs" />
<Compile Include="acVmiLine\RobotManager.cs" />
<Compile Include="acVmiLine\WaitUtil.cs" />
<Compile Include="agvClient\AgvClient.cs" />
<Compile Include="bean\StoreMoveInfo.cs" />
<Compile Include="IO\AIOBOX\AIOBOXManager.cs" />
...
...
source/DeviceLibrary/acVmiLine/VMILineBean.cs
查看文件 @
f18c2fa
using
Asa
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
...
...
@@ -255,7 +256,7 @@ namespace OnlineStore.DeviceLibrary
private
Stopwatch
ol_noshelfWatch
=
new
Stopwatch
();
private
DateTime
ol_lastSendShelfTime
=
DateTime
.
Now
;
private
int
StopDownMS
=
6
00
;
private
int
StopDownMS
=
15
00
;
/// <summary>
/// 出料线体定时处理
/// </summary>
...
...
@@ -288,7 +289,7 @@ namespace OnlineStore.DeviceLibrary
AgvClient
.
NeedEnter
(
Config
.
OutL_AgvName
,
""
);
}
else
{
AgvClient
.
ConnotEnter
(
Config
.
OutL_AgvName
,
""
);
AgvClient
.
SetToNone
(
Config
.
OutL_AgvName
,
""
);
}
}
private
DateTime
il_lastCallAgvTime
=
DateTime
.
Now
.
AddMinutes
(-
5
);
...
...
@@ -302,15 +303,15 @@ namespace OnlineStore.DeviceLibrary
//出口有料架,需要通知agv取走料架
//每次叫小车时间间隔3分钟?
//出口信号需要持续1秒钟
if
(
IOManager
.
IOValue
(
IO_Type
.
InL_OutStopCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
span
.
TotalSeconds
>
18
0
)
if
(
IOManager
.
IOValue
(
IO_Type
.
InL_OutStopCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
span
.
TotalSeconds
>
6
0
)
{
if
(
LineManager
.
checkWatch
(
il_outstopCheckWarch
,
1000
))
{
il_lastCallAgvTime
=
DateTime
.
Now
;
//StopIOMove(IO_Type.InL_OutStopDown, StopDownMS);
LogUtil
.
info
(
" 入库线体出口有料架"
+
LastOutShelfId
+
",呼叫agv小车["
+
Config
.
InL_AgvName
+
"] [NeedLeave] "
);
AgvClient
.
NeedLeave
(
Config
.
InL_AgvName
,
LastOutShelfId
);
LogUtil
.
info
(
" 入库线体出口有料架"
+
LastOutShelfId
+
",呼叫agv小车["
+
Config
.
InL_AgvName
+
"] [NeedLeave] "
);
AgvClient
.
NeedLeave
(
Config
.
InL_AgvName
,
LastOutShelfId
);
}
}
else
if
(
span
.
TotalMilliseconds
>
StopDownMS
)
...
...
@@ -319,7 +320,13 @@ namespace OnlineStore.DeviceLibrary
if
(
IOManager
.
IOValue
(
IO_Type
.
InL_OutStopDown
).
Equals
(
IO_VALUE
.
HIGH
))
{
IOManager
.
IOMove
(
IO_Type
.
InL_OutStopDown
,
IO_VALUE
.
LOW
);
}
}
}
//如果是出口无料架,NeedLeave状态,改为None
if
(
IOManager
.
IOValue
(
IO_Type
.
InL_OutStopCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
AgvClient
.
GetAction
(
Config
.
InL_AgvName
).
Equals
(
ClientAction
.
NeedLeave
))
{
LogUtil
.
info
(
" 入库线体出口无料架 ,更改["
+
Config
.
InL_AgvName
+
"] 状态[None] "
);
AgvClient
.
SetStatus
(
Config
.
InL_AgvName
,
""
,
ClientAction
.
None
);
}
}
...
...
source/DeviceLibrary/acVmiLine/VMILineBean_Partial.cs
查看文件 @
f18c2fa
...
...
@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public
void
StopIOMove
(
string
ioType
,
int
ms
=
6
00
)
public
void
StopIOMove
(
string
ioType
,
int
ms
=
10
00
)
{
Task
.
Factory
.
StartNew
(
delegate
{
...
...
source/DeviceLibrary/acVmiLine/WaitUtil.cs
0 → 100644
查看文件 @
f18c2fa
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
WaitUtil
{
public
delegate
bool
IsOk
();
/// <summary>
/// 使用异步委托检测超时,防止isOk方法不返回结果导致卡死的问题
/// </summary>
/// <param name="waitName"></param>
/// <param name="timeout"></param>
/// <param name="isOk"></param>
public
static
bool
Wait
(
int
timeout
,
IsOk
isOk
,
string
waitName
=
""
)
{
DateTime
startTime
=
System
.
DateTime
.
Now
;
TimeSpan
timoutSpan
=
TimeSpan
.
FromMilliseconds
(
timeout
);
TimeSpan
waitSpan
=
TimeSpan
.
FromMilliseconds
(
0
);
int
sleepTime
=
10
;
while
(
true
)
{
TimeSpan
remainTimes
=
timoutSpan
.
Subtract
(
waitSpan
);
if
(
remainTimes
.
TotalMilliseconds
<
0
)
{
//已经超时
throw
new
TimeoutException
(
waitName
+
"超时"
);
}
try
{
IAsyncResult
re
=
isOk
.
BeginInvoke
(
null
,
null
);
var
waitResult
=
re
.
AsyncWaitHandle
.
WaitOne
(
remainTimes
);
if
(
waitResult
)
{
bool
okResult
=
isOk
.
EndInvoke
(
re
);
if
(
okResult
)
{
return
true
;
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"同步等待出现异常:"
,
ex
);
}
Thread
.
Sleep
(
sleepTime
);
waitSpan
=
System
.
DateTime
.
Now
.
Subtract
(
startTime
);
}
}
}
}
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
f18c2fa
...
...
@@ -72,21 +72,29 @@ namespace OnlineStore.DeviceLibrary
UpdateAction
(
id
,
Asa
.
ClientAction
.
Ready
);
if
(
id
.
Equals
(
LineManager
.
Config
.
OutL_AgvName
))
{
// MayEnter("C2");
if
(
IOManager
.
IOValue
(
IO_Type
.
OutL_InCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
SetStatus
(
id
,
""
,
ClientAction
.
MayEnter
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 调用 MayEnter "
);
Task
.
Factory
.
StartNew
(
delegate
{
//两秒后改为离开状态
Thread
.
Sleep
(
5000
);
SetStatus
(
id
,
""
,
ClientAction
.
FinishEnter
);
Thread
.
Sleep
(
2000
);
SetStatus
(
id
,
""
,
ClientAction
.
MayEnter
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 调用 MayEnter ,等待OutL_InCheck"
);
WaitUtil
.
Wait
(
60000
,
delegate
{
return
IOManager
.
IOValue
(
IO_Type
.
OutL_InCheck
).
Equals
(
IO_VALUE
.
HIGH
);
},
"等待OutL_InCheck=HIGH"
);
if
(
IOManager
.
IOValue
(
IO_Type
.
OutL_InCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
//两秒后改为离开状态
Thread
.
Sleep
(
2000
);
SetStatus
(
id
,
""
,
ClientAction
.
FinishEnter
);
SetStatus
(
id
,
""
,
ClientAction
.
None
);
Thread
.
Sleep
(
2000
);
SetStatus
(
id
,
""
,
ClientAction
.
None
);
}
else
{
LogUtil
.
error
(
"AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 调用 MayEnter ,等待OutL_InCheck超时"
);
}
});
}
}
...
...
@@ -95,16 +103,16 @@ namespace OnlineStore.DeviceLibrary
{
if
(
IOManager
.
IOValue
(
IO_Type
.
InL_OutStopCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
LineManager
.
VMILine
.
StopIOMove
(
IO_Type
.
InL_OutStopDown
);
LineManager
.
VMILine
.
StopIOMove
(
IO_Type
.
InL_OutStopDown
,
2000
);
//agvClient.MayLeave(id);
SetStatus
(
id
,
""
,
ClientAction
.
MayLeave
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] ,下降 InL_OutStopDown
600ms
,调用 MayLeave "
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] ,下降 InL_OutStopDown ,调用 MayLeave "
);
Task
.
Factory
.
StartNew
(
delegate
{
//两秒后改为离开状态
Thread
.
Sleep
(
5
000
);
SetStatus
(
id
,
""
,
ClientAction
.
Finish
Enter
);
Thread
.
Sleep
(
2
000
);
SetStatus
(
id
,
""
,
ClientAction
.
Finish
Leave
);
Thread
.
Sleep
(
2000
);
...
...
@@ -117,9 +125,10 @@ namespace OnlineStore.DeviceLibrary
{
UpdateAction
(
id
,
Asa
.
ClientAction
.
Arrive
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
}
public
static
bool
ConnotEnter
(
string
id
,
string
shelfId
)
public
static
bool
SetToNone
(
string
id
,
string
shelfId
=
""
)
{
ClientAction
currA
=
GetAction
(
id
);
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
FinishLeave
)
||
currA
.
Equals
(
ClientAction
.
FinishEnter
)
||
currA
.
Equals
(
ClientAction
.
NeedLeave
)
||
currA
.
Equals
(
ClientAction
.
NeedEnter
))
...
...
source/VMILineClient/记录.txt
查看文件 @
f18c2fa
\ No newline at end of file
ready是对接上流水线,arrive是在流水线附近等开门,所有节点都会发这两个事件,环形线和vmi只记录arrive的日志
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论