using System.Text.Json.Serialization; namespace Flyshot.Core.Domain; /// /// Represents a request to plan or execute a flyshot trajectory. /// public sealed class TrajectoryRequest { /// /// Initializes a trajectory request with compatibility-oriented defaults. /// public TrajectoryRequest( RobotProfile robot, FlyshotProgram program, PlanningMethod method, bool moveToStart = false, bool saveTrajectoryArtifacts = false, bool useCache = false) { Robot = robot ?? throw new ArgumentNullException(nameof(robot)); Program = program ?? throw new ArgumentNullException(nameof(program)); Method = method; MoveToStart = moveToStart; SaveTrajectoryArtifacts = saveTrajectoryArtifacts; UseCache = useCache; } /// /// Gets the robot profile that constrains planning and runtime compatibility. /// [JsonPropertyName("robot")] public RobotProfile Robot { get; } /// /// Gets the uploaded program to be planned or executed. /// [JsonPropertyName("program")] public FlyshotProgram Program { get; } /// /// Gets the selected planning method. /// [JsonPropertyName("method")] public PlanningMethod Method { get; } /// /// Gets a value indicating whether the robot should move to the first waypoint before execution. /// [JsonPropertyName("moveToStart")] public bool MoveToStart { get; } /// /// Gets a value indicating whether trajectory artifacts should be exported. /// [JsonPropertyName("saveTrajectoryArtifacts")] public bool SaveTrajectoryArtifacts { get; } /// /// Gets a value indicating whether cached planning artifacts may be reused. /// [JsonPropertyName("useCache")] public bool UseCache { get; } } /// /// Identifies the planning mode requested by compatibility APIs. /// [JsonConverter(typeof(JsonStringEnumConverter))] public enum PlanningMethod { /// /// Uses the cubic-spline ICSP planner. /// Icsp, /// /// 使用 Rust 原生库实现的 ICSP 规划器。 /// IcspRust, /// /// Uses the adaptive ICSP planner that may insert additional points. /// SelfAdaptIcsp, /// /// Uses the Double-S planner. /// Doubles }