Initial commit
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
using RobotNet.VDA5050.Order;
|
||||
|
||||
namespace RobotNet10.FleetManager.Services.TrafficControl.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a segment in a robot route (either a node or an edge)
|
||||
/// Uses VDA5050.Order.Node and VDA5050.Order.Edge to store full information
|
||||
/// </summary>
|
||||
public class RouteSegment
|
||||
{
|
||||
// Internal properties needed for traffic control logic
|
||||
/// <summary>
|
||||
/// Node ID (Guid from database) - for conflict detection and edge reservation
|
||||
/// </summary>
|
||||
public Guid NodeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Edge ID (Guid from database) - Null if this is a node-only segment
|
||||
/// </summary>
|
||||
public Guid? EdgeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Start Node ID of the edge (Guid from database) - for conflict detection
|
||||
/// </summary>
|
||||
public Guid? StartNodeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// End Node ID of the edge (Guid from database) - for conflict detection
|
||||
/// </summary>
|
||||
public Guid? EndNodeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether this segment has been released into base
|
||||
/// </summary>
|
||||
public bool Released { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time until which this edge is reserved
|
||||
/// </summary>
|
||||
public DateTime? ReservedUntil { get; set; }
|
||||
|
||||
// VDA5050 Order objects containing full information from MapEditor
|
||||
/// <summary>
|
||||
/// VDA5050 Node with full information (NodeId, NodeDescription, NodePosition, Actions, etc.)
|
||||
/// </summary>
|
||||
public Node? VdaNode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// VDA5050 Edge with full information (EdgeId, EdgeDescription, MaxSpeed, Trajectory, Actions, etc.)
|
||||
/// Null if this is a node-only segment
|
||||
/// </summary>
|
||||
public Edge? VdaEdge { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get SequenceId from VdaNode or VdaEdge
|
||||
/// </summary>
|
||||
public int SequenceId => VdaNode?.SequenceId ?? VdaEdge?.SequenceId ?? 0;
|
||||
|
||||
/// <summary>
|
||||
/// Check if this segment is a node segment
|
||||
/// </summary>
|
||||
public bool IsNode => VdaNode != null;
|
||||
|
||||
/// <summary>
|
||||
/// Check if this segment is an edge segment
|
||||
/// </summary>
|
||||
public bool IsEdge => VdaEdge != null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user