/// Protokollneutrales Wegpunkt-Modell (Architektur-Doku 3.2). /// Divergenz zu MSP/MAVLink findet ausschliesslich im Encoder-Schritt statt /// (MspWaypointEncoder / MavlinkMissionEncoder), nicht in diesem Modell. library; enum WaypointAction { none, loiter, landing, jump } class Waypoint { const Waypoint({ required this.lat, required this.lon, required this.altitudeM, required this.speedMs, required this.catchRadiusM, this.action = WaypointAction.none, this.jumpTargetIndex, this.jumpRepeatCount, this.windSpeedMs, this.windDirFromDeg, this.windElevationM, }); final double lat; final double lon; final double altitudeM; final double speedMs; final double catchRadiusM; final WaypointAction action; /// Nur bei action == jump gesetzt (iNAV Action-Code 6, Doku 7.1). final int? jumpTargetIndex; /// Nur bei action == jump gesetzt; null bedeutet Endlos-Wiederholung. final int? jumpRepeatCount; /// Auf Hoehe altitudeM interpolierte Windgeschwindigkeit (Doku 3.8), null /// bis "Fetch wind" ausgefuehrt wurde. Reine Planungshilfe, nicht Teil des /// protokollneutralen Missionsinhalts - der Encoder liest diese Felder nie. final double? windSpeedMs; /// Windrichtung, aus der der Wind weht (Grad, 0=Nord), analog windSpeedMs. final double? windDirFromDeg; /// Bodenhoehe (ASL) am Wegpunkt, wie von der Wind-API geliefert - noetig, /// um windSpeedMs/windDirFromDeg spaeter neu zu interpolieren oder /// anzuzeigen (z.B. "interpoliert auf X m AMSL"). final double? windElevationM; Waypoint copyWith({ double? lat, double? lon, double? altitudeM, double? speedMs, double? catchRadiusM, WaypointAction? action, int? jumpTargetIndex, int? jumpRepeatCount, double? windSpeedMs, double? windDirFromDeg, double? windElevationM, }) { return Waypoint( lat: lat ?? this.lat, lon: lon ?? this.lon, altitudeM: altitudeM ?? this.altitudeM, speedMs: speedMs ?? this.speedMs, catchRadiusM: catchRadiusM ?? this.catchRadiusM, action: action ?? this.action, jumpTargetIndex: jumpTargetIndex ?? this.jumpTargetIndex, jumpRepeatCount: jumpRepeatCount ?? this.jumpRepeatCount, windSpeedMs: windSpeedMs ?? this.windSpeedMs, windDirFromDeg: windDirFromDeg ?? this.windDirFromDeg, windElevationM: windElevationM ?? this.windElevationM, ); } } /// Gemeinsame, protokollunabhaengige Datenstruktur aller Missionstypen. class FlatWaypointList { const FlatWaypointList(this.waypoints); final List waypoints; }