Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
顾剑亮
/
AGVControl-Qisda-ProductionLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9d96119a
由
张东亮
编写于
2020-11-16 15:19:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
解绑料架更改
1 个父辈
a05de125
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
76 行增加
和
57 行删除
.vs/AGVControl-ProductionLine/v16/.suo
AGVControl-ProductionLine/AGVControl-ProductionLine.csproj
AGVControl-ProductionLine/BLL/Common.cs
AGVControl-ProductionLine/BLL/Control.cs
AGVControl-ProductionLine/BLL/LineWebService.cs
AGVControl-ProductionLine/BLL/StationRFIDManager.cs
AGVControl-ProductionLine/bean/job/EnterLeaveShelfJob.cs
AGVControl-ProductionLine/bean/job/GoEmptyShelfLineJob.cs
AGVControl-ProductionLine/bean/node/ClientNode.cs
AGVControl-ProductionLine/bin/Debug/Config/LinePlace.txt
.vs/AGVControl-ProductionLine/v16/.suo
查看文件 @
9d96119
此文件类型无法预览
AGVControl-ProductionLine/AGVControl-ProductionLine.csproj
查看文件 @
9d96119
...
@@ -95,6 +95,7 @@
...
@@ -95,6 +95,7 @@
<SubType>Component</SubType>
<SubType>Component</SubType>
</Compile>
</Compile>
<Compile Include="BLL\LineWebService.cs" />
<Compile Include="BLL\LineWebService.cs" />
<Compile Include="BLL\StationRFIDManager.cs" />
<Compile Include="FrmMain.cs">
<Compile Include="FrmMain.cs">
<SubType>Form</SubType>
<SubType>Form</SubType>
</Compile>
</Compile>
...
...
AGVControl-ProductionLine/BLL/Common.cs
查看文件 @
9d96119
...
@@ -42,6 +42,7 @@ namespace AGVControl
...
@@ -42,6 +42,7 @@ namespace AGVControl
public
const
string
IsUse
=
"IsUse"
;
public
const
string
IsUse
=
"IsUse"
;
public
const
string
RFID
=
"RFID"
;
public
const
string
RFID
=
"RFID"
;
public
const
string
EmptyShelfCnt
=
"EmptyShelfCnt"
;
public
const
string
EmptyShelfCnt
=
"EmptyShelfCnt"
;
public
const
string
EmptyShelfRFIDs
=
"EmptyShelfRFIDs"
;
/// <summary>
/// <summary>
/// 去4C的3辆车IP
/// 去4C的3辆车IP
/// </summary>
/// </summary>
...
@@ -1065,10 +1066,10 @@ namespace AGVControl
...
@@ -1065,10 +1066,10 @@ namespace AGVControl
for
(
int
i
=
0
;
i
<
s
.
Count
();
i
++)
for
(
int
i
=
0
;
i
<
s
.
Count
();
i
++)
{
{
string
[]
mission
=
s
[
i
].
Split
(
','
);
string
[]
mission
=
s
[
i
].
Split
(
','
);
if
(
mission
.
Length
!=
2
)
if
(
mission
.
Length
!=
3
)
continue
;
continue
;
//missionManager.missionList.Add(new MissionStru(mission[0], mission[1]));
//missionManager.missionList.Add(new MissionStru(mission[0], mission[1]));
missionManager
.
AddMission
(
new
MissionStru
(
mission
[
0
],
mission
[
1
]));
missionManager
.
AddMission
(
new
MissionStru
(
mission
[
0
],
mission
[
1
]
,
mission
[
2
]
));
}
}
}
}
...
@@ -1078,19 +1079,19 @@ namespace AGVControl
...
@@ -1078,19 +1079,19 @@ namespace AGVControl
/// </summary>
/// </summary>
/// <param name="nodeName"></param>
/// <param name="nodeName"></param>
/// <returns></returns>
/// <returns></returns>
public
static
bool
AddEmptyShelfTask
(
string
nodeName
)
public
static
bool
AddEmptyShelfTask
(
string
nodeName
,
string
rfid
)
{
{
int
idx
=
Common
.
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
nodeName
);
int
idx
=
Common
.
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
nodeName
);
if
(
idx
>
-
1
)
if
(
idx
>
-
1
)
{
{
// Common.missionManager.missionList.Add(new MissionStru(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), nodeName));
// Common.missionManager.missionList.Add(new MissionStru(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), nodeName));
Common
.
missionManager
.
AddMission
(
new
MissionStru
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
nodeName
));
Common
.
missionManager
.
AddMission
(
new
MissionStru
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
nodeName
,
rfid
));
Common
.
nodeInfo
[
idx
].
IncreEmptyShelfCnt
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
);
Common
.
nodeInfo
[
idx
].
IncreEmptyShelfCnt
(
rfid
);
using
(
System
.
IO
.
StreamWriter
file
=
new
System
.
IO
.
StreamWriter
(
CONFIG_PATH
+
"LinePlace.txt"
))
using
(
System
.
IO
.
StreamWriter
file
=
new
System
.
IO
.
StreamWriter
(
CONFIG_PATH
+
"LinePlace.txt"
))
{
{
foreach
(
var
item
in
Common
.
missionManager
.
missionList
)
foreach
(
var
item
in
Common
.
missionManager
.
missionList
)
{
{
file
.
WriteLine
(
string
.
Format
(
"{0},{1}
"
,
item
.
CreateTime
,
item
.
NodeName
));
file
.
WriteLine
(
string
.
Format
(
"{0},{1}
,{2}"
,
item
.
CreateTime
,
item
.
NodeName
,
rfid
));
}
}
}
}
...
@@ -1109,23 +1110,23 @@ namespace AGVControl
...
@@ -1109,23 +1110,23 @@ namespace AGVControl
/// </summary>
/// </summary>
/// <param name="nodeName"></param>
/// <param name="nodeName"></param>
/// <returns></returns>
/// <returns></returns>
public
static
bool
DelEmptyShelfTask
(
string
nodeName
)
public
static
bool
DelEmptyShelfTask
(
string
nodeName
,
string
rfid
)
{
{
int
idx
=
Common
.
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
nodeName
);
int
idx
=
Common
.
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
nodeName
);
if
(
idx
>
-
1
)
if
(
idx
>
-
1
)
{
{
Common
.
nodeInfo
[
idx
].
DecreEmptyShelfCnt
();
idx
=
Common
.
missionManager
.
missionList
.
FindIndex
(
s
=>
s
.
NodeName
==
nodeName
);
idx
=
Common
.
missionManager
.
missionList
.
FindIndex
(
s
=>
s
.
NodeName
==
nodeName
);
if
(
idx
>
-
1
)
if
(
idx
>
-
1
)
{
{
LogInfo
(
"删除一个空料架任务:"
+
nodeName
);
Common
.
nodeInfo
[
idx
].
DecreEmptyShelfCnt
(
rfid
);
LogInfo
(
"删除一个空料架任务:"
+
nodeName
+
"[RFID="
+
rfid
+
"]"
);
Common
.
missionManager
.
DelMission
(
idx
);
Common
.
missionManager
.
DelMission
(
idx
);
//Common.missionManager.missionList.RemoveAt(idx);
//Common.missionManager.missionList.RemoveAt(idx);
using
(
System
.
IO
.
StreamWriter
file
=
new
System
.
IO
.
StreamWriter
(
CONFIG_PATH
+
"LinePlace.txt"
))
using
(
System
.
IO
.
StreamWriter
file
=
new
System
.
IO
.
StreamWriter
(
CONFIG_PATH
+
"LinePlace.txt"
))
{
{
foreach
(
var
item
in
Common
.
missionManager
.
missionList
)
foreach
(
var
item
in
Common
.
missionManager
.
missionList
)
{
{
file
.
WriteLine
(
string
.
Format
(
"{0},{1}
"
,
item
.
CreateTime
,
item
.
NodeName
));
file
.
WriteLine
(
string
.
Format
(
"{0},{1}
,{2}"
,
item
.
CreateTime
,
item
.
NodeName
,
rfid
));
}
}
}
}
...
@@ -1459,15 +1460,17 @@ namespace AGVControl
...
@@ -1459,15 +1460,17 @@ namespace AGVControl
{
{
public
string
NodeName
;
public
string
NodeName
;
public
string
CreateTime
;
public
string
CreateTime
;
public
string
Rfid
;
/// <summary>
/// <summary>
/// 任务结构
/// 任务结构
/// </summary>
/// </summary>
/// <param name="dateTime">创建时间</param>
/// <param name="dateTime">创建时间</param>
/// <param name="name">节点名称</param>
/// <param name="name">节点名称</param>
public
MissionStru
(
string
dateTime
,
string
name
)
public
MissionStru
(
string
dateTime
,
string
name
,
string
rfid
)
{
{
NodeName
=
name
;
NodeName
=
name
;
CreateTime
=
dateTime
;
CreateTime
=
dateTime
;
Rfid
=
rfid
;
}
}
}
}
...
...
AGVControl-ProductionLine/BLL/Control.cs
查看文件 @
9d96119
...
@@ -10,7 +10,7 @@ using AGVControl;
...
@@ -10,7 +10,7 @@ using AGVControl;
using
log4net.Util
;
using
log4net.Util
;
using
RestSharp
;
using
RestSharp
;
namespace
BLL
namespace
AGVControl.
BLL
{
{
public
class
Control
public
class
Control
{
{
...
...
AGVControl-ProductionLine/BLL/LineWebService.cs
查看文件 @
9d96119
...
@@ -20,7 +20,7 @@ namespace BLL
...
@@ -20,7 +20,7 @@ namespace BLL
//?emptyStation={line}
//?emptyStation={line}
[
OperationContract
]
[
OperationContract
]
[
WebInvoke
(
UriTemplate
=
"CreateEmptyRecycleTask?emptyStation={line}&rfid={RFID}"
,
Method
=
"GET"
,
BodyStyle
=
WebMessageBodyStyle
.
Bare
,
RequestFormat
=
WebMessageFormat
.
Json
,
ResponseFormat
=
WebMessageFormat
.
Xml
)]
[
WebInvoke
(
UriTemplate
=
"CreateEmptyRecycleTask?emptyStation={line}&rfid={RFID}"
,
Method
=
"GET"
,
BodyStyle
=
WebMessageBodyStyle
.
Bare
,
RequestFormat
=
WebMessageFormat
.
Json
,
ResponseFormat
=
WebMessageFormat
.
Xml
)]
string
CreateEmptyRecycleTaskGET
(
string
line
,
string
RFID
=
""
);
string
CreateEmptyRecycleTaskGET
(
string
line
,
string
RFID
=
""
);
}
}
...
@@ -70,25 +70,22 @@ namespace BLL
...
@@ -70,25 +70,22 @@ namespace BLL
}
}
if
(
Common
.
GetNodeNameByLineName
(
emptyStation
,
out
string
value
))
if
(
Common
.
GetNodeNameByLineName
(
emptyStation
,
out
string
value
))
{
{
if
(!
Common
.
AddEmptyShelfTask
(
value
))
{
Common
.
log
.
Error
(
"CreateEmptyRecycleTask(POST) 节点["
+
value
+
"]不存在"
);
res
=
new
Result
()
{
Succeed
=
false
,
ResultData
=
null
,
ErrorMessage
=
"CreateEmptyRecycleTask failed: "
+
emptyStation
};
}
else
{
if
(
rfid
==
null
)
if
(
rfid
==
null
)
{
{
res
=
new
Result
()
{
Succeed
=
true
,
ResultData
=
null
,
ErrorMessage
=
""
};
res
=
new
Result
()
{
Succeed
=
false
,
ResultData
=
null
,
ErrorMessage
=
"rfid=null"
};
Log
.
Info
(
string
.
Format
(
"WebService Request(POST) emptyStation={0},rfid=null"
,
emptyStation
));
Log
.
Error
(
string
.
Format
(
"WebService Request(POST) Failed emptyStation={0},rfid=null"
,
emptyStation
));
Common
.
LogInfo
(
"任务[POST]:"
+
value
+
" 出空料架 ["
+
emptyStation
+
"]"
);
}
}
else
else
{
{
res
=
new
Result
()
{
Succeed
=
true
,
ResultData
=
rfid
,
ErrorMessage
=
""
};
res
=
new
Result
()
{
Succeed
=
true
,
ResultData
=
rfid
,
ErrorMessage
=
""
};
Log
.
Info
(
string
.
Format
(
"WebService Request(POST) emptyStation={0},rfid={1}"
,
emptyStation
,
rfid
));
Log
.
Info
(
string
.
Format
(
"WebService Request(POST) emptyStation={0},rfid={1}"
,
emptyStation
,
rfid
.
ToUpper
()));
Common
.
LogInfo
(
"任务[POST]:"
+
value
+
" 出空料架 [location="
+
emptyStation
+
",rfid="
+
rfid
+
"]"
);
if
(!
Common
.
AddEmptyShelfTask
(
value
,
rfid
.
ToUpper
()))
{
Common
.
log
.
Error
(
"CreateEmptyRecycleTask(POST) 节点["
+
value
+
"]不存在"
);
res
=
new
Result
()
{
Succeed
=
false
,
ResultData
=
null
,
ErrorMessage
=
"CreateEmptyRecycleTask failed: "
+
emptyStation
+
" rfid="
+
rfid
};
}
}
else
Common
.
LogInfo
(
"任务[POST]:"
+
value
+
" 出空料架 [location="
+
emptyStation
+
",rfid="
+
rfid
.
ToUpper
()
+
"]"
);
}
}
// AGVControl.Common.log.Debug("WebService POST Response OK");
// AGVControl.Common.log.Debug("WebService POST Response OK");
}
}
...
@@ -101,7 +98,7 @@ namespace BLL
...
@@ -101,7 +98,7 @@ namespace BLL
return
JsonHelper
.
SerializeObject
(
res
);
return
JsonHelper
.
SerializeObject
(
res
);
}
}
public
string
CreateEmptyRecycleTaskGET
(
string
line
,
string
RFID
)
public
string
CreateEmptyRecycleTaskGET
(
string
line
,
string
RFID
)
{
{
Result
res
;
Result
res
;
if
(
line
.
Equals
(
"Feeder"
))
if
(
line
.
Equals
(
"Feeder"
))
...
@@ -115,7 +112,7 @@ namespace BLL
...
@@ -115,7 +112,7 @@ namespace BLL
if
(
Common
.
GetNodeNameByLineName
(
line
,
out
string
value
))
if
(
Common
.
GetNodeNameByLineName
(
line
,
out
string
value
))
{
{
if
(!
Common
.
AddEmptyShelfTask
(
value
))
if
(!
Common
.
AddEmptyShelfTask
(
value
,
RFID
.
ToUpper
()
))
{
{
Common
.
log
.
Error
(
"CreateEmptyRecycleTask 节点["
+
value
+
"]不存在"
);
Common
.
log
.
Error
(
"CreateEmptyRecycleTask 节点["
+
value
+
"]不存在"
);
res
=
new
Result
()
{
Succeed
=
false
,
ResultData
=
null
,
ErrorMessage
=
"CreateEmptyRecycleTask failed: "
+
line
};
res
=
new
Result
()
{
Succeed
=
false
,
ResultData
=
null
,
ErrorMessage
=
"CreateEmptyRecycleTask failed: "
+
line
};
...
@@ -124,7 +121,7 @@ namespace BLL
...
@@ -124,7 +121,7 @@ namespace BLL
{
{
res
=
new
Result
()
{
Succeed
=
true
,
ResultData
=
RFID
,
ErrorMessage
=
""
};
res
=
new
Result
()
{
Succeed
=
true
,
ResultData
=
RFID
,
ErrorMessage
=
""
};
Log
.
Info
(
string
.
Format
(
"WebService Request(GET) emptyStation={0},rfid={1}"
,
line
,
RFID
));
Log
.
Info
(
string
.
Format
(
"WebService Request(GET) emptyStation={0},rfid={1}"
,
line
,
RFID
));
Common
.
LogInfo
(
"任务[GET]:"
+
value
+
" 出空料架 [emptyStation="
+
line
+
",rfid="
+
RFID
+
"]"
);
Common
.
LogInfo
(
"任务[GET]:"
+
value
+
" 出空料架 [emptyStation="
+
line
+
",rfid="
+
RFID
.
ToUpper
()
+
"]"
);
}
}
}
}
else
else
...
...
AGVControl-ProductionLine/BLL/StationRFIDManager.cs
0 → 100644
查看文件 @
9d96119
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
AGVControl.BLL
{
/// <summary>
/// 接驳台RFID管理
/// </summary>
public
class
StationRFIDManager
{
}
}
AGVControl-ProductionLine/bean/job/EnterLeaveShelfJob.cs
查看文件 @
9d96119
...
@@ -176,7 +176,7 @@ namespace AGVControl
...
@@ -176,7 +176,7 @@ namespace AGVControl
runInfo
=
"料架在"
+
LineName
+
"出去完成 ["
+
RFID
+
"]"
;
runInfo
=
"料架在"
+
LineName
+
"出去完成 ["
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
EnterLeaveShelfStep
.
Msg
=
msg
;
EnterLeaveShelfStep
.
Msg
=
msg
;
Common
.
DelEmptyShelfTask
(
LineName
);
Common
.
DelEmptyShelfTask
(
LineName
,
RFID
);
return
new
EmptyShelfBackJob
(
LineName
,
eShelfType
.
BigShelf
);
return
new
EmptyShelfBackJob
(
LineName
,
eShelfType
.
BigShelf
);
}
}
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
else
if
(
EnterLeaveShelfStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
...
...
AGVControl-ProductionLine/bean/job/GoEmptyShelfLineJob.cs
查看文件 @
9d96119
...
@@ -19,12 +19,13 @@ namespace AGVControl
...
@@ -19,12 +19,13 @@ namespace AGVControl
/// </summary>
/// </summary>
/// <param name="agvPlae">小车当前位置,空表示在待机位</param>
/// <param name="agvPlae">小车当前位置,空表示在待机位</param>
/// <param name="palce">空料架位置点</param>
/// <param name="palce">空料架位置点</param>
public
GoEmptyShelfLineJob
(
string
agvPlae
,
string
palce
)
public
GoEmptyShelfLineJob
(
string
agvPlae
,
string
palce
,
string
rfid
)
{
{
EmptyShelfPlace
=
palce
;
EmptyShelfPlace
=
palce
;
this
.
agvPlae
=
agvPlae
;
this
.
agvPlae
=
agvPlae
;
RFID
=
rfid
;
}
}
public
string
RFID
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 空料架位置点
/// 空料架位置点
/// </summary>
/// </summary>
...
@@ -65,7 +66,7 @@ namespace AGVControl
...
@@ -65,7 +66,7 @@ namespace AGVControl
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
D4_Name_Prefix
))
//4C->4D
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
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4D门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4D门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
...
@@ -75,7 +76,7 @@ namespace AGVControl
...
@@ -75,7 +76,7 @@ namespace AGVControl
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4D->4C
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4D->4C
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4C_DOOR
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4C_DOOR
);
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
...
@@ -86,7 +87,7 @@ namespace AGVControl
...
@@ -86,7 +87,7 @@ namespace AGVControl
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
;
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveTo4CStandy
(
agv
);
Common
.
MoveTo4CStandy
(
agv
);
...
@@ -95,7 +96,7 @@ namespace AGVControl
...
@@ -95,7 +96,7 @@ namespace AGVControl
else
else
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
...
@@ -103,7 +104,7 @@ namespace AGVControl
...
@@ -103,7 +104,7 @@ namespace AGVControl
else
else
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
...
@@ -116,7 +117,7 @@ namespace AGVControl
...
@@ -116,7 +117,7 @@ namespace AGVControl
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
;
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveTo4CStandy
(
agv
);
Common
.
MoveTo4CStandy
(
agv
);
...
@@ -125,7 +126,7 @@ namespace AGVControl
...
@@ -125,7 +126,7 @@ namespace AGVControl
else
else
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
...
@@ -139,7 +140,7 @@ namespace AGVControl
...
@@ -139,7 +140,7 @@ namespace AGVControl
if
(!
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//未占用
if
(!
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//未占用
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DeleteStandyInfo
(
agv
);
Common
.
DeleteStandyInfo
(
agv
);
...
@@ -152,7 +153,7 @@ namespace AGVControl
...
@@ -152,7 +153,7 @@ namespace AGVControl
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorCToD
,
CurTaskState
))
if
(
Common
.
CheckTaskFinished
(
agv
,
SettingString
.
DoorCToD
,
CurTaskState
))
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
...
@@ -163,7 +164,7 @@ namespace AGVControl
...
@@ -163,7 +164,7 @@ 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
);
runInfo
=
"AGV 添加任务:移动到"
+
EmptyShelfPlace
;
runInfo
=
"AGV 添加任务:移动到"
+
EmptyShelfPlace
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
EmptyShelfPlace
);
Common
.
MoveToNode
(
agv
,
EmptyShelfPlace
);
...
@@ -182,7 +183,7 @@ namespace AGVControl
...
@@ -182,7 +183,7 @@ 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
);
runInfo
=
"AGV开始向目的地["
+
EmptyShelfPlace
+
"]移动"
;
runInfo
=
"AGV开始向目的地["
+
EmptyShelfPlace
+
"]移动"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
}
}
...
@@ -202,7 +203,7 @@ namespace AGVControl
...
@@ -202,7 +203,7 @@ namespace AGVControl
//else
//else
{
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_LINE_RESPONSE
);
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_LINE_RESPONSE
);
runInfo
=
"AGV到达 "
+
EmptyShelfPlace
+
" 向产线发送出料架请求[ReadyLeave]"
;
runInfo
=
"AGV到达 "
+
EmptyShelfPlace
+
" 向产线发送出料架请求[ReadyLeave]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
if
(
nodeIdx
==
-
1
)
if
(
nodeIdx
==
-
1
)
...
@@ -235,7 +236,7 @@ namespace AGVControl
...
@@ -235,7 +236,7 @@ namespace AGVControl
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
);
runInfo
=
"收到产线出料请求[ReadyLeave]的响应 "
+
EmptyShelfPlace
+
"出料架,小车链条运行"
;
runInfo
=
"收到产线出料请求[ReadyLeave]的响应 "
+
EmptyShelfPlace
+
"出料架,小车链条运行"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
//agv.RFID = node.RFID;
//agv.RFID = node.RFID;
...
@@ -260,13 +261,15 @@ namespace AGVControl
...
@@ -260,13 +261,15 @@ namespace AGVControl
ClientNode
node
=
Common
.
nodeInfo
[
nodeIdx
];
ClientNode
node
=
Common
.
nodeInfo
[
nodeIdx
];
node
.
AgvName
=
""
;
node
.
AgvName
=
""
;
//回收空料架数量减少1
//回收空料架数量减少1
Common
.
DelEmptyShelfTask
(
EmptyShelfPlace
);
Common
.
DelEmptyShelfTask
(
EmptyShelfPlace
,
RFID
);
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车完成"
;
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车完成"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
TakeEmptyStep
.
Msg
=
msg
;
//4DfeederOut默认大料架
//4DfeederOut默认大料架
if
(
agv
.
Place
.
Equals
(
SettingString
.
D4FeederOut
))
if
(
agv
.
Place
.
Equals
(
SettingString
.
D4FeederOut
))
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
BigShelf
);
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
BigShelf
);
else
if
(
agv
.
Place
.
Equals
(
SettingString
.
C4FeederOut
))
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
BigShelf
);
else
if
(
agv
.
RFID
.
StartsWith
(
"D"
))
else
if
(
agv
.
RFID
.
StartsWith
(
"D"
))
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
SmallShelf
);
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
SmallShelf
);
else
if
(
agv
.
RFID
.
StartsWith
(
"C"
))
else
if
(
agv
.
RFID
.
StartsWith
(
"C"
))
...
@@ -279,7 +282,7 @@ namespace AGVControl
...
@@ -279,7 +282,7 @@ namespace AGVControl
else
if
(
TakeEmptyStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
else
if
(
TakeEmptyStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
{
//链条停止
//链条停止
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
;
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
+
"[RFID="
+
RFID
+
"]"
;
// msg += runInfo;
// msg += runInfo;
//TakeEmptyStep.Msg = msg;
//TakeEmptyStep.Msg = msg;
}
}
...
...
AGVControl-ProductionLine/bean/node/ClientNode.cs
查看文件 @
9d96119
...
@@ -117,6 +117,7 @@ namespace AGVControl
...
@@ -117,6 +117,7 @@ namespace AGVControl
{
{
System
.
Threading
.
Interlocked
.
Increment
(
ref
_EmptyShelfCnt
);
System
.
Threading
.
Interlocked
.
Increment
(
ref
_EmptyShelfCnt
);
EmptyShelfRFIDs
.
Add
(
rfid
);
EmptyShelfRFIDs
.
Add
(
rfid
);
Common
.
WriteIni
(
Name
,
SettingString
.
EmptyShelfRFIDs
,
string
.
Join
(
","
,
EmptyShelfRFIDs
.
ToArray
()));
Common
.
WriteIni
(
Name
,
SettingString
.
EmptyShelfCnt
,
_EmptyShelfCnt
.
ToString
());
Common
.
WriteIni
(
Name
,
SettingString
.
EmptyShelfCnt
,
_EmptyShelfCnt
.
ToString
());
}
}
else
if
(
rfid
.
Equals
(
""
))
else
if
(
rfid
.
Equals
(
""
))
...
@@ -128,12 +129,17 @@ namespace AGVControl
...
@@ -128,12 +129,17 @@ namespace AGVControl
/// <summary>
/// <summary>
/// 空料架数量减少1
/// 空料架数量减少1
/// </summary>
/// </summary>
public
void
DecreEmptyShelfCnt
()
public
void
DecreEmptyShelfCnt
(
string
rfid
=
""
)
{
{
if
(
_EmptyShelfCnt
>
0
)
if
(
_EmptyShelfCnt
>
0
)
{
{
System
.
Threading
.
Interlocked
.
Decrement
(
ref
_EmptyShelfCnt
);
System
.
Threading
.
Interlocked
.
Decrement
(
ref
_EmptyShelfCnt
);
Common
.
WriteIni
(
Name
,
SettingString
.
EmptyShelfCnt
,
_EmptyShelfCnt
.
ToString
());
Common
.
WriteIni
(
Name
,
SettingString
.
EmptyShelfCnt
,
_EmptyShelfCnt
.
ToString
());
if
(!
rfid
.
Equals
(
""
)
&&
EmptyShelfRFIDs
.
Contains
(
rfid
))
{
EmptyShelfRFIDs
.
Remove
(
rfid
);
Common
.
WriteIni
(
Name
,
SettingString
.
EmptyShelfRFIDs
,
string
.
Join
(
","
,
EmptyShelfRFIDs
.
ToArray
()));
}
}
}
if
(
_EmptyShelfCnt
.
Equals
(
0
)
&&
EmptyShelfRFIDs
.
Count
>
0
)
if
(
_EmptyShelfCnt
.
Equals
(
0
)
&&
EmptyShelfRFIDs
.
Count
>
0
)
...
...
AGVControl-ProductionLine/bin/Debug/Config/LinePlace.txt
查看文件 @
9d96119
2020-11-03 14:08:42,D1
2020-11-03 14:08:42,D1,D11
2020-11-03 14:10:26,D1
2020-11-03 14:10:26,D1,D4
2020-11-03 14:12:43,D1
2020-11-03 14:12:43,D1,D5
2020-11-03 14:20:20,D1
2020-11-03 14:22:26,D1
2020-11-03 14:22:31,D1
2020-11-03 14:22:37,D1
2020-11-03 14:22:48,D1
2020-11-03 14:22:59,D1
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论