live mission details in footer implemented
This commit is contained in:
@@ -57,12 +57,23 @@ bool parseMspInavStatusArmed(Uint8List payload) {
|
||||
return (armingFlags & MspArmingFlags.armed) != 0;
|
||||
}
|
||||
|
||||
/// Parst die `MSP_NAV_STATUS`-Antwort und liefert den aktiven
|
||||
/// Wegpunktindex, oder null, wenn keine Mission aktiv ist (`activeWpNumber
|
||||
/// == 0`, siehe [MspCommands.navStatus]).
|
||||
/// Parst die `MSP_NAV_STATUS`-Antwort und liefert den aktiven Wegpunkt als
|
||||
/// 0-basierten Index in die App-eigene Wegpunktliste, oder null, wenn keine
|
||||
/// Mission aktiv ist (`activeWpNumber == 0`, siehe [MspCommands.navStatus]).
|
||||
///
|
||||
/// `activeWpNumber` selbst ist 1-basiert (`navigation.c`: `NAV_Status.
|
||||
/// activeWpIndex = posControl.activeWaypointIndex - posControl.startWpIndex;
|
||||
/// NAV_Status.activeWpNumber = NAV_Status.activeWpIndex + 1;`) - bei einem
|
||||
/// einzelnen, komplett hochgeladenen Missions-Upload (kein Multi-Mission-
|
||||
/// Jump, `startWpIndex` = 0) entspricht `activeWpNumber - 1` also exakt dem
|
||||
/// 0-basierten Index in [Waypoint]-Listen wie `currentMissionProvider`.
|
||||
/// Frueher wurde hier der Rohwert unveraendert durchgereicht, was beim
|
||||
/// Indizieren in die Wegpunktliste zu einem Off-by-One fuehrte (durch
|
||||
/// Zufall unauffaellig, weil [MockFlightControllerLink] von Anfang an
|
||||
/// 0-basiert gezaehlt hat).
|
||||
int? parseMspNavStatusActiveWaypoint(Uint8List payload) {
|
||||
final activeWpNumber = payload[3];
|
||||
return activeWpNumber == 0 ? null : activeWpNumber;
|
||||
return activeWpNumber == 0 ? null : activeWpNumber - 1;
|
||||
}
|
||||
|
||||
/// Parst `mode`/`state` aus der `MSP_NAV_STATUS`-Antwort (Byte 0/1, siehe
|
||||
|
||||
Reference in New Issue
Block a user