using System; namespace MultiWheelC.TrajectoryPlanning.EMPlanner; /// Immutable trajectory-execution outcome without controller or hardware coupling. public sealed class TrajectoryExecutionState { internal TrajectoryExecutionState(EmTrajectoryPoint selectedPoint, GearSwitchStateUpdate gearSwitchUpdate) { SelectedPoint = selectedPoint ?? throw new ArgumentNullException(nameof(selectedPoint)); if (gearSwitchUpdate == null) throw new ArgumentNullException(nameof(gearSwitchUpdate)); GearSwitchState = gearSwitchUpdate.State; HoldZero = gearSwitchUpdate.HoldZero; RequestDirectionChange = gearSwitchUpdate.RequestDirectionChange; AllowsTrajectoryMotion = gearSwitchUpdate.AllowsTrajectoryMotion; IsTrajectoryComplete = gearSwitchUpdate.IsTrajectoryComplete; Reason = gearSwitchUpdate.Reason; } public EmTrajectoryPoint SelectedPoint { get; } public GearSwitchState GearSwitchState { get; } public bool HoldZero { get; } public bool RequestDirectionChange { get; } public bool AllowsTrajectoryMotion { get; } public bool IsTrajectoryComplete { get; } public string Reason { get; } }