MapResource.cs
4.1 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using NetTopologySuite.Geometries;
using Rcs.Domain.Attributes;
using Rcs.Domain.Enums;
namespace Rcs.Domain.Entities;
[Table("map_resources")]
public partial class MapResource : Entity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column("resource_id")]
public Guid ResourceId { get; set; }
/// <summary>
/// 地图ID(外键)
/// </summary>
[Column("map_id")]
public Guid MapId { get; set; }
/// <summary>
/// 资源编码
/// </summary>
[Required]
[Column("resource_code")]
[MaxLength(50)]
public string ResourceCode { get; set; }
[Column("resource_name")]
[MaxLength(100)]
public string ResourceName { get; set; }
[Column("type")]
public MapResourcesTYPE Type { get; set; }
/// <summary>
/// 区域内车容量
/// </summary>
[Column("capacity")]
public int? Capacity { get; set; } = 999;
/// <summary>
/// 资源位置坐标(多边形区域)
/// @author zzy
/// </summary>
[Column("location_coordinates", TypeName = "geometry(Polygon)")]
public Polygon? LocationCoordinates { get; set; }
[Column("created_at", TypeName = "timestamp")]
public DateTime? CreatedAt { get; set; }
[Column("active")]
public bool Active { get; set; }
/// <summary>
/// 最大速度
/// @author zzy
/// </summary>
[Column("max_speed")]
public double MaxSpeed { get; set; } = 2;
/// <summary>
/// 能否旋转
/// @author zzy
/// </summary>
[Column("can_rotate")]
public bool CanRotate { get; set; } = true;
/// <summary>
/// 前置动作类型1
/// </summary>
[Column("pre_action1_type")]
public ActionType? PreAction1Type { get; set; }
/// <summary>
/// 前置网络动作集合1
/// </summary>
[Column("pre_net_actions1", TypeName = "jsonb")]
public List<Guid>? PreNetActions1 { get; set; }
/// <summary>
/// 后置动作类型1
/// </summary>
[Column("post_action1_type")]
public ActionType? PostAction1Type { get; set; }
/// <summary>
/// 后置网络动作集合1
/// </summary>
[Column("post_net_actions1", TypeName = "jsonb")]
public List<Guid>? PostNetActions1 { get; set; }
/// <summary>
/// 前置动作类型2
/// </summary>
[Column("pre_action2_type")]
public ActionType? PreAction2Type { get; set; }
/// <summary>
/// 前置网络动作集合2
/// </summary>
[Column("pre_net_actions2", TypeName = "jsonb")]
public List<Guid>? PreNetActions2 { get; set; }
/// <summary>
/// 后置动作类型2
/// </summary>
[Column("post_action2_type")]
public ActionType? PostAction2Type { get; set; }
/// <summary>
/// 后置网络动作集合2
/// </summary>
[Column("post_net_actions2", TypeName = "jsonb")]
public List<Guid>? PostNetActions2 { get; set; }
#region 外键 => 导航属性,ManyToOne/OneToOne
[ForeignKey(nameof(MapId))]
public virtual Map Maps { get; set; }
#endregion
}
public enum MapResourcesTYPE
{
[EnumDescription("停靠点", "Dock")]
dock = 1,
[EnumDescription("充电桩", "Charger")]
charger,
[EnumDescription("电梯", "Elevator")]
elevator,
[EnumDescription("风淋门", "Airlock")]
airlock,
[EnumDescription("传送带", "Conveyor")]
conveyor,
[EnumDescription("存储区", "Storage")]
storage,
[EnumDescription("标记区域", "MarkedArea")]
markedArea,
[EnumDescription("其他", "Other")]
other,
/// <summary>
/// 等待区域 - AGV避让等待区
/// @author zzy
/// </summary>
[EnumDescription("等待区域", "WaitingArea")]
waitingArea
}
/// <summary>
/// 资源动作类型枚举
/// @author zzy
/// </summary>
public enum ResourceActionType
{
[EnumDescription("无动作", "None")]
None = 0,
[EnumDescription("动作列表", "ActionList")]
ActionList = 1,
[EnumDescription("网络请求", "NetworkRequest")]
NetworkRequest = 2
}