add telemetry messages: rx link quality, battery percentage, flight mode, relative altitude
This commit is contained in:
@@ -11,6 +11,7 @@ class MockFlightControllerLink implements FlightControllerLink {
|
||||
StreamController<TelemetryFrame>? _telemetryController;
|
||||
Timer? _ticker;
|
||||
double _heading = 0;
|
||||
double _batteryPercent = 100;
|
||||
|
||||
@override
|
||||
FcCapabilities get capabilities => const FcCapabilities(
|
||||
@@ -28,6 +29,9 @@ class MockFlightControllerLink implements FlightControllerLink {
|
||||
// sichtbar ueberprueft werden kann (Doku 9: UI-Entwicklung ohne
|
||||
// Hardware).
|
||||
_heading = (_heading + 5) % 360;
|
||||
// Langsam sinkender Akkustand, damit die Anzeige auch ohne Hardware
|
||||
// sichtbar auf Werteaenderungen reagiert (Doku 9).
|
||||
_batteryPercent = (_batteryPercent - 0.1).clamp(0, 100);
|
||||
_telemetryController?.add(TelemetryFrame(
|
||||
lat: 52.5,
|
||||
lon: 13.4,
|
||||
@@ -37,6 +41,11 @@ class MockFlightControllerLink implements FlightControllerLink {
|
||||
speedMs: 18,
|
||||
headingDeg: _heading,
|
||||
armed: _armed,
|
||||
batteryPercent: _batteryPercent.round(),
|
||||
linkQuality: 95,
|
||||
flightMode: _activeWaypointIndex != null
|
||||
? 'Waypoint mission (en route)'
|
||||
: 'Idle',
|
||||
activeWaypointIndex: _activeWaypointIndex,
|
||||
));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user