Enroute Flight Navigation
A navigation app for VFR pilots
FlightDetector.h
1/***************************************************************************
2 * Copyright (C) 2026 by Stefan Kebekus *
3 * stefan.kebekus@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21#pragma once
22
23#include <QObject>
24#include <QQmlEngine>
25
26#include "positioning/PositionInfo.h"
27
28namespace Flightlog {
29
45class FlightDetector : public QObject
46{
47 QML_ELEMENT
48 QML_UNCREATABLE("")
49 Q_OBJECT
50
51public:
63 Q_ENUM(DetectionState)
64
65
69 explicit FlightDetector(QObject* parent = nullptr) : QObject(parent) {}
70
72 ~FlightDetector() override = default;
73
78 [[nodiscard]] virtual auto detectionState() const -> DetectionState = 0;
79
87 virtual void processPositionUpdate(const Positioning::PositionInfo& info) = 0;
88
99 virtual void endFlight() = 0;
100
106 virtual void resetDetection() = 0;
107
108signals:
111
119 void takeoffDetected(const QString& departureICAO,
120 const QGeoCoordinate& departureCoordinate,
121 const QDateTime& startTime,
122 const QString& aircraftCallsign);
123
134 void landingDetected(const QString& arrivalICAO,
135 const QGeoCoordinate& arrivalCoordinate,
136 const QDateTime& landingTime,
137 int landingCount);
138
139private:
140 Q_DISABLE_COPY_MOVE(FlightDetector)
141};
142
143} // namespace Flightlog
virtual auto detectionState() const -> DetectionState=0
Current detection state.
~FlightDetector() override=default
Standard destructor.
virtual void endFlight()=0
Manually end the current in-flight recording.
void landingDetected(const QString &arrivalICAO, const QGeoCoordinate &arrivalCoordinate, const QDateTime &landingTime, int landingCount)
Emitted when a landing is confirmed.
virtual void resetDetection()=0
Reset the detection state to Idle.
DetectionState
Detection state for automatic takeoff/landing detection.
virtual void processPositionUpdate(const Positioning::PositionInfo &info)=0
Process a position update.
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.
FlightDetector(QObject *parent=nullptr)
Standard constructor.