|
Enroute Flight Navigation
A navigation app for VFR pilots
|
Abstract base class for automatic flight detection strategies. More...
#include <FlightDetector.h>
Public Types | |
| enum | DetectionState : quint8 { Idle , TakeoffPhase , InFlight , LandingPhase } |
| Detection state for automatic takeoff/landing detection. More... | |
Signals | |
| void | detectionStateChanged () |
| Emitted when the detection state changes. | |
| void | takeoffDetected (const QString &departureICAO, const QGeoCoordinate &departureCoordinate, const QDateTime &startTime, const QString &aircraftCallsign) |
| Emitted when a takeoff is confirmed. | |
| void | landingDetected (const QString &arrivalICAO, const QGeoCoordinate &arrivalCoordinate, const QDateTime &landingTime, int landingCount) |
| Emitted when a landing is confirmed. | |
Public Member Functions | |
| FlightDetector (QObject *parent=nullptr) | |
| Standard constructor. | |
| ~FlightDetector () override=default | |
| Standard destructor. | |
| virtual auto | detectionState () const -> DetectionState=0 |
| Current detection state. | |
| virtual void | processPositionUpdate (const Positioning::PositionInfo &info)=0 |
| Process a position update. | |
| virtual void | endFlight ()=0 |
| Manually end the current in-flight recording. | |
| virtual void | resetDetection ()=0 |
| Reset the detection state to Idle. | |
Abstract base class for automatic flight detection strategies.
This class defines the interface for automatic takeoff and landing detection. Concrete subclasses implement detection logic appropriate for different types of flying (e.g. powered aircraft, paragliders).
The detection state machine has four states:
Subclasses decide how to transition between these states based on position, speed, altitude, and other sensor data.
Definition at line 45 of file FlightDetector.h.
| enum Flightlog::FlightDetector::DetectionState : quint8 |
Detection state for automatic takeoff/landing detection.
This enum is shared by all detector implementations.
Definition at line 56 of file FlightDetector.h.
|
inlineexplicit |
Standard constructor.
| parent | The standard QObject parent pointer |
Definition at line 69 of file FlightDetector.h.
|
nodiscardpure virtual |
Current detection state.
Implemented in Flightlog::AirplaneFlightDetector.
|
pure virtual |
Manually end the current in-flight recording.
If the detector is in the InFlight or LandingPhase state, this creates a completed flight with the current UTC time as landing time and resolves the nearest airport if available. The accumulated landing count from LandingPhase is preserved. Resets the detection state to Idle.
Does nothing if the detection state is Idle or TakeoffPhase.
Implemented in Flightlog::AirplaneFlightDetector.
|
signal |
Emitted when a landing is confirmed.
Emitted on LandingPhase → Idle transition, after speed drops below the confirmation threshold.
| arrivalICAO | ICAO code of the arrival airport (may be empty) |
| arrivalCoordinate | Coordinate of the arrival airport |
| landingTime | The landing time |
| landingCount | Number of landings (1 for normal, >1 for touch-and-go) |
|
pure virtual |
Process a position update.
Called on every position update when auto-detection is enabled. Subclasses implement the state machine transitions here.
| info | The current position information |
Implemented in Flightlog::AirplaneFlightDetector.
|
pure virtual |
Reset the detection state to Idle.
Clears all pending detection data and returns to the Idle state. Used when auto-detection is disabled while detection is in progress.
Implemented in Flightlog::AirplaneFlightDetector.
|
signal |
Emitted when a takeoff is confirmed.
| departureICAO | ICAO code of the departure airport (may be empty) |
| departureCoordinate | Coordinate of the departure airport |
| startTime | The takeoff time |
| aircraftCallsign | Callsign of the aircraft |