Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
Qisda-SO1037-AGVDispatch
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8e420219
由
张东亮
编写于
2023-04-12 13:26:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
添加4楼在电梯口查询接口,在电梯口等待时电量充足时去待机点
1 个父辈
952af3b5
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
72 行增加
和
10 行删除
DeviceLibrary/bean/job/LiftToLinesJob.cs
DeviceLibrary/bean/job/LineToLiftJob.cs
DeviceLibrary/bean/job/SteelLiftToStorageJob.cs
DeviceLibrary/bean/job/SteelLineToLiftJob.cs
DeviceLibrary/lift/LiftContext.cs
DeviceLibrary/service/IService.cs
DeviceLibrary/service/Service.cs
DeviceLibrary/bean/job/LiftToLinesJob.cs
查看文件 @
8e42021
...
...
@@ -395,7 +395,11 @@ namespace DeviceLibrary
return
job
;
}
}
else
if
(
agv
.
Battery
>
50
&&
agv
.
IsInCharge
)
{
ChargePileManager
.
StopCharge
(
agv
);
ToStandby
(
agv
);
return
job
;
}
JobRunStep
.
ToNextStep
(
RunStep
.
SD_LiftToLine_12_WaitDoorOpen
);
//请求电梯
lift
.
LiftContext
.
Request
(
JobParam
.
GetMissionInfo
(),
agv
,
true
);
...
...
DeviceLibrary/bean/job/LineToLiftJob.cs
查看文件 @
8e42021
...
...
@@ -224,6 +224,11 @@ namespace DeviceLibrary
return
job
;
}
}
else
if
(
agv
.
Battery
>
50
&&
agv
.
IsInCharge
)
{
ChargePileManager
.
StopCharge
(
agv
);
ToStandby
(
agv
);
return
job
;
}
JobRunStep
.
ToNextStep
(
RunStep
.
LineToLift_04_CheckLiftStatus
);
//请求电梯
lift
.
LiftContext
.
Request
(
JobParam
.
GetMissionInfo
(),
agv
);
...
...
DeviceLibrary/bean/job/SteelLiftToStorageJob.cs
查看文件 @
8e42021
...
...
@@ -378,6 +378,11 @@ namespace DeviceLibrary.bean.job
return
job
;
}
}
else
if
(
agv
.
Battery
>
50
&&
agv
.
IsInCharge
)
{
ChargePileManager
.
StopCharge
(
agv
);
ToStandby
(
agv
);
return
job
;
}
JobRunStep
.
ToNextStep
(
RunStep
.
Steel_LiftToLine_21_WaitDoorOpen
);
//请求电梯
lift
.
LiftContext
.
Request
(
JobParam
.
GetMissionInfo
(),
agv
);
...
...
DeviceLibrary/bean/job/SteelLineToLiftJob.cs
查看文件 @
8e42021
...
...
@@ -208,6 +208,11 @@ namespace DeviceLibrary
return
job
;
}
}
else
if
(
agv
.
Battery
>
50
&&
agv
.
IsInCharge
)
{
ChargePileManager
.
StopCharge
(
agv
);
ToStandby
(
agv
);
return
job
;
}
JobRunStep
.
ToNextStep
(
RunStep
.
LineToLift_04_CheckLiftStatus
);
//请求电梯
lift
.
LiftContext
.
Request
(
JobParam
.
GetMissionInfo
(),
agv
);
...
...
DeviceLibrary/lift/LiftContext.cs
查看文件 @
8e42021
...
...
@@ -68,7 +68,7 @@ namespace DeviceLibrary.lift
foreach
(
var
item
in
lifts
)
{
sb
.
Append
(
item
.
Key
+
":"
);
sb
.
AppendLine
(
"[电梯占用:"
+
string
.
Join
(
";"
,
item
.
Value
.
Agvs
)
+
"]"
);
sb
.
AppendLine
(
"[电梯占用:"
+
string
.
Join
(
";"
,
item
.
Value
.
Agvs
)
+
"]"
);
}
return
sb
.
ToString
();
}
...
...
@@ -94,7 +94,7 @@ namespace DeviceLibrary.lift
if
(
item
.
Agvs
!=
null
&&
item
.
Agvs
.
Contains
(
agv
.
Name
))
{
item
.
Agvs
.
Remove
(
agv
.
Name
);
LogUtil
.
info
(
$
"【{agv.Name}】清除电梯节点占用:{string.Join("
,
",item.Agvs)}"
);
LogUtil
.
info
(
$
"【{agv.Name}】清除电梯节点占用:{string.Join("
,
",
item.Agvs)}"
);
}
}
}
...
...
@@ -122,7 +122,7 @@ namespace DeviceLibrary.lift
{
try
{
AgvInfo
agvInfo
=
AGVManager
.
agvInfo
.
Find
(
s
=>
AgvInfo
agvInfo
=
AGVManager
.
agvInfo
.
Find
(
s
=>
s
.
Scope
.
Workshop
.
Equals
(
agv
.
Scope
.
Workshop
)
&&
!
s
.
IP
.
Equals
(
agv
.
IP
));
if
(
agvInfo
!=
null
)
{
...
...
@@ -131,9 +131,35 @@ namespace DeviceLibrary.lift
else
return
false
;
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
LogUtil
.
error
(
$
"OtherAGVIsInLift: {agv.Name},{liftName}"
,
ex
);
}
return
false
;
}
/// <summary>
/// 4楼AGV是否在D2电梯
/// </summary>
/// <param name="liftName"></param>
/// <returns></returns>
public
static
bool
F4AGVIsInD2Lift
()
{
try
{
var
agvs
=
AGVManager
.
agvInfo
.
FindAll
(
s
=>
s
.
Scope
.
Workshop
.
Equals
(
SettingString
.
_4D
));
foreach
(
var
item
in
agvs
)
{
if
(
lifts
.
ContainsKey
(
SettingString
.
LIFT_D2
)
&&
lifts
[
SettingString
.
LIFT_D2
].
Agvs
.
Contains
(
item
.
Name
))
{
return
true
;
}
}
return
false
;
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
$
"OtherAGVIsInLift: {
agv.Name},{liftName}"
,
ex
);
LogUtil
.
error
(
$
"OtherAGVIsInLift: {
SettingString.LIFT_D2}"
,
ex
);
}
return
false
;
}
...
...
@@ -142,12 +168,12 @@ namespace DeviceLibrary.lift
/// </summary>
/// <param name="liftId"></param>
/// <returns></returns>
public
static
bool
IsDoorOpen
(
string
liftId
,
int
floor
,
AgvInfo
agv
)
public
static
bool
IsDoorOpen
(
string
liftId
,
int
floor
,
AgvInfo
agv
)
{
LiftStatus
liftStatus
=
GetLiftStatus
(
liftId
);
{
LogUtil
.
debug
(
$
"检查电梯{liftId}门是否开开启"
);
if
(
liftStatus
.
door
.
Equals
(
"opened"
)
&&
liftStatus
.
floor
.
Equals
(
floor
)
&&
!
OtherAGVIsInLift
(
agv
,
liftId
))
if
(
liftStatus
.
door
.
Equals
(
"opened"
)
&&
liftStatus
.
floor
.
Equals
(
floor
)
&&
!
OtherAGVIsInLift
(
agv
,
liftId
))
return
true
;
}
return
false
;
...
...
@@ -245,7 +271,7 @@ namespace DeviceLibrary.lift
sourceFloor
=
missionInfo
.
destinationFloor
,
sourceClient
=
agvInfo
.
Client
,
missionId
=
missionInfo
.
missionId
,
updateInfo
=
true
updateInfo
=
true
};
}
else
...
...
DeviceLibrary/service/IService.cs
查看文件 @
8e42021
...
...
@@ -35,7 +35,11 @@ namespace DeviceLibrary
StealResult
Storage
(
string
Place
);
[
OperationContract
]
[
WebInvoke
(
UriTemplate
=
"/StealAgv/sendNew?From={From}&Place={Place}"
,
Method
=
"GET"
,
BodyStyle
=
WebMessageBodyStyle
.
Bare
,
RequestFormat
=
WebMessageFormat
.
Json
,
ResponseFormat
=
WebMessageFormat
.
Json
)]
StealResult
SendNew
(
string
From
,
string
Place
);
StealResult
SendNew
(
string
From
,
string
Place
);
[
OperationContract
]
[
WebInvoke
(
UriTemplate
=
"/position/state?name={name}"
,
Method
=
"GET"
,
BodyStyle
=
WebMessageBodyStyle
.
Bare
,
RequestFormat
=
WebMessageFormat
.
Json
,
ResponseFormat
=
WebMessageFormat
.
Json
)]
Result
GetPositionState
(
string
name
);
}
[
DataContract
]
...
...
DeviceLibrary/service/Service.cs
查看文件 @
8e42021
...
...
@@ -9,6 +9,7 @@ using DeviceLibrary.service.model;
using
DeviceLibrary.manager
;
using
System.Reflection
;
using
System.Windows.Forms
;
using
DeviceLibrary.lift
;
namespace
DeviceLibrary
{
...
...
@@ -284,6 +285,18 @@ namespace DeviceLibrary
Log
.
Info
(
$
"收到立库调用SendNew接口:【From={From}】【Place={Place}】【{JsonHelper.SerializeObject(stealResult)}】"
);
return
stealResult
;
}
public
Result
GetPositionState
(
string
name
)
{
Result
result
=
new
Result
();
bool
rtn
=
LiftContext
.
F4AGVIsInD2Lift
();
if
(
rtn
)
{
result
.
code
=
-
1
;
result
.
msg
=
"agv in lift"
;
}
return
result
;
}
}
public
class
Service
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论