Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
顾剑亮
/
AGVControl-Qisda-ProductionLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 75c17094
由
张东亮
编写于
2020-09-07 07:30:58 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
686076d6
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
29 个修改的文件
包含
402 行增加
和
248 行删除
.vs/AGVControl-ProductionLine/v16/.suo
AGVControl-ProductionLine/BLL/AGVManager.cs
AGVControl-ProductionLine/BLL/AgvServer.cs
AGVControl-ProductionLine/BLL/Common.cs
AGVControl-ProductionLine/BLL/Control.cs
AGVControl-ProductionLine/BLL/MiR_API.cs
AGVControl-ProductionLine/FrmMain.Designer.cs
AGVControl-ProductionLine/FrmMain.cs
AGVControl-ProductionLine/Program.cs
AGVControl-ProductionLine/bean/Agv_Info.cs
AGVControl-ProductionLine/bean/Job.cs
AGVControl-ProductionLine/bean/job/ChargeJob.cs
AGVControl-ProductionLine/bean/job/EmptyAGVBackJob.cs
AGVControl-ProductionLine/bean/job/EmptyShelfBackJob.cs
AGVControl-ProductionLine/bean/job/EnterLeaveShelfJob.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/bin/Debug/logs/AgvServer.log
AGVControl-ProductionLine/bin/Debug/logs/AgvServer.log2020-09-02
AGVControl-ProductionLine/bin/Debug/logs/LineWebService.log2020-09-02
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.csproj.FileListAbsolute.txt
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.csproj.GenerateResource.cache
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.exe
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.pdb
.vs/AGVControl-ProductionLine/v16/.suo
查看文件 @
75c1709
此文件类型无法预览
AGVControl-ProductionLine/BLL/AGVManager.cs
查看文件 @
75c1709
...
@@ -116,7 +116,7 @@ namespace BLL
...
@@ -116,7 +116,7 @@ namespace BLL
json
=
json
.
Replace
(
"\r"
,
""
);
json
=
json
.
Replace
(
"\r"
,
""
);
json
=
json
.
Replace
(
"\n"
,
""
);
json
=
json
.
Replace
(
"\n"
,
""
);
json
=
json
.
Replace
(
" "
,
""
);
json
=
json
.
Replace
(
" "
,
""
);
Common
.
LogInfo
(
"ITS URL: "
+
url
+
" Return: "
+
json
,
false
);
Common
.
log
.
Debug
(
"ITS URL: "
+
url
+
" Return: "
+
json
);
if
(
string
.
IsNullOrWhiteSpace
(
json
))
return
false
;
if
(
string
.
IsNullOrWhiteSpace
(
json
))
return
false
;
List
<
BoxDestInfo
>
res
=
JsonHelper
.
DeserializeJsonToList
<
BoxDestInfo
>(
json
);
List
<
BoxDestInfo
>
res
=
JsonHelper
.
DeserializeJsonToList
<
BoxDestInfo
>(
json
);
...
@@ -166,8 +166,9 @@ namespace BLL
...
@@ -166,8 +166,9 @@ namespace BLL
#
endregion
#
endregion
res
[
0
].
location
=
loc
;
res
[
0
].
location
=
loc
;
dest
=
res
[
0
];
dest
=
res
[
0
];
A6_Target
=
res
[
0
].
ShowInfo
()
+
"["
+
loc
+
"]"
;
Common
.
GetLineNameByNodeName
(
loc
,
out
string
line
);
Common
.
log
.
Debug
(
"查找满料架任务[RFID="
+
rfid
+
"]:目的地为 "
+
loc
+
" [产线名 "
+
tempLocation
+
"]"
);
A6_Target
=
res
[
0
].
ShowInfo
(
line
);
Common
.
log
.
Debug
(
"查找满料架任务[RFID="
+
rfid
+
"]:目的地为 "
+
loc
+
" [产线名 "
+
line
+
"]"
);
return
true
;
return
true
;
}
}
else
else
...
@@ -179,6 +180,7 @@ namespace BLL
...
@@ -179,6 +180,7 @@ namespace BLL
}
}
}
}
//[{"msg":"0料车已解绑或未发新料"}]
//[{"msg":"0料车已解绑或未发新料"}]
A6_Target
=
json
;
return
false
;
return
false
;
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -198,9 +200,9 @@ namespace BLL
...
@@ -198,9 +200,9 @@ namespace BLL
public
string
SO
{
get
;
set
;
}
public
string
SO
{
get
;
set
;
}
public
string
location
{
get
;
set
;
}
public
string
location
{
get
;
set
;
}
public
string
ShowInfo
()
public
string
ShowInfo
(
string
loc
)
{
{
return
string
.
Format
(
"RFID={0},SO={1},location={2}
"
,
id
,
SO
,
location
);
return
string
.
Format
(
"RFID={0},SO={1},location={2}
[{3}]"
,
id
,
SO
,
loc
,
location
);
}
}
}
}
...
@@ -279,7 +281,7 @@ namespace BLL
...
@@ -279,7 +281,7 @@ namespace BLL
int
.
TryParse
(
msgs
[
0
].
msg
.
Substring
(
0
,
1
),
out
int
resCode
);
int
.
TryParse
(
msgs
[
0
].
msg
.
Substring
(
0
,
1
),
out
int
resCode
);
string
resStr
=
msgs
[
0
].
msg
.
Substring
(
1
,
2
);
string
resStr
=
msgs
[
0
].
msg
.
Substring
(
1
,
2
);
lineName
=
msgs
[
0
].
msg
.
Substring
(
3
);
lineName
=
msgs
[
0
].
msg
.
Substring
(
3
);
Common
.
LogInfo
(
string
.
Format
(
"[{0}] [{1}]"
,
addr
,
result
),
false
);
Common
.
log
.
Debug
(
string
.
Format
(
"[{0}] [{1}]"
,
addr
,
result
)
);
if
(
lineName
.
Equals
(
""
).
Equals
(
true
))
if
(
lineName
.
Equals
(
""
).
Equals
(
true
))
return
false
;
return
false
;
if
(
resStr
.
Equals
(
"OK"
)
||
resCode
.
Equals
(
1
))
if
(
resStr
.
Equals
(
"OK"
)
||
resCode
.
Equals
(
1
))
...
@@ -502,6 +504,8 @@ namespace BLL
...
@@ -502,6 +504,8 @@ namespace BLL
public
string
msgKey
=
""
;
public
string
msgKey
=
""
;
//>>>msgValue : 异常信息
//>>>msgValue : 异常信息
public
string
msgValue
=
""
;
public
string
msgValue
=
""
;
//0:异常;1:正常显示
public
int
type
=
0
;
/// <summary>
/// <summary>
/// 异常信息
/// 异常信息
...
@@ -509,11 +513,12 @@ namespace BLL
...
@@ -509,11 +513,12 @@ namespace BLL
/// <param name="name">异常位置名称</param>
/// <param name="name">异常位置名称</param>
/// <param name="key">异常信息唯一标识</param>
/// <param name="key">异常信息唯一标识</param>
/// <param name="value">异常信息</param>
/// <param name="value">异常信息</param>
public
AlarmMsg
(
string
name
,
string
key
,
string
value
)
public
AlarmMsg
(
string
name
,
string
key
,
string
value
,
int
type
=
0
)
{
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
msgKey
=
key
;
this
.
msgKey
=
key
;
this
.
msgValue
=
value
;
this
.
msgValue
=
value
;
this
.
type
=
type
;
}
}
}
}
public
class
RfidData
public
class
RfidData
...
...
AGVControl-ProductionLine/BLL/AgvServer.cs
查看文件 @
75c1709
...
@@ -510,7 +510,7 @@ namespace BLL
...
@@ -510,7 +510,7 @@ namespace BLL
Common
.
nodeInfo
[
idx
].
UpdateNodeStatus
(
node
.
GetState
());
Common
.
nodeInfo
[
idx
].
UpdateNodeStatus
(
node
.
GetState
());
Common
.
nodeInfo
[
idx
].
ClientLevel
=
node
.
ClientLevel
;
Common
.
nodeInfo
[
idx
].
ClientLevel
=
node
.
ClientLevel
;
Common
.
nodeInfo
[
idx
].
RFID
=
node
.
RFID
;
Common
.
nodeInfo
[
idx
].
RFID
=
node
.
RFID
;
Common
.
LogInfo
(
"节点更新 "
+
node
.
StatetText
()
+
" "
+
node
.
ClientLevel
.
ToString
()
);
Common
.
LogInfo
(
"节点更新 "
+
node
.
StatetText
());
NodeChanged
?.
Invoke
(
idx
);
NodeChanged
?.
Invoke
(
idx
);
}
}
}
}
...
...
AGVControl-ProductionLine/BLL/Common.cs
查看文件 @
75c1709
此文件的差异被折叠,
点击展开。
AGVControl-ProductionLine/BLL/Control.cs
查看文件 @
75c1709
...
@@ -24,7 +24,6 @@ namespace BLL
...
@@ -24,7 +24,6 @@ namespace BLL
public
delegate
void
AgvMissionEvent
();
public
delegate
void
AgvMissionEvent
();
public
event
AgvChangedEvent
AgvChanged
;
public
event
AgvChangedEvent
AgvChanged
;
public
event
AgvChangedEvent
AgvOnline
;
public
event
AgvChangedEvent
AgvOnline
;
public
event
AgvMissionEvent
AgvMissionChanged
;
public
Control
()
public
Control
()
{
{
...
@@ -38,7 +37,7 @@ namespace BLL
...
@@ -38,7 +37,7 @@ namespace BLL
AgvStateTimer
=
new
System
.
Timers
.
Timer
AgvStateTimer
=
new
System
.
Timers
.
Timer
{
{
Interval
=
500
,
Interval
=
1
500
,
AutoReset
=
true
,
AutoReset
=
true
,
Enabled
=
false
Enabled
=
false
};
};
...
@@ -78,104 +77,87 @@ namespace BLL
...
@@ -78,104 +77,87 @@ namespace BLL
if
(!
Common
.
nodeInfo
[
j
].
Online
)
if
(!
Common
.
nodeInfo
[
j
].
Online
)
{
{
isAlarm
=
true
;
isAlarm
=
true
;
msglist
.
Add
(
new
AlarmMsg
(
Common
.
nodeInfo
[
j
].
AliceName
,
"
agv."
+
Common
.
nodeInfo
[
j
].
Name
+
".On
Line"
,
"接驳台状态:离线"
));
msglist
.
Add
(
new
AlarmMsg
(
Common
.
nodeInfo
[
j
].
AliceName
,
"
lineAgv."
+
Common
.
nodeInfo
[
j
].
Name
+
".Off
Line"
,
"接驳台状态:离线"
));
}
}
}
}
for
(
int
i
=
0
;
i
<
Common
.
agvInfo
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
Common
.
agvInfo
.
Count
;
i
++)
{
{
if
(!
CheckOnline
(
i
))
continue
;
try
//获取AGV状态
rtn
=
Common
.
mir
.
Get_State
(
Common
.
agvInfo
[
i
],
out
eAGVState
stateID
,
out
string
stateText
,
out
int
battery
,
out
string
mission_text
,
out
Agv_Info
.
clsPosition
position
);
if
(!
rtn
)
continue
;
Common
.
log
.
Debug
(
"获取AGV状态"
);
Thread
.
Sleep
(
50
);
rtn
=
Common
.
mir
.
Get_Task_State
(
Common
.
agvInfo
[
i
],
out
string
stateStr
);
Thread
.
Sleep
(
50
);
rtn
=
Common
.
mir
.
Get_IO_Status
(
Common
.
agvInfo
[
i
],
out
bool
[]
input
,
out
bool
[]
output
);
if
(!
rtn
)
continue
;
Common
.
log
.
Debug
(
"获取IO状态"
);
bool
change
=
false
;
if
(
rtn
)
change
=
Common
.
agvInfo
[
i
].
SetState
(
stateID
,
stateStr
,
battery
,
mission_text
,
position
);
if
(
Common
.
agvInfo
[
i
].
StateID
.
Equals
(
eAGVState
.
Docking
))
{
{
if
(!
Common
.
agvInfo
[
i
].
StateID
.
Equals
(
preAGVState
))
if
(!
CheckOnline
(
i
))
continue
;
bool
change
=
false
;
//获取AGV状态
rtn
=
Common
.
mir
.
Get_State
(
Common
.
agvInfo
[
i
],
out
eAGVState
stateID
,
out
string
stateText
,
out
int
battery
,
out
string
mission_text
,
out
Agv_Info
.
clsPosition
position
);
Thread
.
Sleep
(
50
);
Common
.
mir
.
Get_Task_State
(
Common
.
agvInfo
[
i
],
out
string
stateStr
);
Thread
.
Sleep
(
50
);
if
(
rtn
)
change
=
Common
.
agvInfo
[
i
].
SetState
(
stateID
,
stateStr
,
battery
,
mission_text
,
position
);
Common
.
log
.
Debug
(
"获取AGV状态"
);
//获取地点任务状态
Thread
.
Sleep
(
50
);
rtn
=
Common
.
mir
.
Get_Register
(
Common
.
agvInfo
[
i
],
REG_STATUS
,
out
int
regValue
);
if
(
rtn
)
Common
.
agvInfo
[
i
].
GetPlace
(
regValue
);
Thread
.
Sleep
(
50
);
rtn
=
Common
.
mir
.
Get_IO_Status
(
Common
.
agvInfo
[
i
],
out
bool
[]
input
,
out
bool
[]
output
);
Common
.
log
.
Debug
(
"获取IO状态"
);
//if (Common.agvInfo[i].StateID.Equals(eAGVState.Docking))
//{
// if (!Common.agvInfo[i].StateID.Equals(preAGVState))
// {
// Common.agvInfo[i].DockingStartTime = DateTime.Now;
// }
// else
// {
// if ((DateTime.Now - Common.agvInfo[i].DockingStartTime).TotalMinutes >= 1)
// {
// isAlarm = true;
// msglist.Add(new AlarmMsg(Common.agvInfo[i].Name, "lineAgv." + Common.agvInfo[i].Name + ".Docking", "停靠超时:" + (DateTime.Now - Common.agvInfo[i].DockingStartTime).TotalSeconds + "秒"));
// }
// }
//}
preAGVState
=
Common
.
agvInfo
[
i
].
StateID
;
if
(
battery
<=
10
)
{
{
Common
.
agvInfo
[
i
].
DockingStartTime
=
DateTime
.
Now
;
isAlarm
=
true
;
msglist
.
Add
(
new
AlarmMsg
(
Common
.
agvInfo
[
i
].
Name
,
"lineAgv."
+
Common
.
agvInfo
[
i
].
Name
+
".battery"
,
"电量 "
+
battery
.
ToString
()
+
"%"
));
}
}
else
if
(
stateText
.
Equals
(
"Error"
)
||
stateText
.
Equals
(
"EmergencyStop"
)
||
stateText
.
Equals
(
"Pause"
))
{
{
if
((
DateTime
.
Now
-
Common
.
agvInfo
[
i
].
DockingStartTime
).
TotalMinutes
>=
1
)
isAlarm
=
true
;
msglist
.
Add
(
new
AlarmMsg
(
Common
.
agvInfo
[
i
].
Name
,
"lineAgv."
+
Common
.
agvInfo
[
i
].
Name
+
".Error.EmergencyStop"
,
"agv状态:"
+
stateText
+
";"
+
mission_text
));
}
if
(
input
!=
null
&&
input
.
Length
==
4
)
{
if
(!
Common
.
agvInfo
[
i
].
IsExistShelf
.
Equals
(
input
[
3
]))
{
{
isAlarm
=
true
;
isAlarm
=
true
;
msglist
.
Add
(
new
AlarmMsg
(
Common
.
agvInfo
[
i
].
Name
,
"
agv."
+
Common
.
agvInfo
[
i
].
Name
+
".Docking"
,
"停靠超时:"
+
(
DateTime
.
Now
-
Common
.
agvInfo
[
i
].
DockingStartTime
).
TotalSeconds
+
"秒
"
));
msglist
.
Add
(
new
AlarmMsg
(
Common
.
agvInfo
[
i
].
Name
,
"
lineAgv."
+
Common
.
agvInfo
[
i
].
Name
+
".IsExistShelf"
,
"agv负载:"
+
"IO信号与负载信号不匹配
"
));
}
}
}
}
preAGVState
=
Common
.
agvInfo
[
i
].
StateID
;
}
if
(
battery
<=
10
)
//更新状态stateID.Equals(eAGVState.Executing)
{
if
(
change
)
isAlarm
=
true
;
msglist
.
Add
(
new
AlarmMsg
(
Common
.
agvInfo
[
i
].
Name
,
"agv."
+
Common
.
agvInfo
[
i
].
Name
+
".battery"
,
"电量 "
+
battery
.
ToString
()
+
"%"
));
}
if
(
stateText
.
Equals
(
"Error"
)
||
stateText
.
Equals
(
"EmergencyStop"
)
||
stateText
.
Equals
(
"Pause"
))
{
isAlarm
=
true
;
msglist
.
Add
(
new
AlarmMsg
(
Common
.
agvInfo
[
i
].
Name
,
"agv."
+
Common
.
agvInfo
[
i
].
Name
+
".Error.EmergencyStop"
,
"agv状态:"
+
stateText
+
";"
+
mission_text
));
}
if
(
input
!=
null
&&
input
.
Length
==
4
)
{
if
(!
Common
.
agvInfo
[
i
].
IsExistShelf
.
Equals
(
input
[
3
]))
{
{
isAlarm
=
true
;
AgvChanged
?.
Invoke
(
i
);
msglist
.
Add
(
new
AlarmMsg
(
Common
.
agvInfo
[
i
].
Name
,
"agv."
+
Common
.
agvInfo
[
i
].
Name
+
".IsExistShelf"
,
"agv负载:"
+
"IO信号与负载信号不匹配"
));
}
}
}
}
catch
(
Exception
ex
)
//获取地点任务状态
Thread
.
Sleep
(
50
);
rtn
=
Common
.
mir
.
Get_Register
(
Common
.
agvInfo
[
i
],
REG_STATUS
,
out
int
regValue
);
if
(
rtn
)
Common
.
agvInfo
[
i
].
GetPlace
(
regValue
);
//if (change)
//{
// Common.log.Debug(string.Format("{0} Get_State StateID={1}, StateText={2}, Battery={3}, Mission_text={4},IsExistShelf={5}", Common.agvInfo[i].Name, stateID, stateText, battery, mission_text, Common.agvInfo[i].IsExistShelf));
//}
//执行任务更新状态
if
(
stateID
.
Equals
(
eAGVState
.
Executing
)
||
change
)
{
{
//Common.log.Debug(string.Format("{0} Get_Register PLC{1}={2}", Common.agvInfo[i].Name, REG_STATUS, regValue));
Common
.
log
.
Error
(
"AgvStateTimer_"
+
Common
.
agvInfo
[
i
].
Name
+
ex
.
Message
+
ex
.
StackTrace
);
AgvChanged
?.
Invoke
(
i
);
}
}
//获取任务队列
//rtn = Common.mir.Get_Mission_Queue(Common.agvInfo[i], out List<string> mission);
//if (rtn)
//{
// string[] arr = new string[mission.Count];
// for (int j = 0; j < mission.Count; j++)
// arr[j] = Common.agvMission.FirstOrDefault(q => q.Value == mission[j]).Key;
// string missionKey = string.Join(",", arr);
// if (Common.agvInfo[i].MissionQueue != missionKey)
// {
// Common.agvInfo[i].MissionQueue = missionKey;
// AgvChanged?.Invoke(i);
// }
//}
}
}
if
(
isAlarm
)
if
(
isAlarm
)
BLL
.
AGVManager
.
updateDeviceAlarmMsg
(
msglist
);
BLL
.
AGVManager
.
updateDeviceAlarmMsg
(
msglist
);
AgvStateInProcess
=
false
;
AgvStateInProcess
=
false
;
}
}
...
...
AGVControl-ProductionLine/BLL/MiR_API.cs
查看文件 @
75c1709
...
@@ -405,13 +405,14 @@ namespace BLL
...
@@ -405,13 +405,14 @@ namespace BLL
if
(
dic
==
null
)
return
false
;
if
(
dic
==
null
)
return
false
;
//state_id不存在:{"args":{},"error_code":"service_unavailable","error_human":"\u670d\u52a1\u4e0d\u53ef\u7528\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"}
//state_id不存在:{"args":{},"error_code":"service_unavailable","error_human":"\u670d\u52a1\u4e0d\u53ef\u7528\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"}
Common
.
log
.
Debug
(
"Get_State URL:"
+
url
+
" Return"
+
json
);
try
try
{
{
state
Text
=
dic
[
"state_text"
].
ToString
(
);
state
ID
=
(
eAGVState
)(
Convert
.
ToInt32
(
dic
[
"state_id"
].
ToString
())
);
}
}
catch
catch
{
{
Common
.
log
.
Error
(
"获取状态失败:"
+
json
);
Common
.
log
.
Error
(
"获取状态失败:"
+
info
.
IP
+
" "
+
json
);
return
false
;
return
false
;
}
}
stateID
=
(
eAGVState
)(
Convert
.
ToInt32
(
dic
[
"state_id"
].
ToString
()));
stateID
=
(
eAGVState
)(
Convert
.
ToInt32
(
dic
[
"state_id"
].
ToString
()));
...
...
AGVControl-ProductionLine/FrmMain.Designer.cs
查看文件 @
75c1709
此文件的差异被折叠,
点击展开。
AGVControl-ProductionLine/FrmMain.cs
查看文件 @
75c1709
...
@@ -21,6 +21,7 @@ namespace AGVControl
...
@@ -21,6 +21,7 @@ namespace AGVControl
private
ContextMenuStrip
notifyMenu
;
private
ContextMenuStrip
notifyMenu
;
private
System
.
Timers
.
Timer
showTimer
;
private
System
.
Timers
.
Timer
showTimer
;
private
Label
[]
agvRunInfo
;
private
Label
[]
agvRunInfo
;
//private string[] agvRunStep;
public
FrmMain
()
public
FrmMain
()
{
{
InitializeComponent
();
InitializeComponent
();
...
@@ -31,13 +32,13 @@ namespace AGVControl
...
@@ -31,13 +32,13 @@ namespace AGVControl
showTimer
.
Elapsed
+=
ShowTimer_Elapsed
;
showTimer
.
Elapsed
+=
ShowTimer_Elapsed
;
showTimer
.
Start
();
showTimer
.
Start
();
Common
.
logTextBox
=
TxtLog
;
Common
.
logTextBox
=
TxtLog
;
agvRunInfo
=
new
Label
[]
{
label1
,
label2
,
label3
,
label4
,
label5
,
label6
};
agvRunInfo
=
new
Label
[]
{
label1
,
label2
,
label3
,
label4
,
label5
,
label6
};
}
}
private
void
ShowConfig
()
private
void
ShowConfig
()
{
{
int
n
;
int
n
;
//agvRunStep = new string[Common.agvInfo.Count];
for
(
int
i
=
0
;
i
<
Common
.
agvInfo
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
Common
.
agvInfo
.
Count
;
i
++)
{
{
Common
.
mir
.
Get_IO_Status
(
Common
.
agvInfo
[
i
],
out
bool
[]
input
,
out
bool
[]
output
);
Common
.
mir
.
Get_IO_Status
(
Common
.
agvInfo
[
i
],
out
bool
[]
input
,
out
bool
[]
output
);
...
@@ -49,6 +50,8 @@ namespace AGVControl
...
@@ -49,6 +50,8 @@ namespace AGVControl
DgvAgv
.
Rows
[
n
].
DefaultCellStyle
.
BackColor
=
Color
.
LightBlue
;
DgvAgv
.
Rows
[
n
].
DefaultCellStyle
.
BackColor
=
Color
.
LightBlue
;
if
(!
Common
.
agvInfo
[
i
].
IsCon
)
if
(!
Common
.
agvInfo
[
i
].
IsCon
)
DgvAgv
.
Rows
[
n
].
DefaultCellStyle
.
ForeColor
=
Color
.
Red
;
DgvAgv
.
Rows
[
n
].
DefaultCellStyle
.
ForeColor
=
Color
.
Red
;
//agvRunStep[i] = Common.agvInfo[i].Msg;
//if (i % 2 == 0)
//if (i % 2 == 0)
// agvRunInfo[i].BackColor = Color.LightBlue;
// agvRunInfo[i].BackColor = Color.LightBlue;
//else
//else
...
@@ -85,7 +88,6 @@ namespace AGVControl
...
@@ -85,7 +88,6 @@ namespace AGVControl
DgvNode
.
Rows
[
nodeIndex
].
DefaultCellStyle
.
ForeColor
=
Common
.
nodeInfo
[
nodeIndex
].
Online
&&
Common
.
nodeInfo
[
nodeIndex
].
IsUse
?
Color
.
Black
:
Color
.
Red
;
DgvNode
.
Rows
[
nodeIndex
].
DefaultCellStyle
.
ForeColor
=
Common
.
nodeInfo
[
nodeIndex
].
Online
&&
Common
.
nodeInfo
[
nodeIndex
].
IsUse
?
Color
.
Black
:
Color
.
Red
;
DgvNode
.
Rows
[
nodeIndex
].
SetValues
(
Common
.
nodeInfo
[
nodeIndex
].
ToRow
());
DgvNode
.
Rows
[
nodeIndex
].
SetValues
(
Common
.
nodeInfo
[
nodeIndex
].
ToRow
());
}));
}));
ShowEmptyTask
();
System
.
GC
.
Collect
();
System
.
GC
.
Collect
();
}
}
...
@@ -101,29 +103,24 @@ namespace AGVControl
...
@@ -101,29 +103,24 @@ namespace AGVControl
private
void
Control_AgvChanged
(
int
agvIndex
)
private
void
Control_AgvChanged
(
int
agvIndex
)
{
{
Invoke
(
new
Action
(()
=>
{
DgvAgv
.
Rows
[
agvIndex
].
DefaultCellStyle
.
ForeColor
=
Common
.
agvInfo
[
agvIndex
].
StateID
.
Equals
(
12
)
?
Color
.
Red
:
Color
.
Black
;
}));
Invoke
(
new
Action
(()
=>
{
DgvAgv
.
Rows
[
agvIndex
].
DefaultCellStyle
.
ForeColor
=
Common
.
agvInfo
[
agvIndex
].
StateID
.
Equals
(
eAGVState
.
Error
)
?
Color
.
Red
:
Color
.
Black
;
}));
Invoke
(
new
Action
(()
=>
Invoke
(
new
Action
(()
=>
{
{
DgvAgv
.
Rows
[
agvIndex
].
SetValues
(
Common
.
agvInfo
[
agvIndex
].
ToRow
());
DgvAgv
.
Rows
[
agvIndex
].
SetValues
(
Common
.
agvInfo
[
agvIndex
].
ToRow
());
}));
}));
try
ShowEmptyTask
();
{
Invoke
(
new
Action
(()
=>
{
for
(
int
i
=
0
;
i
<
Common
.
nodeInfo
.
Count
;
i
++)
{
DgvNode
.
Rows
[
i
].
SetValues
(
Common
.
nodeInfo
[
i
].
ToRow
());
}
}));
}
catch
{
};
System
.
GC
.
Collect
();
System
.
GC
.
Collect
();
}
}
private
void
Control_AgvOnline
(
int
agvIndex
)
private
void
Control_AgvOnline
(
int
agvIndex
)
{
{
Invoke
(
new
Action
(()
=>
{
DgvAgv
.
Rows
[
agvIndex
].
DefaultCellStyle
.
ForeColor
=
Common
.
agvInfo
[
agvIndex
].
IsCon
?
Color
.
Black
:
Color
.
Red
;
}));
Invoke
(
new
Action
(()
=>
{
DgvAgv
.
Rows
[
agvIndex
].
DefaultCellStyle
.
ForeColor
=
Common
.
agvInfo
[
agvIndex
].
IsCon
?
Color
.
Black
:
Color
.
Red
;
}));
Invoke
(
new
Action
(()
=>
{
DgvAgv
.
Rows
[
agvIndex
].
SetValues
(
Common
.
agvInfo
[
agvIndex
].
ToRow
());
}));
GC
.
Collect
();
GC
.
Collect
();
}
}
...
@@ -151,7 +148,7 @@ namespace AGVControl
...
@@ -151,7 +148,7 @@ namespace AGVControl
if
(
WindowState
==
FormWindowState
.
Minimized
)
if
(
WindowState
==
FormWindowState
.
Minimized
)
WindowState
=
FormWindowState
.
Normal
;
WindowState
=
FormWindowState
.
Normal
;
}
}
private
void
Control_
AgvMissionChanged
()
private
void
AgvMissionChanged
()
{
{
if
(!
Common
.
missionManager
.
AGV_Name_EmptyTask
.
Equals
(
""
))
if
(!
Common
.
missionManager
.
AGV_Name_EmptyTask
.
Equals
(
""
))
Invoke
(
new
Action
(()
=>
Invoke
(
new
Action
(()
=>
...
@@ -183,7 +180,6 @@ namespace AGVControl
...
@@ -183,7 +180,6 @@ namespace AGVControl
change
=
false
;
change
=
false
;
Common
.
control
.
AgvChanged
+=
Control_AgvChanged
;
Common
.
control
.
AgvChanged
+=
Control_AgvChanged
;
Common
.
control
.
AgvOnline
+=
Control_AgvOnline
;
Common
.
control
.
AgvOnline
+=
Control_AgvOnline
;
Common
.
control
.
AgvMissionChanged
+=
Control_AgvMissionChanged
;
Common
.
server
.
NodeChanged
+=
Server_NodeChanged
;
Common
.
server
.
NodeChanged
+=
Server_NodeChanged
;
Common
.
server
.
NodeOnline
+=
Server_NodeOnline
;
Common
.
server
.
NodeOnline
+=
Server_NodeOnline
;
//foreach (var item in Common.agvInfo)
//foreach (var item in Common.agvInfo)
...
@@ -220,13 +216,14 @@ namespace AGVControl
...
@@ -220,13 +216,14 @@ namespace AGVControl
if
(
e
.
ColumnIndex
==
10
)
//调用
if
(
e
.
ColumnIndex
==
10
)
//调用
{
{
if
(
Common
.
agvInfo
[
e
.
RowIndex
].
IsUse
.
Equals
(
true
))
if
(
Common
.
agvInfo
[
e
.
RowIndex
].
IsUse
.
Equals
(
true
))
{
{
if
(
MessageBox
.
Show
(
"是否关闭当前小车的自动模式?"
,
Common
.
agvInfo
[
e
.
RowIndex
].
Name
+
"_警告"
,
MessageBoxButtons
.
YesNo
).
Equals
(
DialogResult
.
Yes
))
if
(
MessageBox
.
Show
(
"是否关闭当前小车的自动模式?"
,
Common
.
agvInfo
[
e
.
RowIndex
].
Name
+
"_警告"
,
MessageBoxButtons
.
YesNo
).
Equals
(
DialogResult
.
Yes
))
{
{
Common
.
agvInfo
[
e
.
RowIndex
].
IsUse
=
false
;
Common
.
agvInfo
[
e
.
RowIndex
].
IsUse
=
false
;
Common
.
agvInfo
[
e
.
RowIndex
].
CurJob
=
null
;
Common
.
agvInfo
[
e
.
RowIndex
].
CurJob
=
null
;
Common
.
agvInfo
[
e
.
RowIndex
].
RFID
=
""
;
Common
.
agvInfo
[
e
.
RowIndex
].
RFID
=
""
;
Common
.
LogInfo
(
string
.
Format
(
"手动关闭小车自动模式,{0} {1}"
,
Common
.
agvInfo
[
e
.
RowIndex
].
Name
,
Common
.
agvInfo
[
e
.
RowIndex
].
RunInfo
()));
}
}
}
}
else
else
...
@@ -348,13 +345,13 @@ namespace AGVControl
...
@@ -348,13 +345,13 @@ namespace AGVControl
if
(
idx
<
0
)
return
;
if
(
idx
<
0
)
return
;
if
(
Common
.
agvInfo
[
idx
].
IsCon
)
if
(
Common
.
agvInfo
[
idx
].
IsCon
)
{
{
if
(
Common
.
agvInfo
[
idx
].
IsUse
)
if
(
Common
.
agvInfo
[
idx
].
IsUse
)
{
{
if
(
MessageBox
.
Show
(
"确定在自动模式下对小车手动分配任务?"
,
Common
.
agvInfo
[
idx
].
Name
,
MessageBoxButtons
.
YesNo
)
==
DialogResult
.
No
)
if
(
MessageBox
.
Show
(
"确定在自动模式下对小车手动分配任务?"
,
Common
.
agvInfo
[
idx
].
Name
,
MessageBoxButtons
.
YesNo
)
==
DialogResult
.
No
)
return
;
return
;
}
}
bool
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
Common
.
agvInfo
[
idx
],
Common
.
agvMission
[
Common
.
showNameMissionName
[
LstAgvPlace
.
Text
]]);
bool
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
Common
.
agvInfo
[
idx
],
Common
.
agvMission
[
Common
.
showNameMissionName
[
LstAgvPlace
.
Text
]]);
if
(!
rtn
)
if
(!
rtn
)
return
;
return
;
//Common.agvInfo[idx].TaskSend = LstAgvPlace.Text;
//Common.agvInfo[idx].TaskSend = LstAgvPlace.Text;
...
@@ -384,16 +381,33 @@ namespace AGVControl
...
@@ -384,16 +381,33 @@ namespace AGVControl
Invoke
(
new
Action
(()
=>
Invoke
(
new
Action
(()
=>
{
{
List
<
AlarmMsg
>
msglist
=
new
List
<
AlarmMsg
>();
//bool change = false;
for
(
int
i
=
0
;
i
<
Common
.
agvInfo
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
Common
.
agvInfo
.
Count
;
i
++)
{
{
agvRunInfo
[
i
].
Text
=
Common
.
agvInfo
[
i
].
RunInfo
();
try
{
agvRunInfo
[
i
].
Text
=
Common
.
agvInfo
[
i
].
RunInfo
();
if
(!
Common
.
agvInfo
[
i
].
Msg
.
Equals
(
""
))
msglist
.
Add
(
new
AlarmMsg
(
Common
.
agvInfo
[
i
].
Name
,
"lineAgv."
+
Common
.
agvInfo
[
i
].
Name
+
".Msg"
,
Common
.
agvInfo
[
i
].
Msg
,
1
));
}
catch
(
Exception
ex
)
{
Common
.
log
.
Error
(
"上报小车运行步骤失败"
+
ex
.
Message
+
ex
.
StackTrace
);
}
}
}
//if (change)
BLL
.
AGVManager
.
updateDeviceAlarmMsg
(
msglist
);
lblWO
.
Text
=
Common
.
doubleLine_WO
;
lblWO
.
Text
=
Common
.
doubleLine_WO
;
lblDestInfo
.
Text
=
AGVManager
.
A6_Target
;
lblDestInfo
.
Text
=
AGVManager
.
A6_Target
;
lblCharge3
.
Text
=
"充电桩3:"
+
Common
.
chargeStatus
.
charge3
;
lblCharge4
.
Text
=
"充电桩4:"
+
Common
.
chargeStatus
.
charge4
;
}));
}));
InShhow
=
false
;
InShhow
=
false
;
}
}
...
@@ -487,7 +501,7 @@ namespace AGVControl
...
@@ -487,7 +501,7 @@ namespace AGVControl
ShowEmptyTask
();
ShowEmptyTask
();
return
;
return
;
}
}
if
(
MessageBox
.
Show
(
"确定删除产线任务["
+
cmbBoxLineName
.
SelectedItem
.
ToString
()
+
"]"
,
"手动删除解绑任务"
,
MessageBoxButtons
.
YesNo
)
==
DialogResult
.
No
)
if
(
MessageBox
.
Show
(
"确定删除产线任务["
+
cmbBoxLineName
.
SelectedItem
.
ToString
()
+
"]"
,
"手动删除解绑任务"
,
MessageBoxButtons
.
YesNo
)
==
DialogResult
.
No
)
return
;
return
;
//int idx=Common.missionList.FindIndex(s => s.NodeName == Common.agvProductionLine[txtBoxMission.Text]);
//int idx=Common.missionList.FindIndex(s => s.NodeName == Common.agvProductionLine[txtBoxMission.Text]);
...
@@ -539,7 +553,7 @@ namespace AGVControl
...
@@ -539,7 +553,7 @@ namespace AGVControl
}
}
if
(
cmbBoxLineName
.
SelectedItem
.
ToString
().
StartsWith
(
"A"
))
if
(
cmbBoxLineName
.
SelectedItem
.
ToString
().
StartsWith
(
"A"
))
return
;
return
;
if
(
MessageBox
.
Show
(
"确定添加产线任务["
+
cmbBoxLineName
.
SelectedItem
.
ToString
()
+
"]"
,
"手动1添加解绑"
,
MessageBoxButtons
.
YesNo
)
==
DialogResult
.
No
)
if
(
MessageBox
.
Show
(
"确定添加产线任务["
+
cmbBoxLineName
.
SelectedItem
.
ToString
()
+
"]"
,
"手动1添加解绑"
,
MessageBoxButtons
.
YesNo
)
==
DialogResult
.
No
)
return
;
return
;
int
idx
=
Common
.
nodeInfo
.
FindIndex
(
s
=>
s
.
AliceName
.
Equals
(
cmbBoxLineName
.
SelectedItem
.
ToString
()));
int
idx
=
Common
.
nodeInfo
.
FindIndex
(
s
=>
s
.
AliceName
.
Equals
(
cmbBoxLineName
.
SelectedItem
.
ToString
()));
if
(
idx
>
-
1
)
if
(
idx
>
-
1
)
...
@@ -658,7 +672,7 @@ namespace AGVControl
...
@@ -658,7 +672,7 @@ namespace AGVControl
if
(
idx
<
0
)
return
;
if
(
idx
<
0
)
return
;
if
(
Common
.
agvInfo
[
idx
].
IsCon
)
if
(
Common
.
agvInfo
[
idx
].
IsCon
)
{
{
Common
.
agvInfo
[
idx
].
CurJob
=
null
;
Common
.
agvInfo
[
idx
].
CurJob
=
null
;
}
}
}
}
...
@@ -668,7 +682,7 @@ namespace AGVControl
...
@@ -668,7 +682,7 @@ namespace AGVControl
if
(
DgvAgv
.
SelectedCells
.
Count
==
0
)
return
;
if
(
DgvAgv
.
SelectedCells
.
Count
==
0
)
return
;
int
idx
=
DgvAgv
.
SelectedCells
[
0
].
RowIndex
;
int
idx
=
DgvAgv
.
SelectedCells
[
0
].
RowIndex
;
if
(
idx
<
0
)
return
;
if
(
idx
<
0
)
return
;
Common
.
CalculateNearNode
(
Common
.
agvInfo
[
idx
],
"E"
);
Common
.
CalculateNearNode
(
Common
.
agvInfo
[
idx
],
"E"
);
}
}
private
void
btnUpdateStatus_Click
(
object
sender
,
EventArgs
e
)
private
void
btnUpdateStatus_Click
(
object
sender
,
EventArgs
e
)
...
@@ -680,7 +694,7 @@ namespace AGVControl
...
@@ -680,7 +694,7 @@ namespace AGVControl
if
(
idx
<
0
)
return
;
if
(
idx
<
0
)
return
;
Task
.
Factory
.
StartNew
(()
=>
Task
.
Factory
.
StartNew
(()
=>
{
{
idx
=
Common
.
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
SettingString
.
A6
));
idx
=
Common
.
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
SettingString
.
A6
));
if
(
idx
>
-
1
)
if
(
idx
>
-
1
)
{
{
AGVManager
.
UpdateStatus
(
txtBoxRFID
.
Text
.
ToUpper
(),
Common
.
agvInfo
[
idx
].
Place
);
AGVManager
.
UpdateStatus
(
txtBoxRFID
.
Text
.
ToUpper
(),
Common
.
agvInfo
[
idx
].
Place
);
...
@@ -693,5 +707,10 @@ namespace AGVControl
...
@@ -693,5 +707,10 @@ namespace AGVControl
MessageBox
.
Show
(
"手动上报状态失败:"
+
ex
.
Message
+
"\r\n"
+
ex
.
StackTrace
);
MessageBox
.
Show
(
"手动上报状态失败:"
+
ex
.
Message
+
"\r\n"
+
ex
.
StackTrace
);
}
}
}
}
private
void
dgvLineMission_Click
(
object
sender
,
EventArgs
e
)
{
ShowEmptyTask
();
}
}
}
}
}
AGVControl-ProductionLine/Program.cs
查看文件 @
75c1709
...
@@ -54,7 +54,7 @@ namespace AGVControl
...
@@ -54,7 +54,7 @@ namespace AGVControl
// Common.CheckAGVMissionState();
// Common.CheckAGVMissionState();
//获取节点位置
//获取节点位置
//
Common.GetNodesPosition();
Common
.
GetNodesPosition
();
Common
.
control
.
Start
();
Common
.
control
.
Start
();
Common
.
server
=
new
AgvServer
();
Common
.
server
=
new
AgvServer
();
Common
.
server
.
Start
();
Common
.
server
.
Start
();
...
...
AGVControl-ProductionLine/bean/Agv_Info.cs
查看文件 @
75c1709
...
@@ -118,7 +118,11 @@ namespace AGVControl
...
@@ -118,7 +118,11 @@ namespace AGVControl
/// <summary>
/// <summary>
/// 任务内容
/// 任务内容
/// </summary>
/// </summary>
public
string
Msg
{
get
;
set
;
}
public
string
Msg
{
get
;
set
;
}
=
""
;
/// <summary>
/// <summary>
/// 当前任务
/// 当前任务
/// </summary>
/// </summary>
...
@@ -165,19 +169,19 @@ namespace AGVControl
...
@@ -165,19 +169,19 @@ namespace AGVControl
tmpJob
=
(
SendFullShelfToLineJob
)
CurJob
;
tmpJob
=
(
SendFullShelfToLineJob
)
CurJob
;
if
(
RFID
.
StartsWith
(
"C"
))
if
(
RFID
.
StartsWith
(
"C"
))
{
{
return
string
.
Format
(
"Name:{1}{0}RFID:{2}{0}CurJob:{3}{0}CurTaskName:{4}{0}Run
Step:{5}{0}BoxDestInfo:{6}{0}GetRack:{7}{0}RunInfo:{8}"
,
"\r\n"
,
Name
,
RFID
,
CurJob
.
ToString
(),
CurTaskName
,
Msg
,
BoxDestInfo
,
BLL
.
AGVManager
.
GetRackBy
(
RFID
),
MissionText
);
return
string
.
Format
(
"Name:{1}{0}RFID:{2}{0}CurJob:{3}{0}CurTaskName:{4}{0}Run
Info:{5}{0}BoxDestInfo:{6}{0}GetRack:{7}{0}MissionText:{8}"
,
"\r\n"
,
Name
,
RFID
,
CurJob
.
ToString
(),
CurTaskName
,
Msg
,
BoxDestInfo
,
BLL
.
AGVManager
.
GetRackBy
(
RFID
),
MissionText
);
}
}
else
if
(!
RFID
.
Equals
(
""
))
else
if
(!
RFID
.
Equals
(
""
))
{
{
return
string
.
Format
(
"Name:{1}{0}RFID:{2}{0}CurJob:{3}{0}CurTaskName:{4}{0}Run
Step:{5}{0}BoxDestInfo:{6}{0}RunInfo:{7}"
,
"\r\n"
,
Name
,
RFID
,
CurJob
.
ToString
(),
CurTaskName
,
Msg
,
BoxDestInfo
,
MissionText
);
return
string
.
Format
(
"Name:{1}{0}RFID:{2}{0}CurJob:{3}{0}CurTaskName:{4}{0}Run
Info:{5}{0}BoxDestInfo:{6}{0}MissionText:{7}"
,
"\r\n"
,
Name
,
RFID
,
CurJob
.
ToString
(),
CurTaskName
,
Msg
,
BoxDestInfo
,
MissionText
);
}
}
else
else
return
string
.
Format
(
"Name:{1}{0}RFID:{2}{0}CurJob:{3}{0}CurTaskName:{4}{0}Run
Step:{5}{0}RunInfo:{6}"
,
"\r\n"
,
Name
,
RFID
,
CurJob
.
ToString
(),
CurTaskName
,
Msg
,
MissionText
);
return
string
.
Format
(
"Name:{1}{0}RFID:{2}{0}CurJob:{3}{0}CurTaskName:{4}{0}Run
Info:{5}{0}MissionText:{6}"
,
"\r\n"
,
Name
,
RFID
,
CurJob
.
ToString
(),
CurTaskName
,
Msg
,
MissionText
);
}
}
else
else
return
string
.
Format
(
"Name:{1}{0}RFID:{2}{0}CurTaskName:{3}{0}
RunInfo:{4}"
,
"\r\n"
,
Name
,
RFID
,
CurTaskName
,
MissionText
);
return
string
.
Format
(
"Name:{1}{0}RFID:{2}{0}CurTaskName:{3}{0}
MissionText:{4}"
,
"\r\n"
,
Name
,
RFID
,
CurTaskName
,
MissionText
);
}
}
public
Agv_Info
(
string
id
,
string
name
,
string
ip
,
string
authorization
,
string
ioID
,
bool
isUse
,
string
rfid
)
public
Agv_Info
(
string
id
,
string
name
,
string
ip
,
string
authorization
,
string
ioID
,
bool
isUse
,
string
rfid
)
{
{
...
@@ -232,7 +236,7 @@ namespace AGVControl
...
@@ -232,7 +236,7 @@ namespace AGVControl
IsExistShelf
=
input
[
3
];
IsExistShelf
=
input
[
3
];
}
}
}
}
if
(!
StateID
.
Equals
(
stateID
)
||
!
CurTaskState
.
Equals
(
stateText
)
if
(!
StateID
.
Equals
(
stateID
)
||
!
CurTaskState
.
Equals
(
stateText
)
||
!
Battery
.
Equals
(
battery
)
||
!
MissionText
.
Equals
(
missionText
)
||
!
IsExistShelf
.
Equals
(
preShelfState
))
||
!
MissionText
.
Equals
(
missionText
)
||
!
IsExistShelf
.
Equals
(
preShelfState
))
isChange
=
true
;
isChange
=
true
;
StateID
=
stateID
;
StateID
=
stateID
;
...
@@ -245,7 +249,7 @@ namespace AGVControl
...
@@ -245,7 +249,7 @@ namespace AGVControl
public
void
GetPlace
(
int
value
)
public
void
GetPlace
(
int
value
)
{
{
// Common.log.Debug(Name + " PLC20=" + value);
// Common.log.Debug(Name + " PLC20=" + value);
if
(
value
==
0
)
if
(
value
==
0
)
{
{
Place
=
""
;
Place
=
""
;
...
@@ -289,7 +293,7 @@ namespace AGVControl
...
@@ -289,7 +293,7 @@ namespace AGVControl
s
.
Add
(
CurTaskState
);
s
.
Add
(
CurTaskState
);
s
.
Add
(
RFID
);
s
.
Add
(
RFID
);
//s.Add(Msg);
//s.Add(Msg);
// s.Add(MissionText);
// s.Add(MissionText);
s
.
Add
(
PlaceAliceName
);
s
.
Add
(
PlaceAliceName
);
//s.Add(Place);
//s.Add(Place);
s
.
Add
(
PlaceState
.
ToString
());
s
.
Add
(
PlaceState
.
ToString
());
...
...
AGVControl-ProductionLine/bean/Job.cs
查看文件 @
75c1709
...
@@ -13,11 +13,9 @@ namespace AGVControl
...
@@ -13,11 +13,9 @@ namespace AGVControl
/// <summary>
/// <summary>
///
任务是否结束
///
运行信息
/// </summary>
/// </summary>
/// <returns></returns>
public
abstract
string
RunInfo
{
get
;
}
public
abstract
bool
IsEnd
{
get
;
}
/// <summary>
/// <summary>
/// 根据任务状态继续执行任务
/// 根据任务状态继续执行任务
/// </summary>
/// </summary>
...
...
AGVControl-ProductionLine/bean/job/ChargeJob.cs
查看文件 @
75c1709
此文件的差异被折叠,
点击展开。
AGVControl-ProductionLine/bean/job/EmptyAGVBackJob.cs
查看文件 @
75c1709
...
@@ -31,10 +31,15 @@ namespace AGVControl
...
@@ -31,10 +31,15 @@ namespace AGVControl
/// </summary>
/// </summary>
private
string
agvPlace
{
get
;
set
;
}
private
string
agvPlace
{
get
;
set
;
}
private
string
runInfo
=
""
;
/// <summary>
/// <summary>
///
到达待机位
///
运行信息
/// </summary>
/// </summary>
public
override
bool
IsEnd
{
get
{
return
EmptyAGVBackStep
.
IsStep
(
EMPTY_AGV_BACK_STEP
.
END
);
}
}
public
override
string
RunInfo
{
get
{
return
runInfo
;
}
}
private
JobStep
<
EMPTY_AGV_BACK_STEP
>
EmptyAGVBackStep
=
new
JobStep
<
EMPTY_AGV_BACK_STEP
>(
EMPTY_AGV_BACK_STEP
.
NONE
);
private
JobStep
<
EMPTY_AGV_BACK_STEP
>
EmptyAGVBackStep
=
new
JobStep
<
EMPTY_AGV_BACK_STEP
>(
EMPTY_AGV_BACK_STEP
.
NONE
);
...
@@ -44,31 +49,61 @@ namespace AGVControl
...
@@ -44,31 +49,61 @@ namespace AGVControl
/// <param name="agv"></param>
/// <param name="agv"></param>
public
override
Job
Execute
(
Agv_Info
agv
)
public
override
Job
Execute
(
Agv_Info
agv
)
{
{
string
msg
=
agv
.
Name
+
" "
;
string
msg
=
agv
.
Name
+
" "
;
bool
rtn
=
false
;
bool
rtn
=
false
;
agv
.
Msg
=
EmptyAGVBackStep
.
Msg
;
agv
.
Msg
=
runInfo
;
if
(
EmptyAGVBackStep
.
IsStep
(
EMPTY_AGV_BACK_STEP
.
NONE
))
if
(
EmptyAGVBackStep
.
IsStep
(
EMPTY_AGV_BACK_STEP
.
NONE
))
{
{
if
(
Common
.
FindEmptyShelfNode
(
agv
,
out
string
nodeName
,
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
)
{
runInfo
=
"小车在产线 "
+
agvPlace
+
" 准备返回时检测到 "
+
nodeName
+
" 有空料架"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
GoEmptyShelfLineJob
(
agvPlace
,
nodeName
);
}
else
{
if
(
agvPlace
.
StartsWith
(
"G"
))
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
}
else
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_REACH_STANDBY
);
runInfo
=
"从产线"
+
agvPlace
+
"回待机位"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
}
}
//EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.END);
//EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.END);
msg
=
"小车在产线 "
+
agvPlace
+
" 准备返回时检测到 "
+
nodeName
+
" 有空料架"
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
GoEmptyShelfLineJob
(
agvPlace
,
nodeName
);
}
}
else
else
{
{
if
(
agvPlace
.
StartsWith
(
"G"
))
if
(
agvPlace
.
StartsWith
(
"G"
))
{
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
msg
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
runInfo
=
"从产线"
+
agvPlace
+
"回待机位,先到4D门"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
}
}
else
else
{
{
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_REACH_STANDBY
);
EmptyAGVBackStep
.
ToNextStep
(
EMPTY_AGV_BACK_STEP
.
WAIT_REACH_STANDBY
);
msg
=
"从产线"
+
agvPlace
+
"回待机位"
;
runInfo
=
"从产线"
+
agvPlace
+
"回待机位"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
EmptyAGVBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
}
}
...
@@ -81,13 +116,15 @@ namespace AGVControl
...
@@ -81,13 +116,15 @@ namespace AGVControl
Job
job
=
Common
.
control
.
GetJob
(
agv
);
Job
job
=
Common
.
control
.
GetJob
(
agv
);
if
(
job
==
null
&&
agv
.
Battery
<
Common
.
chargeStatus
.
chargeMax
)
if
(
job
==
null
&&
agv
.
Battery
<
Common
.
chargeStatus
.
chargeMax
)
{
{
msg
=
"到达待机位,电量["
+
agv
.
Battery
+
"]小于最大电量["
+
Common
.
chargeStatus
.
chargeMax
+
"],暂无任务,去充电"
;
runInfo
=
"到达待机位,电量["
+
agv
.
Battery
+
"]小于最大电量["
+
Common
.
chargeStatus
.
chargeMax
+
"],暂无任务,去充电"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
ChargeJob
(
""
);
return
new
ChargeJob
(
""
);
}
}
else
else
{
{
msg
=
"到达待机位,检测到新任务,执行任务"
;
runInfo
=
"到达待机位,检测到新任务,执行任务"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
job
;
return
job
;
}
}
...
@@ -97,7 +134,8 @@ namespace AGVControl
...
@@ -97,7 +134,8 @@ namespace AGVControl
{
{
if
(
Common
.
FindFullShelfTask
(
agv
))
if
(
Common
.
FindFullShelfTask
(
agv
))
{
{
msg
=
"从产线"
+
agvPlace
+
"回待机位过程中,检测到A6出满料,去A6"
;
runInfo
=
"从产线"
+
agvPlace
+
"回待机位过程中,检测到A6出满料,去A6"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
GoFullShelfStationJob
(
SettingString
.
Standby
);
return
new
GoFullShelfStationJob
(
SettingString
.
Standby
);
}
}
...
@@ -116,13 +154,15 @@ namespace AGVControl
...
@@ -116,13 +154,15 @@ namespace AGVControl
{
{
if
(
Common
.
FindFullShelfTask
(
agv
))
if
(
Common
.
FindFullShelfTask
(
agv
))
{
{
msg
=
"从产线"
+
agvPlace
+
"到达4D门,检测到A6出满料,去A6"
;
runInfo
=
"从产线"
+
agvPlace
+
"到达4D门,检测到A6出满料,去A6"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
GoFullShelfStationJob
(
SettingString
.
D4_DOOR_Name
);
return
new
GoFullShelfStationJob
(
SettingString
.
D4_DOOR_Name
);
}
}
else
else
{
{
msg
=
"从产线"
+
agvPlace
+
"到达4D门,暂无任务,去充电位"
;
runInfo
=
"从产线"
+
agvPlace
+
"到达4D门,暂无任务,去充电位"
;
msg
+=
runInfo
;
EmptyAGVBackStep
.
Msg
=
msg
;
EmptyAGVBackStep
.
Msg
=
msg
;
return
new
ChargeJob
(
SettingString
.
D4_DOOR_Name
);
return
new
ChargeJob
(
SettingString
.
D4_DOOR_Name
);
}
}
...
...
AGVControl-ProductionLine/bean/job/EmptyShelfBackJob.cs
查看文件 @
75c1709
...
@@ -42,7 +42,15 @@ namespace AGVControl
...
@@ -42,7 +42,15 @@ namespace AGVControl
private
eShelfType
shelfType
;
private
eShelfType
shelfType
;
public
override
bool
IsEnd
{
get
{
return
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
END
);
}
}
private
string
runInfo
=
""
;
/// <summary>
/// 运行信息
/// </summary>
public
override
string
RunInfo
{
get
{
return
runInfo
;
}
}
private
JobStep
<
EMPTY_SHELF_BACK_STEP
>
EmptyBackStep
=
new
JobStep
<
EMPTY_SHELF_BACK_STEP
>(
EMPTY_SHELF_BACK_STEP
.
NONE
);
private
JobStep
<
EMPTY_SHELF_BACK_STEP
>
EmptyBackStep
=
new
JobStep
<
EMPTY_SHELF_BACK_STEP
>(
EMPTY_SHELF_BACK_STEP
.
NONE
);
...
@@ -52,15 +60,16 @@ namespace AGVControl
...
@@ -52,15 +60,16 @@ namespace AGVControl
/// <param name="agv"></param>
/// <param name="agv"></param>
public
override
Job
Execute
(
Agv_Info
agv
)
public
override
Job
Execute
(
Agv_Info
agv
)
{
{
string
msg
=
"
"
;
string
msg
=
agv
.
Name
+
"
"
;
bool
rtn
=
false
;
bool
rtn
=
false
;
agv
.
Msg
=
EmptyBackStep
.
Msg
;
agv
.
Msg
=
runInfo
;
if
(
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
NONE
))
if
(
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
NONE
))
{
{
if
(
EmptyShelfPlace
.
StartsWith
(
"G"
))
//4车间
if
(
EmptyShelfPlace
.
StartsWith
(
"G"
))
//4车间
{
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_DOOR
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_DOOR
);
msg
=
"空料架从产线"
+
EmptyShelfPlace
+
"前往4D门"
;
runInfo
=
"空料架从产线"
+
EmptyShelfPlace
+
"前往4D门"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
}
}
...
@@ -70,7 +79,8 @@ namespace AGVControl
...
@@ -70,7 +79,8 @@ namespace AGVControl
{
{
EmptyShelfTargetPlace
=
nodeName
;
EmptyShelfTargetPlace
=
nodeName
;
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
msg
=
"空料架从产线 ["
+
EmptyShelfPlace
+
"] 送往双层线"
+
EmptyShelfTargetPlace
;
runInfo
=
"空料架从产线 ["
+
EmptyShelfPlace
+
"] 送往双层线"
+
EmptyShelfTargetPlace
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
if
(!
EmptyShelfTargetPlace
.
Equals
(
""
))
if
(!
EmptyShelfTargetPlace
.
Equals
(
""
))
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
...
@@ -78,7 +88,8 @@ namespace AGVControl
...
@@ -78,7 +88,8 @@ namespace AGVControl
else
else
{
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_STANDBY
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_STANDBY
);
msg
=
"双层线暂不需要空料架,从产线["
+
EmptyShelfPlace
+
"]到待机位"
;
runInfo
=
"双层线暂不需要空料架,从产线["
+
EmptyShelfPlace
+
"]到待机位"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
}
}
...
@@ -92,14 +103,16 @@ namespace AGVControl
...
@@ -92,14 +103,16 @@ namespace AGVControl
{
{
EmptyShelfTargetPlace
=
nodeName
;
EmptyShelfTargetPlace
=
nodeName
;
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
msg
=
"空料架从产线 ["
+
EmptyShelfPlace
+
"] 送往双层线"
+
EmptyShelfTargetPlace
;
runInfo
=
"空料架从产线 ["
+
EmptyShelfPlace
+
"] 送往双层线"
+
EmptyShelfTargetPlace
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
}
}
else
else
{
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_STANDBY
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_STANDBY
);
msg
=
"双层线暂不需要空料架,从产线["
+
EmptyShelfPlace
+
"]到待机位"
;
runInfo
=
"双层线暂不需要空料架,从产线["
+
EmptyShelfPlace
+
"]到待机位"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
Common
.
MoveToNode
(
agv
,
SettingString
.
Standby
);
}
}
...
@@ -111,7 +124,8 @@ namespace AGVControl
...
@@ -111,7 +124,8 @@ namespace AGVControl
{
{
EmptyShelfTargetPlace
=
nodeName
;
EmptyShelfTargetPlace
=
nodeName
;
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
msg
=
"待机位检测到双层线需要料架,送往双层线 "
+
EmptyShelfTargetPlace
;
runInfo
=
"待机位检测到双层线需要料架,送往双层线 "
+
EmptyShelfTargetPlace
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
Common
.
MoveToNode
(
agv
,
EmptyShelfTargetPlace
);
}
}
...
@@ -124,7 +138,8 @@ namespace AGVControl
...
@@ -124,7 +138,8 @@ namespace AGVControl
//EmptyBackStep.Msg = msg;
//EmptyBackStep.Msg = msg;
//return new EnterLeaveShelfJob(EmptyShelfTargetPlace,eEnterLeaveType.Leave,shelfType);
//return new EnterLeaveShelfJob(EmptyShelfTargetPlace,eEnterLeaveType.Leave,shelfType);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_DOUBLE_LINE_RESPONSE
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_DOUBLE_LINE_RESPONSE
);
msg
=
"AGV到达 "
+
EmptyShelfTargetPlace
+
",并发送入料架请求[ReadyEnter]"
;
runInfo
=
"AGV到达 "
+
EmptyShelfTargetPlace
+
",并发送入料架请求[ReadyEnter]"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
Common
.
server
.
ReadyEnter
(
EmptyShelfTargetPlace
);
Common
.
server
.
ReadyEnter
(
EmptyShelfTargetPlace
);
}
}
...
@@ -138,7 +153,8 @@ namespace AGVControl
...
@@ -138,7 +153,8 @@ namespace AGVControl
if
(!
agv
.
CurTaskName
.
Equals
(
"Leave"
))
if
(!
agv
.
CurTaskName
.
Equals
(
"Leave"
))
{
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT__EMPTY_SHELF_IN_DOUBLE_LINE
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT__EMPTY_SHELF_IN_DOUBLE_LINE
);
msg
=
"收到双层线入料架请求[ReadyEnter]的响应 "
+
EmptyShelfTargetPlace
+
"入料架,小车链条运行"
;
runInfo
=
"收到双层线入料架请求[ReadyEnter]的响应 "
+
EmptyShelfTargetPlace
+
"入料架,小车链条运行"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Leave"
]);
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Leave"
]);
agv
.
TaskSend
=
rtn
?
"Leave"
:
""
;
agv
.
TaskSend
=
rtn
?
"Leave"
:
""
;
...
@@ -148,13 +164,14 @@ namespace AGVControl
...
@@ -148,13 +164,14 @@ namespace AGVControl
else
if
(
EmptyBackStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
else
if
(
EmptyBackStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
{
{
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
EmptyBackStep
.
ToNextStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT_AGV_REACH_A5A6
);
msg
=
"AGV到达 "
+
EmptyShelfTargetPlace
+
",15秒后重新向双层线发送入料架请求[ReadyEnter]"
;
runInfo
=
"AGV到达 "
+
EmptyShelfTargetPlace
+
",15秒后重新向双层线发送入料架请求[ReadyEnter]"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
}
}
}
}
else
if
(
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT__EMPTY_SHELF_IN_DOUBLE_LINE
))
else
if
(
EmptyBackStep
.
IsStep
(
EMPTY_SHELF_BACK_STEP
.
WAIT__EMPTY_SHELF_IN_DOUBLE_LINE
))
{
{
if
(
agv
.
Place
.
Equals
(
EmptyShelfTargetPlace
)
&&
agv
.
PlaceState
.
Equals
(
ePlaceState
.
LeaveFinish
))
if
(
Common
.
CheckEnterOrLeaveFinished
(
agv
,
"Leave"
,
agv
.
CurTaskGUID
))
{
{
//EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.END);
//EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.END);
...
@@ -162,13 +179,15 @@ namespace AGVControl
...
@@ -162,13 +179,15 @@ namespace AGVControl
Job
job
=
Common
.
control
.
GetJob
(
agv
);
Job
job
=
Common
.
control
.
GetJob
(
agv
);
if
(
job
!=
null
)
if
(
job
!=
null
)
{
{
msg
+=
"在双层线检测到任务,执行任务"
;
runInfo
=
"在双层线检测到任务,执行任务"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
return
job
;
return
job
;
}
}
else
else
{
{
msg
=
"空料架进入"
+
EmptyShelfTargetPlace
+
"完成,暂无任务,回充电位"
;
runInfo
=
"空料架进入"
+
EmptyShelfTargetPlace
+
"完成,暂无任务,回充电位"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
return
new
ChargeJob
(
SettingString
.
DoubleLine_Name_Prefix
);
return
new
ChargeJob
(
SettingString
.
DoubleLine_Name_Prefix
);
}
}
...
@@ -177,7 +196,8 @@ namespace AGVControl
...
@@ -177,7 +196,8 @@ namespace AGVControl
else
if
(
EmptyBackStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
else
if
(
EmptyBackStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
{
//链条停止
//链条停止
msg
=
"空料架在["
+
EmptyShelfTargetPlace
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
runInfo
=
"空料架在["
+
EmptyShelfTargetPlace
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
msg
+=
runInfo
;
EmptyBackStep
.
Msg
=
msg
;
EmptyBackStep
.
Msg
=
msg
;
}
}
...
...
AGVControl-ProductionLine/bean/job/EnterLeaveShelfJob.cs
查看文件 @
75c1709
...
@@ -53,15 +53,23 @@ namespace AGVControl
...
@@ -53,15 +53,23 @@ namespace AGVControl
public
eEnterLeaveType
ActionType
{
get
;
set
;
}
public
eEnterLeaveType
ActionType
{
get
;
set
;
}
private
eShelfType
shelfType
;
private
eShelfType
shelfType
;
public
override
bool
IsEnd
{
get
{
return
EnterLeaveShelfStep
.
IsStep
(
ENTER_LEAVE_SHELF_STEP
.
END
);
}
}
private
string
runInfo
=
""
;
/// <summary>
/// 运行信息
/// </summary>
public
override
string
RunInfo
{
get
{
return
runInfo
;
}
}
private
JobStep
<
ENTER_LEAVE_SHELF_STEP
>
EnterLeaveShelfStep
=
new
JobStep
<
ENTER_LEAVE_SHELF_STEP
>(
ENTER_LEAVE_SHELF_STEP
.
NONE
);
private
JobStep
<
ENTER_LEAVE_SHELF_STEP
>
EnterLeaveShelfStep
=
new
JobStep
<
ENTER_LEAVE_SHELF_STEP
>(
ENTER_LEAVE_SHELF_STEP
.
NONE
);
public
override
Job
Execute
(
Agv_Info
agv
)
public
override
Job
Execute
(
Agv_Info
agv
)
{
{
string
msg
=
"
"
;
string
msg
=
agv
.
Name
+
"
"
;
bool
rtn
=
false
;
bool
rtn
=
false
;
agv
.
Msg
=
EnterLeaveShelfStep
.
Msg
;
agv
.
Msg
=
runInfo
;
if
(
EnterLeaveShelfStep
.
IsStep
(
ENTER_LEAVE_SHELF_STEP
.
NONE
))
if
(
EnterLeaveShelfStep
.
IsStep
(
ENTER_LEAVE_SHELF_STEP
.
NONE
))
{
{
if
(
ActionType
.
Equals
(
eEnterLeaveType
.
Leave
))
if
(
ActionType
.
Equals
(
eEnterLeaveType
.
Leave
))
...
@@ -71,7 +79,8 @@ namespace AGVControl
...
@@ -71,7 +79,8 @@ namespace AGVControl
//EnterLeaveShelfStep.Msg = msg;
//EnterLeaveShelfStep.Msg = msg;
//Common.server.ReadyEnter(LineName);
//Common.server.ReadyEnter(LineName);
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_IN_LINE
);
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_IN_LINE
);
msg
=
LineName
+
"入料架,小车链条运行"
;
runInfo
=
LineName
+
"入料架,小车链条运行"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Leave"
]);
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Leave"
]);
agv
.
TaskSend
=
rtn
?
"Leave"
:
""
;
agv
.
TaskSend
=
rtn
?
"Leave"
:
""
;
...
@@ -83,7 +92,8 @@ namespace AGVControl
...
@@ -83,7 +92,8 @@ namespace AGVControl
//EnterLeaveShelfStep.Msg = msg;
//EnterLeaveShelfStep.Msg = msg;
//Common.server.ReadyLeave(LineName);
//Common.server.ReadyLeave(LineName);
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_OUT_LINE
);
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_OUT_LINE
);
msg
=
LineName
+
"出料架,小车链条运行"
;
runInfo
=
LineName
+
"出料架,小车链条运行"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Enter"
]);
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Enter"
]);
agv
.
TaskSend
=
rtn
?
"Enter"
:
""
;
agv
.
TaskSend
=
rtn
?
"Enter"
:
""
;
...
@@ -96,7 +106,8 @@ namespace AGVControl
...
@@ -96,7 +106,8 @@ namespace AGVControl
if
(
node
.
StateEquals
(
eNodeStatus
.
MayEnter
))
if
(
node
.
StateEquals
(
eNodeStatus
.
MayEnter
))
{
{
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_IN_LINE
);
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_IN_LINE
);
msg
=
"收到产线入料架请求[ReadyEnter]的响应, "
+
LineName
+
"入料架,小车链条运行"
;
runInfo
=
"收到产线入料架请求[ReadyEnter]的响应, "
+
LineName
+
"入料架,小车链条运行"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Leave"
]);
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Leave"
]);
agv
.
TaskSend
=
rtn
?
"Leave"
:
""
;
agv
.
TaskSend
=
rtn
?
"Leave"
:
""
;
...
@@ -104,7 +115,8 @@ namespace AGVControl
...
@@ -104,7 +115,8 @@ namespace AGVControl
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
{
{
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
NONE
);
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
NONE
);
msg
=
"AGV到达 "
+
LineName
+
",15秒后重新向产线发送入料架请求[ReadyEnter]"
;
runInfo
=
"AGV到达 "
+
LineName
+
",15秒后重新向产线发送入料架请求[ReadyEnter]"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
}
}
}
}
...
@@ -115,7 +127,8 @@ namespace AGVControl
...
@@ -115,7 +127,8 @@ namespace AGVControl
if
(
node
.
StateEquals
(
eNodeStatus
.
MayLeave
))
if
(
node
.
StateEquals
(
eNodeStatus
.
MayLeave
))
{
{
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_OUT_LINE
);
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_OUT_LINE
);
msg
=
"收到产线出料架请求[ReadyLeave]的响应, "
+
LineName
+
"出料架,小车链条运行"
;
runInfo
=
"收到产线出料架请求[ReadyLeave]的响应, "
+
LineName
+
"出料架,小车链条运行"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Enter"
]);
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Enter"
]);
agv
.
TaskSend
=
rtn
?
"Enter"
:
""
;
agv
.
TaskSend
=
rtn
?
"Enter"
:
""
;
...
@@ -123,17 +136,19 @@ namespace AGVControl
...
@@ -123,17 +136,19 @@ namespace AGVControl
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
{
{
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
NONE
);
EnterLeaveShelfStep
.
ToNextStep
(
ENTER_LEAVE_SHELF_STEP
.
NONE
);
msg
=
"AGV到达 "
+
LineName
+
",15秒后重新向产线发送入料架请求[ReadyLeave]"
;
runInfo
=
"AGV到达 "
+
LineName
+
",15秒后重新向产线发送入料架请求[ReadyLeave]"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
}
}
}
}
else
if
(
EnterLeaveShelfStep
.
IsStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_IN_LINE
))
else
if
(
EnterLeaveShelfStep
.
IsStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_IN_LINE
))
{
{
if
(
agv
.
Place
.
Equals
(
LineName
)
&&
agv
.
PlaceState
.
Equals
(
ePlaceState
.
LeaveFinish
))
if
(
Common
.
CheckEnterOrLeaveFinished
(
agv
,
"Leave"
,
agv
.
CurTaskGUID
))
{
{
//EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END);
//EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END);
msg
=
"料架进入"
+
LineName
+
"完成 ["
+
RFID
+
"]"
;
runInfo
=
"料架进入"
+
LineName
+
"完成 ["
+
RFID
+
"]"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
agv
.
RFID
=
""
;
agv
.
RFID
=
""
;
return
new
EmptyAGVBackJob
(
LineName
);
return
new
EmptyAGVBackJob
(
LineName
);
...
@@ -142,26 +157,29 @@ namespace AGVControl
...
@@ -142,26 +157,29 @@ namespace AGVControl
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
{
//链条停止
//链条停止
msg
=
"料架在["
+
LineName
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
runInfo
=
"料架在["
+
LineName
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
}
}
}
}
else
if
(
EnterLeaveShelfStep
.
IsStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_OUT_LINE
))
else
if
(
EnterLeaveShelfStep
.
IsStep
(
ENTER_LEAVE_SHELF_STEP
.
WAIT__SHELF_OUT_LINE
))
{
{
if
(
agv
.
Place
.
Equals
(
LineName
)
&&
agv
.
PlaceState
.
Equals
(
ePlaceState
.
EnterFinish
))
if
(
Common
.
CheckEnterOrLeaveFinished
(
agv
,
"Enter"
,
agv
.
CurTaskGUID
))
{
{
//EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END);
//EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END);
msg
=
"料架在"
+
LineName
+
"出去完成 ["
+
RFID
+
"]"
;
runInfo
=
"料架在"
+
LineName
+
"出去完成 ["
+
RFID
+
"]"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
Common
.
DelEmptyShelfTask
(
LineName
);
Common
.
DelEmptyShelfTask
(
LineName
);
return
new
EmptyShelfBackJob
(
LineName
,
shelfType
);
return
new
EmptyShelfBackJob
(
LineName
,
eShelfType
.
BigShelf
);
}
}
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
{
//链条停止
//链条停止
msg
=
"料架在["
+
LineName
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
;
runInfo
=
"料架在["
+
LineName
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
}
}
...
...
AGVControl-ProductionLine/bean/job/GoEmptyShelfLineJob.cs
查看文件 @
75c1709
...
@@ -36,7 +36,15 @@ namespace AGVControl
...
@@ -36,7 +36,15 @@ namespace AGVControl
private
string
agvPlae
{
get
;
set
;
}
private
string
agvPlae
{
get
;
set
;
}
public
override
bool
IsEnd
{
get
{
return
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
END
);
}
}
private
string
runInfo
=
""
;
/// <summary>
/// 运行信息
/// </summary>
public
override
string
RunInfo
{
get
{
return
runInfo
;
}
}
private
JobStep
<
TAKE_EMPTY_STEP
>
TakeEmptyStep
=
new
JobStep
<
TAKE_EMPTY_STEP
>(
TAKE_EMPTY_STEP
.
NONE
);
private
JobStep
<
TAKE_EMPTY_STEP
>
TakeEmptyStep
=
new
JobStep
<
TAKE_EMPTY_STEP
>(
TAKE_EMPTY_STEP
.
NONE
);
...
@@ -46,9 +54,9 @@ namespace AGVControl
...
@@ -46,9 +54,9 @@ namespace AGVControl
/// <param name="agv"></param>
/// <param name="agv"></param>
public
override
Job
Execute
(
Agv_Info
agv
)
public
override
Job
Execute
(
Agv_Info
agv
)
{
{
string
msg
=
agv
.
Name
+
" "
;
string
msg
=
agv
.
Name
+
" "
;
bool
rtn
=
false
;
bool
rtn
=
false
;
agv
.
Msg
=
TakeEmptyStep
.
Msg
;
agv
.
Msg
=
runInfo
;
int
nodeIdx
=
Common
.
FindNode
(
EmptyShelfPlace
);
int
nodeIdx
=
Common
.
FindNode
(
EmptyShelfPlace
);
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
NONE
))
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
NONE
))
...
@@ -56,22 +64,25 @@ namespace AGVControl
...
@@ -56,22 +64,25 @@ namespace AGVControl
if
(
agvPlae
.
StartsWith
(
"G"
)
&&
EmptyShelfPlace
.
StartsWith
(
"E"
))
//4C->4D
if
(
agvPlae
.
StartsWith
(
"G"
)
&&
EmptyShelfPlace
.
StartsWith
(
"E"
))
//4C->4D
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
msg
+=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4D门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4D门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
}
}
else
if
((
agvPlae
.
StartsWith
(
"E"
)
||
agvPlae
.
StartsWith
(
"A"
)
)
else
if
((
agvPlae
.
StartsWith
(
"E"
)
||
agvPlae
.
StartsWith
(
"A"
)
||
agvPlae
.
StartsWith
(
"I"
)
||
agvPlae
.
StartsWith
(
"H"
))
&&
EmptyShelfPlace
.
StartsWith
(
"G"
))
//4D->4C
&&
EmptyShelfPlace
.
StartsWith
(
"G"
))
//4D->4C
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4C_DOOR
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4C_DOOR
);
msg
+=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
}
}
else
else
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
msg
+=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
}
}
...
@@ -80,7 +91,8 @@ namespace AGVControl
...
@@ -80,7 +91,8 @@ namespace AGVControl
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorDToC
,
agv
.
CurTaskGUID
))
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorDToC
,
agv
.
CurTaskGUID
))
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
msg
+=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
}
}
...
@@ -89,7 +101,8 @@ namespace AGVControl
...
@@ -89,7 +101,8 @@ namespace AGVControl
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorCToD
,
agv
.
CurTaskGUID
))
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorCToD
,
agv
.
CurTaskGUID
))
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
msg
+=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
}
}
...
@@ -99,14 +112,16 @@ namespace AGVControl
...
@@ -99,14 +112,16 @@ namespace AGVControl
if
(
nodeIdx
>
-
1
)
if
(
nodeIdx
>
-
1
)
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_START_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_START_TASK
);
msg
+=
"AGV 添加任务:移动到"
+
EmptyShelfPlace
;
runInfo
=
"AGV 添加任务:移动到"
+
EmptyShelfPlace
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
EmptyShelfPlace
);
Common
.
MoveToNode
(
agv
,
EmptyShelfPlace
);
}
}
else
else
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
msg
+=
EmptyShelfPlace
+
" 不存在或未开启调用"
;
runInfo
=
EmptyShelfPlace
+
" 不存在或未开启调用"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
}
}
...
@@ -115,7 +130,8 @@ namespace AGVControl
...
@@ -115,7 +130,8 @@ namespace AGVControl
if
(
agv
.
CurTaskState
.
Equals
(
SettingString
.
Executing
))
if
(
agv
.
CurTaskState
.
Equals
(
SettingString
.
Executing
))
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_PLACE
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_PLACE
);
msg
+=
"AGV开始向目的地["
+
EmptyShelfPlace
+
"]移动"
;
runInfo
=
"AGV开始向目的地["
+
EmptyShelfPlace
+
"]移动"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
}
}
...
@@ -125,14 +141,16 @@ namespace AGVControl
...
@@ -125,14 +141,16 @@ namespace AGVControl
{
{
if
(
EmptyShelfPlace
.
Equals
(
"G22"
))
if
(
EmptyShelfPlace
.
Equals
(
"G22"
))
{
{
msg
+=
"AGV到达 "
+
EmptyShelfPlace
;
runInfo
=
"AGV到达 "
+
EmptyShelfPlace
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
return
new
EnterLeaveShelfJob
(
EmptyShelfPlace
,
eEnterLeaveType
.
Enter
);
return
new
EnterLeaveShelfJob
(
EmptyShelfPlace
,
eEnterLeaveType
.
Enter
);
}
}
else
else
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_LINE_RESPONSE
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_LINE_RESPONSE
);
msg
+=
"AGV到达 "
+
EmptyShelfPlace
+
" 向产线发送出料架请求[ReadyLeave]"
;
runInfo
=
"AGV到达 "
+
EmptyShelfPlace
+
" 向产线发送出料架请求[ReadyLeave]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
server
.
ReadyLeave
(
EmptyShelfPlace
);
Common
.
server
.
ReadyLeave
(
EmptyShelfPlace
);
}
}
...
@@ -141,13 +159,20 @@ namespace AGVControl
...
@@ -141,13 +159,20 @@ namespace AGVControl
}
}
else
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
WAIT_LINE_RESPONSE
))
else
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
WAIT_LINE_RESPONSE
))
{
{
if
(
nodeIdx
==-
1
)
{
runInfo
=
EmptyShelfPlace
+
" 未开启调用"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
ClientNode
node
=
Common
.
nodeInfo
[
nodeIdx
];
ClientNode
node
=
Common
.
nodeInfo
[
nodeIdx
];
if
(
node
.
StateEquals
(
eNodeStatus
.
MayLeave
))
if
(
node
.
StateEquals
(
eNodeStatus
.
MayLeave
))
{
{
if
(!
agv
.
CurTaskName
.
Equals
(
"Enter"
))
if
(!
agv
.
CurTaskName
.
Equals
(
"Enter"
))
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_TAKE_EMPTY_SHELF
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_TAKE_EMPTY_SHELF
);
msg
+=
"收到产线出料请求[ReadyLeave]的响应 "
+
EmptyShelfPlace
+
"出料架,小车链条运行"
;
runInfo
=
"收到产线出料请求[ReadyLeave]的响应 "
+
EmptyShelfPlace
+
"出料架,小车链条运行"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
agv
.
RFID
=
node
.
RFID
;
agv
.
RFID
=
node
.
RFID
;
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Enter"
]);
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Enter"
]);
...
@@ -158,13 +183,14 @@ namespace AGVControl
...
@@ -158,13 +183,14 @@ namespace AGVControl
else
if
(
TakeEmptyStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
else
if
(
TakeEmptyStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_PLACE
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_PLACE
);
msg
+=
"AGV到达 "
+
EmptyShelfPlace
+
",15秒后重新向产线发送出料架请求[ReadyLeave]"
;
runInfo
=
"AGV到达 "
+
EmptyShelfPlace
+
",15秒后重新向产线发送出料架请求[ReadyLeave]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
}
}
else
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
WAIT_TAKE_EMPTY_SHELF
))
else
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
WAIT_TAKE_EMPTY_SHELF
))
{
{
if
(
agv
.
PlaceState
.
Equals
(
ePlaceState
.
EnterFinish
))
if
(
Common
.
CheckEnterOrLeaveFinished
(
agv
,
"Enter"
,
agv
.
CurTaskGUID
))
{
{
ClientNode
node
=
Common
.
nodeInfo
[
nodeIdx
];
ClientNode
node
=
Common
.
nodeInfo
[
nodeIdx
];
node
.
AgvName
=
""
;
node
.
AgvName
=
""
;
...
@@ -173,11 +199,14 @@ namespace AGVControl
...
@@ -173,11 +199,14 @@ namespace AGVControl
//TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.END);
//TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.END);
//if (shelfType.Equals(eShelfType.SmallShelf))
//if (shelfType.Equals(eShelfType.SmallShelf))
Common
.
DelEmptyShelfTask
(
EmptyShelfPlace
);
Common
.
DelEmptyShelfTask
(
EmptyShelfPlace
);
msg
+=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车完成"
;
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车完成"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
if
(
agv
.
RFID
.
StartsWith
(
"D"
))
if
(
agv
.
Place
.
Equals
(
"E22"
))
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
SmallShelf
);
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
BigShelf
);
else
if
(
agv
.
RFID
.
StartsWith
(
"C"
))
else
if
(
agv
.
RFID
.
StartsWith
(
"D"
))
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
SmallShelf
);
else
if
(
agv
.
RFID
.
StartsWith
(
"C"
))
{
{
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
BigShelf
);
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
BigShelf
);
}
}
...
@@ -187,7 +216,8 @@ namespace AGVControl
...
@@ -187,7 +216,8 @@ namespace AGVControl
else
if
(
TakeEmptyStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
else
if
(
TakeEmptyStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
{
//链条停止
//链条停止
msg
+=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
;
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
...
...
AGVControl-ProductionLine/bean/job/GoFullShelfStationJob.cs
查看文件 @
75c1709
此文件的差异被折叠,
点击展开。
AGVControl-ProductionLine/bean/job/SendFullShelfToLineJob.cs
查看文件 @
75c1709
...
@@ -43,30 +43,40 @@ namespace AGVControl
...
@@ -43,30 +43,40 @@ namespace AGVControl
public
bool
IsIgnoreBigShelf
{
get
;
private
set
;
}
public
bool
IsIgnoreBigShelf
{
get
;
private
set
;
}
public
override
bool
IsEnd
{
get
{
return
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
END
);
}
}
private
string
runInfo
=
""
;
/// <summary>
/// 运行信息
/// </summary>
public
override
string
RunInfo
{
get
{
return
runInfo
;
}
}
private
JobStep
<
SEND_FULL_SHELF_STEP
>
SendFullShelfStep
=
new
JobStep
<
SEND_FULL_SHELF_STEP
>(
SEND_FULL_SHELF_STEP
.
NONE
);
private
JobStep
<
SEND_FULL_SHELF_STEP
>
SendFullShelfStep
=
new
JobStep
<
SEND_FULL_SHELF_STEP
>(
SEND_FULL_SHELF_STEP
.
NONE
);
public
override
Job
Execute
(
Agv_Info
agv
)
public
override
Job
Execute
(
Agv_Info
agv
)
{
{
string
msg
=
"
"
;
string
msg
=
agv
.
Name
+
"
"
;
bool
rtn
=
false
;
bool
rtn
=
false
;
agv
.
RFID
=
RFID
;
agv
.
RFID
=
RFID
;
agv
.
Msg
=
SendFullShelfStep
.
Msg
;
agv
.
Msg
=
runInfo
;
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
NONE
))
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
NONE
))
{
{
if
(
FullShelfPlace
.
StartsWith
(
"G"
))
if
(
FullShelfPlace
.
StartsWith
(
"G"
))
{
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_DOOR
);
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_DOOR
);
msg
=
"满料架前往4C门,从双层线A6送往["
+
FullShelfPlace
+
"]["
+
RFID
+
"]"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"满料架前往4C门,从双层线A6送往["
+
FullShelfPlace
+
"]["
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
}
}
else
else
{
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
msg
=
"满料架从双层线A6送往["
+
FullShelfPlace
+
"]["
+
RFID
+
"]"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"满料架从双层线A6送往["
+
FullShelfPlace
+
"]["
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
FullShelfPlace
);
Common
.
MoveToNode
(
agv
,
FullShelfPlace
);
}
}
...
@@ -78,7 +88,8 @@ namespace AGVControl
...
@@ -78,7 +88,8 @@ namespace AGVControl
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorDToC
,
agv
.
CurTaskGUID
))
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorDToC
,
agv
.
CurTaskGUID
))
{
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
msg
=
"满料架从双层线A6送往["
+
FullShelfPlace
+
"]["
+
RFID
+
"]"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"满料架从双层线A6送往["
+
FullShelfPlace
+
"]["
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
FullShelfPlace
);
Common
.
MoveToNode
(
agv
,
FullShelfPlace
);
}
}
...
@@ -89,14 +100,16 @@ namespace AGVControl
...
@@ -89,14 +100,16 @@ namespace AGVControl
{
{
if
(
FullShelfPlace
.
Equals
(
"G21"
))
if
(
FullShelfPlace
.
Equals
(
"G21"
))
{
{
msg
=
"AGV到达 "
+
FullShelfPlace
+
"完成"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"AGV到达 "
+
FullShelfPlace
+
"完成"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
return
new
EnterLeaveShelfJob
(
FullShelfPlace
,
eEnterLeaveType
.
Leave
);
return
new
EnterLeaveShelfJob
(
FullShelfPlace
,
eEnterLeaveType
.
Leave
);
}
}
if
(
IsIgnoreBigShelf
)
if
(
IsIgnoreBigShelf
)
{
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_LINE_RESPONSE
);
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_LINE_RESPONSE
);
msg
=
"AGV到达 "
+
FullShelfPlace
+
",并发送入料架请求[ReadyEnter]"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"AGV到达 "
+
FullShelfPlace
+
",并发送入料架请求[ReadyEnter]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
server
.
ReadyEnter
(
FullShelfPlace
);
Common
.
server
.
ReadyEnter
(
FullShelfPlace
);
}
}
...
@@ -105,13 +118,15 @@ namespace AGVControl
...
@@ -105,13 +118,15 @@ namespace AGVControl
if
(
RFID
.
StartsWith
(
"C"
)
&&
!
agv
.
Place
.
Equals
(
"E21"
))
if
(
RFID
.
StartsWith
(
"C"
)
&&
!
agv
.
Place
.
Equals
(
"E21"
))
{
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_BIG_SHELF_UNLOCK
);
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_BIG_SHELF_UNLOCK
);
msg
=
"AGV到达 "
+
FullShelfPlace
+
",并等待大料架["
+
RFID
+
"]解绑"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"AGV到达 "
+
FullShelfPlace
+
",并等待大料架["
+
RFID
+
"]解绑"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
}
}
else
else
{
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_LINE_RESPONSE
);
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_LINE_RESPONSE
);
msg
=
"AGV到达 "
+
FullShelfPlace
+
",并发送入料架请求[ReadyEnter]"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"AGV到达 "
+
FullShelfPlace
+
",并发送入料架请求[ReadyEnter]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
Common
.
server
.
ReadyEnter
(
FullShelfPlace
);
Common
.
server
.
ReadyEnter
(
FullShelfPlace
);
}
}
...
@@ -122,9 +137,11 @@ namespace AGVControl
...
@@ -122,9 +137,11 @@ namespace AGVControl
else
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
WAIT_BIG_SHELF_UNLOCK
))
else
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
WAIT_BIG_SHELF_UNLOCK
))
{
{
Common
.
mir
.
Get_IO_Status
(
agv
,
out
bool
[]
input
,
out
bool
[]
output
);
Common
.
mir
.
Get_IO_Status
(
agv
,
out
bool
[]
input
,
out
bool
[]
output
);
if
(
AGVManager
.
GetRackBy
(
RFID
,
out
string
lineName
)
||
input
[
0
])
System
.
Threading
.
Thread
.
Sleep
(
50
);
if
(
AGVManager
.
GetRackBy
(
RFID
,
out
string
lineName
)
||
(
input
!=
null
&&
input
[
0
]))
{
{
msg
=
"大料架在"
+
FullShelfPlace
+
"解绑完成 ["
+
RFID
+
"]"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"大料架在"
+
FullShelfPlace
+
"解绑完成 ["
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
return
new
EmptyShelfBackJob
(
FullShelfPlace
,
eShelfType
.
BigShelf
);
return
new
EmptyShelfBackJob
(
FullShelfPlace
,
eShelfType
.
BigShelf
);
}
}
...
@@ -138,7 +155,8 @@ namespace AGVControl
...
@@ -138,7 +155,8 @@ namespace AGVControl
if
(!
agv
.
CurTaskName
.
Equals
(
"Leave"
))
if
(!
agv
.
CurTaskName
.
Equals
(
"Leave"
))
{
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT__SHELF_IN_LINE
);
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT__SHELF_IN_LINE
);
msg
=
"收到产线入料架请求[ReadyEnter]的响应 "
+
FullShelfPlace
+
"入料架,小车链条运行"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"收到产线入料架请求[ReadyEnter]的响应 "
+
FullShelfPlace
+
"入料架,小车链条运行"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Leave"
]);
rtn
=
Common
.
mir
.
Add_Mission_Fleet
(
agv
,
Common
.
agvMission
[
"Leave"
]);
agv
.
TaskSend
=
rtn
?
"Leave"
:
""
;
agv
.
TaskSend
=
rtn
?
"Leave"
:
""
;
...
@@ -148,15 +166,17 @@ namespace AGVControl
...
@@ -148,15 +166,17 @@ namespace AGVControl
else
if
(
SendFullShelfStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
else
if
(
SendFullShelfStep
.
IsTimeOut
(
15000
,
out
double
timeOutValue
))
{
{
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
SendFullShelfStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
msg
=
"AGV到达 "
+
FullShelfPlace
+
",15秒后重新向产线发送入料架请求[ReadyEnter]"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"AGV到达 "
+
FullShelfPlace
+
",15秒后重新向产线发送入料架请求[ReadyEnter]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
}
}
}
}
else
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
WAIT__SHELF_IN_LINE
))
else
if
(
SendFullShelfStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
WAIT__SHELF_IN_LINE
))
{
{
if
(
agv
.
Place
.
Equals
(
FullShelfPlace
)
&&
agv
.
PlaceState
.
Equals
(
ePlaceState
.
LeaveFinish
))
if
(
Common
.
CheckEnterOrLeaveFinished
(
agv
,
"Leave"
,
agv
.
CurTaskGUID
))
{
{
msg
=
"满料架进入"
+
FullShelfPlace
+
"完成 ["
+
RFID
+
"]"
+
BoxDestInfo
.
ShowInfo
();
runInfo
=
"满料架进入"
+
FullShelfPlace
+
"完成 ["
+
RFID
+
"]"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
agv
.
RFID
=
""
;
agv
.
RFID
=
""
;
AGVManager
.
UpdateStatus
(
RFID
,
FullShelfPlace
);
AGVManager
.
UpdateStatus
(
RFID
,
FullShelfPlace
);
...
@@ -165,7 +185,8 @@ namespace AGVControl
...
@@ -165,7 +185,8 @@ namespace AGVControl
else
if
(
SendFullShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
else
if
(
SendFullShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
{
//链条停止
//链条停止
msg
=
"满料架在["
+
FullShelfPlace
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
runInfo
=
"满料架在["
+
FullShelfPlace
+
"]离开小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架离开小车的情况"
;
msg
+=
runInfo
;
SendFullShelfStep
.
Msg
=
msg
;
SendFullShelfStep
.
Msg
=
msg
;
}
}
...
...
AGVControl-ProductionLine/bean/node/DoubleLineNodeFor4C.cs
查看文件 @
75c1709
...
@@ -39,7 +39,7 @@ namespace AGVControl
...
@@ -39,7 +39,7 @@ namespace AGVControl
emptyJobCnt
++;
emptyJobCnt
++;
}
}
}
}
if
((
SettingString
.
AGVCNT
-
emptyJobCnt
).
Equals
(
1
))
//保留一
辆小车出满料架
if
((
SettingString
.
AGVCNT
-
emptyJobCnt
).
Equals
(
2
))
//保留2
辆小车出满料架
{
{
return
null
;
return
null
;
}
}
...
@@ -74,31 +74,40 @@ namespace AGVControl
...
@@ -74,31 +74,40 @@ namespace AGVControl
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoFullShelfStationJob
&&
!
s
.
IP
.
Equals
(
currentAgv
.
IP
));
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoFullShelfStationJob
&&
!
s
.
IP
.
Equals
(
currentAgv
.
IP
));
if
(
i
>
-
1
)
if
(
i
>
-
1
)
return
null
;
return
null
;
}
//foreach (Agv_Info agv in Common.agvInfo)
//{
// if (agv.CurJob is GoFullShelfStationJob)
//foreach (Agv_Info agv in Common.agvInfo)
// {
//{
// return null;
// }
// if (agv.CurJob is GoFullShelfStationJob)
//}
// {
return
new
GoFullShelfStationJob
(
currentAgv
.
Place
);
// return null;
// }
//}
return
new
GoFullShelfStationJob
(
currentAgv
.
Place
);
}
}
}
//回收空料架
//回收空料架
if
(
Common
.
FindEmptyShelfNode
(
currentAgv
,
out
string
emptyNodeName
))
if
(
Common
.
FindEmptyShelfNode
(
currentAgv
,
out
string
emptyNodeName
))
{
{
foreach
(
Agv_Info
agv
in
Common
.
agvInfo
)
if
(
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
)
)
{
{
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
s
.
CurJob
).
EmptyShelfPlace
.
Equals
(
emptyNodeName
));
continue
;
if
(
i
>
-
1
)
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
agv
.
CurJob
).
EmptyShelfPlace
.
Equals
(
emptyNodeName
))
{
return
null
;
return
null
;
}
//foreach (Agv_Info agv in Common.agvInfo)
//{
// if (!SettingString.C4_AGV_IPs.Contains(agv.IP))
// continue;
// if (agv.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)agv.CurJob).EmptyShelfPlace.Equals(emptyNodeName))
// {
// return null;
// }
//}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
);
}
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
);
}
}
return
null
;
return
null
;
}
}
...
...
AGVControl-ProductionLine/bean/node/DoubleLineNodeFor4D.cs
查看文件 @
75c1709
...
@@ -41,14 +41,14 @@ namespace AGVControl
...
@@ -41,14 +41,14 @@ namespace AGVControl
emptyJobCnt
++;
emptyJobCnt
++;
}
}
}
}
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
1
))
//保留一
辆小车出满料架
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
2
))
//保留两
辆小车出满料架
{
{
return
null
;
return
null
;
}
}
//出工单料的目的地是否有空料架
//出工单料的目的地是否有空料架
if
(
Common
.
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
))
if
(
Common
.
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
))
{
{
if
(
nodeName
.
StartsWith
(
"E"
)
&&
!
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
if
(
nodeName
.
StartsWith
(
"E"
)
&&
!
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
{
{
ClientNode
clientNode
=
Common
.
nodeInfo
.
Find
(
s
=>
s
.
Name
.
Equals
(
nodeName
));
ClientNode
clientNode
=
Common
.
nodeInfo
.
Find
(
s
=>
s
.
Name
.
Equals
(
nodeName
));
int
cnt
=
0
;
int
cnt
=
0
;
...
@@ -74,27 +74,35 @@ namespace AGVControl
...
@@ -74,27 +74,35 @@ namespace AGVControl
{
{
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
))
{
{
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoFullShelfStationJob
&&
!
s
.
IP
.
Equals
(
currentAgv
.
IP
));
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoFullShelfStationJob
&&
!
s
.
IP
.
Equals
(
currentAgv
.
IP
));
if
(
i
>
-
1
)
if
(
i
>
-
1
)
return
null
;
return
null
;
}
return
new
GoFullShelfStationJob
(
currentAgv
.
Place
);
return
new
GoFullShelfStationJob
(
currentAgv
.
Place
);
}
}
}
//回收空料架
//回收空料架
if
(
Common
.
FindEmptyShelfNode
(
currentAgv
,
out
string
emptyNodeName
))
if
(
Common
.
FindEmptyShelfNode
(
currentAgv
,
out
string
emptyNodeName
))
{
{
foreach
(
Agv_Info
agv
in
Common
.
agvInfo
)
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
currentAgv
.
IP
)
)
{
{
if
(
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
s
.
CurJob
).
EmptyShelfPlace
.
Equals
(
emptyNodeName
));
continue
;
if
(
i
>
-
1
)
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
agv
.
CurJob
).
EmptyShelfPlace
.
Equals
(
emptyNodeName
))
{
return
null
;
return
null
;
}
//foreach (Agv_Info agv in Common.agvInfo)
//{
// if (SettingString.C4_AGV_IPs.Contains(agv.IP))
// continue;
// if (agv.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)agv.CurJob).EmptyShelfPlace.Equals(emptyNodeName))
// {
// return null;
// }
//}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
);
}
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
);
}
}
return
null
;
return
null
;
}
}
...
...
AGVControl-ProductionLine/bin/Debug/AGVControl-ProductionLine.exe
查看文件 @
75c1709
此文件类型无法预览
AGVControl-ProductionLine/bin/Debug/AGVControl-ProductionLine.pdb
查看文件 @
75c1709
此文件类型无法预览
AGVControl-ProductionLine/bin/Debug/logs/AgvServer.log
查看文件 @
75c1709
此文件的差异太大,无法显示。
AGVControl-ProductionLine/bin/Debug/logs/AgvServer.log2020-09-02
0 → 100644
查看文件 @
75c1709
此文件的差异太大,无法显示。
AGVControl-ProductionLine/bin/Debug/logs/LineWebService.log2020-09-02
0 → 100644
查看文件 @
75c1709
文件属性发生变化
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.csproj.FileListAbsolute.txt
查看文件 @
75c1709
...
@@ -54,4 +54,3 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine
...
@@ -54,4 +54,3 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\Newtonsoft.Json.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\Newtonsoft.Json.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\AsaPL.AgvClient.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\AsaPL.AgvClient.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.csproj.GenerateResource.cache
查看文件 @
75c1709
此文件类型无法预览
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.exe
查看文件 @
75c1709
此文件类型无法预览
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.pdb
查看文件 @
75c1709
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论