AgvInfo.cs
2.9 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class AgvInfo
{
/// <summary>
/// 小车名称
/// </summary>
public string Name { set; get; } = "";
/// <summary>
/// 在Fleet中的ID
/// </summary>
public string FleetID { set; get; } = "";
/// <summary>
/// 小车IP地址
/// </summary>
public string IP { set; get; } = "";
/// <summary>
/// 授权码
/// </summary>
public string Authorization { set; get; } = "";
/// <summary>
/// 是否自动使用
/// </summary>
public bool IsAuto { set; get; } = false;
/// <summary>
/// 是否在线
/// </summary>
public bool IsOnline { set; get; } = false;
/// <summary>
/// 电量百分比
/// </summary>
public int Battery { set; get; } = 0;
/// <summary>
/// AGV最大充电电量
/// </summary>
public int BatteryMax { set; get; } = 0;
/// <summary>
/// AGV最低电量,小于此值必须充电
/// </summary>
public int BatteryMin { set; get; } = 0;
/// <summary>
/// 状态ID号
/// </summary>
public int StateID { set; get; } = -1;
/// <summary>
/// 状态文本
/// </summary>
public string StateText { set; get; } = "";
/// <summary>
/// 任务文本
/// </summary>
public string MissionText { set; get; } = "";
/// <summary>
/// 小车坐标位置
/// </summary>
public System.Drawing.PointF Position { set; get; }
/// <summary>
/// 是否正在被调用
/// </summary>
public bool IsCall { set; get; } = false;
/// <summary>
/// 当前的工作
/// </summary>
public IJob CurrentJob { set; get; } = null;
/// <summary>
/// 当前位置
/// </summary>
public string Place { set; get; } = "";
public AgvInfo()
{
}
public bool IsWorkshop4D
{
get
{
//小车地图中的Y坐标
if (Position.Y < 55)
return true;
else if (Position.Y > 62)
return false;
else
return false;
}
}
public string[] ToGridRow()
{
string[] arr = new string[] { Name, Place, StateText, Battery.ToString(), IsOnline.ToString(), IsAuto.ToString(), "清除" };
return arr;
}
public string ToMissionState()
{
string s = Name + " [" + IP + "]\r\n\r\n" + MissionText;
return s;
}
}
}