MapNode.cs
3.74 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
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Rcs.Domain.Attributes;
namespace Rcs.Domain.Entities
{
[Table("map_nodes")]
public partial class MapNode : Entity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column("node_id")]
public Guid NodeId { get; set; }
/// <summary>
/// 地图ID(外键)
/// </summary>
[Column("map_id")]
public Guid MapId { get; set; }
[Required]
[Column("node_code")]
[MaxLength(50)]
public string NodeCode { get; set; }
[Column("node_name")]
[MaxLength(100)]
public string? NodeName { get; set; }
[Column("description")]
public string? Description { get; set; }
[Column("x")]
public double X { get; set; }
[Column("y")]
public double Y { get; set; }
[Column("theta")]
public double? Theta { get; set; }
/// <summary>
/// 是否倒车进入
/// </summary>
[Column("is_reverse_parking")]
public bool IsReverseParking { get; set; }
/// <summary>
/// 是否旋转
/// </summary>
[Column("allow_rotate")]
public bool AllowRotate { get; set; }
/// <summary>
/// 最大坐标偏移值 (单位:米)
/// </summary>
[Column("max_coordinate_offset")]
public double? MaxCoordinateOffset { get; set; }
[Column("type")]
public MapNodeTYPE Type { get; set; }
[Column("metadata", TypeName = "jsonb")]
public Dictionary<string, object>? Metadata { get; set; }
[Column("created_at", TypeName = "timestamp")]
public DateTime? CreatedAt { get; set; }
[Column("active")]
public bool Active { get; set; }
#region 外键 => 导航属性,ManyToOne/OneToOne
[ForeignKey(nameof(MapId))]
public virtual Map Map { get; set; }
#endregion
#region 外键 => 导航属性,OneToMany
public virtual ICollection<MapEdge> MapEdgesFromNodes { get; set; } = new List<MapEdge>();
public virtual ICollection<MapEdge> MapEdgesToNodes { get; set; } = new List<MapEdge>();
public virtual ICollection<MapResource> MapResourcess { get; set; } = new List<MapResource>();
/// <summary>
/// 关联库位集合
/// @author zzy
/// </summary>
public virtual ICollection<StorageLocation> StorageLocations { get; set; } = new List<StorageLocation>();
#endregion
#region 外键 => 导航属性,OneToOne
[Column("robot_id")]
public Guid? RobotId { get; set; }
[ForeignKey(nameof(RobotId))]
public virtual Robot? Robot { get; set; }
#endregion
/// <summary>
/// 是否为斑马线点
/// </summary>
[NotMapped]
public bool ZebraCrossing { get; set; }
}
public enum MapNodeTYPE
{
[EnumDescription("高速点", "High Speed")]
speediness = 1,
[EnumDescription("储位", "Storage")]
store,
[EnumDescription("充电位", "Charger")]
charger,
[EnumDescription("停车位", "Parking")]
parking,
[EnumDescription("其他", "Other")]
other
}
/// <summary>
/// 节点使用状态枚举
/// @author zzy
/// </summary>
public enum MapNodeUseStatus
{
[EnumDescription("空闲", "Free")]
free = 0,
[EnumDescription("占用/已放货", "In Use")]
use = 1,
[EnumDescription("预占用/放货中", "Pre Use")]
pre_use = 2
}
}