Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
顾剑亮
/
AGVControl-Qisda-ProductionLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 54be25c3
由
张东亮
编写于
2020-12-04 19:39:00 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
运行版1
1 个父辈
c0e49397
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
220 行增加
和
78 行删除
.vs/AGVControl-ProductionLine/v16/.suo
AGVControl-ProductionLine/BLL/AGVManager.cs
AGVControl-ProductionLine/BLL/Common.cs
AGVControl-ProductionLine/BLL/Control.cs
AGVControl-ProductionLine/FrmMain.Designer.cs
AGVControl-ProductionLine/FrmMain.cs
AGVControl-ProductionLine/FrmMain.resx
AGVControl-ProductionLine/Program.cs
AGVControl-ProductionLine/bean/UnlockedShelf.cs
AGVControl-ProductionLine/bean/job/GoEmptyShelfLineJob.cs
AGVControl-ProductionLine/bean/node/ClientNode.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/LineWebService.log
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
查看文件 @
54be25c
此文件类型无法预览
AGVControl-ProductionLine/BLL/AGVManager.cs
查看文件 @
54be25c
...
...
@@ -451,7 +451,7 @@ namespace AGVControl
{
Msg1
msgs
=
JsonHelper
.
DeserializeJsonToObject
<
Msg1
>(
result
);
if
(
msgs
==
null
)
return
",,,
D22
"
;
return
",,,"
;
else
{
Common
.
log
.
Debug
(
string
.
Format
(
"{0}接驳台状态:{1}"
,
lineName
,
msgs
.
Msg
));
...
...
@@ -463,9 +463,58 @@ namespace AGVControl
catch
(
Exception
ex
)
{
Common
.
log
.
Error
(
ex
.
Message
);
return
",,,
D22
"
;
return
",,,"
;
}
return
",,,D22"
;
return
",,,"
;
}
/// <summary>
/// 获取接驳台最外面料架
/// </summary>
/// <param name="lineName"></param>
/// <returns></returns>
public
static
string
GetFirstRFID
(
string
lineName
)
{
string
addr
=
""
;
if
(
lineName
.
StartsWith
(
SettingString
.
D4_Name_Prefix
))
{
addr
=
string
.
Format
(
"http://{0}/LineGetRFID?line={1}"
,
ConfigAppSettings
.
GetValue
(
SettingString
.
IP_4D_Light
),
lineName
);
}
else
if
(
lineName
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
addr
=
string
.
Format
(
"http://{0}/LineGetRFID?line={1}"
,
ConfigAppSettings
.
GetValue
(
SettingString
.
IP_4C_Light
),
lineName
);
}
try
{
string
result
=
HttpHelper
.
Get
(
addr
);
if
(!
result
.
Equals
(
""
))
{
Msg1
msgs
=
JsonHelper
.
DeserializeJsonToObject
<
Msg1
>(
result
);
if
(
msgs
==
null
)
return
""
;
else
{
Common
.
log
.
Debug
(
string
.
Format
(
"{0}接驳台状态:{1}"
,
lineName
,
msgs
.
Msg
));
string
rfid
=
""
;
foreach
(
string
item
in
msgs
.
Msg
.
Split
(
','
))
{
if
(!
item
.
Equals
(
""
))
{
rfid
=
item
;
}
}
return
rfid
;
}
}
}
catch
(
Exception
ex
)
{
Common
.
log
.
Error
(
ex
.
Message
);
return
""
;
}
return
""
;
}
/// <summary>
/// 删除接驳台料架
...
...
AGVControl-ProductionLine/BLL/Common.cs
查看文件 @
54be25c
...
...
@@ -617,8 +617,8 @@ namespace AGVControl
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
log
.
Error
(
warnMsg
);
return
fals
e
;
Common
.
LogInfo
(
warnMsg
);
return
tru
e
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
...
...
@@ -664,8 +664,8 @@ namespace AGVControl
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
log
.
Error
(
warnMsg
);
return
fals
e
;
Common
.
LogInfo
(
warnMsg
);
return
tru
e
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
...
...
@@ -705,8 +705,8 @@ namespace AGVControl
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
log
.
Error
(
warnMsg
);
return
fals
e
;
Common
.
LogInfo
(
warnMsg
);
return
tru
e
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
...
...
@@ -727,8 +727,8 @@ namespace AGVControl
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
log
.
Error
(
warnMsg
);
return
fals
e
;
Common
.
LogInfo
(
warnMsg
);
return
tru
e
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
...
...
@@ -757,8 +757,8 @@ namespace AGVControl
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
log
.
Error
(
warnMsg
);
return
fals
e
;
Common
.
LogInfo
(
warnMsg
);
return
tru
e
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
...
...
@@ -779,8 +779,8 @@ namespace AGVControl
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
log
.
Error
(
warnMsg
);
return
fals
e
;
Common
.
LogInfo
(
warnMsg
);
return
tru
e
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
...
...
@@ -796,12 +796,14 @@ namespace AGVControl
//4C车间备料区寻找
if
(
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
{
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
EmptyShelfCnt
>
0
&&
s
.
Name
.
Equals
(
SettingString
.
C4FeederOut
)
&&
s
.
IsUse
);
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
EmptyShelfCnt
>
0
&&
s
.
Name
.
Equals
(
SettingString
.
C4FeederOut
)
&&
!
s
.
RFID
.
StartsWith
(
"0"
)
&&
s
.
IsUse
);
if
(
idx
>
-
1
)
{
int
idx1
=
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
EnterLeaveShelfJob
&&
((
EnterLeaveShelfJob
)
s
.
CurJob
).
LineName
.
Equals
(
SettingString
.
C4FeederOut
));
if
(
idx1
==
-
1
)
{
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
nodeInfo
[
idx
].
Name
;
Common
.
log
.
Debug
(
agv
.
Name
+
" 双层线右侧需要料架,准备去4C-"
+
nodeName
);
return
true
;
...
...
@@ -812,9 +814,11 @@ namespace AGVControl
//4D车间备料区寻找
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
{
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
EmptyShelfCnt
>
0
&&
s
.
Name
.
Equals
(
SettingString
.
D4FeederOut
)
&&
s
.
IsUse
);
idx
=
nodeInfo
.
FindIndex
(
s
=>
s
.
EmptyShelfCnt
>
0
&&
s
.
Name
.
Equals
(
SettingString
.
D4FeederOut
)
&&
!
s
.
RFID
.
StartsWith
(
"0"
)&&
s
.
IsUse
);
if
(
idx
>
-
1
)
{
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
nodeName
=
nodeInfo
[
idx
].
Name
;
Common
.
log
.
Debug
(
agv
.
Name
+
" 双层线右侧需要料架,准备去4D-"
+
nodeName
);
return
true
;
...
...
@@ -891,8 +895,8 @@ namespace AGVControl
if
(!
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
idx
].
Name
).
Contains
(
nodeInfo
[
idx
].
RFID
))
{
warnMsg
=
string
.
Format
(
"料架{0}在接驳台{1}最外侧,但没有解绑信息,请检查"
,
nodeInfo
[
idx
].
RFID
,
nodeInfo
[
idx
].
Name
);
Common
.
log
.
Error
(
warnMsg
);
return
fals
e
;
Common
.
LogInfo
(
warnMsg
);
return
tru
e
;
}
rfid
=
nodeInfo
[
idx
].
RFID
;
warnMsg
=
""
;
...
...
AGVControl-ProductionLine/BLL/Control.cs
查看文件 @
54be25c
...
...
@@ -18,6 +18,7 @@ namespace AGVControl.BLL
//private int areaC_Index;
private
System
.
Timers
.
Timer
AgvCallTimer
;
private
System
.
Timers
.
Timer
AgvStateTimer
;
private
System
.
Timers
.
Timer
NodeStateTimer
;
//public List<string> Marks;
private
const
int
REG_STATUS
=
20
;
//private List<string> shelfLockedNodeNames;
...
...
@@ -42,6 +43,13 @@ namespace AGVControl.BLL
Enabled
=
false
};
AgvStateTimer
.
Elapsed
+=
AgvStateTimer_Elapsed
;
NodeStateTimer
=
new
System
.
Timers
.
Timer
{
Interval
=
5000
,
AutoReset
=
true
,
Enabled
=
false
};
NodeStateTimer
.
Elapsed
+=
NodeStateTimer_Elapsed
;
}
...
...
@@ -49,19 +57,67 @@ namespace AGVControl.BLL
{
AgvCallTimer
.
Enabled
=
true
;
AgvStateTimer
.
Enabled
=
true
;
NodeStateTimer
.
Enabled
=
true
;
AgvCallTimer
.
Start
();
AgvStateTimer
.
Start
();
NodeStateTimer
.
Start
();
}
public
void
Stop
()
{
AgvCallTimer
.
Enabled
=
false
;
AgvStateTimer
.
Enabled
=
false
;
NodeStateTimer
.
Enabled
=
false
;
AgvCallTimer
.
Stop
();
AgvStateTimer
.
Stop
();
NodeStateTimer
.
Stop
();
}
private
bool
NodeStateInProcess
=
false
;
private
void
NodeStateTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
NodeStateInProcess
)
return
;
NodeStateInProcess
=
true
;
try
{
String
tmp
=
""
;
for
(
int
j
=
0
;
j
<
Common
.
nodeInfo
.
Count
;
j
++)
{
if
(
Common
.
nodeInfo
[
j
].
Name
.
StartsWith
(
SettingString
.
D4_Name_Prefix
)
||
Common
.
nodeInfo
[
j
].
Name
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
if
(!
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
C4FeederIn
)
&&
!
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
C4FeederOut
)
&&
!
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
D4FeederIn
)
&&
!
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
D4FeederOut
))
{
tmp
=
AGVManager
.
GetFirstRFID
(
Common
.
nodeInfo
[
j
].
Name
);
if
(!
tmp
.
Equals
(
Common
.
nodeInfo
[
j
].
RFID
))
{
Common
.
nodeInfo
[
j
].
RFID
=
tmp
;
NodeChangedEvent
?.
Invoke
(
j
);
}
}
if
(
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
C4FeederOut
)
||
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
D4FeederOut
))
{
if
(
Common
.
missionManager
.
GetUnlockCnt
(
Common
.
nodeInfo
[
j
].
Name
)
>
0
)
{
tmp
=
Common
.
missionManager
.
GetUnlockRfids
(
Common
.
nodeInfo
[
j
].
Name
)[
0
];
if
(!
tmp
.
Equals
(
Common
.
nodeInfo
[
j
].
RFID
))
{
Common
.
nodeInfo
[
j
].
RFID
=
tmp
;
NodeChangedEvent
?.
Invoke
(
j
);
}
}
}
}
}
}
catch
(
Exception
ex
)
{
Common
.
log
.
Error
(
"NodeStateTimer "
+
ex
.
Message
+
ex
.
StackTrace
);
}
NodeStateInProcess
=
false
;
}
private
bool
AgvStateInProcess
=
false
;
private
eAGVState
preAGVState
=
eAGVState
.
None
;
private
void
AgvStateTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
...
...
@@ -73,20 +129,6 @@ namespace AGVControl.BLL
String
tmp
=
""
;
for
(
int
j
=
0
;
j
<
Common
.
nodeInfo
.
Count
;
j
++)
{
if
(
Common
.
nodeInfo
[
j
].
Name
.
StartsWith
(
SettingString
.
D4_Name_Prefix
)
||
Common
.
nodeInfo
[
j
].
Name
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
if
(!
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
C4FeederIn
)
&&
!
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
C4FeederOut
)
&&
!
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
D4FeederIn
)
&&
!
Common
.
nodeInfo
[
j
].
Name
.
Equals
(
SettingString
.
D4FeederOut
))
{
tmp
=
AGVManager
.
GetRFIDs
(
Common
.
nodeInfo
[
j
].
Name
).
Split
(
','
)[
3
];
if
(!
tmp
.
Equals
(
Common
.
nodeInfo
[
j
].
RFID
))
{
Common
.
nodeInfo
[
j
].
RFID
=
tmp
;
NodeChangedEvent
?.
Invoke
(
j
);
}
}
}
if
(!
Common
.
nodeInfo
[
j
].
Online
)
{
msglist
.
Add
(
new
AlarmMsg
(
Common
.
nodeInfo
[
j
].
AliceName
,
"lineAgv."
+
Common
.
nodeInfo
[
j
].
Name
+
".OffLine"
,
"离线"
));
...
...
@@ -116,7 +158,7 @@ namespace AGVControl.BLL
{
AgvChanged
?.
Invoke
(
i
);
}
Common
.
log
.
Debug
(
"获取AGV状态"
);
Common
.
log
.
Debug
(
"获取AGV状态"
);
Thread
.
Sleep
(
50
);
rtn
=
Common
.
mir
.
Get_IO_Status
(
Common
.
agvInfo
[
i
],
out
bool
[]
input
,
out
bool
[]
output
);
...
...
AGVControl-ProductionLine/FrmMain.Designer.cs
查看文件 @
54be25c
此文件的差异被折叠,
点击展开。
AGVControl-ProductionLine/FrmMain.cs
查看文件 @
54be25c
...
...
@@ -214,9 +214,9 @@ namespace AGVControl
}
dgvUnlockInfo
.
DataSource
=
bs
;
//赋值控件自动更新
dgvUnlockDetail
.
DataSource
=
bs2
;
dgvUnlockDetail
.
DataSource
=
bs2
;
}));
this
.
Invoke
(
new
Action
(()=>
this
.
Invoke
(
new
Action
(()
=>
{
//grpUnlock.Text = "解绑总数:"+count;
}
...
...
@@ -616,9 +616,11 @@ namespace AGVControl
{
Task
.
Factory
.
StartNew
(()
=>
{
AGVManager
.
UpdateStatus
(
txtBoxRFID
.
Text
.
ToUpper
(),
txtBoxLineName
.
Text
.
ToUpper
());
bool
rtn
=
AGVManager
.
UpdateStatus
(
txtBoxRFID
.
Text
.
ToUpper
(),
txtBoxLineName
.
Text
.
ToUpper
());
this
.
Invoke
(
new
Action
(()
=>
{
label11
.
Text
=
rtn
?
"状态上报成功"
:
"状态上报失败"
;
}));
Common
.
LogInfo
(
string
.
Format
(
"手动上报状态 产线{0} 物料状态更新成功[{1}]"
,
txtBoxLineName
.
Text
.
ToUpper
(),
txtBoxRFID
.
Text
.
ToUpper
()));
txtBoxLineName
.
Text
=
""
;
txtBoxRFID
.
Text
=
""
;
});
}
catch
(
Exception
ex
)
...
...
@@ -662,5 +664,23 @@ namespace AGVControl
}
}
private
void
btnGetStationRfid_Click
(
object
sender
,
EventArgs
e
)
{
if
(
txtBoxLineName
.
Text
.
Equals
(
""
))
return
;
string
res
=
AGVManager
.
GetRFIDs
(
txtBoxLineName
.
Text
.
ToUpper
());
this
.
Invoke
(
new
Action
(()
=>
{
label11
.
Text
=
string
.
Format
(
"由里到外料架顺序:{0}"
,
res
);
}));
}
private
void
btnClearStationRFID_Click
(
object
sender
,
EventArgs
e
)
{
if
(!
txtBoxLineName
.
Text
.
Equals
(
""
)
&&
!
txtBoxRFID
.
Text
.
Equals
(
""
))
{
bool
rtn
=
AGVManager
.
ClearRFID
(
txtBoxLineName
.
Text
.
ToUpper
(),
txtBoxRFID
.
Text
.
ToUpper
());
this
.
Invoke
(
new
Action
(()
=>
{
label11
.
Text
=
rtn
?
"清除接驳RFID成功:"
+
txtBoxLineName
.
Text
+
" "
+
txtBoxRFID
.
Text
:
"清除接驳RFID失败:"
+
txtBoxLineName
.
Text
+
" "
+
txtBoxRFID
.
Text
;
}));
txtBoxLineName
.
Text
=
""
;
txtBoxRFID
.
Text
=
""
;
}
}
}
}
AGVControl-ProductionLine/FrmMain.resx
查看文件 @
54be25c
...
...
@@ -174,6 +174,9 @@
<metadata name="Column16.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="backgroundWorker1.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>
...
...
AGVControl-ProductionLine/Program.cs
查看文件 @
54be25c
...
...
@@ -51,7 +51,7 @@ namespace AGVControl
Common
.
control
=
new
BLL
.
Control
();
//获取节点位置
//
Common.GetNodesPosition();
Common
.
GetNodesPosition
();
Common
.
control
.
Start
();
Common
.
server
=
new
AgvServer
();
Common
.
server
.
Start
();
...
...
AGVControl-ProductionLine/bean/UnlockedShelf.cs
查看文件 @
54be25c
...
...
@@ -56,7 +56,7 @@ namespace AGVControl
System
.
Threading
.
Interlocked
.
Increment
(
ref
tmp
);
EmptyCnt
=
tmp
;
Rfids
.
Add
(
rfid
,
DateTime
.
Now
.
ToString
(
"yyyy/MM/dd/HH:mm:ss,fff"
));
// Common.WriteIni(NodeName, SettingString.EmptyShelfCnt, e
mptyCnt.ToString());
Common
.
WriteIni
(
NodeName
,
SettingString
.
EmptyShelfCnt
,
E
mptyCnt
.
ToString
());
//using (System.IO.StreamWriter file = new System.IO.StreamWriter(Common.CONFIG_PATH + "UnlockInfo.txt"))
//{
// foreach (var item in Rfids.Keys)
...
...
@@ -83,8 +83,12 @@ namespace AGVControl
int
tmp
=
EmptyCnt
;
System
.
Threading
.
Interlocked
.
Decrement
(
ref
tmp
);
EmptyCnt
=
tmp
;
Rfids
.
Remove
(
rfid
);
//Common.WriteIni(nodeName, SettingString.EmptyShelfCnt, emptyCnt.ToString());
if
(
EmptyCnt
.
Equals
(
0
)
&&
Rfids
.
Count
>
0
)
{
Rfids
.
Clear
();
}
//Rfids.Remove(rfid);
Common
.
WriteIni
(
NodeName
,
SettingString
.
EmptyShelfCnt
,
EmptyCnt
.
ToString
());
//using (System.IO.StreamWriter file = new System.IO.StreamWriter(Common.CONFIG_PATH + "UnlockInfo.txt"))
//{
// foreach (var item in Rfids.Keys)
...
...
AGVControl-ProductionLine/bean/job/GoEmptyShelfLineJob.cs
查看文件 @
54be25c
...
...
@@ -19,7 +19,7 @@ namespace AGVControl
/// </summary>
/// <param name="agvPlae">小车当前位置,空表示在待机位</param>
/// <param name="palce">空料架位置点</param>
public
GoEmptyShelfLineJob
(
string
agvPlae
,
string
palce
,
string
rfid
)
public
GoEmptyShelfLineJob
(
string
agvPlae
,
string
palce
,
string
rfid
)
{
EmptyShelfPlace
=
palce
;
this
.
agvPlae
=
agvPlae
;
...
...
@@ -63,10 +63,12 @@ namespace AGVControl
// CurTaskState = st;
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
NONE
))
{
if
(
nodeIdx
==
-
1
)
return
null
;
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
D4_Name_Prefix
))
//4C->4D
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4D_DOOR
);
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4D门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4D门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorCToD
);
...
...
@@ -76,15 +78,15 @@ namespace AGVControl
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
//4D->4C
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_REACH_4C_DOOR
);
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
runInfo
=
"去空料架产线"
+
EmptyShelfPlace
+
",先前往4C门["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
DoorMission
(
agv
,
SettingString
.
DoorDToC
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
else
if
(
agvPlae
.
StartsWith
(
SettingString
.
C4_Name_Prefix
)
&&
EmptyShelfPlace
.
StartsWith
(
SettingString
.
C4_Name_Prefix
))
{
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
if
(
Common
.
Check4CTarget
(
agv
,
EmptyShelfPlace
))
//被占用
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_TEMP_PLACE
);
runInfo
=
"目的地"
+
EmptyShelfPlace
+
"有小车占用,先到临时待机位"
+
"[RFID="
+
RFID
+
"]"
;
...
...
@@ -92,8 +94,8 @@ namespace AGVControl
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveTo4CStandy
(
agv
);
UpdateJobTaskInfo
(
agv
.
CurTaskName
,
agv
.
CurTaskID
);
}
else
}
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
...
...
@@ -104,7 +106,7 @@ namespace AGVControl
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
runInfo
=
"开始执行回收空料架任务["
+
agvPlae
+
"->"
+
EmptyShelfPlace
+
"]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
...
...
@@ -164,7 +166,7 @@ namespace AGVControl
if
(
nodeIdx
>
-
1
)
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_AGV_START_TASK
);
runInfo
=
"AGV 添加任务:移动到"
+
EmptyShelfPlace
+
"[RFID="
+
RFID
+
"]"
;
runInfo
=
"AGV 添加任务:移动到"
+
EmptyShelfPlace
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
Common
.
MoveToNode
(
agv
,
EmptyShelfPlace
);
...
...
@@ -173,7 +175,7 @@ namespace AGVControl
else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
ASSIGN_AGV_TASK
);
runInfo
=
EmptyShelfPlace
+
" 不存在或未开启调用"
;
runInfo
=
EmptyShelfPlace
+
" 不存在或未开启调用"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
...
...
@@ -183,7 +185,7 @@ namespace AGVControl
if
(
agv
.
CurTaskState
.
Equals
(
SettingString
.
Executing
))
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_REACH_PLACE
);
runInfo
=
"AGV开始向目的地["
+
EmptyShelfPlace
+
"]移动"
+
"[RFID="
+
RFID
+
"]"
;
runInfo
=
"AGV开始向目的地["
+
EmptyShelfPlace
+
"]移动"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
}
...
...
@@ -203,7 +205,7 @@ namespace AGVControl
//else
{
TakeEmptyStep
.
ToNextStep
(
TAKE_EMPTY_STEP
.
WAIT_LINE_RESPONSE
);
runInfo
=
"AGV到达 "
+
EmptyShelfPlace
+
" 向产线发送出料架请求[ReadyLeave]"
+
"[RFID="
+
RFID
+
"]"
;
runInfo
=
"AGV到达 "
+
EmptyShelfPlace
+
" 向产线发送出料架请求[ReadyLeave]"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
if
(
nodeIdx
==
-
1
)
...
...
@@ -222,9 +224,9 @@ namespace AGVControl
}
else
if
(
TakeEmptyStep
.
IsStep
(
TAKE_EMPTY_STEP
.
WAIT_LINE_RESPONSE
))
{
if
(
nodeIdx
==
-
1
)
if
(
nodeIdx
==
-
1
)
{
runInfo
=
EmptyShelfPlace
+
" 未开启调用"
;
runInfo
=
EmptyShelfPlace
+
" 未开启调用"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
return
this
;
...
...
@@ -260,18 +262,23 @@ namespace AGVControl
{
ClientNode
node
=
Common
.
nodeInfo
[
nodeIdx
];
//回收空料架数量减少1
Common
.
missionManager
.
DelMission
(
EmptyShelfPlace
,
RFID
);
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车完成"
+
"[RFID="
+
RFID
+
"]"
;
Common
.
missionManager
.
DelMission
(
EmptyShelfPlace
,
RFID
);
if
(!
agvPlae
.
Equals
(
SettingString
.
D4FeederOut
)
&&
!
agvPlae
.
Equals
(
SettingString
.
C4FeederOut
))
AGVManager
.
ClearRFID
(
EmptyShelfPlace
,
RFID
);
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车完成"
+
"[RFID="
+
RFID
+
"]"
;
msg
+=
runInfo
;
TakeEmptyStep
.
Msg
=
msg
;
//4DfeederOut默认大料架
if
(
agv
.
Place
.
Equals
(
SettingString
.
D4FeederOut
))
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"
))
//if (agv.Place.Equals(SettingString.D4FeederOut))
//{
// return new EmptyShelfBackJob(EmptyShelfPlace, eShelfType.BigShelf);
//}
//else if(agv.Place.Equals(SettingString.C4FeederOut))
//{
// return new EmptyShelfBackJob(EmptyShelfPlace, eShelfType.BigShelf);
//}
if
(
agv
.
RFID
.
StartsWith
(
"D"
))
{
AGVManager
.
ClearRFID
(
EmptyShelfPlace
,
RFID
);
return
new
EmptyShelfBackJob
(
EmptyShelfPlace
,
eShelfType
.
SmallShelf
);
}
else
if
(
agv
.
RFID
.
StartsWith
(
"C"
))
...
...
@@ -285,7 +292,7 @@ namespace AGVControl
{
//链条停止
runInfo
=
"空料架在["
+
EmptyShelfPlace
+
"]进入小车超时["
+
timeOutValue
.
ToString
(
"f1"
)
+
"秒],请检查料架进入小车的情况"
+
"[RFID="
+
RFID
+
"]"
;
// msg += runInfo;
// msg += runInfo;
//TakeEmptyStep.Msg = msg;
}
...
...
AGVControl-ProductionLine/bean/node/ClientNode.cs
查看文件 @
54be25c
...
...
@@ -60,7 +60,7 @@ namespace AGVControl
{
return
Common
.
missionManager
.
GetUnlockCnt
(
Name
);
}
return
-
1
;
return
0
;
}
}
public
string
AliceName
{
get
;
set
;
}
...
...
AGVControl-ProductionLine/bean/node/DoubleLineNodeFor4C.cs
查看文件 @
54be25c
...
...
@@ -35,15 +35,12 @@ namespace AGVControl
{
if
(!
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
continue
;
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
||
agv
.
CurJob
is
EmptyShelfBackJob
)
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
)
//|| agv.CurJob is EmptyShelfBackJob
{
emptyJobCnt
++;
}
}
if
((
SettingString
.
AGVCNT
-
emptyJobCnt
).
Equals
(
2
))
//保留2辆小车出满料架
{
return
null
;
}
//出工单料的目的地是否有空料架
if
(
Common
.
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
,
out
rfid
))
{
...
...
@@ -61,6 +58,10 @@ namespace AGVControl
}
if
(
cnt
<
clientNode
.
EmptyShelfCnt
)
{
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
2
))
//保留1辆小车出满料架
{
return
null
;
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
nodeName
,
rfid
);
}
}
...
...
@@ -74,7 +75,13 @@ namespace AGVControl
{
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
s
.
CurJob
).
EmptyShelfPlace
.
Equals
(
emptyNodeName
));
if
(
i
==
-
1
)
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
,
rfid
);
{
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
2
))
//保留1辆小车出满料架
{
return
null
;
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
,
rfid
);
}
}
}
...
...
AGVControl-ProductionLine/bean/node/DoubleLineNodeFor4D.cs
查看文件 @
54be25c
...
...
@@ -38,15 +38,11 @@ namespace AGVControl
{
if
(
SettingString
.
C4_AGV_IPs
.
Contains
(
agv
.
IP
))
continue
;
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
||
agv
.
CurJob
is
EmptyShelfBackJob
)
if
(
agv
.
CurJob
is
GoEmptyShelfLineJob
)
//|| agv.CurJob is EmptyShelfBackJob
{
emptyJobCnt
++;
}
}
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
1
))
//保留1辆小车出满料架
{
return
null
;
}
//出工单料的目的地是否有空料架
if
(
Common
.
FindEmptyShelfBeforeSendFullShelf
(
out
string
nodeName
,
out
rfid
))
{
...
...
@@ -66,6 +62,10 @@ namespace AGVControl
}
if
(
cnt
<
clientNode
.
EmptyShelfCnt
)
{
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
1
))
//保留1辆小车出满料架
{
return
null
;
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
nodeName
,
rfid
);
}
}
...
...
@@ -78,7 +78,13 @@ namespace AGVControl
{
int
i
=
Common
.
agvInfo
.
FindIndex
(
s
=>
s
.
CurJob
is
GoEmptyShelfLineJob
&&
((
GoEmptyShelfLineJob
)
s
.
CurJob
).
EmptyShelfPlace
.
Equals
(
emptyNodeName
));
if
(
i
==
-
1
)
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
,
rfid
);
{
if
((
SettingString
.
AGVCNT
/
2
-
emptyJobCnt
).
Equals
(
1
))
//保留1辆小车出满料架
{
return
null
;
}
return
new
GoEmptyShelfLineJob
(
currentAgv
.
Place
,
emptyNodeName
,
rfid
);
}
}
}
...
...
AGVControl-ProductionLine/bin/Debug/AGVControl-ProductionLine.exe
查看文件 @
54be25c
此文件类型无法预览
AGVControl-ProductionLine/bin/Debug/AGVControl-ProductionLine.pdb
查看文件 @
54be25c
此文件类型无法预览
AGVControl-ProductionLine/bin/Debug/logs/AgvServer.log
deleted
100644 → 0
查看文件 @
c0e4939
此文件的差异太大,无法显示。
AGVControl-ProductionLine/bin/Debug/logs/LineWebService.log
deleted
100644 → 0
查看文件 @
c0e4939
文件属性发生变化
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.csproj.GenerateResource.cache
查看文件 @
54be25c
此文件类型无法预览
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.exe
查看文件 @
54be25c
此文件类型无法预览
AGVControl-ProductionLine/obj/Debug/AGVControl-ProductionLine.pdb
查看文件 @
54be25c
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论