24#include <QGeoCoordinate>
28#include "units/Distance.h"
42 QML_VALUE_TYPE(flight)
85 Flight() : m_id(QUuid::createUuid()) {}
102 [[nodiscard]]
auto uuid() const -> QUuid {
return m_id; }
108 [[nodiscard]]
auto departureICAO() const -> QString {
return m_departureICAO; }
114 [[nodiscard]]
auto arrivalICAO() const -> QString {
return m_arrivalICAO; }
120 [[nodiscard]]
auto offBlockTime() const -> QDateTime {
return m_offBlockTime; }
126 [[nodiscard]]
auto startTime() const -> QDateTime {
return m_startTime; }
132 [[nodiscard]]
auto landingTime() const -> QDateTime {
return m_landingTime; }
138 [[nodiscard]]
auto onBlockTime() const -> QDateTime {
return m_onBlockTime; }
144 [[nodiscard]]
auto pilotName() const -> QString {
return m_pilotName; }
156 [[nodiscard]]
auto comments() const -> QString {
return m_comments; }
162 [[nodiscard]]
auto landingCount() const ->
int {
return m_landingCount; }
180 [[nodiscard]]
auto hasTrack() const ->
bool {
return !m_trackFile.isEmpty(); }
186 [[nodiscard]]
auto trackFile() const -> QString {
return m_trackFile; }
278 if (!fileName.isEmpty() && (fileName.contains(u
'/') || fileName.contains(u
'\\'))) {
281 m_trackFile = fileName;
321 QString m_departureICAO;
322 QString m_arrivalICAO;
323 QDateTime m_offBlockTime;
324 QDateTime m_startTime;
325 QDateTime m_landingTime;
326 QDateTime m_onBlockTime;
328 QString m_aircraftCallsign;
330 int m_landingCount {0};
331 QGeoCoordinate m_departureCoordinate;
332 QGeoCoordinate m_arrivalCoordinate;
A single flight log entry.
auto pilotName() const -> QString
Getter function for property of the same name.
auto arrivalCoordinate() const -> QGeoCoordinate
Coordinate of the arrival airport.
void setArrivalICAO(const QString &icao)
Setter function for property of the same name.
void setLandingTime(const QDateTime &dt)
Setter function for property of the same name.
QDateTime landingTime
Landing time in UTC.
Q_INVOKABLE QString blockTime() const
Block time as a formatted string.
auto landingTime() const -> QDateTime
Getter function for property of the same name.
QUuid uuid
Unique identity of this flight entry (stable across sorting and edits).
void setPilotName(const QString &name)
Setter function for property of the same name.
auto aircraftCallsign() const -> QString
Getter function for property of the same name.
auto trackFile() const -> QString
Get the track file name.
QString trackFile
Filename of the track file (relative to tracks directory).
QDateTime startTime
Start (takeoff) time in UTC.
auto departureCoordinate() const -> QGeoCoordinate
Coordinate of the departure airport.
Flight()
Default constructor — generates a unique identity.
auto onBlockTime() const -> QDateTime
Getter function for property of the same name.
QString arrivalICAO
ICAO code of the arrival airport.
auto arrivalICAO() const -> QString
Getter function for property of the same name.
auto landingCount() const -> int
Getter function for property of the same name.
auto startTime() const -> QDateTime
Getter function for property of the same name.
QDateTime onBlockTime
On-block time in UTC (optional).
void setAircraftCallsign(const QString &callsign)
Setter function for property of the same name.
void setArrivalCoordinate(const QGeoCoordinate &coord)
Set arrival coordinate.
QString aircraftCallsign
Aircraft callsign (e.g. D-KEBE, optional).
Q_INVOKABLE Units::Distance distance() const
Direct distance between departure and arrival airports.
void setComments(const QString &text)
Setter function for property of the same name.
QString comments
Free-text comments (optional).
Q_INVOKABLE QString flightTime() const
Flight duration as a human-readable string (H:MM).
auto comments() const -> QString
Getter function for property of the same name.
Flight(const QUuid &uuid)
Construct with a specific identity.
Q_INVOKABLE bool operator==(const Flightlog::Flight &other) const
Comparison operator.
auto departureICAO() const -> QString
Getter function for property of the same name.
int landingCount
Number of landings (touch-and-goes + final landing).
QDateTime offBlockTime
Off-block time in UTC (optional).
void setDepartureICAO(const QString &icao)
Setter function for property of the same name.
void setOffBlockTime(const QDateTime &dt)
Setter function for property of the same name.
void setDepartureCoordinate(const QGeoCoordinate &coord)
Set departure coordinate.
void setStartTime(const QDateTime &dt)
Setter function for property of the same name.
void setOnBlockTime(const QDateTime &dt)
Setter function for property of the same name.
auto hasTrack() const -> bool
Check if this flight has a recorded GPS track.
void setLandingCount(int count)
Setter function for property of the same name.
QString departureICAO
ICAO code of the departure airport.
QString pilotName
Pilot name (optional).
bool hasTrack
Whether this flight has a recorded track.
auto offBlockTime() const -> QDateTime
Getter function for property of the same name.
void setTrackFile(const QString &fileName)
Set the track file name.
Q_INVOKABLE qint64 flightTimeSeconds() const
Flight duration in seconds.
Convenience class for distance computations.