Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
顾剑亮
/
AGVControl-Qisda-ProductionLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 85238ee5
由
张东亮
编写于
2020-12-05 13:26:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
添加风淋门
1 个父辈
54be25c3
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
519 行增加
和
259 行删除
.vs/AGVControl-ProductionLine/v16/.suo
AGVControl-ProductionLine/BLL/Common.cs
AGVControl-ProductionLine/bean/job/ChargeJob.cs
AGVControl-ProductionLine/bean/job/EmptyAGVBackJob.cs
AGVControl-ProductionLine/bean/job/EmptyShelfBackJob.cs
AGVControl-ProductionLine/bean/job/GoEmptyShelfLineJob.cs
AGVControl-ProductionLine/bean/job/GoFullShelfStationJob.cs
AGVControl-ProductionLine/bean/job/SendFullShelfToLineJob.cs
AGVControl-ProductionLine/bean/node/DoubleLineNodeFor4C.cs
AGVControl-ProductionLine/bean/node/DoubleLineNodeFor4D.cs
AGVControl-ProductionLine/bin/Debug/AGVControl-ProductionLine.exe
AGVControl-ProductionLine/bin/Debug/AGVControl-ProductionLine.pdb
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.exe
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.pdb
.vs/AGVControl-ProductionLine/v16/.suo
查看文件 @
85238ee
此文件类型无法预览
AGVControl-ProductionLine/BLL/Common.cs
查看文件 @
85238ee
...
...
@@ -24,6 +24,8 @@ namespace AGVControl
public
const
string
CheckShelf
=
"CheckShelf"
;
public
const
string
DoorDToC
=
"DoorDToC"
;
public
const
string
DoorCToD
=
"DoorCToD"
;
public
const
string
DoorAirIn
=
"DoorAirIn"
;
public
const
string
DoorAirOut
=
"DoorAirOut"
;
public
const
string
DoubleLine_Name_Prefix
=
"A"
;
public
const
string
Wait
=
"Wait"
;
public
const
string
Done
=
"Done"
;
...
...
@@ -67,6 +69,8 @@ namespace AGVControl
public
const
string
IP_4D_Light
=
"IP_4D_Light"
;
public
const
string
IP_4C_Light
=
"IP_4C_Light"
;
public
const
string
Lines_In_Air_Door
=
"C8,C9,C10"
;
}
...
...
@@ -559,7 +563,15 @@ namespace AGVControl
agv
.
Place
=
doorName
;
return
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
SettingString
.
Move
+
doorName
]);
}
/// <summary>
/// 检查是否在4C风淋门内
/// </summary>
/// <param name="nodeName"></param>
/// <returns></returns>
public
static
bool
CheckIsInAirDoor
(
string
nodeName
)
{
return
SettingString
.
Lines_In_Air_Door
.
Contains
(
nodeName
);
}
/// <summary>
/// 检查当前任务是否结束
/// </summary>
...
...
@@ -596,11 +608,10 @@ namespace AGVControl
/// <param name="nodeName">出空料架的节点名</param>
/// <param name="emptyAGVbACK">agv空车返回,带一个料架</param>
/// <returns></returns>
public
static
bool
FindEmptyShelfNode
(
Agv_Info
agv
,
out
string
nodeName
,
out
string
rfid
,
bool
emptyAGVbACK
=
false
)
public
static
bool
FindEmptyShelfNode
(
Agv_Info
agv
,
out
string
nodeName
,
bool
emptyAGVbACK
=
false
)
{
nodeName
=
""
;
rfid
=
""
;
if
(!
Common
.
CheckCanExecuteMission
(
agv
))
return
false
;
...
...
@@ -614,14 +625,6 @@ namespace AGVControl
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
FullShelfDestInfo
.
location
)
&&
s
.
EmptyShelfCnt
>
0
);
if
(
idx
>
-
1
)
{
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
LogInfo
(
warnMsg
);
return
true
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
if
(
FullShelfDestInfo
.
location
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
{
nodeName
=
FullShelfDestInfo
.
location
;
...
...
@@ -661,14 +664,6 @@ namespace AGVControl
if
(
idx
>
-
1
)
{
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
LogInfo
(
warnMsg
);
return
true
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
if
(
loc
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
{
nodeName
=
loc
;
...
...
@@ -701,15 +696,6 @@ namespace AGVControl
{
return
false
;
}
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
nearNodeName
));
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
LogInfo
(
warnMsg
);
return
true
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
nearNodeName
;
Common
.
log
.
Debug
(
agv
.
Name
+
" 双层线需要小料架,准备去4C-"
+
nearNodeName
);
return
true
;
...
...
@@ -723,15 +709,6 @@ namespace AGVControl
{
return
false
;
}
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
nearNodeName
));
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
LogInfo
(
warnMsg
);
return
true
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
nearNodeName
;
Common
.
log
.
Debug
(
agv
.
Name
+
" 双层线需要小料架,准备去4D-"
+
nearNodeName
);
return
true
;
...
...
@@ -753,15 +730,6 @@ namespace AGVControl
string
nearNodeName
=
CalculateNearNode
(
agv
,
SettingString
.
C4_Name_Prefix
);
if
(!
nearNodeName
.
Equals
(
""
))
{
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
nearNodeName
));
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
LogInfo
(
warnMsg
);
return
true
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
nearNodeName
;
Common
.
log
.
Debug
(
agv
.
Name
+
" 双层线需要小料架,准备去4C-"
+
nearNodeName
);
return
true
;
...
...
@@ -775,15 +743,6 @@ namespace AGVControl
string
nearNodeName
=
CalculateNearNode
(
agv
,
SettingString
.
D4_Name_Prefix
);
if
(!
nearNodeName
.
Equals
(
""
))
{
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
nearNodeName
));
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
LogInfo
(
warnMsg
);
return
true
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
nearNodeName
;
Common
.
log
.
Debug
(
agv
.
Name
+
" 双层线需要小料架,准备去4D-"
+
nearNodeName
);
return
true
;
...
...
@@ -802,8 +761,6 @@ namespace AGVControl
int
idx1
=
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
EnterLeaveShelfJob
&&
((
EnterLeaveShelfJob
)
s
.
CurJob
).
LineName
.
Equals
(
SettingString
.
C4FeederOut
));
if
(
idx1
==
-
1
)
{
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
nodeInfo
[
idx
].
Name
;
Common
.
log
.
Debug
(
agv
.
Name
+
" 双层线右侧需要料架,准备去4C-"
+
nodeName
);
return
true
;
...
...
@@ -814,11 +771,9 @@ namespace AGVControl
//4D车间备料区寻找
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
{
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
EmptyShelfCnt
>
0
&&
s
.
Name
.
Equals
(
SettingString
.
D4FeederOut
)
&&
!
s
.
RFID
.
StartsWith
(
"0"
)&&
s
.
IsUse
);
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
EmptyShelfCnt
>
0
&&
s
.
Name
.
Equals
(
SettingString
.
D4FeederOut
)
&&
!
s
.
RFID
.
StartsWith
(
"0"
)
&&
s
.
IsUse
);
if
(
idx
>
-
1
)
{
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
nodeInfo
[
idx
].
Name
;
Common
.
log
.
Debug
(
agv
.
Name
+
" 双层线右侧需要料架,准备去4D-"
+
nodeName
);
return
true
;
...
...
@@ -879,10 +834,9 @@ namespace AGVControl
/// </summary>
/// <param name="agv"></param>
/// <returns></returns>
public
static
bool
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
,
out
string
rfid
)
public
static
bool
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
)
{
nodeName
=
""
;
rfid
=
""
;
int
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
SettingString
.
A6
)
&&
(
s
.
StateEquals
(
eNodeStatus
.
NeedEnterLeave
)
||
(
s
.
StateEquals
(
eNodeStatus
.
NeedLeave
)))
&&
!
s
.
RFID
.
Equals
(
""
)
&&
s
.
IsUse
);
if
(
idx
>
-
1
)
...
...
@@ -892,14 +846,6 @@ namespace AGVControl
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
FullShelfDestInfo
.
location
)
&&
s
.
EmptyShelfCnt
>
0
&&
s
.
IsUse
);
if
(
idx
>
-
1
)
{
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
LogInfo
(
warnMsg
);
return
true
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
FullShelfDestInfo
.
location
;
Common
.
GetLineNameByNodeName
(
nodeName
,
out
string
line
);
Common
.
log
.
Debug
(
"A6出满料架的产线有空料架,优先处理 "
+
FullShelfDestInfo
.
ShowInfo
(
line
));
...
...
@@ -918,6 +864,26 @@ namespace AGVControl
return
false
;
}
/// <summary>
/// 检查接驳台状态
/// </summary>
/// <returns></returns>
public
static
bool
CheckStationState
(
ClientNode
clientNode
,
out
string
rfid
)
{
rfid
=
""
;
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
clientNode
.
Name
).
Contains
(
clientNode
.
RFID
))
{
// if (warnMsg.Equals(""))
{
warnMsg
=
string
.
Format
(
"料架[{0}]在接驳台[{1}]最外侧,但没有解绑信息,请检查"
,
clientNode
.
RFID
,
clientNode
.
Name
);
Common
.
LogInfo
(
warnMsg
);
}
return
false
;
}
rfid
=
clientNode
.
RFID
;
warnMsg
=
""
;
return
true
;
}
/// <summary>
/// 计算当前小车距离最近的任务点(只针对产线)
/// </summary>
/// <param name="agv"></param>
...
...
AGVControl-ProductionLine/bean/job/ChargeJob.cs
查看文件 @
85238ee
...
...
@@ -49,23 +49,29 @@ namespace AGVControl
{
string
msg
=
agv
.
Name
+
" "
;
bool
rtn
=
false
;
runInfo
=
""
;
agv
.
Msg
=
runInfo
;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
agv
.
Msg
=
"充电任务:"
+
runInfo
;
//runInfo = "充电任务:";
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
ChargeStep
.
IsStep
(
CHARGE_STEP
.
NONE
))
{
if
(
agv
.
Battery
>
Common
.
chargeStatus
.
chargeMax
)
{
if
(
agv
.
Place
.
Equals
(
SettingString
.
Standby
))
//在待机位不操作
if
(
agv
Place
.
Equals
(
SettingString
.
Standby
)
||
agvPlace
.
Equals
(
""
))
//在待机位不操作
{
ChargeStep
.
ToNextStep
(
CHARGE_STEP
.
END
);
runInfo
=
"在待机位,电量充足["
+
agv
.
Battery
+
"%],等待任务"
;
msg
+=
runInfo
;
ChargeStep
.
Msg
=
msg
;
}
else
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
Common
.
CheckIsInAirDoor
(
agvPlace
))
{
ChargeStep
.
ToNextStep
(
CHARGE_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"电量充足["
+
agv
.
Battery
+
"%],从当前位置"
+
agvPlace
+
"回到待机位,先过4C风淋门"
;
msg
+=
runInfo
;
ChargeStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
ChargeStep
.
ToNextStep
(
CHARGE_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
...
...
@@ -89,7 +95,17 @@ namespace AGVControl
}
else
{
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
Common
.
CheckIsInAirDoor
(
agvPlace
))
{
ChargeStep
.
ToNextStep
(
CHARGE_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"电量["
+
agv
.
Battery
+
"%]小于最大电量["
+
Common
.
chargeStatus
.
chargeMax
+
"%],从当前位置"
+
agvPlace
+
"回到充电位,先过4C风淋门"
;
msg
+=
runInfo
;
ChargeStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
ChargeStep
.
ToNextStep
(
CHARGE_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"电量["
+
agv
.
Battery
+
"%]小于最大电量["
+
Common
.
chargeStatus
.
chargeMax
+
"%],从当前位置"
+
agvPlace
+
"回到充电位,先到4D门"
;
...
...
@@ -123,7 +139,18 @@ namespace AGVControl
}
}
else
if
(
ChargeStep
.
IsStep
(
CHARGE_STEP
.
WAIT_AGV_REACH_AIR_DOOR
))
{
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorAirOut
,
CurTaskState
))
{
ChargeStep
.
ToNextStep
(
CHARGE_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"电量充足["
+
agv
.
Battery
+
"%],从当前位置"
+
agvPlace
+
"回到待机位,先到4D门"
;
msg
+=
runInfo
;
ChargeStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
if
(
ChargeStep
.
IsStep
(
CHARGE_STEP
.
WAIT_AGV_REACH_4D_DOOR
))
{
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorCToD
,
CurTaskState
))
...
...
@@ -166,7 +193,7 @@ namespace AGVControl
if
(
Common
.
CheckTaskFinished
(
agv
,
CurTaskName
))
{
ChargeStep
.
ToNextStep
(
CHARGE_STEP
.
WAIT_REACH_CHARGE_OK
);
runInfo
=
"充电任务分配完成,去充电
且
等待任务"
;
runInfo
=
"充电任务分配完成,去充电
并
等待任务"
;
msg
+=
runInfo
;
ChargeStep
.
Msg
=
msg
;
}
...
...
@@ -213,20 +240,12 @@ namespace AGVControl
Job
job
=
Common
.
control
.
GetJob
(
agv
);
if
(
job
!=
null
&&
!(
job
is
ChargeJob
))
{
runInfo
=
"充电过程检测到任务,电量["
+
agv
.
Battery
+
"%]大于最小电量["
+
Common
.
chargeStatus
.
chargeMin
+
"%],中断充电执行任务"
;
runInfo
=
"充电过程
中
检测到任务,电量["
+
agv
.
Battery
+
"%]大于最小电量["
+
Common
.
chargeStatus
.
chargeMin
+
"%],中断充电执行任务"
;
msg
+=
runInfo
;
ChargeStep
.
Msg
=
msg
;
Common
.
chargeStatus
.
ClearRandomChargeInfo
(
agv
);
return
job
;
}
//else if (job == null && agv.Battery < Common.chargeStatus.chargeMax / 2)
//{
// ChargeStep.ToNextStep(CHARGE_STEP.NONE);
// runInfo = "在待机位暂无任务,且当前电量小于" + Common.chargeStatus.chargeMax / 2 + "%,去充电位";
// msg += runInfo;
// ChargeStep.Msg = msg;
// Common.chargeStatus.ClearRandomChargeInfo(agv);
//}
}
}
...
...
@@ -291,7 +310,10 @@ namespace AGVControl
///
/// </summary>
NONE
,
/// <summary>
/// 等待到达风淋门
/// </summary>
WAIT_AGV_REACH_AIR_DOOR
,
/// <summary>
/// 等待到达4D门
/// </summary>
...
...
AGVControl-ProductionLine/bean/job/EmptyAGVBackJob.cs
查看文件 @
85238ee
...
...
@@ -51,30 +51,71 @@ namespace AGVControl
{
string
msg
=
agv
.
Name
+
" "
;
bool
rtn
=
false
;
agv
.
Msg
=
runInfo
;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
agv
.
Msg
=
"返回任务:"
+
runInfo
;
// runInfo = "返回任务:";
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
EmptyAGVBackStep
.
IsStep
(
EMPTY_AGV_BACK_STEP
.
NONE
))
{
if
(
Common
.
FindEmptyShelfNode
(
agv
,
out
string
nodeName
,
out
string
rfid
,
true
))
if
(
Common
.
FindEmptyShelfNode
(
agv
,
out
string
nodeName
,
true
))
{
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
s
.
CurJob
).
EmptyShelfPlace
.
Equals
(
nodeName
));
if
(
i
==
-
1
)
if
(
i
==
-
1
)
{
runInfo
=
"小车在产线 "
+
agvPlace
+
" 准备返回时检测到 "
+
nodeName
+
" 有空料架"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
GoEmptyShelfLineJob
(
agvPlace
,
nodeName
,
rfid
);
ClientNode
clientNode
=
Common
.
nodeInfo
.
Find
(
s
=>
s
.
Name
.
Equals
(
nodeName
));
if
(
Common
.
CheckStationState
(
clientNode
,
out
string
rfid
))
{
runInfo
=
"小车在产线 "
+
agvPlace
+
" 准备返回时检测到 "
+
nodeName
+
" 有空料架"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
GoEmptyShelfLineJob
(
agvPlace
,
nodeName
,
rfid
);
}
else
{
if
(
Common
.
CheckIsInAirDoor
(
agvPlace
))
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先过4C风淋门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_REACH_STANDBY
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
}
else
{
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
if
(
Common
.
CheckIsInAirDoor
(
agvPlace
))
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先过4C风淋门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
...
...
@@ -83,22 +124,30 @@ namespace AGVControl
else
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_REACH_STANDBY
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位"
;
msg
+=
runInfo
;
runInfo
=
"从产线"
+
agvPlace
+
"回待机位"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
//EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.END);
}
else
{
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
if
(
Common
.
CheckIsInAirDoor
(
agvPlace
))
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先过4C风淋门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
...
...
@@ -107,7 +156,7 @@ namespace AGVControl
else
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_REACH_STANDBY
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位"
;
runInfo
=
"从产线"
+
agvPlace
+
"回待机位"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
...
...
@@ -118,19 +167,19 @@ namespace AGVControl
else
if
(
EmptyAGVBackStep
.
IsStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_REACH_STANDBY
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
Standby
,
CurTaskState
))
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
Standby
,
CurTaskState
))
{
Job
job
=
Common
.
control
.
GetJob
(
agv
);
if
(
job
==
null
&&
agv
.
Battery
<
Common
.
chargeStatus
.
chargeMax
)
{
runInfo
=
"到达待机位,电量["
+
agv
.
Battery
+
"]小于最大电量["
+
Common
.
chargeStatus
.
chargeMax
+
"],暂无任务,去充电"
;
runInfo
=
"到达待机位,电量["
+
agv
.
Battery
+
"]小于最大电量["
+
Common
.
chargeStatus
.
chargeMax
+
"],暂无任务,去充电"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
ChargeJob
(
""
);
}
else
{
runInfo
=
"到达待机位,检测到新任务,执行任务"
;
runInfo
=
"到达待机位,检测到新任务,执行任务"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
job
;
...
...
@@ -141,31 +190,27 @@ namespace AGVControl
{
if
(
Common
.
FindFullShelfTask
(
agv
))
{
runInfo
=
"从产线"
+
agvPlace
+
"回待机位过程中,检测到A6出满料,去A6"
;
runInfo
=
"从产线"
+
agvPlace
+
"回待机位过程中,检测到A6出满料,去A6"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
GoFullShelfStationJob
(
SettingString
.
Standby
);
}
//else
//{
// msg = "从产线" + agvPlace + "到达4D门,暂无任务,去充电位";
// EmptyAGVBackStep.Msg = msg;
// return new ChargeJob(SettingString.D4_DOOR_Name);
//}
}
}
//else if (EmptyAGVBackStep.IsStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_4D_DOOR))
//{
// CurTaskState = Common.GetTakJobState(CurTaskID);
// if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
// {
// EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.WAIT_REACH_STANDBY);
// runInfo = "从产线" + agvPlace + "回待机位";
// msg += runInfo;
// EmptyAGVBackStep.Msg = msg;
// }
//}
else
if
(
EmptyAGVBackStep
.
IsStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_AIR_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorAirOut
,
CurTaskState
))
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
if
(
EmptyAGVBackStep
.
IsStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_4D_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
...
...
@@ -180,7 +225,7 @@ namespace AGVControl
}
else
{
runInfo
=
"从产线"
+
agvPlace
+
"到达4D门,暂无任务,去充电位"
;
runInfo
=
"从产线"
+
agvPlace
+
"到达4D门,暂无任务,去充电位"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
ChargeJob
(
SettingString
.
DoorCToD
);
...
...
@@ -189,8 +234,6 @@ namespace AGVControl
}
return
this
;
}
/// <summary>
/// AGV回收空料架流程
/// </summary>
...
...
@@ -200,7 +243,10 @@ namespace AGVControl
/// 查询任务
/// </summary>
NONE
,
/// <summary>
/// 等待到达4C风淋门
/// </summary>
WAIT_AGV_REACH_AIR_DOOR
,
/// <summary>
/// 等待到达4D门
/// </summary>
...
...
AGVControl-ProductionLine/bean/job/EmptyShelfBackJob.cs
查看文件 @
85238ee
...
...
@@ -62,16 +62,23 @@ namespace AGVControl
{
string
msg
=
agv
.
Name
+
" "
;
bool
rtn
=
false
;
agv
.
Msg
=
runInfo
;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
agv
.
Msg
=
"空料架返回:"
+
runInfo
;
//runInfo = "空料架返回:";
if
(
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
NONE
))
{
if
(
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4C车间
if
(
Common
.
CheckIsInAirDoor
(
EmptyShelfPlace
))
//4C车间
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"从产线["
+
EmptyShelfPlace
+
"]前往4C风淋门"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4C车间
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_DOOR
);
runInfo
=
"空料架从产线"
+
EmptyShelfPlace
+
"
前往4D门"
;
runInfo
=
"从产线["
+
EmptyShelfPlace
+
"]
前往4D门"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
...
...
@@ -83,7 +90,7 @@ namespace AGVControl
{
EmptyShelfTargetPlace
=
nodeName
;
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
runInfo
=
"空料架从产线 ["
+
EmptyShelfPlace
+
"]
送往双层线"
+
EmptyShelfTargetPlace
;
runInfo
=
"从产线 ["
+
EmptyShelfPlace
+
"]
送往双层线"
+
EmptyShelfTargetPlace
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
if
(!
EmptyShelfTargetPlace
.
Equals
(
""
))
...
...
@@ -91,12 +98,12 @@ namespace AGVControl
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_STANDBY
);
runInfo
=
"双层线暂不需要空料架,从产线["
+
EmptyShelfPlace
+
"]到待机位"
;
runInfo
=
"双层线暂不需要空料架,从产线["
+
EmptyShelfPlace
+
"]到待机位"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
...
...
@@ -104,6 +111,19 @@ namespace AGVControl
}
}
}
else
if
(
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_AIR_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorAirOut
,
CurTaskState
))
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_DOOR
);
runInfo
=
"出风淋门,前往4D门"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
if
(
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
...
...
@@ -113,7 +133,7 @@ namespace AGVControl
{
EmptyShelfTargetPlace
=
nodeName
;
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
runInfo
=
"空料架从产线 ["
+
EmptyShelfPlace
+
"]
送往双层线"
+
EmptyShelfTargetPlace
;
runInfo
=
"进4D门,
送往双层线"
+
EmptyShelfTargetPlace
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
...
...
@@ -122,7 +142,7 @@ namespace AGVControl
else
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_STANDBY
);
runInfo
=
"双层线暂不需要空料架,从产线["
+
EmptyShelfPlace
+
"]
到待机位"
;
runInfo
=
"进4D门,双层线暂不需要空料架,
到待机位"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
...
...
@@ -137,7 +157,7 @@ namespace AGVControl
{
EmptyShelfTargetPlace
=
nodeName
;
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
runInfo
=
"待机位检测到双层线需要料架,送往双层线 "
+
EmptyShelfTargetPlace
;
runInfo
=
"待机位检测到双层线需要料架,送往双层线 "
+
EmptyShelfTargetPlace
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
...
...
@@ -149,11 +169,8 @@ namespace AGVControl
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckTaskFinished
(
agv
,
EmptyShelfTargetPlace
,
CurTaskState
)
&&
EmptyShelfTargetPlace
.
StartsWith
(
"A"
))
{
//msg = "AGV到达 " + EmptyShelfTargetPlace;
//EmptyBackStep.Msg = msg;
//return new EnterLeaveShelfJob(EmptyShelfTargetPlace,eEnterLeaveType.Leave,shelfType);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_DOUBLE_LINE_RESPONSE
);
runInfo
=
"AGV到达 "
+
EmptyShelfTargetPlace
+
",并发送入料架请求[ReadyEnter]"
;
runInfo
=
"AGV到达 "
+
EmptyShelfTargetPlace
+
",并发送入料架请求[ReadyEnter]"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
server
.
ReadyEnter
(
EmptyShelfTargetPlace
);
...
...
@@ -165,7 +182,7 @@ namespace AGVControl
ClientNode
node
=
Common
.
nodeInfo
[
id
];
if
(
node
.
StateEquals
(
eNodeStatus
.
MayEnter
))
{
if
(!
agv
.
CurTaskName
.
Equals
(
"Leave"
))
if
(!
agv
.
CurTaskName
.
Equals
(
"Leave"
))
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT__EMPTY_SHELF_IN_DOUBLE_LINE
);
runInfo
=
"收到双层线入料架请求[ReadyEnter]的响应 "
+
EmptyShelfTargetPlace
+
"入料架,小车链条运行"
;
...
...
@@ -179,57 +196,34 @@ namespace AGVControl
else
if
(
EmptyBackStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
{
tryTimes
++;
if
(
tryTimes
<
5
)
if
(
tryTimes
<
3
)
return
this
;
// if(EmptyShelfTargetPlace.Equals(SettingString.A6))
// {
tryTimes
=
0
;
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_STANDBY
);
runInfo
=
"双层线"
+
EmptyShelfTargetPlace
+
"暂不需要空料架,从["
+
EmptyShelfTargetPlace
+
"]到待机位"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
// }
//else if(EmptyShelfTargetPlace.Equals(SettingString.A5))
//{
// tryTimes = 0;
// EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_STANDBY);
// runInfo = "双层线A5暂不需要空料架,从[" + EmptyShelfTargetPlace + "]到待机位";
// msg += runInfo;
// EmptyBackStep.Msg = msg;
// Common.MoveToNode(agv, SettingString.Standby);
// UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
//}
//else
//{
// EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_A5A6);
//}
// EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_A5A6);
//runInfo= "AGV到达 " + EmptyShelfTargetPlace + ",15秒后重新向双层线发送入料架请求[ReadyEnter]";
//msg += runInfo;
//EmptyBackStep.Msg = msg;
tryTimes
=
0
;
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_STANDBY
);
runInfo
=
"双层线"
+
EmptyShelfTargetPlace
+
"暂不需要空料架,从["
+
EmptyShelfTargetPlace
+
"]到待机位"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
if
(
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT__EMPTY_SHELF_IN_DOUBLE_LINE
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckEnterOrLeaveFinished
(
agv
,
"Leave"
,
CurTaskState
))
if
(
Common
.
CheckEnterOrLeaveFinished
(
agv
,
"Leave"
,
CurTaskState
))
{
//EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.END);
agv
.
RFID
=
""
;
Job
job
=
Common
.
control
.
GetJob
(
agv
);
if
(
job
!=
null
)
{
runInfo
=
"在双层线检测到任务,执行任务"
;
runInfo
=
"在双层线检测到任务,执行任务"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
return
job
;
}
else
{
runInfo
=
"空料架进入"
+
EmptyShelfTargetPlace
+
"完成,暂无任务,回充电位"
;
runInfo
=
"空料架进入"
+
EmptyShelfTargetPlace
+
"完成,暂无任务,回充电位"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
agv
.
RFID
=
""
;
...
...
@@ -240,10 +234,7 @@ namespace AGVControl
}
else
if
(
EmptyBackStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
//链条停止
runInfo
=
"空料架在["
+
EmptyShelfTargetPlace
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
//msg += runInfo;
//EmptyBackStep.Msg = msg;
runInfo
=
"空料架在["
+
EmptyShelfTargetPlace
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
}
}
...
...
@@ -264,6 +255,10 @@ namespace AGVControl
/// </summary>
NONE
,
/// <summary>
/// 等待到达4C风淋门
/// </summary>
WAIT_AGV_REACH_AIR_DOOR
,
/// <summary>
/// 等待AGV到达门
/// </summary>
WAIT_AGV_REACH_DOOR
,
...
...
AGVControl-ProductionLine/bean/job/GoEmptyShelfLineJob.cs
查看文件 @
85238ee
...
...
@@ -57,56 +57,184 @@ namespace AGVControl
{
string
msg
=
agv
.
Name
+
" "
;
bool
rtn
=
false
;
agv
.
Msg
=
runInfo
;
agv
.
Msg
=
"回收空料架任务:"
+
runInfo
;
//runInfo = "回收空料架任务:";
int
nodeIdx
=
Common
.
FindNode
(
EmptyShelfPlace
);
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
NONE
))
{
if
(
nodeIdx
==
-
1
)
return
null
;
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
D4_Name_Prefix
))
//4C->4D
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)&&
Common
.
CheckIsInAirDoor
(
agvPlae
)
&&
!
Common
.
CheckIsInAirDoor
(
EmptyShelfPlace
))
//4C风淋门内->风淋门外
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_
4D
_DOOR
);
runInfo
=
"去
空料架产线"
+
EmptyShelfPlace
+
",先前往4D
门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_
AIR_OUT
_DOOR
);
runInfo
=
"去
产线"
+
EmptyShelfPlace
+
",先过风淋
门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
Door
CToD
);
Common
.
DoorMission
(
agv
,
SettingString
.
Door
AirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
((
agvPlae
.
StartsWith
(
SettingString
.
D4_Name_Prefix
)
||
agvPlae
.
StartsWith
(
"A"
)
||
agvPlae
.
Equals
(
SettingString
.
Standby
)
||
agvPlae
.
Equals
(
SettingString
.
AutoCharge
))
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4D->4C
else
if
(!
Common
.
CheckIsInAirDoor
(
agvPlae
)
&&
Common
.
CheckIsInAirDoor
(
EmptyShelfPlace
))
//4C风淋门外->风淋门内
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4C_DOOR
);
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4C->4C
{
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveTo4CStandy
(
agv
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_AIR_IN_DOOR
);
runInfo
=
"去产线"
+
EmptyShelfPlace
+
",先过风淋门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirIn
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
if
((
agvPlae
.
StartsWith
(
SettingString
.
D4_Name_Prefix
)
||
agvPlae
.
StartsWith
(
"A"
)
||
agvPlae
.
Equals
(
SettingString
.
Standby
)
||
agvPlae
.
Equals
(
SettingString
.
AutoCharge
))
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4D->4C
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4C_DOOR
);
runInfo
=
"去产线"
+
EmptyShelfPlace
+
",先过4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
else
//起始与目的地在风淋门同一侧
{
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
Common
.
CheckIsInAirDoor
(
agvPlae
)
&&
Common
.
CheckIsInAirDoor
(
EmptyShelfPlace
))
//都在风淋门内
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
+
"[RFID="
+
RFID
+
"]"
;
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_AIR_OUT_DOOR
);
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先过风淋门,再到临时待机位"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
else
if
(
agvPlae
.
Equals
(
""
)||
(!
Common
.
CheckIsInAirDoor
(
agvPlae
))
&&
!
Common
.
CheckIsInAirDoor
(
EmptyShelfPlace
))
//都在风淋门外
{
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4C->4C
{
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveTo4CStandy
(
agv
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
else
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
D4_Name_Prefix
))
//4C->4D
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"去产线"
+
EmptyShelfPlace
+
",先过4D门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
((
agvPlae
.
StartsWith
(
SettingString
.
D4_Name_Prefix
)
||
agvPlae
.
StartsWith
(
"A"
)
||
agvPlae
.
Equals
(
SettingString
.
Standby
)
||
agvPlae
.
Equals
(
SettingString
.
AutoCharge
))
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4D->4C
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4C_DOOR
);
runInfo
=
"去产线"
+
EmptyShelfPlace
+
",先过4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
//4D->4D
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
}
}
else
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_AIR_OUT_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorAirOut
,
CurTaskState
))
{
//4C风淋门内->风淋门外,到达风淋门外
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4C->4C
{
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
"到风淋门外,目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveTo4CStandy
(
agv
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"到风淋门外,开始任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
else
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
D4_Name_Prefix
))
//4C->4D
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"到风淋门外,去产线"
+
EmptyShelfPlace
+
",先过4D门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveTo4CStandy
(
agv
);
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
//都在风淋门内,到达风淋门外
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"
开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]
"
+
"[RFID="
+
RFID
+
"]"
;
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
"
到风淋门外,目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位
"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveTo4CStandy
(
agv
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
}
else
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_AIR_IN_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorAirIn
,
CurTaskState
))
{
//4C风淋门外->风淋门内
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"
开始执行回收空料架
任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
runInfo
=
"
到达风淋门内,开始
任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
...
...
@@ -127,10 +255,22 @@ namespace AGVControl
}
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
if
(
Common
.
CheckIsInAirDoor
(
EmptyShelfPlace
))
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_AIR_IN_DOOR
);
runInfo
=
"去产线"
+
EmptyShelfPlace
+
",先过风淋门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirIn
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
}
}
...
...
@@ -316,6 +456,14 @@ namespace AGVControl
/// </summary>
NONE
,
/// <summary>
/// 等待到达4C风淋门内
/// </summary>
WAIT_AGV_REACH_AIR_IN_DOOR
,
/// <summary>
/// 等待到达4C风淋门外
/// </summary>
WAIT_AGV_REACH_AIR_OUT_DOOR
,
/// <summary>
/// 等待到达4C门
/// </summary>
WAIT_AGV_REACH_4C_DOOR
,
...
...
AGVControl-ProductionLine/bean/job/GoFullShelfStationJob.cs
查看文件 @
85238ee
...
...
@@ -56,7 +56,8 @@ namespace AGVControl
{
string
msg
=
agv
.
Name
+
" "
;
bool
rtn
=
false
;
agv
.
Msg
=
runInfo
;
agv
.
Msg
=
"去云仓接满料任务:"
+
runInfo
;
//runInfo = "去云仓接满料任务:";
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
if
(
GoFullShelfStationStep
.
IsStep
(
GO_FULL_SHELF_STATION_STEP
.
NONE
))
...
...
@@ -89,7 +90,7 @@ namespace AGVControl
}
else
if
(
input
!=
null
&&
!
input
[
3
])
{
if
(
agvPlace
.
Equals
(
SettingString
.
Standby
)
||
agvPlace
.
StartsWith
(
SettingString
.
AutoCharge
))
//待机位/充电位接到任务
if
(
agvPlace
.
Equals
(
""
)
||
agvPlace
.
Equals
(
SettingString
.
Standby
)
||
agvPlace
.
StartsWith
(
SettingString
.
AutoCharge
))
//待机位/充电位接到任务
{
GoFullShelfStationStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_AGV_REACH_A6
);
runInfo
=
"无负载,准备运动到入料口"
+
FullShelfStationPlace
;
...
...
@@ -98,6 +99,15 @@ namespace AGVControl
Common
.
MoveToNode
(
agv
,
FullShelfStationPlace
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
Common
.
CheckIsInAirDoor
(
agvPlace
))
{
GoFullShelfStationStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"在4C风淋门内,先过风淋门"
;
msg
+=
runInfo
;
GoFullShelfStationStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4C车间
{
GoFullShelfStationStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_AGV_REACH_DOOR
);
...
...
@@ -132,6 +142,15 @@ namespace AGVControl
Common
.
MoveToNode
(
agv
,
FullShelfStationPlace
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
Common
.
CheckIsInAirDoor
(
agvPlace
))
{
GoFullShelfStationStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"在4C风淋门内,先过风淋门"
;
msg
+=
runInfo
;
GoFullShelfStationStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirOut
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
agvPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4C车间
{
GoFullShelfStationStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_AGV_REACH_DOOR
);
...
...
@@ -147,6 +166,20 @@ namespace AGVControl
}
}
else
if
(
GoFullShelfStationStep
.
IsStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_AGV_REACH_AIR_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorAirOut
,
CurTaskState
))
{
GoFullShelfStationStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_AGV_REACH_DOOR
);
runInfo
=
"过风淋门,向4D门运行,再到双层线入料口"
+
FullShelfStationPlace
;
msg
+=
runInfo
;
GoFullShelfStationStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
DoorCToD
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
if
(
GoFullShelfStationStep
.
IsStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_AGV_REACH_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
...
...
@@ -278,7 +311,7 @@ namespace AGVControl
else
if
(
GoFullShelfStationStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
//链条停止
runInfo
=
"满料架在["
+
FullShelfStationPlace
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
;
runInfo
=
"满料架在["
+
FullShelfStationPlace
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
;
//msg +=runInfo;
//GoFullShelfStationStep.Msg = msg;
}
...
...
@@ -303,6 +336,10 @@ namespace AGVControl
/// </summary>
WAIT_CHECK_RESULT
,
/// <summary>
/// 等待到达4C风淋门
/// </summary>
WAIT_AGV_REACH_AIR_DOOR
,
/// <summary>
/// 等待AGV到达门
/// </summary>
WAIT_AGV_REACH_DOOR
,
...
...
AGVControl-ProductionLine/bean/job/SendFullShelfToLineJob.cs
查看文件 @
85238ee
...
...
@@ -60,7 +60,8 @@ namespace AGVControl
string
msg
=
agv
.
Name
+
" "
;
bool
rtn
=
false
;
agv
.
RFID
=
RFID
;
agv
.
Msg
=
runInfo
;
agv
.
Msg
=
"送满料任务:"
+
runInfo
;
//runInfo = "送满料任务:";
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
NONE
))
...
...
@@ -69,7 +70,7 @@ namespace AGVControl
if
(
FullShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_DOOR
);
runInfo
=
"
满料架
前往4C门,从双层线A6送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
runInfo
=
"前往4C门,从双层线A6送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
...
...
@@ -78,7 +79,7 @@ namespace AGVControl
else
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
runInfo
=
"
满料架
从双层线A6送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
runInfo
=
"从双层线A6送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
FullShelfPlace
);
...
...
@@ -86,7 +87,6 @@ namespace AGVControl
}
}
else
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
...
...
@@ -103,14 +103,39 @@ namespace AGVControl
}
else
{
if
(
Common
.
CheckIsInAirDoor
(
FullShelfPlace
))
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_AIR_DOOR
);
runInfo
=
"到达4C门,过风淋门["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorAirIn
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
runInfo
=
"从双层线A6送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
FullShelfPlace
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
}
}
else
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_AIR_DOOR
))
{
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorAirIn
,
CurTaskState
))
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
runInfo
=
"
满料架从双层线A6
送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
runInfo
=
"送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
FullShelfPlace
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
}
else
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
WAIT_REACH_TEMP_PLACE
))
...
...
@@ -121,7 +146,7 @@ namespace AGVControl
if
(!
Common
.
Check4CTarget
(
agv
,
FullShelfPlace
))
//未占用
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
runInfo
=
"
满料架
从临时待机位送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
runInfo
=
"从临时待机位送往["
+
FullShelfPlace
+
"][RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
DeleteStandyInfo
(
agv
);
...
...
@@ -226,7 +251,7 @@ namespace AGVControl
CurTaskState
=
Common
.
GetTakJobState
(
CurTaskID
);
if
(
Common
.
CheckEnterOrLeaveFinished
(
agv
,
"Leave"
,
CurTaskState
))
{
runInfo
=
"满料
架
进入"
+
FullShelfPlace
+
"完成 [RFID="
+
RFID
+
"] ["
+
agv
.
BoxDestInfo
+
"]"
;
runInfo
=
"满料进入"
+
FullShelfPlace
+
"完成 [RFID="
+
RFID
+
"] ["
+
agv
.
BoxDestInfo
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
agv
.
RFID
=
""
;
...
...
@@ -237,7 +262,7 @@ namespace AGVControl
else
if
(
SendFullShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
//链条停止
runInfo
=
"满料
架
在["
+
FullShelfPlace
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
runInfo
=
"满料在["
+
FullShelfPlace
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
//msg += runInfo;
//SendFullShelfStep.Msg = msg;
}
...
...
@@ -270,6 +295,10 @@ namespace AGVControl
/// </summary>
WAIT_REACH_TEMP_PLACE
,
/// <summary>
/// 等待到达4C风淋门
/// </summary>
WAIT_AGV_REACH_AIR_DOOR
,
/// <summary>
/// 等待小车到达目的地
/// </summary>
WAIT_AGV_REACH_LINE
,
...
...
AGVControl-ProductionLine/bean/node/DoubleLineNodeFor4C.cs
查看文件 @
85238ee
...
...
@@ -35,14 +35,14 @@ namespace AGVControl
{
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
continue
;
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
)
//|| agv.CurJob is EmptyShelfBackJob
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
||
(
agv
.
CurJob
is
EmptyShelfBackJob
))
{
emptyJobCnt
++;
}
}
//出工单料的目的地是否有空料架
if
(
Common
.
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
,
out
rfid
))
if
(
Common
.
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
))
{
if
(
nodeName
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
{
...
...
@@ -58,29 +58,24 @@ namespace AGVControl
}
if
(
cnt
<
clientNode
.
EmptyShelfCnt
)
{
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
2
))
//保留1辆小车出满料架
{
return
null
;
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
nodeName
,
rfid
);
if
(
Common
.
CheckStationState
(
clientNode
,
out
rfid
)
&&
CanEmptyTask
(
emptyJobCnt
))
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
nodeName
,
rfid
);
}
}
}
//回收空料架
if
(
Common
.
FindEmptyShelfNode
(
currentAgv
,
out
string
emptyNodeName
,
out
rfid
))
if
(
Common
.
FindEmptyShelfNode
(
currentAgv
,
out
string
emptyNodeName
))
{
if
(
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
{
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
s
.
CurJob
).
EmptyShelfPlace
.
Equals
(
emptyNodeName
));
if
(
i
==
-
1
)
{
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
2
))
//保留1辆小车出满料架
{
return
null
;
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
,
rfid
);
ClientNode
clientNode
=
Common
.
nodeInfo
.
Find
(
s
=>
s
.
Name
.
Equals
(
emptyNodeName
));
if
(
Common
.
CheckStationState
(
clientNode
,
out
rfid
)
&&
CanEmptyTask
(
emptyJobCnt
))
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
,
rfid
);
}
}
}
...
...
@@ -92,12 +87,25 @@ namespace AGVControl
if
(
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
{
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoFullShelfStationJob
&&
!
s
.
IP
.
Equals
(
currentAgv
.
IP
));
if
(
i
==
-
1
)
return
new
GoFullShelfStationJob
(
currentAgv
.
Place
);
if
(
i
==
-
1
)
return
new
GoFullShelfStationJob
(
currentAgv
.
Place
);
}
}
return
null
;
}
/// <summary>
/// 控制出空架小车数量
/// </summary>
/// <param name="emptytASKAGV"></param>
/// <returns></returns>
private
bool
CanEmptyTask
(
int
emptytASKAGV
)
{
if
((
SettingString
.
AGVCNT
/
2
-
emptytASKAGV
).
Equals
(
2
))
//保留1辆小车出满料架
{
return
false
;
}
return
true
;
}
}
}
AGVControl-ProductionLine/bean/node/DoubleLineNodeFor4D.cs
查看文件 @
85238ee
...
...
@@ -38,13 +38,13 @@ namespace AGVControl
{
if
(
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
continue
;
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
)
//|| agv.CurJob is EmptyShelfBackJob
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
||
agv
.
CurJob
is
EmptyShelfBackJob
)
//
{
emptyJobCnt
++;
}
}
//出工单料的目的地是否有空料架
if
(
Common
.
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
,
out
rfid
))
if
(
Common
.
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
))
{
if
(
nodeName
.
StartsWith
(
SettingString
.
D4_Name_Prefix
)
&&
!
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
{
...
...
@@ -62,28 +62,24 @@ namespace AGVControl
}
if
(
cnt
<
clientNode
.
EmptyShelfCnt
)
{
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
1
))
//保留1辆小车出满料架
{
return
null
;
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
nodeName
,
rfid
);
if
(
Common
.
CheckStationState
(
clientNode
,
out
rfid
)
&&
CanEmptyTask
(
emptyJobCnt
))
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
nodeName
,
rfid
);
}
}
}
//回收空料架
if
(
Common
.
FindEmptyShelfNode
(
currentAgv
,
out
string
emptyNodeName
,
out
rfid
))
if
(
Common
.
FindEmptyShelfNode
(
currentAgv
,
out
string
emptyNodeName
))
{
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
{
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
s
.
CurJob
).
EmptyShelfPlace
.
Equals
(
emptyNodeName
));
if
(
i
==
-
1
)
{
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
1
))
//保留1辆小车出满料架
{
return
null
;
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
,
rfid
);
ClientNode
clientNode
=
Common
.
nodeInfo
.
Find
(
s
=>
s
.
Name
.
Equals
(
emptyNodeName
));
if
(
Common
.
CheckStationState
(
clientNode
,
out
rfid
)
&&
CanEmptyTask
(
emptyJobCnt
))
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
,
rfid
);
}
}
}
...
...
@@ -121,5 +117,18 @@ namespace AGVControl
return
null
;
}
/// <summary>
/// 控制出空架小车数量
/// </summary>
/// <param name="emptytASKAGV"></param>
/// <returns></returns>
private
bool
CanEmptyTask
(
int
emptytASKAGV
)
{
if
((
SettingString
.
AGVCNT
/
2
-
emptytASKAGV
).
Equals
(
1
))
//保留1辆小车出满料架
{
return
false
;
}
return
true
;
}
}
}
AGVControl-ProductionLine/bin/Debug/AGVControl-ProductionLine.exe
查看文件 @
85238ee
此文件类型无法预览
AGVControl-ProductionLine/bin/Debug/AGVControl-ProductionLine.pdb
查看文件 @
85238ee
此文件类型无法预览
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.exe
查看文件 @
85238ee
此文件类型无法预览
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.pdb
查看文件 @
85238ee
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论