AgvBean.cs
1.5 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
58
59
60
61
62
63
64
using Acc.Common;
using System;
using System.Collections.Generic;
namespace Acc.AgvManager
{
public class AgvBean
{
public AgvStatus agvStatus;
public AgvApi AgvApi;
public Job job;
public string Name;
public bool IsIdle()
{
return false;
}
public bool NeedCharge()
{
return false;
}
public void ExecuteNewJob(Job newJob)
{
job = newJob;
}
public void JobContinue(AgvBean currentAgvBean, Dictionary<string, Node> nodeMap, Dictionary<string, AgvBean> agvBeanMap)
{
if (job != null)
{
if (!job.IsProcess)
{
try
{
job.IsProcess = true;
job.Execute(currentAgvBean, nodeMap, agvBeanMap);
}catch(Exception e)
{
LogUtil.error("AGV["+Name+"]执行任务["+job.ToString()+"]出错",e);
}
finally
{
job.IsProcess = false;
}
}
if (job.IsEnd())
{
//添加任务已经完成日志
job = null;
}
}
}
internal bool IsInCharge()
{
throw new NotImplementedException();
}
}
}