Robot.cs
27.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Rcs.Domain.Models.VDA5050;
using Rcs.Domain.Entities.DomainEvents;
using Rcs.Domain.Entities.DomainEvents.Robot;
using Rcs.Domain.Attributes;
namespace Rcs.Domain.Entities
{
[Table("robots")]
public partial class Robot : Entity
{
/// <summary>
/// 系统ID
/// </summary>
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column("robot_id")]
public Guid RobotId { get; set; }
/// <summary>
/// 当前地图ID
/// </summary>
[Column("current_map_code")]
public Guid? CurrentMapCodeId { get; set; }
/// <summary>
/// 当前位置
/// </summary>
[Column("current_node")]
public Guid? CurrentNodeId { get; set; }
/// <summary>
/// 当前位置x
/// </summary>
[Column("current_x")]
public double? CurrentX { get; set; }
/// <summary>
/// 当前位置y
/// </summary>
[Column("current_y")]
public double? CurrentY { get; set; }
/// <summary>
/// 坐标换算系数,默认1
/// </summary>
[Column("coordinate_scale")]
public double CoordinateScale { get; set; } = 1d;
/// <summary>
/// robot编码
/// </summary>
[Required]
[Column("robot_code")]
[MaxLength(50)]
public string RobotCode { get; set; }
/// <summary>
/// robot名称
/// </summary>
[Required]
[Column("robot_name")]
[MaxLength(100)]
public string RobotName { get; set; }
/// <summary>
/// robot版本
/// </summary>
[Required]
[Column("robot_version")]
[MaxLength(50)]
public string RobotVersion { get; set; }
/// <summary>
/// 协议名称
/// </summary>
[Required]
[Column("protocol_name")]
[MaxLength(50)]
public string ProtocolName { get; set; }
/// <summary>
/// 协议版本
/// </summary>
[Required]
[Column("protocol_version")]
[MaxLength(50)]
public string ProtocolVersion { get; set; }
/// <summary>
/// 协议类型
/// @author zzy
/// </summary>
[Column("protocol_type")]
public ProtocolType ProtocolType { get; set; } = ProtocolType.VDA;
/// <summary>
/// 制造商ID
/// @author zzy
/// </summary>
[Column("robot_manufacturer")]
public string RobotManufacturer { get; set; }
/// <summary>
/// 序列号
/// </summary>
[Required]
[Column("robot_serial_number")]
[MaxLength(100)]
public string RobotSerialNumber { get; set; }
/// <summary>
/// 型号
/// @author zzy
/// </summary>
[Column("robot_model")]
[MaxLength(100)]
public string? RobotModel { get; set; }
/// <summary>
/// robot类型ID
/// @author zzy
/// </summary>
[Column("robot_type")]
public RobotType RobotType { get; set; }
// 动态属性
/// <summary>
/// robot状态
/// </summary>
[Column("status")]
public RobotStatus Status { get; set; } = RobotStatus.Idle;
/// <summary>
/// 是否在线
/// </summary>
[Column("online")]
public OnlineStatus Online { get; set; } = OnlineStatus.Offline;
/// <summary>
/// 当前电池电量百分比,范围0-100
/// </summary>
[Column("battery_level")]
public int? BatteryLevel { get; set; } = 100;
/// <summary>
/// 行驶状态,是否动态
/// </summary>
[Column("driving")]
public bool Driving { get; set; }
/// <summary>
/// 暂停状态
/// </summary>
[Column("paused")]
public bool Paused { get; set; }
/// <summary>
/// 充电中
/// </summary>
[Column("charging")]
public bool Charging { get; set; }
/// <summary>
/// 操作模式
/// </summary>
[Column("operatingMode")]
public OperatingMode OperatingMode { get; set; }
/// <summary>
/// 当前旋转角,范围0-Pi
/// </summary>
[Column("current_theta")]
public double? CurrentTheta { get; set; }
[Column("errors", TypeName = "text")]
public string? Errors { get; set; }
// 静态属性
/// <summary>
/// 最大载重,单位kg
/// </summary>
[Column("payload_capacity")]
public double? PayloadCapacity { get; set; }
/// <summary>
/// 最大速度,单位m/s
/// </summary>
[Column("speed_max")]
public double? SpeedMax { get; set; }
/// <summary>
/// 最小速度,单位m/s
/// </summary>
[Column("speed_min")]
public double? SpeedMin { get; set; }
/// <summary>
/// 加速时最大加速度,单位m/s^2
/// </summary>
[Column("acceleration_max")]
public double? AccelerationMax { get; set; }
/// <summary>
/// 减速时最大加速度,单位m/s^2
/// </summary>
[Column("deceleration_max")]
public double? DecelerationMax { get; set; }
/// <summary>
/// 最小高度 m
/// </summary>
[Column("height_min")]
public double? HeightMin { get; set; }
/// <summary>
/// 最大高度m
/// </summary>
[Column("height_max")]
public double? HeightMax { get; set; }
/// <summary>
/// 宽度m
/// </summary>
[Column("width")]
public double? Width { get; set; }
/// <summary>
/// 长度m
/// </summary>
[Column("length")]
public double? Length { get; set; }
/// <summary>
/// 是否为全向
/// </summary>
[Column("is_omnidirectional")]
public bool IsOmnidirectional { get; set; } = false;
/// <summary>
/// 转弯半径
/// </summary>
[Column("radius")]
public double? Radius { get; set; }
/// <summary>
/// 运动中心到货位边缘间距(m)
/// @author zzy
/// </summary>
[Column("motion_center_to_edge")]
public double? MotionCenterToEdge { get; set; }
/// <summary>
/// IP地址
/// </summary>
[Column("ip_address")]
public string? IpAddress { get; set; }
/// <summary>
/// 端口
/// </summary>
[Column("net_port")]
public string? NetPort { get; set; }
/// <summary>
/// MAC地址
/// </summary>
[Column("mac_address")]
public string? MacAddress { get; set; }
/// <summary>
/// 是否启用
/// </summary>
[Column("active")]
public bool Active { get; set; }
/// <summary>
/// 当前order消息ID
/// </summary>
[Column("header_id")]
public long HeaderId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Column("created_at", TypeName = "timestamp")]
public DateTime? CreatedAt { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Column("updated_at", TypeName = "timestamp")]
public DateTime? UpdatedAt { get; set; }
#region 外键 => 导航属性,ManyToOne/OneToOne
public virtual MapNode? MapNode { get; set; }
public virtual Map? Map { get; set; }
#endregion
#region 领域方法
/// <summary>
/// 创建新的机器人实例(工厂方法)
/// </summary>
/// <param name="robotCode">机器人编码</param>
/// <param name="robotName">机器人名称</param>
/// <param name="robotVersion">机器人版本</param>
/// <param name="protocolName">协议名称</param>
/// <param name="protocolVersion">协议版本</param>
/// <param name="robotManufacturer">制造商</param>
/// <param name="robotSerialNumber">序列号</param>
/// <param name="robotType">机器人类型</param>
/// <param name="ipAddress">IP地址</param>
/// <param name="payloadCapacity">最大载重</param>
/// <param name="speedMax">最大速度</param>
/// <param name="speedMin">最小速度</param>
/// <param name="accelerationMax">最大加速度</param>
/// <param name="decelerationMax">最大减速度</param>
/// <param name="heightMin">最小高度</param>
/// <param name="heightMax">最大高度</param>
/// <param name="width">宽度</param>
/// <param name="length">长度</param>
/// <param name="isOmnidirectional">是否全向</param>
/// <param name="radius">转弯半径</param>
/// <param name="coordinateScale">坐标换算系数</param>
/// <returns>新的机器人实例</returns>
public static Robot Create(
string robotCode,
string robotName,
string robotVersion,
string protocolName,
string protocolVersion,
string robotManufacturer,
string robotSerialNumber,
RobotType robotType,
ProtocolType protocolType = ProtocolType.VDA,
string? ipAddress = null,
string? netPort = null,
string? netMac = null,
double? payloadCapacity = null,
double? speedMax = null,
double? speedMin = null,
double? accelerationMax = null,
double? decelerationMax = null,
double? heightMin = null,
double? heightMax = null,
double? width = null,
double? length = null,
bool isOmnidirectional = false,
double? radius = null,
double coordinateScale = 1d,
Guid? currMap = null,
bool active = false)
{
if (string.IsNullOrWhiteSpace(robotCode))
throw new ArgumentException("机器人编码不能为空", nameof(robotCode));
if (string.IsNullOrWhiteSpace(robotName))
throw new ArgumentException("机器人名称不能为空", nameof(robotName));
if (string.IsNullOrWhiteSpace(robotVersion))
throw new ArgumentException("机器人版本不能为空", nameof(robotVersion));
if (string.IsNullOrWhiteSpace(protocolName))
throw new ArgumentException("协议名称不能为空", nameof(protocolName));
if (string.IsNullOrWhiteSpace(protocolVersion))
throw new ArgumentException("协议版本不能为空", nameof(protocolVersion));
if (string.IsNullOrWhiteSpace(robotManufacturer))
throw new ArgumentException("制造商不能为空", nameof(robotManufacturer));
if (string.IsNullOrWhiteSpace(robotSerialNumber))
throw new ArgumentException("序列号不能为空", nameof(robotSerialNumber));
var robot = new Robot
{
RobotId = Guid.NewGuid(),
RobotCode = robotCode,
RobotName = robotName,
RobotVersion = robotVersion,
ProtocolName = protocolName,
ProtocolVersion = protocolVersion,
RobotManufacturer = robotManufacturer,
RobotSerialNumber = robotSerialNumber,
RobotType = robotType,
ProtocolType = protocolType,
IpAddress = ipAddress,
NetPort = netPort,
MacAddress = netMac,
PayloadCapacity = payloadCapacity,
SpeedMax = speedMax,
SpeedMin = speedMin,
AccelerationMax = accelerationMax,
DecelerationMax = decelerationMax,
HeightMin = heightMin,
HeightMax = heightMax,
Width = width,
Length = length,
IsOmnidirectional = isOmnidirectional,
Radius = radius,
CoordinateScale = coordinateScale,
CurrentMapCodeId = currMap,
// 初始化动态属性
Status = RobotStatus.Idle,
Online = OnlineStatus.Offline,
OperatingMode = OperatingMode.Automatic,
Driving = false,
Paused = false,
Charging = false,
BatteryLevel = 100,
HeaderId = 0,
Active = active,
CreatedAt = DateTime.Now,
UpdatedAt = DateTime.Now
};
// 添加创建领域事件
robot.AddDomainEvent(new RobotCreatedDomainEvent(
robot.RobotId,
robot.RobotCode,
robot.RobotName,
robot.RobotVersion,
robot.ProtocolName,
robot.ProtocolVersion,
robot.RobotManufacturer,
robot.RobotSerialNumber,
robot.RobotType,
robot.IpAddress,
robot.Active));
return robot;
}
/// <summary>
/// 注册机器人
/// </summary>
/// <param name="protocolName">协议名称</param>
/// <param name="protocolVersion">协议版本</param>
/// <param name="manufacturer">制造厂家</param>
/// <param name="serialNumber">序列号</param>
public void Register(string protocolName, string protocolVersion, string manufacturer, string serialNumber)
{
if (string.IsNullOrWhiteSpace(protocolName))
throw new ArgumentException("协议名称不能为空", nameof(protocolName));
if (string.IsNullOrWhiteSpace(protocolVersion))
throw new ArgumentException("协议版本不能为空", nameof(protocolVersion));
if (string.IsNullOrWhiteSpace(manufacturer))
throw new ArgumentException("制造厂家不能为空", nameof(manufacturer));
if (string.IsNullOrWhiteSpace(serialNumber))
throw new ArgumentException("序列号不能为空", nameof(serialNumber));
var previousOnline = Online;
RobotCode = serialNumber;
RobotName = manufacturer + "-" + serialNumber;
RobotVersion = protocolVersion;
ProtocolName = protocolName;
ProtocolVersion = protocolVersion;
RobotManufacturer = manufacturer;
RobotSerialNumber = serialNumber;
RobotType = RobotType.Forklift;
UpdatedAt = DateTime.Now;
// 如果之前是离线状态,现在变为在线,触发注册事件
if (previousOnline != OnlineStatus.Online)
{
AddDomainEvent(new RobotRegisteredDomainEvent(
RobotId,
RobotCode,
RobotName,
RobotSerialNumber,
RobotManufacturer,
RobotType,
ProtocolName,
ProtocolVersion));
}
}
/// <summary>
/// 更新机器人动态状态信息
/// </summary>
/// <param name="status">机器人状态</param>
/// <param name="online">在线状态</param>
/// <param name="batteryLevel">电池电量</param>
/// <param name="driving">是否行驶中</param>
/// <param name="paused">是否暂停</param>
/// <param name="charging">是否充电中</param>
/// <param name="operatingMode">操作模式</param>
/// <param name="currentMapCode">当前地图ID</param>
/// <param name="currentNode">当前节点</param>
/// <param name="currentX">当前X坐标</param>
/// <param name="currentY">当前Y坐标</param>
/// <param name="currentTheta">当前角度</param>
/// <param name="errors">错误信息</param>
public void UpdateDynamicStatus(
RobotStatus? status = null,
OnlineStatus? online = null,
int? batteryLevel = null,
bool? driving = null,
bool? paused = null,
bool? charging = null,
OperatingMode? operatingMode = null,
Guid? currentMapCode = null,
Guid? currentNode = null,
double? currentX = null,
double? currentY = null,
double? currentTheta = null,
string? errors = null)
{
var oldStatus = Status;
var statusChanged = false;
// 更新状态(只更新提供的字段)
if (status.HasValue && Status != status.Value)
{
Status = status.Value;
statusChanged = true;
}
if (online.HasValue) Online = online.Value;
if (batteryLevel.HasValue && batteryLevel.Value >= 0 && batteryLevel.Value <= 100)
BatteryLevel = batteryLevel.Value;
if (driving.HasValue) Driving = driving.Value;
if (paused.HasValue) Paused = paused.Value;
if (charging.HasValue) Charging = charging.Value;
if (operatingMode.HasValue) OperatingMode = operatingMode.Value;
if (currentMapCode.HasValue) CurrentMapCodeId = currentMapCode;
if (currentNode.HasValue) CurrentNodeId = currentNode;
if (currentX.HasValue) CurrentX = currentX.Value;
if (currentY.HasValue) CurrentY = currentY.Value;
if (currentTheta.HasValue) CurrentTheta = currentTheta.Value;
if (errors != null) Errors = errors;
UpdatedAt = DateTime.Now;
// 如果状态发生变化,触发状态变更事件
if (statusChanged)
{
AddDomainEvent(new RobotStatusChangedDomainEvent(
RobotId,
RobotCode,
RobotName,
oldStatus,
Status,
Online,
BatteryLevel,
CurrentX,
CurrentY,
CurrentTheta,
CurrentMapCodeId,
Driving,
Charging,
Paused));
}
}
/// <summary>
/// 设置离线状态
/// </summary>
public void SetOffline()
{
if (Online != OnlineStatus.Offline)
{
Online = OnlineStatus.Offline;
Driving = false;
UpdatedAt = DateTime.Now;
}
}
/// <summary>
/// 设置连接中断状态
/// </summary>
public void SetConnectionBroken()
{
if (Online != OnlineStatus.Connectionbroken)
{
Online = OnlineStatus.Connectionbroken;
Driving = false;
UpdatedAt = DateTime.Now;
}
}
/// <summary>
/// 激活机器人
/// </summary>
public void Activate()
{
if (!Active)
{
Active = true;
UpdatedAt = DateTime.Now;
}
}
/// <summary>
/// 停用机器人
/// </summary>
public void Deactivate()
{
if (Active)
{
Active = false;
Driving = false;
Status = RobotStatus.Idle;
UpdatedAt = DateTime.Now;
}
}
/// <summary>
/// 更新位置信息
/// </summary>
/// <param name="mapCode">地图ID</param>
/// <param name="node">节点</param>
/// <param name="x">X坐标</param>
/// <param name="y">Y坐标</param>
/// <param name="theta">角度</param>
public void UpdateLocation(Guid? mapCode, Guid? node, double? x, double? y, double? theta)
{
if (mapCode.HasValue) CurrentMapCodeId = mapCode;
if (node.HasValue) CurrentNodeId = node;
if (x.HasValue) CurrentX = x.Value;
if (y.HasValue) CurrentY = y.Value;
if (theta.HasValue) CurrentTheta = theta.Value;
UpdatedAt = DateTime.Now;
}
/// <summary>
/// 更新电池信息
/// </summary>
/// <param name="batteryLevel">电池电量</param>
/// <param name="charging">是否充电中</param>
public void UpdateBattery(int? batteryLevel, bool? charging = null)
{
if (batteryLevel.HasValue && batteryLevel.Value >= 0 && batteryLevel.Value <= 100)
BatteryLevel = batteryLevel.Value;
if (charging.HasValue) Charging = charging.Value;
UpdatedAt = DateTime.Now;
}
/// <summary>
/// 更新机器人基础信息
/// </summary>
/// <param name="robotCode">机器人编码</param>
/// <param name="robotName">机器人名称</param>
/// <param name="robotVersion">机器人版本</param>
/// <param name="protocolName">协议名称</param>
/// <param name="protocolVersion">协议版本</param>
/// <param name="robotManufacturer">制造商</param>
/// <param name="robotSerialNumber">序列号</param>
/// <param name="robotType">机器人类型</param>
/// <param name="ipAddress">IP地址</param>
/// <param name="netPort">网络端口</param>
/// <param name="macAddress">MAC地址</param>
/// <param name="coordinateScale">坐标换算系数</param>
/// <param name="payloadCapacity">最大载重</param>
/// <param name="speedMax">最大速度</param>
/// <param name="speedMin">最小速度</param>
/// <param name="accelerationMax">最大加速度</param>
/// <param name="decelerationMax">最大减速度</param>
/// <param name="heightMin">最小高度</param>
/// <param name="heightMax">最大高度</param>
/// <param name="width">宽度</param>
/// <param name="length">长度</param>
/// <param name="isOmnidirectional">是否全向</param>
/// <param name="radius">转弯半径</param>
/// <param name="active">是否启用</param>
public void UpdateBasicInfo(
string robotCode,
string robotName,
string robotVersion,
string protocolName,
string protocolVersion,
string robotManufacturer,
string robotSerialNumber,
RobotType robotType,
ProtocolType protocolType = ProtocolType.VDA,
string? ipAddress = null,
string? netPort = null,
string? netMac = null,
double? payloadCapacity = null,
double? speedMax = null,
double? speedMin = null,
double? accelerationMax = null,
double? decelerationMax = null,
double? heightMin = null,
double? heightMax = null,
double? width = null,
double? length = null,
bool isOmnidirectional = false,
double? radius = null,
double? coordinateScale = null,
Guid? currMap = null,
bool active = false)
{
if (!string.IsNullOrWhiteSpace(robotCode)) RobotCode = robotCode;
if (!string.IsNullOrWhiteSpace(robotName)) RobotName = robotName;
if (!string.IsNullOrWhiteSpace(robotVersion)) RobotVersion = robotVersion;
if (!string.IsNullOrWhiteSpace(protocolName)) ProtocolName = protocolName;
if (!string.IsNullOrWhiteSpace(protocolVersion)) ProtocolVersion = protocolVersion;
if (!string.IsNullOrWhiteSpace(robotManufacturer)) RobotManufacturer = robotManufacturer;
if (!string.IsNullOrWhiteSpace(robotSerialNumber)) RobotSerialNumber = robotSerialNumber;
IpAddress = ipAddress;
NetPort = netPort;
MacAddress = netMac;
CoordinateScale = coordinateScale.HasValue ? coordinateScale.Value : 1;
PayloadCapacity = payloadCapacity;
SpeedMax = speedMax;
SpeedMin = speedMin;
AccelerationMax = accelerationMax;
DecelerationMax = decelerationMax;
HeightMin = heightMin;
HeightMax = heightMax;
Width = width;
Length = length;
Radius = radius;
CurrentMapCodeId = currMap;
Active = active;
IsOmnidirectional = isOmnidirectional;
RobotType = robotType;
ProtocolType = protocolType;
UpdatedAt = DateTime.Now;
}
/// <summary>
/// 取消机器人当前任务
/// @author zzy
/// </summary>
public void CancelTask(string? orderId)
{
AddDomainEvent(new RobotTaskCancelledDomainEvent(RobotId, RobotSerialNumber, orderId));
}
#endregion
/// <summary>
/// 当前所有节点状态列表
/// </summary>
[NotMapped]
public List<NodeState> NodeStates { get; set; } = new();
/// <summary>
/// 当前所有边的状态列表
/// </summary>
[NotMapped]
public List<EdgeState> EdgeStates { get; set; } = new();
}
public enum RobotType
{
[EnumDescription("潜伏式", "Latent")]
Latent = 1,
[EnumDescription("叉车式", "Forklift")]
Forklift
}
public enum RobotStatus
{
[EnumDescription("空闲", "Idle")]
Idle = 1,
[EnumDescription("忙碌", "Busy")]
Busy,
[EnumDescription("异常", "Error")]
Error
}
public enum OnlineStatus
{
[EnumDescription("在线", "Online")]
Online = 1,
[EnumDescription("离线", "Offline")]
Offline,
[EnumDescription("连接中断", "Connection Broken")]
Connectionbroken
}
public enum OperatingMode
{
[EnumDescription("自动", "Automatic")]
Automatic = 1,
[EnumDescription("半自动", "Semi-automatic")]
Semiautomatic,
[EnumDescription("手动", "Manual")]
Manual,
[EnumDescription("维护", "Service")]
Service,
[EnumDescription("示教", "Teach-in")]
Teachin
}
/// <summary>
/// 协议类型
/// @author zzy
/// </summary>
public enum ProtocolType
{
[EnumDescription("VDA5050标准协议", "VDA5050")]
VDA = 1,
[EnumDescription("自定义协议", "Custom")]
Custom
}
}