Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
RC1250-FeederLineClient
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 41172313
由
张东亮
编写于
2021-01-12 09:42:51 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
0112
1 个父辈
ca8c4274
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
65 行增加
和
21 行删除
source/DeviceLibrary/acFeederLine/FeederLineBean.cs
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/acFeederLine/FeederLineBean.cs
查看文件 @
4117231
...
@@ -237,7 +237,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -237,7 +237,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
runStatus
.
Equals
(
RunStatus
.
Runing
))
else
if
(
runStatus
.
Equals
(
RunStatus
.
Runing
))
{
{
//
InLineTimerProcess();
InLineTimerProcess
();
OutLineTimerProcess
();
OutLineTimerProcess
();
TranverseTimerProcess
();
TranverseTimerProcess
();
...
@@ -259,10 +259,57 @@ namespace OnlineStore.DeviceLibrary
...
@@ -259,10 +259,57 @@ namespace OnlineStore.DeviceLibrary
InProcess
=
false
;
InProcess
=
false
;
}
}
private
DateTime
il_lastCallAgvTime
=
DateTime
.
Now
.
AddMinutes
(-
5
);
private
Stopwatch
il_outstopCheckWarch
=
new
Stopwatch
();
private
Stopwatch
il_manualCheckWatch
=
new
Stopwatch
();
/// <summary>
/// 入料线体定时处理
/// </summary>
private
void
InLineTimerProcess
()
{
TimeSpan
span
=
DateTime
.
Now
-
il_lastCallAgvTime
;
//出口有料架,需要通知agv取走料架
//每次叫小车时间间隔3分钟?
//出口信号需要持续1秒钟
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
span
.
TotalSeconds
>
60
)
{
if
(
LastOutShelfId
.
Equals
(
"000"
).
Equals
(
false
))
{
if
(
LineManager
.
checkWatch
(
il_outstopCheckWarch
,
1000
))
{
il_lastCallAgvTime
=
DateTime
.
Now
;
//StopIOMove(IO_Type.InL_OutStopDown, StopDownMS);
LogUtil
.
info
(
" 出料线体出口有料架"
+
LastOutShelfId
+
",呼叫agv小车["
+
Config
.
L2_AgvName
+
"] [NeedLeave] "
);
agvClient
.
OutLine_NeedLeave
(
LastOutShelfId
);
}
}
}
else
if
(
span
.
TotalMilliseconds
>
StopDownMS
)
{
il_outstopCheckWarch
.
Stop
();
ClientAction
currA
=
AgvClient
.
GetAction
(
Config
.
L2_AgvName
);
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
NeedLeave
)
||
currA
.
Equals
(
ClientAction
.
NeedEnter
))
{
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_StopDown
).
Equals
(
IO_VALUE
.
HIGH
))
{
IOManager
.
IOMove
(
IO_Type
.
L2_StopDown
,
IO_VALUE
.
LOW
);
}
}
}
//如果是出口无料架,NeedLeave状态,改为None
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
AgvClient
.
GetAction
(
Config
.
L2_AgvName
).
Equals
(
ClientAction
.
NeedLeave
))
{
il_outstopCheckWarch
.
Stop
();
LogUtil
.
info
(
" 出料线体出口无料架 ,更改["
+
Config
.
L2_AgvName
+
"] 状态[None] "
);
agvClient
.
OutLine_RFID
=
""
;
agvClient
.
OutLine_None
(
LastOutShelfId
);
}
}
private
Stopwatch
ol_noshelfWatch
=
new
Stopwatch
();
private
Stopwatch
ol_noshelfWatch
=
new
Stopwatch
();
private
Stopwatch
ol_noshelfWatch1
=
new
Stopwatch
();
private
Stopwatch
ol_noshelfWatch1
=
new
Stopwatch
();
private
Stopwatch
rfidWatch
=
new
Stopwatch
();
private
Stopwatch
rfidWatch
=
new
Stopwatch
();
private
Stopwatch
rfidNoWatch
=
new
Stopwatch
();
private
DateTime
ol_lastSendShelfTime
=
DateTime
.
Now
;
private
DateTime
ol_lastSendShelfTime
=
DateTime
.
Now
;
private
int
StopDownMS
=
1500
;
private
int
StopDownMS
=
1500
;
/// <summary>
/// <summary>
...
@@ -280,10 +327,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -280,10 +327,10 @@ namespace OnlineStore.DeviceLibrary
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_StopCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
span
.
TotalSeconds
>
3
)
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_StopCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
span
.
TotalSeconds
>
3
)
{
{
//如果出料线体出口无料架,放一个料架到出口
//如果出料线体出口无料架,放一个料架到出口
if
(
LineManager
.
checkWatch
(
ol_noshelfWatch
,
1
000
))
if
(
LineManager
.
checkWatch
(
ol_noshelfWatch
,
5
000
))
{
{
IOManager
.
CIOMove
(
IO_Type
.
L2_OutStopDown
,
IO_VALUE
.
LOW
);
IOManager
.
CIOMove
(
IO_Type
.
L2_OutStopDown
,
IO_VALUE
.
LOW
);
LogUtil
.
info
(
"
Feeder2
线体出口无料架,下降 ["
+
IO_Type
.
L2_StopDown
+
"] ["
+
StopDownMS
+
"] 秒"
);
LogUtil
.
info
(
"
出料
线体出口无料架,下降 ["
+
IO_Type
.
L2_StopDown
+
"] ["
+
StopDownMS
+
"] 秒"
);
ol_lastSendShelfTime
=
DateTime
.
Now
;
ol_lastSendShelfTime
=
DateTime
.
Now
;
StopIOMove
(
IO_Type
.
L2_StopDown
,
StopDownMS
);
StopIOMove
(
IO_Type
.
L2_StopDown
,
StopDownMS
);
}
}
...
@@ -296,7 +343,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -296,7 +343,7 @@ namespace OnlineStore.DeviceLibrary
{
{
StopIOMove
(
IO_Type
.
L1_OutStopDown
,
StopDownMS
);
StopIOMove
(
IO_Type
.
L1_OutStopDown
,
StopDownMS
);
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
LogUtil
.
info
(
"
Feeder1
线体出口无料架,下降 ["
+
IO_Type
.
L1_StopDown
+
"] ["
+
StopDownMS
+
"] 秒"
);
LogUtil
.
info
(
"
入料
线体出口无料架,下降 ["
+
IO_Type
.
L1_StopDown
+
"] ["
+
StopDownMS
+
"] 秒"
);
ol_lastSendShelfTime
=
DateTime
.
Now
;
ol_lastSendShelfTime
=
DateTime
.
Now
;
StopIOMove
(
IO_Type
.
L1_StopDown
,
StopDownMS
);
StopIOMove
(
IO_Type
.
L1_StopDown
,
StopDownMS
);
}
}
...
@@ -309,16 +356,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -309,16 +356,6 @@ namespace OnlineStore.DeviceLibrary
IOManager
.
CIOMove
(
IO_Type
.
L1_StopDown
,
IO_VALUE
.
LOW
);
IOManager
.
CIOMove
(
IO_Type
.
L1_StopDown
,
IO_VALUE
.
LOW
);
IOManager
.
CIOMove
(
IO_Type
.
L1_OutStopDown
,
IO_VALUE
.
LOW
);
IOManager
.
CIOMove
(
IO_Type
.
L1_OutStopDown
,
IO_VALUE
.
LOW
);
}
}
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
LineManager
.
checkWatch
(
rfidWatch
,
2000
))
{
agvClient
.
OutLine_NeedLeave
(
LastOutShelfId
);
}
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
LineManager
.
checkWatch
(
rfidNoWatch
,
2000
))
{
agvClient
.
OutLine_RFID
=
""
;
agvClient
.
OutLine_None
(
LastOutShelfId
);
}
}
}
private
Task
TranverseTask
;
private
Task
TranverseTask
;
private
static
void
TranverseProcess
()
private
static
void
TranverseProcess
()
...
@@ -370,9 +407,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -370,9 +407,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
" TranverseProcess Finish"
);
LogUtil
.
info
(
" TranverseProcess Finish"
);
}
}
private
Stopwatch
ol_tranverseShelfWatch
=
new
Stopwatch
();
private
Stopwatch
ol_tranverseShelfWatch
=
new
Stopwatch
();
private
DateTime
il_lastTranverseTime
=
DateTime
.
Now
.
AddMinutes
(-
5
);
private
void
TranverseTimerProcess
()
private
void
TranverseTimerProcess
()
{
{
TimeSpan
span
=
DateTime
.
Now
-
il_last
CallAgv
Time
;
TimeSpan
span
=
DateTime
.
Now
-
il_last
Tranverse
Time
;
//Feeder1出口有料架,Feeder2入口空
//Feeder1出口有料架,Feeder2入口空
//出口信号需要持续6秒钟
//出口信号需要持续6秒钟
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
L2_InCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
span
.
TotalSeconds
>
6
)
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
L2_InCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
span
.
TotalSeconds
>
6
)
...
@@ -382,12 +420,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -382,12 +420,12 @@ namespace OnlineStore.DeviceLibrary
if
(
TranverseTask
==
null
)
if
(
TranverseTask
==
null
)
{
{
TranverseTask
=
Task
.
Factory
.
StartNew
(
new
Action
(
TranverseProcess
));
TranverseTask
=
Task
.
Factory
.
StartNew
(
new
Action
(
TranverseProcess
));
il_last
CallAgv
Time
=
DateTime
.
Now
;
il_last
Tranverse
Time
=
DateTime
.
Now
;
}
}
else
if
(
TranverseTask
.
IsCompleted
)
else
if
(
TranverseTask
.
IsCompleted
)
{
{
TranverseTask
=
Task
.
Factory
.
StartNew
(
new
Action
(
TranverseProcess
));
TranverseTask
=
Task
.
Factory
.
StartNew
(
new
Action
(
TranverseProcess
));
il_last
CallAgv
Time
=
DateTime
.
Now
;
il_last
Tranverse
Time
=
DateTime
.
Now
;
}
}
}
}
...
@@ -397,7 +435,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -397,7 +435,6 @@ namespace OnlineStore.DeviceLibrary
ol_tranverseShelfWatch
.
Stop
();
ol_tranverseShelfWatch
.
Stop
();
}
}
}
}
private
DateTime
il_lastCallAgvTime
=
DateTime
.
Now
.
AddMinutes
(-
5
);
//private void LedProcess()
//private void LedProcess()
//{
//{
...
...
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
4117231
...
@@ -127,7 +127,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -127,7 +127,7 @@ namespace OnlineStore.DeviceLibrary
}
}
//五秒后改为离开状态
//五秒后改为离开状态
Thread
.
Sleep
(
5
000
);
Thread
.
Sleep
(
10
000
);
Feeder_In_Msg
=
"Feeder In: 调用 FinishEnter "
;
Feeder_In_Msg
=
"Feeder In: 调用 FinishEnter "
;
LogUtil
.
info
(
Feeder_In_Msg
);
LogUtil
.
info
(
Feeder_In_Msg
);
FinishEnter
(
InLine_Name
);
FinishEnter
(
InLine_Name
);
...
@@ -329,7 +329,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -329,7 +329,14 @@ namespace OnlineStore.DeviceLibrary
}
}
return
agvClient
.
IsConn
;
return
agvClient
.
IsConn
;
}
}
public
static
ClientAction
GetAction
(
string
NodeName
)
{
if
(
actionMap
.
ContainsKey
(
NodeName
))
{
return
actionMap
[
NodeName
];
}
return
ClientAction
.
None
;
}
public
void
Dispose
()
public
void
Dispose
()
{
{
try
try
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论