MapEdge.cs
3.51 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
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Rcs.Domain.Entities
{
[Table("map_edges")]
public partial class MapEdge : Entity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column("edge_id")]
public Guid EdgeId { get; set; }
/// <summary>
/// 地图ID(外键)
/// </summary>
[Column("map_id")]
public Guid MapId { get; set; }
[Required]
[Column("edge_code")]
[MaxLength(50)]
public string EdgeCode { get; set; }
[Column("from_node")]
public Guid FromNode { get; set; }
[Column("to_node")]
public Guid ToNode { get; set; }
[Column("edge_name")]
public string? EdgeName { get; set; }
[Column("length")] public double Length { get; set; } = 0;
[Column("cost")]
public double? Cost { get; set; } = 1d;
[Column("created_at", TypeName = "timestamp")]
public DateTime? CreatedAt { get; set; }
[Column("active")]
public bool Active { get; set; }
/// <summary>
/// 是否为曲线
/// false = 直线
/// true = NURBS 曲线
/// </summary>
[Column("is_curve")]
public bool IsCurve { get; set; }
/// <summary>
/// 半径
/// </summary>
[Column("radius")]
public double? Radius { get; set; }
/// <summary>
/// 圆心X
/// </summary>
[Column("center_x")]
public double? CenterX { get; set; }
/// <summary>
/// 圆心Y
/// </summary>
[Column("center_y")]
public double? CenterY { get; set; }
// ----------------------
// NURBS 曲线参数(仅当 IsCurve = true 时有效)
// ----------------------
/// <summary>
/// 曲线阶数(degree)
/// 常用值:2(二次),3(三次)
/// </summary>
[Column("degree")]
public int? Degree { get; set; } = 2;
[Column("control_points", TypeName = "jsonb")]
public List<Point>? ControlPoints { get; set; }
[Column("weights", TypeName = "jsonb")]
public List<double>? Weights { get; set; }
[Column("knots", TypeName = "jsonb")]
public List<double>? Knots { get; set; }
/// <summary>
/// 是否倒车行驶
/// </summary>
[Column("regress")]
public bool Regress { get; set; }
/// <summary>
/// 最大坐标偏移值 (单位:米)
/// </summary>
[Column("max_coordinate_offset")]
public double? MaxCoordinateOffset { get; set; }
/// <summary>
/// 最大角度偏差值 (单位:度)
/// </summary>
[Column("max_angle_deviation")]
public double? MaxAngleDeviation { get; set; }
/// <summary>
/// 最高速度 (单位:米/秒)
/// </summary>
[Column("max_speed")]
public double? MaxSpeed { get; set; }
#region 外键 => 导航属性,ManyToOne/OneToOne
[ForeignKey(nameof(MapId))]
public virtual Map Maps { get; set; }
public virtual MapNode MapNodesFromNode { get; set; }
public virtual MapNode MapNodesToNode { get; set; }
#endregion
}
public class Point
{
public double X { get; set; }
public double Y { get; set; }
}
}