Add Flutter project skeleton (Android-only MVP)
Five-layer architecture per DMC_Architektur_und_Design.md: FlightControllerLink abstraction (Mock + MSP stub), protocol-neutral mission domain layer, App-Mode state machine with Ready-to-Fly gate, Drift persistence schema, and placeholder UI screens wired via go_router. App icon generated from design/Y2_pink_dark.svg. Verified with flutter analyze and flutter test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
62d655fe8e
commit
346fcc2183
@@ -0,0 +1,57 @@
|
||||
import '../domain/waypoint/flat_waypoint_list.dart';
|
||||
|
||||
/// Abstrakte Flugmodi, protokollunabhaengig (Architektur-Doku 3.1).
|
||||
enum FlightMode { missionRun, guidedPoint, returnHome, hold }
|
||||
|
||||
/// Feature-Flags des angebundenen Flightcontrollers (Doku 3.1).
|
||||
class FcCapabilities {
|
||||
const FcCapabilities({
|
||||
required this.supportsMultiMission,
|
||||
required this.supportsInFlightUpload,
|
||||
required this.maxWaypoints,
|
||||
});
|
||||
|
||||
final bool supportsMultiMission;
|
||||
final bool supportsInFlightUpload;
|
||||
final int maxWaypoints;
|
||||
}
|
||||
|
||||
/// Normalisiertes Telemetrie-Frame, das an die UI weitergereicht wird (Doku 3.4).
|
||||
class TelemetryFrame {
|
||||
const TelemetryFrame({
|
||||
required this.lat,
|
||||
required this.lon,
|
||||
required this.altitudeM,
|
||||
required this.speedMs,
|
||||
required this.armed,
|
||||
this.activeWaypointIndex,
|
||||
});
|
||||
|
||||
final double lat;
|
||||
final double lon;
|
||||
final double altitudeM;
|
||||
final double speedMs;
|
||||
final bool armed;
|
||||
final int? activeWaypointIndex;
|
||||
}
|
||||
|
||||
/// Zentrale Abstraktion fuer alle Flightcontroller-Interaktionen (Doku 3.1).
|
||||
/// Implementierungen: MspFlightControllerLink (iNAV), MavlinkFlightControllerLink
|
||||
/// (ArduPilot, Post-MVP), MockFlightControllerLink (Tests ohne Hardware).
|
||||
abstract class FlightControllerLink {
|
||||
FcCapabilities get capabilities;
|
||||
|
||||
Future<void> connect();
|
||||
|
||||
Future<void> disconnect();
|
||||
|
||||
Future<void> uploadMission(FlatWaypointList mission);
|
||||
|
||||
Future<void> setFlightMode(FlightMode mode);
|
||||
|
||||
Future<void> arm();
|
||||
|
||||
Stream<TelemetryFrame> subscribeTelemetry();
|
||||
|
||||
Future<int?> readActiveWaypointIndex();
|
||||
}
|
||||
Reference in New Issue
Block a user