Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
827-AGV
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a44da5a2
由
张东亮
编写于
2021-04-20 16:36:56 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
0420
1 个父辈
8c2b595c
全部展开
显示空白字符变更
内嵌
并排
正在显示
29 个修改的文件
包含
462 行增加
和
186 行删除
AGV_UI/AGV_UI.csproj
AGV_UI/Status.cs
Common/Common.csproj
Common/SettingString.cs
DeviceLibrary/AgvServer.cs
DeviceLibrary/Config/AgvMission.csv
DeviceLibrary/Config/AgvName.csv
DeviceLibrary/Config/AgvProductionLine.csv
DeviceLibrary/Control.cs
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/MissionSys.cs
DeviceLibrary/bean/Agv_Info.cs
DeviceLibrary/bean/MiR_API.cs
DeviceLibrary/bean/job/EmptyShelfBackJob.cs
DeviceLibrary/bean/job/GoEmptyShelfLineJob.cs
DeviceLibrary/bean/job/GoFullShelfStationJob.cs
DeviceLibrary/bean/job/SendFullShelfToLineJob.cs
DeviceLibrary/bean/job/jobType/GetEmptyShelfJobType.cs
DeviceLibrary/bean/job/jobType/SendFullShelfJobType.cs
DeviceLibrary/bean/node/ClientNode.cs
DeviceLibrary/manager/AGVManager.cs
DeviceLibrary/manager/HttpManager.cs
SO827-AGV/App.config
SO827-AGV/FrmMain.Designer.cs
SO827-AGV/FrmMain.cs
SO827-AGV/Manual.Designer.cs
SO827-AGV/Manual.cs
SO827-AGV/Manual.resx
SO827-AGV/SO827-AGV.csproj
AGV_UI/AGV_UI.csproj
查看文件 @
a44da5a
...
...
@@ -8,9 +8,10 @@
<OutputType>Library</OutputType>
<RootNamespace>AGV_UI</RootNamespace>
<AssemblyName>AGV_UI</AssemblyName>
<TargetFrameworkVersion>v4.
7.2
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
...
...
AGV_UI/Status.cs
查看文件 @
a44da5a
...
...
@@ -24,7 +24,7 @@ namespace AGV_UI
missionShow
.
Add
(
item
,
new
Label
()
{
Name
=
item
,
Font
=
new
Font
(
"宋体"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
))),
AutoSize
=
true
,
BorderStyle
=
BorderStyle
.
Fixed3D
//
BorderStyle = BorderStyle.Fixed3D
});
}
flowPanelMissionState
.
Controls
.
AddRange
(
missionShow
.
Values
.
ToArray
());
...
...
Common/Common.csproj
查看文件 @
a44da5a
...
...
@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common</RootNamespace>
<AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.
7.2
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
...
...
Common/SettingString.cs
查看文件 @
a44da5a
...
...
@@ -34,7 +34,7 @@ namespace Common
public
const
string
FileName_tempData
=
"tempData.ini"
;
public
const
string
IsUse
=
"IsUse"
;
public
const
string
RFID
=
"RFID"
;
public
const
string
ReelString_RFID_Prefix
=
"F"
;
//云仓出料口
public
const
string
D1
=
"D1"
;
public
const
string
D2
=
"D2"
;
...
...
DeviceLibrary/AgvServer.cs
查看文件 @
a44da5a
此文件的差异被折叠,
点击展开。
DeviceLibrary/Config/AgvMission.csv
查看文件 @
a44da5a
任务名称,任务别名,任务GUID
Init,初始化,219cd91a-61da-11eb-96a9-0001297a1dca
Standby,待机位,615cef05-61f4-11eb-96a9-0001297a1dca
AutoCharge1,充电桩4,b4a9e87a-7768-11eb-8758-54b2038d1924
AutoCharge2,充电桩5,c4326dfb-7768-11eb-8758-54b2038d1924
CheckShelf,检查负载,cc5f1d78-75a2-11eb-8565-0001297a1dca
Leave,出料,28a2ab7b-75ac-11eb-8565-0001297a1dca
Enter,进料,4bf5d4c5-75a4-11eb-8565-0001297a1dca
D1,云仓出料口1,4c533e85-75c6-11eb-a7fe-0001297a1dca
D2,云仓出料口2,3a0d8f1b-75c8-11eb-a7fe-0001297a1dca
D3,云仓出料口3,d2ee5b8e-75c5-11eb-a7fe-0001297a1dca
S1,SMT1线,968abc82-75c5-11eb-a7fe-0001297a1dca
S2,SMT2线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S3,SMT3线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S4,SMT4线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S5,SMT5线,968abc82-75c5-11eb-a7fe-0001297a1dca
S6,SMT6线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S7,SMT7线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S8,SMT8线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S9,SMT9线,968abc82-75c5-11eb-a7fe-0001297a1dca
S10,SMT10线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S11,SMT11线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S12,SMT12线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S13,SMT13线,968abc82-75c5-11eb-a7fe-0001297a1dca
S14,SMT14线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S15,SMT15线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S16,SMT16线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S17,SMT17线,968abc82-75c5-11eb-a7fe-0001297a1dca
S18,SMT18线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S19,SMT19线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S20,SMT20线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
\ No newline at end of file
Init,初始化,079fdb1f-8df0-11eb-8766-0001297a205c
Standby,待机位,1f51c9d1-8df4-11eb-8766-0001297a205c
AutoCharge1,充电桩1,8b7aa527-8dee-11eb-8766-0001297a205c
AutoCharge2,充电桩2,d340077e-8dee-11eb-8766-0001297a205c
Leave,出料,47619ae8-8eca-11eb-b3c1-0001297a205c
Enter,进料,da717775-8eaa-11eb-b3c1-0001297a205c
A1,缓存线出口,22236ced-985c-11eb-bc75-54b2038d1fb1
A2,缓存线入口,4be3a323-985c-11eb-bc75-54b2038d1fb1
D1,云仓出料口1,eb59ef9f-8f8b-11eb-8ff4-0001297a205c
D2,云仓出料口2,11d68633-8e20-11eb-8766-0001297a205c
D3,云仓出料口3,d1d041c7-8e0c-11eb-8766-0001297a205c
S1,SMT1线,743b96e3-8d45-11eb-8674-0001297a205c
S2,SMT2线,b684ade5-8ebd-11eb-b3c1-0001297a205c
S3,SMT3线,1f1c3591-8ebe-11eb-b3c1-0001297a205c
S4,SMT4线,605cabc1-8ebe-11eb-b3c1-0001297a205c
S5,SMT5线,405e1c4a-8ebf-11eb-b3c1-0001297a205c
S6,SMT6线,af7657bc-8ebe-11eb-b3c1-0001297a205c
S7,SMT7线,772bae5c-8ebf-11eb-b3c1-0001297a205c
S8,SMT8线,15ccd887-8ec0-11eb-b3c1-0001297a205c
S9,SMT9线,5cb5a0f4-8ec0-11eb-b3c1-0001297a205c
S10,SMT10线,8d6abfed-8ec0-11eb-b3c1-0001297a205c
S11,SMT11线,c2dbf9d2-8ec0-11eb-b3c1-0001297a205c
S12,SMT12线,1756a49d-8ec1-11eb-b3c1-0001297a205c
S13,SMT13线,5dcf1db7-8ec1-11eb-b3c1-0001297a205c
S14,SMT14线,5fafb312-97b1-11eb-bc75-54b2038d1fb1
S15,SMT15线,b68828ae-8ec1-11eb-b3c1-0001297a205c
S16,SMT16线,f2fa0b98-8ec1-11eb-b3c1-0001297a205c
S17,SMT17线,2a5916d6-8ec2-11eb-b3c1-0001297a205c
S18,SMT18线,5a3bf7eb-8ec2-11eb-b3c1-0001297a205c
S19,SMT19线,97914d5f-8ec2-11eb-b3c1-0001297a205c
S20,SMT20线,c755faf6-8ec2-11eb-b3c1-0001297a205c
\ No newline at end of file
DeviceLibrary/Config/AgvName.csv
查看文件 @
a44da5a
Fleet ID,agv名称,IP,授权码,IOID
1,1号车,10.85.199.123,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,5d084001-6155-11eb-bee4-0001297a2016
2,1号车,172.74.52.117,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,241538ac-8dd1-11eb-8766-0001297a205c
3,2号车,172.74.52.188,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,241538ac-8dd1-11eb-8766-0001297a205c
4,3号车,172.74.52.242,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,241538ac-8dd1-11eb-8766-0001297a205c
5,4号车,172.74.54.254,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,241538ac-8dd1-11eb-8766-0001297a205c
DeviceLibrary/Config/AgvProductionLine.csv
查看文件 @
a44da5a
产线名,节点名,IP,产线别名
A2,A2,1
27.0.0.1
,料架存放线入口
A1,A1,1
27.0.0.1
,料架存放线出口
D1,D1,1
27.0.0.1
,云仓出料口1
D2,D2,1
27.0.0.1
,云仓出料口2
D3,D3,1
27.0.0.1
,云仓出料口3
A2,A2,1
72.74.200.80
,料架存放线入口
A1,A1,1
72.74.200.80
,料架存放线出口
D1,D1,1
72.74.200.80
,云仓出料口1
D2,D2,1
72.74.200.80
,云仓出料口2
D3,D3,1
72.74.200.80
,云仓出料口3
SMT1,S1,,SMT1线
SMT2,S2,,SMT2线
SMT3,S3,,SMT3线
...
...
DeviceLibrary/Control.cs
查看文件 @
a44da5a
...
...
@@ -149,7 +149,7 @@ namespace DeviceLibrary
//获取AGV状态
rtn
=
MiR_API
.
Get_State
(
AGVManager
.
agvInfo
[
i
],
out
eAGVState
stateID
,
out
string
stateText
,
out
int
battery
,
out
string
mission_text
,
out
Agv_Info
.
MirPosition
position
);
Thread
.
Sleep
(
50
);
if
(
rtn
)
change
=
AGVManager
.
agvInfo
[
i
].
SetState
(
stateID
,
taskStateStr
,
battery
,
mission_text
,
position
);
change
=
AGVManager
.
agvInfo
[
i
].
SetState
(
stateID
,
taskStateStr
,
battery
,
mission_text
,
position
);
// if (change)
{
...
...
@@ -215,7 +215,6 @@ namespace DeviceLibrary
return
null
;
if
(
job
!=
null
)
{
log
.
Debug
(
agv_Info
.
Name
+
" GetJob OK "
+
job
.
ToString
());
return
job
;
}
}
...
...
@@ -250,12 +249,6 @@ namespace DeviceLibrary
{
agv
.
CurJob
=
job
;
}
//else
//{
// //if (agv.Battery < Common.chargeStatus.chargeMax)
// agv.CurJob = new ChargeJob(agv.Place);
//}
}
if
(
agv
.
CurJob
!=
null
)
...
...
@@ -280,11 +273,7 @@ namespace DeviceLibrary
bool
rtn
=
MiR_API
.
CheckIP
(
AGVManager
.
agvInfo
[
idx
].
IP
);
if
(
rtn
)
{
if
(
AGVManager
.
agvInfo
[
idx
].
IsCon
)
{
log
.
Debug
(
AGVManager
.
agvInfo
[
idx
].
Name
+
" Online"
);
}
else
if
(!
AGVManager
.
agvInfo
[
idx
].
IsCon
)
{
AGVManager
.
agvInfo
[
idx
].
IsCon
=
true
;
log
.
Info
(
AGVManager
.
agvInfo
[
idx
].
Name
+
" Online"
);
...
...
@@ -299,10 +288,6 @@ namespace DeviceLibrary
log
.
Info
(
AGVManager
.
agvInfo
[
idx
].
Name
+
" Offline"
);
AgvOnline
?.
Invoke
(
idx
);
}
else
{
log
.
Debug
(
AGVManager
.
agvInfo
[
idx
].
Name
+
" Offline"
);
}
}
return
rtn
;
}
...
...
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
a44da5a
...
...
@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
7.2
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
...
...
DeviceLibrary/MissionSys.cs
查看文件 @
a44da5a
...
...
@@ -157,7 +157,7 @@ namespace DeviceLibrary
/// <returns></returns>
public
static
bool
CheckTaskFinished
(
Agv_Info
agv
,
string
taskName
,
string
curTaskState
)
{
LogUtil
.
debug
(
agv
.
Name
+
" 检查当前任务是否结束: "
+
taskName
+
" "
+
curTaskState
);
LogUtil
.
debug
(
agv
.
Name
+
" 检查当前任务是否结束: "
+
taskName
+
" "
+
curTaskState
+
" "
+
agv
.
CurTaskID
);
return
GetMissionGuidByTaskName
(
taskName
).
Equals
(
agv
.
CurTaskGUID
)
&&
curTaskState
.
Equals
(
SettingString
.
Done
);
}
/// <summary>
...
...
DeviceLibrary/bean/Agv_Info.cs
查看文件 @
a44da5a
...
...
@@ -144,7 +144,8 @@ namespace DeviceLibrary
/// 当前料架的工单信息
/// </summary>
public
string
BoxDestInfo
{
get
;
set
;
}
=
""
;
public
string
IOInState
{
get
;
set
;
}
=
""
;
public
string
IOOutState
{
get
;
set
;
}
=
""
;
/// <summary>
/// 任务重发
/// </summary>
...
...
@@ -190,6 +191,12 @@ namespace DeviceLibrary
MiR_API
.
Get_IO_Status
(
this
,
out
bool
[]
input
,
out
bool
[]
output
);
if
(
input
!=
null
&&
input
.
Length
==
4
)
{
try
{
IOInState
=
string
.
Join
(
","
,
input
.
ToArray
());
IOOutState
=
string
.
Join
(
","
,
output
.
ToArray
());
}
catch
{
}
bool
reachIoValue
=
input
[
3
].
Equals
(
true
);
if
(
reachIoValue
)
{
...
...
DeviceLibrary/bean/MiR_API.cs
查看文件 @
a44da5a
...
...
@@ -74,6 +74,7 @@ namespace DeviceLibrary
JavaScriptSerializer
serializer
=
new
JavaScriptSerializer
();
Dictionary
<
string
,
object
>
dic
=
(
Dictionary
<
string
,
object
>)
serializer
.
DeserializeObject
(
json
);
if
(
dic
==
null
)
{
log
.
Error
(
"URL: "
+
url
+
"\n"
+
"Return: "
+
json
);
...
...
@@ -95,7 +96,7 @@ namespace DeviceLibrary
{
input
=
null
;
output
=
null
;
//
log.Error("Get_IO_Status", ex);
log
.
Error
(
"Get_IO_Status"
,
ex
);
return
false
;
}
}
...
...
DeviceLibrary/bean/job/EmptyShelfBackJob.cs
查看文件 @
a44da5a
...
...
@@ -19,10 +19,11 @@ namespace DeviceLibrary
/// 载空料架返回任务
/// </summary>
/// <param name="lineName">产线的节点名称</param>
public
EmptyShelfBackJob
(
string
lineName
,
eShelfType
shelfTyp
e
)
public
EmptyShelfBackJob
(
string
emptyShelfPlace
,
eShelfType
shelfType
,
string
emptyShelfTargetPlac
e
)
{
EmptyShelfPlace
=
lineNam
e
;
EmptyShelfPlace
=
emptyShelfPlac
e
;
this
.
shelfType
=
shelfType
;
EmptyShelfTargetPlace
=
emptyShelfTargetPlace
;
}
/// <summary>
...
...
@@ -156,7 +157,6 @@ namespace DeviceLibrary
CurTaskState
=
MissionSys
.
GetTakJobState
(
agv
);
if
(
MissionSys
.
CheckTaskFinished
(
agv
,
SettingString
.
Leave
,
CurTaskState
))
{
AGVManager
.
SetNodeOccupy
(
EmptyShelfTargetPlace
,
LineState
.
None
);
agv
.
RFID
=
""
;
Job
job
=
AGVManager
.
control
.
GetJob
(
agv
);
if
(
job
!=
null
)
...
...
DeviceLibrary/bean/job/GoEmptyShelfLineJob.cs
查看文件 @
a44da5a
...
...
@@ -153,8 +153,8 @@ namespace DeviceLibrary
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车完成"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
SmallShelf
);
AGVManager
.
CheckBoxNeedShelfState
(
agv
,
out
string
nodeName
);
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
SmallShelf
,
nodeName
);
}
else
if
(
jobStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
...
...
DeviceLibrary/bean/job/GoFullShelfStationJob.cs
查看文件 @
a44da5a
...
...
@@ -11,17 +11,18 @@ namespace DeviceLibrary
/// </summary>
/// <param name="agvCurPlace">接到任务时,AGV的位置(空表示待机位)</param>
/// <param name="palce"></param>
public
GoFullShelfStationJob
(
string
palce
,
string
agvCurPlace
=
SettingString
.
Standby
)
public
GoFullShelfStationJob
(
string
palce
,
string
agvCurPlace
,
string
rfid
)
{
FullShelfStationPlace
=
palce
;
agvPlace
=
agvCurPlace
;
RFID
=
rfid
;
}
/// <summary>
/// 出满料位置点
/// </summary>
public
string
FullShelfStationPlace
{
get
;
set
;
}
public
string
RFID
{
get
;
set
;
}
/// <summary>
/// 接到任务时,AGV的位置
/// </summary>
...
...
@@ -32,9 +33,9 @@ namespace DeviceLibrary
/// </summary>
public
override
string
RunInfo
{
get
{
return
string
.
Format
(
"接满料任务[{0}]
:{1}"
,
CurTask
ID
,
runInfo
);
}
get
{
return
string
.
Format
(
"接满料任务[{0}]
[rfid={1}]:{2}"
,
CurTaskID
,
RF
ID
,
runInfo
);
}
}
private
bool
noneTargetHandle
=
false
;
/// <summary>
/// AGV上是否有负载
/// </summary>
...
...
@@ -91,39 +92,36 @@ namespace DeviceLibrary
CurTaskState
=
MissionSys
.
GetTakJobState
(
agv
);
if
(
MissionSys
.
CheckTaskFinished
(
agv
,
FullShelfStationPlace
,
CurTaskState
))
{
//if (HttpManager.FindFullShelfTarget(node.RFID, out FullShelfDestInfo))
//{
// jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_DOUBLE_LINE_RESPONSE);
// if (FullShelfDestInfo != null)
// {
// AGVManager.GetLineNameByNodeName(FullShelfDestInfo.location, out string line);
// agv.BoxDestInfo = FullShelfDestInfo.ShowInfo(line);
// }
// runInfo = "AGV到达 " + FullShelfStationPlace + ",并发送出料架请求[ReadyLeave]";
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
// jobStep.Msg = msg;
// AGVManager.server.ReadyLeave(FullShelfStationPlace);
//}
//else
//{
// if (FullShelfDestInfo != null)
// {
// AGVManager.GetLineNameByNodeName(FullShelfDestInfo.location, out string line);
// runInfo = "AGV到达 " + FullShelfStationPlace + ",查询满料架目的地:" + FullShelfDestInfo.ShowInfo(line);
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); ;
// jobStep.Msg = msg;
// }
// else
// {
// //[{"msg":"0料车已解绑或未发新料"}]
// jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_STANDBY);
// runInfo = "从产线" + agvPlace + "回到待机位";
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
// jobStep.Msg = msg;
// MissionSys.AssignMission(agv, SettingString.Standby);
// UpdateJobTaskInfo(agv);
// }
//}
if
(
HttpManager
.
FindFullShelfTarget
(
RFID
,
out
FullShelfDestInfo
))
{
if
(
FullShelfDestInfo
!=
null
&&
AGVManager
.
GetLineNameByNodeName
(
FullShelfDestInfo
.
data
,
out
string
line
))
{
jobStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_DOUBLE_LINE_RESPONSE
);
runInfo
=
"AGV到达 "
+
FullShelfStationPlace
+
",并发送出料架请求[ReadyLeave]"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
AGVManager
.
server
.
ReadyLeave
(
FullShelfStationPlace
);
}
else
{
jobStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_REACH_STANDBY
);
runInfo
=
"从"
+
FullShelfStationPlace
+
"回到待机位,因不存在该节点"
+
FullShelfDestInfo
.
data
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
MissionSys
.
AssignMission
(
agv
,
SettingString
.
Standby
);
UpdateJobTaskInfo
(
agv
);
}
}
else
{
noneTargetHandle
=
true
;
jobStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_DOUBLE_LINE_RESPONSE
);
runInfo
=
"AGV到达 "
+
FullShelfStationPlace
+
",并发送出料架请求[ReadyLeave][该料架无目的地]"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
AGVManager
.
server
.
ReadyLeave
(
FullShelfStationPlace
);
}
...
...
@@ -156,10 +154,10 @@ namespace DeviceLibrary
if
(!
agv
.
CurTarName
.
Equals
(
"Enter"
))
{
jobStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT__FULL_SHELF_IN_AGV
);
runInfo
=
"收到
双层线出料架
请求[ReadyLeave]的响应 "
+
FullShelfStationPlace
+
"出料架,小车链条运行"
;
runInfo
=
"收到请求[ReadyLeave]的响应 "
+
FullShelfStationPlace
+
"出料架,小车链条运行"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
MissionSys
.
AssignMission
(
agv
,
SettingString
.
Enter
);
MissionSys
.
AssignMission
(
agv
,
SettingString
.
Enter
);
UpdateJobTaskInfo
(
agv
);
}
...
...
@@ -176,12 +174,25 @@ namespace DeviceLibrary
CurTaskState
=
MissionSys
.
GetTakJobState
(
agv
);
if
(
MissionSys
.
CheckTaskFinished
(
agv
,
SettingString
.
Enter
,
CurTaskState
))
{
//GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.END);
HttpManager
.
AgvRemoveRfid
(
RFID
);
if
(
noneTargetHandle
)
{
jobStep
.
ToNextStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
FullShelfStationPlace
+
"满料架进入小车完成,由于该料架无目的地,去临时点卸料"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
//FullShelfStationPlace = SettingString.A2;
MissionSys
.
AssignMission
(
agv
,
SettingString
.
A2
);
UpdateJobTaskInfo
(
agv
);
}
else
{
runInfo
=
FullShelfStationPlace
+
"满料架进入小车完成"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
return
new
SendFullShelfToLineJob
(
FullShelfDestInfo
);
return
new
SendFullShelfToLineJob
(
FullShelfDestInfo
,
RFID
);
}
}
else
if
(
jobStep
.
IsTimeOut
(
60000
,
out
double
timeOutValue
))
{
...
...
@@ -192,7 +203,28 @@ namespace DeviceLibrary
}
}
else
if
(
jobStep
.
IsStep
(
GO_FULL_SHELF_STATION_STEP
.
WAIT_REACH_TEMP_PLACE
))
{
CurTaskState
=
MissionSys
.
GetTakJobState
(
agv
);
if
(
MissionSys
.
CheckTaskFinished
(
agv
,
SettingString
.
A2
,
CurTaskState
))
{
MiR_API
.
Get_IO_Status
(
agv
,
out
bool
[]
input
,
out
bool
[]
output
);
System
.
Threading
.
Thread
.
Sleep
(
500
);
if
((
input
!=
null
&&
(
input
[
0
]
||
input
[
1
])))
{
runInfo
=
"人员在临时区卸料完成[无目的地],回收料架"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
AGVManager
.
CheckBoxNeedShelfState
(
agv
,
out
string
nodeName
);
return
new
EmptyShelfBackJob
(
SettingString
.
A2
,
eShelfType
.
SmallShelf
,
nodeName
);
}
}
}
else
if
(
jobStep
.
IsStep
(
GO_FULL_SHELF_STATION_STEP
.
END
))
{
return
null
;
}
return
this
;
}
...
...
@@ -227,6 +259,10 @@ namespace DeviceLibrary
/// </summary>
WAIT_REACH_STANDBY
,
/// <summary>
/// 无目的地,放到临时位置
/// </summary>
WAIT_REACH_TEMP_PLACE
,
/// <summary>
/// 送上双层线
/// </summary>
END
...
...
DeviceLibrary/bean/job/SendFullShelfToLineJob.cs
查看文件 @
a44da5a
...
...
@@ -12,10 +12,10 @@ namespace DeviceLibrary
/// <param name="palce">产线名</param>
/// <param name="rfid">料架RFID</param>
/// <param name="isIgNoreBigShelf">是否忽略大料架</param>
public
SendFullShelfToLineJob
(
HttpManager
.
BoxDestInfo
boxDestInfo
,
bool
isIgNoreBigShelf
=
false
)
public
SendFullShelfToLineJob
(
HttpManager
.
BoxDestInfo
boxDestInfo
,
string
rfid
,
bool
isIgNoreBigShelf
=
false
)
{
FullShelfPlace
=
boxDestInfo
.
location
;
RFID
=
boxDestInfo
.
id
;
FullShelfPlace
=
boxDestInfo
.
data
;
RFID
=
rf
id
;
BoxDestInfo
=
boxDestInfo
;
IsIgnoreBigShelf
=
isIgNoreBigShelf
;
}
...
...
@@ -53,7 +53,6 @@ namespace DeviceLibrary
agv
.
RFID
=
RFID
;
if
(
jobStep
.
IsStep
(
SEND_FULL_SHELF_STEP
.
NONE
))
{
HttpManager
.
AgvRemoveRfid
(
RFID
);
jobStep
.
ToNextStep
(
SEND_FULL_SHELF_STEP
.
WAIT_AGV_REACH_LINE
);
runInfo
=
"从云仓送往["
+
FullShelfPlace
+
"]"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
...
...
@@ -77,12 +76,13 @@ namespace DeviceLibrary
{
MiR_API
.
Get_IO_Status
(
agv
,
out
bool
[]
input
,
out
bool
[]
output
);
System
.
Threading
.
Thread
.
Sleep
(
500
);
if
((
input
!=
null
&&
input
[
0
]
))
if
((
input
!=
null
&&
(
input
[
0
]||
input
[
1
])
))
{
runInfo
=
"人员在"
+
FullShelfPlace
+
"卸料完成"
;
msg
+=
string
.
Format
(
"[{0}] {1}"
,
jobStep
.
CurStep
(),
runInfo
);
jobStep
.
Msg
=
msg
;
return
new
EmptyShelfBackJob
(
FullShelfPlace
,
eShelfType
.
SmallShelf
);
AGVManager
.
CheckBoxNeedShelfState
(
agv
,
out
string
nodeName
);
return
new
EmptyShelfBackJob
(
FullShelfPlace
,
eShelfType
.
SmallShelf
,
nodeName
);
}
}
...
...
DeviceLibrary/bean/job/jobType/GetEmptyShelfJobType.cs
查看文件 @
a44da5a
...
...
@@ -29,7 +29,7 @@ namespace DeviceLibrary
if
(
AGVManager
.
CheckShelfStorageOutState
(
agv
))
{
AGVManager
.
SetNodeOccupy
(
nodename
,
LineState
.
Busy
);
LogUtil
.
debug
(
string
.
Format
(
"{0} Get Job OK:{1},place={2}"
,
agv
.
Name
,
"GoEmptyShelfLineJob"
,
nodename
)
);
return
new
GoEmptyShelfLineJob
(
agv
.
Place
,
SettingString
.
A1
,
""
);
}
...
...
DeviceLibrary/bean/job/jobType/SendFullShelfJobType.cs
查看文件 @
a44da5a
...
...
@@ -24,8 +24,103 @@ namespace DeviceLibrary
if
(!
AGVManager
.
CheckAGVStatusNone
(
currentAgv
))
return
null
;
//查看云仓出料口情况
string
rfid
;
string
checkPlace
=
SettingString
.
D1
;
//查找云仓出料的任务
if
(
FindNeedLeaveMission
(
currentAgv
,
checkPlace
,
out
rfid
))
{
LogUtil
.
info
(
string
.
Format
(
"{0} [{1}]需要出满料串{2}"
,
currentAgv
.
Name
,
checkPlace
,
rfid
));
return
new
GoFullShelfStationJob
(
checkPlace
,
currentAgv
.
Place
,
rfid
);
}
checkPlace
=
SettingString
.
D2
;
//查找云仓出料的任务
if
(
FindNeedLeaveMission
(
currentAgv
,
checkPlace
,
out
rfid
))
{
LogUtil
.
info
(
string
.
Format
(
"{0} [{1}]需要出满料串{2}"
,
currentAgv
.
Name
,
checkPlace
,
rfid
));
return
new
GoFullShelfStationJob
(
checkPlace
,
currentAgv
.
Place
,
rfid
);
}
checkPlace
=
SettingString
.
D3
;
//查找云仓出料的任务
if
(
FindNeedLeaveMission
(
currentAgv
,
checkPlace
,
out
rfid
))
{
LogUtil
.
info
(
string
.
Format
(
"{0} [{1}]需要出满料串{2}"
,
currentAgv
.
Name
,
checkPlace
,
rfid
));
return
new
GoFullShelfStationJob
(
checkPlace
,
currentAgv
.
Place
,
rfid
);
}
return
null
;
}
public
static
bool
CheckFullTask
(
string
rfid
,
out
string
targetName
)
{
targetName
=
""
;
if
(
HttpManager
.
FindFullShelfTarget
(
rfid
,
out
HttpManager
.
BoxDestInfo
destInfo
))
{
targetName
=
destInfo
.
data
;
return
true
;
}
return
false
;
}
/// <summary>
/// 查询节点出料架[满]任务
/// </summary>
/// <param name="agv"></param>
/// <param name="nodeName"></param>
/// <param name="RFID"></param>
/// <param name="empty">料架类型</param>
/// <returns></returns>
public
static
bool
FindNeedLeaveMission
(
Agv_Info
agv
,
string
nodeName
,
out
string
RFID
,
bool
empty
=
false
)
{
RFID
=
""
;
if
(
FindNeedLeave
(
agv
,
nodeName
,
out
string
rfid
))
{
int
idx
=
AGVManager
.
agvInfo
.
FindIndex
(
s
=>
!
s
.
IP
.
Equals
(
agv
.
IP
)
&&
s
.
CurJob
!=
null
&&
(
s
.
CurJob
is
GoFullShelfStationJob
&&
(((
GoFullShelfStationJob
)
s
.
CurJob
).
FullShelfStationPlace
.
Equals
(
nodeName
)))
);
HttpManager
.
FindFullShelfTarget
(
rfid
,
out
HttpManager
.
BoxDestInfo
boxDestInfo
);
if
(
idx
==
-
1
&&
boxDestInfo
!=
null
)
// && HttpManager.FindFullShelfTarget(rfid,out HttpManager.BoxDestInfo boxDestInfo)
{
RFID
=
rfid
;
LogUtil
.
debug
(
string
.
Format
(
"{0} FindNeedLeaveMission"
,
agv
.
Name
));
return
true
;
}
}
return
false
;
}
/// <summary>
/// 需要离开料架
/// </summary>
/// <param name="agv"></param>
/// <param name="nodeName"></param>
/// <param name="rfid"></param>
/// <param name="empty">料架类型</param>
/// <returns></returns>
public
static
bool
FindNeedLeave
(
Agv_Info
agv
,
string
nodeName
,
out
string
rfid
)
{
rfid
=
""
;
int
nodeIdx
=
AGVManager
.
FindNode
(
nodeName
);
List
<
AlarmMsg
>
msglist
=
new
List
<
AlarmMsg
>();
if
(
nodeIdx
>
-
1
)
{
nodeIdx
=
AGVManager
.
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
nodeName
)
&&
s
.
StateEquals
(
eNodeStatus
.
NeedLeave
));
if
(
nodeIdx
>
-
1
)
{
if
(
AGVManager
.
nodeInfo
[
nodeIdx
].
RFID
.
StartsWith
(
SettingString
.
ReelString_RFID_Prefix
))
{
rfid
=
AGVManager
.
nodeInfo
[
nodeIdx
].
RFID
;
return
true
;
}
else
{
msglist
.
Add
(
new
AlarmMsg
(
nodeName
,
"Using."
+
nodeName
,
"出口为出料任务,但是RFID状态异常:rfid="
+
AGVManager
.
nodeInfo
[
nodeIdx
].
RFID
));
}
}
}
else
{
msglist
.
Add
(
new
AlarmMsg
(
nodeName
,
"Using."
+
nodeName
,
"调用关闭"
));
}
if
(
msglist
.
Count
>
0
)
HttpManager
.
updateDeviceAlarmMsg
(
msglist
);
return
false
;
}
}
}
DeviceLibrary/bean/node/ClientNode.cs
查看文件 @
a44da5a
...
...
@@ -33,12 +33,9 @@ namespace DeviceLibrary
public
string
LineName
{
set
;
get
;
}
public
ClientLevel
ClientLevel
{
get
;
set
;
}
=
ClientLevel
.
Low
;
/// <summary>
/// 节点状态(AGV占用情况)
/// </summary>
public
LineState
State
=
LineState
.
None
;
public
string
AliceName
{
get
;
set
;
}
public
string
DestInfo
{
get
;
set
;
}
/// <summary>
/// 客户端节点
/// </summary>
...
...
@@ -88,7 +85,7 @@ namespace DeviceLibrary
// if (Online)
// {
s
[
2
]
=
nodeStatus
.
ToString
();
s
[
3
]
=
State
.
ToString
()
;
s
[
3
]
=
"None"
;
s
[
4
]
=
RFID
;
// s[5] = AgvName;
// }
...
...
DeviceLibrary/manager/AGVManager.cs
查看文件 @
a44da5a
...
...
@@ -154,23 +154,7 @@ namespace DeviceLibrary
return
idx
;
}
/// <summary>
/// 设置节点的状态占用
/// </summary>
/// <param name="nodeName"></param>
/// <param name="state"></param>
public
static
void
SetNodeOccupy
(
string
nodeName
,
LineState
state
)
{
int
i
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
nodeName
));
if
(
i
>-
1
)
{
if
(
nodeInfo
[
i
].
State
.
Equals
(
state
))
return
;
nodeInfo
[
i
].
State
=
state
;
log
.
Debug
(
string
.
Format
(
"设置{0}的占用状态为{1}"
,
nodeName
,
state
));
}
}
private
static
object
checkLocObj
=
new
object
();
//private static object checkLocObj = new object();
/// <summary>
/// 查看云仓需要料架的状况
/// </summary>
...
...
@@ -180,14 +164,14 @@ namespace DeviceLibrary
{
nodeName
=
""
;
if
(
Monitor
.
TryEnter
(
checkLocObj
))
//
if (Monitor.TryEnter(checkLocObj))
{
try
{
int
tarIdx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
SettingString
.
D1
&&
s
.
StateEquals
(
eNodeStatus
.
NeedEnter
)
&&
s
.
IsUse
);
if
(
tarIdx
>
-
1
)
{
if
(
!
CheckLineBusy
(
SettingString
.
D1
))
if
(
CheckAgvEmptyJob
(
agv
,
SettingString
.
D1
))
{
nodeName
=
SettingString
.
D1
;
log
.
Debug
(
string
.
Format
(
"{0} {1}需要料架"
,
agv
.
Name
,
SettingString
.
D1
));
...
...
@@ -198,7 +182,7 @@ namespace DeviceLibrary
tarIdx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
SettingString
.
D2
&&
s
.
StateEquals
(
eNodeStatus
.
NeedEnter
)
&&
s
.
IsUse
);
if
(
tarIdx
>
-
1
)
{
if
(
!
CheckLineBusy
(
SettingString
.
D2
))
if
(
CheckAgvEmptyJob
(
agv
,
SettingString
.
D2
))
{
nodeName
=
SettingString
.
D2
;
log
.
Debug
(
string
.
Format
(
"{0} {1}需要料架"
,
agv
.
Name
,
SettingString
.
D2
));
...
...
@@ -208,7 +192,7 @@ namespace DeviceLibrary
tarIdx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
SettingString
.
D3
&&
s
.
StateEquals
(
eNodeStatus
.
NeedEnter
)
&&
s
.
IsUse
);
if
(
tarIdx
>
-
1
)
{
if
(
!
CheckLineBusy
(
SettingString
.
D3
))
if
(
CheckAgvEmptyJob
(
agv
,
SettingString
.
D3
))
{
nodeName
=
SettingString
.
D3
;
log
.
Debug
(
string
.
Format
(
"{0} {1}需要料架"
,
agv
.
Name
,
SettingString
.
D3
));
...
...
@@ -222,7 +206,7 @@ namespace DeviceLibrary
}
finally
{
Monitor
.
Exit
(
checkLocObj
);
//
Monitor.Exit(checkLocObj);
}
}
...
...
@@ -230,16 +214,16 @@ namespace DeviceLibrary
}
/// <summary>
/// 检查
云仓出料口是否被agv占用
/// 检查
是否有AGV送空架子
/// </summary>
/// <param name="nodeName"></param>
/// <returns></returns>
public
static
bool
Check
LineBusy
(
string
nodeN
ame
)
public
static
bool
Check
AgvEmptyJob
(
Agv_Info
agv
,
string
noden
ame
)
{
int
i
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
.
Equals
(
nodeName
));
if
(
i
>-
1
&&
nodeInfo
[
i
].
State
.
Equals
(
LineState
.
Busy
))
int
i
=
agvInfo
.
FindIndex
(
s
=>
!
s
.
IP
.
Equals
(
agv
.
IP
)
&&
s
.
CurJob
is
EmptyShelfBackJob
&&
((
EmptyShelfBackJob
)
s
.
CurJob
).
EmptyShelfTargetPlace
.
Equals
(
nodename
));
if
(
i
>
-
1
)
return
false
;
return
true
;
return
false
;
}
/// <summary>
/// 查看料架存放处是否可以放空料架
...
...
@@ -264,12 +248,12 @@ namespace DeviceLibrary
/// <param name="agv"></param>
/// <param name="nodeName"></param>
/// <returns></returns>
public
static
bool
CheckNeedEmptyShelf
(
Agv_Info
agv
,
out
string
nodeName
)
public
static
bool
CheckNeedEmptyShelf
(
Agv_Info
agv
,
out
string
nodeName
)
{
if
(!
CheckBoxNeedShelfState
(
agv
,
out
nodeName
))
if
(!
CheckBoxNeedShelfState
(
agv
,
out
nodeName
))
{
if
(
CheckShelfStorageInState
(
agv
))
if
(
CheckShelfStorageInState
(
agv
))
{
nodeName
=
SettingString
.
A2
;
return
true
;
...
...
@@ -285,8 +269,10 @@ namespace DeviceLibrary
public
static
bool
CheckShelfStorageOutState
(
Agv_Info
agv
)
{
int
tarIdx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
Name
==
SettingString
.
A1
&&
(
s
.
StateEquals
(
eNodeStatus
.
NeedEnter
))
&&
s
.
IsUse
);
if
(
tarIdx
>
-
1
)
&&
(
s
.
StateEquals
(
eNodeStatus
.
NeedLeave
))
&&
s
.
IsUse
);
int
idx
=
AGVManager
.
agvInfo
.
FindIndex
(
s
=>
!
s
.
IP
.
Equals
(
agv
.
IP
)
&&
s
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
s
.
CurJob
).
EmptyShelfPlace
.
Equals
(
SettingString
.
A1
));
if
(
tarIdx
>
-
1
&&
idx
==
-
1
)
{
log
.
Debug
(
string
.
Format
(
"{0} {1}可以出料架"
,
agv
.
Name
,
SettingString
.
A1
));
return
true
;
...
...
DeviceLibrary/manager/HttpManager.cs
查看文件 @
a44da5a
此文件的差异被折叠,
点击展开。
SO827-AGV/App.config
查看文件 @
a44da5a
...
...
@@ -4,21 +4,21 @@
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
</
configSections
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
7.2
"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
6.1
"
/>
</
startup
>
<
appSettings
>
<
add
key
=
"Port_AGV_Server"
value
=
"9501"
/>
<
add
key
=
"http.server"
value
=
"http://1
0.85.162.124/myproject
/"
/>
<
add
key
=
"FLEET"
value
=
"1
0.85.19.3
"
/>
<
add
key
=
"UseFleet"
value
=
"
Fals
e"
/>
<
add
key
=
"http.server"
value
=
"http://1
72.74.200.81/smdbox
/"
/>
<
add
key
=
"FLEET"
value
=
"1
72.74.200.82
"
/>
<
add
key
=
"UseFleet"
value
=
"
Tru
e"
/>
<
add
key
=
"ChargeThreshold"
value
=
"20,90"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"AgvServer"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/AgvServer.log"
/>
<
file
value
=
"logs/AgvServer
/AgvServer
.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"
3
0"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"
1
0"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
...
...
@@ -26,10 +26,10 @@
</
layout
>
</
appender
>
<
appender
name
=
"HttpManager"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/HttpManager.log"
/>
<
file
value
=
"logs/HttpManager
/HttpManager
.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"
3
0"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"
1
0"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
...
...
@@ -37,7 +37,7 @@
</
layout
>
</
appender
>
<
appender
name
=
"AGV_3D_Line"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/AGV
_3D
_Line.log"
/>
<
file
value
=
"logs/AGV
/AGV
_Line.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
...
...
@@ -46,11 +46,11 @@
<
conversionPattern
value
=
"[%date][%t][%c:%L]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
appender
name
=
"
LineWebService
"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/
UnlockInfo
.log"
/>
<
appender
name
=
"
MiR_API
"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/
MiR_API/MiR_API
.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"
3
0"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"
1
0"
/>
<!-- 切割最多文件数 -->
<
param
name
=
"MaximumFileSize"
value
=
"50MB"
/>
<!-- 每个文件的大小 -->
...
...
@@ -60,9 +60,9 @@
<
conversionPattern
value
=
"[%date]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
logger
name
=
"
LineWebService
"
>
<
logger
name
=
"
MiR_API
"
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"
LineWebService
"
/>
<
appender
-
ref
ref
=
"
MiR_API
"
/>
</
logger
>
<
logger
name
=
"AgvServer"
>
<
level
value
=
"Info"
/>
...
...
SO827-AGV/FrmMain.Designer.cs
查看文件 @
a44da5a
此文件的差异被折叠,
点击展开。
SO827-AGV/FrmMain.cs
查看文件 @
a44da5a
...
...
@@ -12,6 +12,8 @@ using System.Threading.Tasks;
using
System.Windows.Forms
;
using
Common
;
using
DeviceLibrary
;
using
static
DeviceLibrary
.
HttpManager
;
namespace
AGVControl
{
public
partial
class
FrmMain
:
Form
...
...
@@ -26,7 +28,7 @@ namespace AGVControl
InitializeComponent
();
showTimer
=
new
System
.
Timers
.
Timer
();
showTimer
.
Interval
=
5000
;
//
showTimer.Enabled = true;
showTimer
.
Enabled
=
true
;
showTimer
.
AutoReset
=
true
;
showTimer
.
Elapsed
+=
ShowTimer_Elapsed
;
showTimer
.
Start
();
...
...
@@ -43,7 +45,7 @@ namespace AGVControl
if
(
input
!=
null
&&
input
.
Length
==
4
)
AGVManager
.
agvInfo
[
i
].
IsExistShelf
=
input
[
3
];
flowLayoutPanel1
.
Controls
.
Add
(
AGVManager
.
agvInfo
[
i
].
StateKanban
);
AddForm
(
AGVManager
.
agvInfo
[
i
].
Name
,
new
Manual
(
AGVManager
.
agvInfo
[
i
]));
AddForm
(
AGVManager
.
agvInfo
[
i
].
Name
,
new
Manual
(
AGVManager
.
agvInfo
[
i
]));
AGVManager
.
agvInfo
[
i
].
StateKanban
.
Init
();
}
...
...
@@ -64,8 +66,12 @@ namespace AGVControl
{
Invoke
(
new
Action
(()
=>
{
DgvNode
.
Rows
[
nodeIndex
].
DefaultCellStyle
.
ForeColor
=
AGVManager
.
nodeInfo
[
nodeIndex
].
Online
&&
AGVManager
.
nodeInfo
[
nodeIndex
].
IsUse
?
Color
.
Black
:
Color
.
Red
;
DgvNode
.
Rows
[
nodeIndex
].
SetValues
(
AGVManager
.
nodeInfo
[
nodeIndex
].
ToRow
());
for
(
int
i
=
0
;
i
<
AGVManager
.
nodeInfo
.
Count
;
i
++)
{
DgvNode
.
Rows
[
i
].
DefaultCellStyle
.
ForeColor
=
AGVManager
.
nodeInfo
[
i
].
Online
&&
AGVManager
.
nodeInfo
[
i
].
IsUse
?
Color
.
Black
:
Color
.
Red
;
DgvNode
.
Rows
[
i
].
SetValues
(
AGVManager
.
nodeInfo
[
i
].
ToRow
());
}
}));
System
.
GC
.
Collect
();
}
...
...
@@ -74,8 +80,11 @@ namespace AGVControl
{
Invoke
(
new
Action
(()
=>
{
DgvNode
.
Rows
[
nodeIndex
].
DefaultCellStyle
.
ForeColor
=
AGVManager
.
nodeInfo
[
nodeIndex
].
Online
?
Color
.
Black
:
Color
.
Red
;
// for (int i = 0; i < AGVManager.nodeInfo.Count; i++)
{
DgvNode
.
Rows
[
nodeIndex
].
DefaultCellStyle
.
ForeColor
=
AGVManager
.
nodeInfo
[
nodeIndex
].
Online
&&
AGVManager
.
nodeInfo
[
nodeIndex
].
IsUse
?
Color
.
Black
:
Color
.
Red
;
DgvNode
.
Rows
[
nodeIndex
].
SetValues
(
AGVManager
.
nodeInfo
[
nodeIndex
].
ToRow
());
}
}));
System
.
GC
.
Collect
();
}
...
...
@@ -161,24 +170,111 @@ namespace AGVControl
bool
InShhow
=
false
;
Dictionary
<
string
,
string
>
destInfoMap
=
new
Dictionary
<
string
,
string
>();
private
void
ShowTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
//ShowEmptyTask();
if
(
InShhow
)
return
;
InShhow
=
true
;
BoxDestInfo
destInfo
;
ClientNode
node
;
Invoke
(
new
Action
(()
=>
{
node
=
AGVManager
.
nodeInfo
.
Find
(
s
=>
s
.
Name
.
Equals
(
SettingString
.
D1
)
&&
s
.
RFID
.
StartsWith
(
SettingString
.
ReelString_RFID_Prefix
));
if
(
node
!=
null
)
{
if
(!
destInfoMap
.
ContainsKey
(
SettingString
.
D1
))
{
FindFullShelfTarget
(
node
.
RFID
,
out
destInfo
);
if
(
destInfo
!=
null
)
{
lblD1
.
Text
=
destInfo
.
ToString
();
destInfoMap
.
Add
(
SettingString
.
D1
,
node
.
RFID
);
}
}
else
if
(!
destInfoMap
[
SettingString
.
D1
].
Equals
(
node
.
RFID
))
{
FindFullShelfTarget
(
node
.
RFID
,
out
destInfo
);
if
(
destInfo
!=
null
)
{
lblD1
.
Text
=
destInfo
.
ToString
();
destInfoMap
[
SettingString
.
D1
]
=
node
.
RFID
;
}
}
}
else
{
lblD1
.
Text
=
""
;
if
(
destInfoMap
.
ContainsKey
(
SettingString
.
D1
))
destInfoMap
.
Remove
(
SettingString
.
D1
);
}
node
=
AGVManager
.
nodeInfo
.
Find
(
s
=>
s
.
Name
.
Equals
(
SettingString
.
D2
)
&&
s
.
RFID
.
StartsWith
(
SettingString
.
ReelString_RFID_Prefix
));
if
(
node
!=
null
)
{
if
(!
destInfoMap
.
ContainsKey
(
SettingString
.
D2
))
{
FindFullShelfTarget
(
node
.
RFID
,
out
destInfo
);
if
(
destInfo
!=
null
)
{
lblD2
.
Text
=
destInfo
.
ToString
();
destInfoMap
.
Add
(
SettingString
.
D2
,
node
.
RFID
);
}
}
else
if
(!
destInfoMap
[
SettingString
.
D2
].
Equals
(
node
.
RFID
))
{
FindFullShelfTarget
(
node
.
RFID
,
out
destInfo
);
if
(
destInfo
!=
null
)
{
lblD2
.
Text
=
destInfo
.
ToString
();
destInfoMap
[
SettingString
.
D2
]
=
node
.
RFID
;
}
}
}
else
{
lblD2
.
Text
=
""
;
if
(
destInfoMap
.
ContainsKey
(
SettingString
.
D2
))
destInfoMap
.
Remove
(
SettingString
.
D2
);
}
node
=
AGVManager
.
nodeInfo
.
Find
(
s
=>
s
.
Name
.
Equals
(
SettingString
.
D3
)
&&
s
.
RFID
.
StartsWith
(
SettingString
.
ReelString_RFID_Prefix
));
if
(
node
!=
null
)
{
if
(!
destInfoMap
.
ContainsKey
(
SettingString
.
D3
))
{
FindFullShelfTarget
(
node
.
RFID
,
out
destInfo
);
if
(
destInfo
!=
null
)
{
lblD3
.
Text
=
destInfo
.
ToString
();
destInfoMap
.
Add
(
SettingString
.
D3
,
node
.
RFID
);
}
}
else
if
(!
destInfoMap
[
SettingString
.
D3
].
Equals
(
node
.
RFID
))
{
FindFullShelfTarget
(
node
.
RFID
,
out
destInfo
);
if
(
destInfo
!=
null
)
{
lblD3
.
Text
=
destInfo
.
ToString
();
destInfoMap
[
SettingString
.
D3
]
=
node
.
RFID
;
}
}
}
else
{
lblD3
.
Text
=
""
;
if
(
destInfoMap
.
ContainsKey
(
SettingString
.
D3
))
destInfoMap
.
Remove
(
SettingString
.
D3
);
}
Application
.
DoEvents
();
//if (!Common.doubleLine_WO.Equals(""))
lblWO
.
Text
=
AGVManager
.
doubleLine_WO
;
// if (!AGVManager.A6_Target.Equals(""))
//lblDestInfo.Text = HttpManager.A6_Target;
lblCharge1
.
Text
=
"充电桩1:"
;
lblCharge2
.
Text
=
"充电桩2:"
;
lblWarn
.
Text
=
AGVManager
.
warnMsg
;
}));
...
...
@@ -214,5 +310,28 @@ namespace AGVControl
}
}
private
void
btnAgvRemoveRfid_Click
(
object
sender
,
EventArgs
e
)
{
try
{
if
(
txtBoxRFID
.
Text
.
Equals
(
""
))
return
;
Task
.
Factory
.
StartNew
(()
=>
{
bool
rtn
=
HttpManager
.
AgvRemoveRfid
(
txtBoxRFID
.
Text
.
ToUpper
());
this
.
Invoke
(
new
Action
(()
=>
{
label1
.
BackColor
=
rtn
?
Color
.
Green
:
Color
.
Red
;
label1
.
Text
=
rtn
?
"清理料架的缓存信息成功:"
+
txtBoxRFID
.
Text
.
ToUpper
()
:
"清理料架的缓存信息失败:"
+
txtBoxRFID
.
Text
.
ToUpper
();
}));
LogUtil
.
info
(
string
.
Format
(
"手动清理料架的缓存信息成功[{0}]"
,
txtBoxRFID
.
Text
.
ToUpper
()));
txtBoxRFID
.
Text
=
""
;
});
}
catch
(
Exception
ex
)
{
}
}
}
}
SO827-AGV/Manual.Designer.cs
查看文件 @
a44da5a
...
...
@@ -28,6 +28,7 @@
/// </summary>
private
void
InitializeComponent
()
{
this
.
components
=
new
System
.
ComponentModel
.
Container
();
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
Manual
));
this
.
panelInfo
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
lblInfo
=
new
System
.
Windows
.
Forms
.
Label
();
...
...
@@ -42,6 +43,9 @@
this
.
grpBxMission
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnAssignTask
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
cmbBxMission
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
panelInfo
.
SuspendLayout
();
this
.
grpBxRunMode
.
SuspendLayout
();
this
.
grpBxOperation
.
SuspendLayout
();
...
...
@@ -72,6 +76,8 @@
//
// grpBxRunMode
//
this
.
grpBxRunMode
.
Controls
.
Add
(
this
.
label2
);
this
.
grpBxRunMode
.
Controls
.
Add
(
this
.
label1
);
this
.
grpBxRunMode
.
Controls
.
Add
(
this
.
chkBxAuto
);
this
.
grpBxRunMode
.
Controls
.
Add
(
this
.
btnReSendTask
);
this
.
grpBxRunMode
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Top
;
...
...
@@ -96,7 +102,7 @@
//
// btnReSendTask
//
this
.
btnReSendTask
.
Location
=
new
System
.
Drawing
.
Point
(
251
,
11
);
this
.
btnReSendTask
.
Location
=
new
System
.
Drawing
.
Point
(
96
,
11
);
this
.
btnReSendTask
.
Name
=
"btnReSendTask"
;
this
.
btnReSendTask
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
53
);
this
.
btnReSendTask
.
TabIndex
=
3
;
...
...
@@ -194,6 +200,30 @@
this
.
cmbBxMission
.
Size
=
new
System
.
Drawing
.
Size
(
159
,
20
);
this
.
cmbBxMission
.
TabIndex
=
0
;
//
// label1
//
this
.
label1
.
AutoSize
=
true
;
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
194
,
11
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
47
,
12
);
this
.
label1
.
TabIndex
=
4
;
this
.
label1
.
Text
=
"label1"
;
//
// label2
//
this
.
label2
.
AutoSize
=
true
;
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
194
,
52
);
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
47
,
12
);
this
.
label2
.
TabIndex
=
5
;
this
.
label2
.
Text
=
"label2"
;
//
// timer1
//
this
.
timer1
.
Enabled
=
true
;
this
.
timer1
.
Interval
=
1000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// Manual
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
...
@@ -232,5 +262,8 @@
private
System
.
Windows
.
Forms
.
GroupBox
grpBxMission
;
private
System
.
Windows
.
Forms
.
Button
btnAssignTask
;
private
System
.
Windows
.
Forms
.
ComboBox
cmbBxMission
;
private
System
.
Windows
.
Forms
.
Label
label2
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
}
}
SO827-AGV/Manual.cs
查看文件 @
a44da5a
...
...
@@ -33,6 +33,7 @@ namespace AGVControl
}
cmbBxMission
.
SelectedIndex
=
0
;
isIni
=
true
;
timer1
.
Enabled
=
true
;
}
private
void
chkBxAuto_CheckedChanged
(
object
sender
,
EventArgs
e
)
...
...
@@ -58,12 +59,14 @@ namespace AGVControl
if
(
Agv
.
IsExistShelf
)
{
LogUtil
.
error
(
string
.
Format
(
"{0} 车上有负载,无法开启自动模式,请先清空小车负载!"
,
Agv
.
Name
));
MessageBox
.
Show
(
this
,
string
.
Format
(
"{0} 车上有负载,无法开启自动模式,请先清空小车负载!"
,
Agv
.
Name
));
chkBxAuto
.
Checked
=
false
;
return
;
}
if
(
MessageBox
.
Show
(
this
,
"是否继续上一次的任务?\r\n"
+
Agv
.
Msg
,
"提示"
,
MessageBoxButtons
.
YesNo
).
Equals
(
DialogResult
.
No
))
{
LogUtil
.
info
(
string
.
Format
(
"{0} 中断上一次任务:{1}"
,
Agv
.
Name
,
Agv
.
Msg
));
Agv
.
CurJob
=
null
;
AGVManager
.
SetNodeOccupy
(
Agv
.
Place
,
LineState
.
None
);
if
(
Agv
.
Place
.
Equals
(
SettingString
.
Standby
)
||
Agv
.
Place
.
Equals
(
SettingString
.
AutoCharge
))
Agv
.
Place
=
""
;
MiR_API
.
Del_Mission
(
Agv
);
...
...
@@ -151,5 +154,13 @@ namespace AGVControl
{
Close
();
}
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
this
.
Invoke
(
new
Action
(()=>
{
label1
.
Text
=
Agv
.
IOInState
;
label2
.
Text
=
Agv
.
IOOutState
;
}));
}
}
}
SO827-AGV/Manual.resx
查看文件 @
a44da5a
...
...
@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
...
...
SO827-AGV/SO827-AGV.csproj
查看文件 @
a44da5a
...
...
@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>SO827_AGV</RootNamespace>
<AssemblyName>SO827-AGV</AssemblyName>
<TargetFrameworkVersion>v4.
7.2
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
...
...
@@ -37,9 +37,6 @@
<ApplicationIcon>line.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="AsaPL.AgvClient">
<HintPath>..\AgvClient\bin\Debug\AsaPL.AgvClient.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>dll\log4net.dll</HintPath>
</Reference>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论