TmpPlaceJob.cs
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using Common;
using DeviceLib.Model.AGV;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLib.BLL
{
internal class TmpPlaceJob : ImpJob
{
public TmpPlaceJob(JobParam jobParam) : base(jobParam)
{
JobName = "去临时点任务";
}
public override Job Run(Robot robot)
{
Job job = this;
switch (JobRunStep.CurStep)
{
case RunStep.None:
if (!AppConfigSetting.GetBoolVal(Setting_Str.TmpPlaceIsCharge, true))
{
ToNextStep(RunStep.TmpPlace_01_Start, "去临时点任务开始");
MoveToNode(robot, NodeManager.GetTmpPlace(JobParam.LineNode));
}
else
{
ToNextStep(RunStep.TmpPlace_01_Start, "充电桩作为临时点任务开始");
StartCharge(robot);
}
break;
case RunStep.TmpPlace_01_Start:
if (AppConfigSetting.GetBoolVal(Setting_Str.TmpPlaceIsCharge, true))
ToNextStep(RunStep.TmpPlace_04_WaitDstIdle, "在充电桩等待目标点空闲");
if (MissionIsOk())
ToNextStep(RunStep.TmpPlace_04_WaitDstIdle, "检查目标点是否空闲");
break;
case RunStep.TmpPlace_04_WaitDstIdle:
if (!NodeManager.CheckNodeIsOccupied(JobParam.LineNode))
ToNextStep(RunStep.TmpPlace_05_End, "目标点空闲,无需去临时点");
else if (JobRunStep.IsTimeOut(60, out double timeOut))
{
SetWarnMsg($"等待其他车离开{JobParam?.LineNode?.name}超时");
}
break;
case RunStep.TmpPlace_05_End:
job = GetCallBackJob();//new DeliverShelfJob(JobParam);
job.ToNextStep(GetCallBackStep(), "去临时点任务结束");
break;
}
return job;
}
}
}