6 #ifndef SWIFT_MISC_AVIATION_FLIGHTPLAN_H
7 #define SWIFT_MISC_AVIATION_FLIGHTPLAN_H
20 #include "misc/aviation/flightplanaircraftinfo.h"
37 namespace swift::misc::aviation
73 bool setSelcalCode(
const QString &selcal);
88 bool hasAnyParsedRemarks()
const;
91 bool hasParsedAirlineRemarks()
const;
94 void parseFlightPlanRemarks(
bool force =
false);
101 bool isEmpty()
const {
return m_remarks.isEmpty(); }
107 QString convertToQString(
bool i18n =
false)
const;
110 static QString textToVoiceCapabilitiesRemarks(
const QString &text);
113 static QString replaceVoiceCapabilities(
const QString &newCapRemarks,
const QString &oldRemarks);
116 static QString cleanRemarks(
const QString &remarksIn);
120 QString m_radioTelephony;
121 QString m_flightOperator;
126 bool m_isParsed =
false;
140 static QString getRemark(
const QString &remarks,
const QString &marker);
143 static QString replaceRemark(
const QString &remarks,
const QString &marker,
const QString &newRemark);
151 static const QStringList &getLogCategories();
166 IndexCallsign = CPropertyIndexRef::GlobalIndexCFlightPlan,
167 IndexOriginAirportIcao,
168 IndexDestinationAirportIcao,
169 IndexAlternateAirportIcao,
176 static constexpr
int MaxRemarksLength = 512;
177 static constexpr
int MaxRouteLength = 512;
178 static constexpr
int MaxRouteAndRemarksLength = 624;
186 const CAirportIcaoCode &alternateAirportIcao,
const QDateTime &takeoffTimePlanned,
190 const QString &route,
const QString &remarks);
193 void setCallsign(
const CCallsign &callsign);
204 m_originAirportIcao = originAirportIcao;
210 m_destinationAirportIcao = destinationAirportIcao;
216 m_destinationAirportIcao = destinationAirportIcao;
222 m_alternateAirportIcao = alternateAirportIcao;
228 m_alternateAirportIcao = alternateAirportIcao;
232 void setTakeoffTimePlanned(
const QDateTime &takeoffTimePlanned);
237 m_takeoffTimePlanned = QDateTime::currentDateTimeUtc();
238 m_takeoffTimePlanned.setTime(QTime::fromString(time,
"hh:mm"));
242 void setTakeoffTimeActual(
const QDateTime &takeoffTimeActual);
247 m_takeoffTimeActual = QDateTime::currentDateTimeUtc();
248 m_takeoffTimeActual.setTime(QTime::fromString(time,
"hh:mm"));
254 m_enrouteTime = enrouteTime;
261 m_fuelTime = fuelTime;
271 m_cruiseAltitude = cruiseAltitude;
272 m_cruiseAltitudeString.clear();
281 m_cruiseTrueAirspeed = cruiseTrueAirspeed;
288 void setFlightRule(
const QString &flightRule);
291 void setRoute(
const QString &route);
294 void setRemarks(
const QString &remarks);
297 void setVoiceCapabilities(
const QString &capabilities);
321 QString getTakeoffTimePlannedHourMin()
const;
327 QString getTakeoffTimeActualHourMin()
const;
363 const QString &
getRoute()
const {
return m_route; }
375 const QString &
getRemarks()
const {
return m_remarks.getRemarks(); }
396 QString convertToQString(
bool i18n =
false)
const;
399 QString asHTML(
bool i18n =
false)
const;
402 static CFlightPlan fromSB4Format(
const QString &sbData);
405 static CFlightPlan fromSimBriefFormat(
const QString &simBrief);
408 static CFlightPlan fromMultipleFormats(
const QString &data,
const QString &fileSuffix);
414 static const QString &flightRulesToString(FlightRules rules);
417 static FlightRules stringToFlightRules(
const QString &flightRules);
420 static const QStringList &flightRules();
424 static bool isVFRRules(FlightRules rule);
425 static bool isVFRRules(
const QString &rule);
430 static bool isIFRRules(FlightRules rule);
431 static bool isIFRRules(
const QString &rule);
440 QDateTime m_takeoffTimePlanned;
441 QDateTime m_takeoffTimeActual;
445 QString m_cruiseAltitudeString;
447 FlightRules m_flightRules {};
449 CFlightPlanRemarks m_remarks;
452 QString buildString(
bool i18n =
false,
const QString &separator =
" ")
const;
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Non-owning reference to a CPropertyIndex with a subset of its features.
Status messages, e.g. from Core -> GUI.
Mix of the most commonly used mixin classes.
Value object for ICAO classification.
Value object encapsulating information of airport ICAO data.
Altitude as used in aviation, can be AGL or MSL altitude.
Value object encapsulating information of a callsign.
Flightplan-related information about an aircraft (aircraft ICAO, equipment and WTC)
Value object for a flight plan.
void setFuelTime(const QString &fuelTime)
Set amount of fuel load in time hh:mm.
void setFlightPlanRemarks(const CFlightPlanRemarks &remarks)
Set FP remarks.
bool wasSentOrLoaded() const
Flight plan already sent.
const CCallsign & getCallsign() const
Aircraft callsign.
const physical_quantities::CTime & getFuelTime() const
Get amount of fuel load in time.
QString getFlightRulesAsString() const
Get flight rules as in FlightRules as string.
CFlightPlan()=default
Default constructor.
void setFlightRule(FlightRules flightRule)
Set flight rules (VFR or IFR)
QString getFuelTimeHourMin() const
Get amount of fuel load in time.
void setOriginAirportIcao(const CAirportIcaoCode &originAirportIcao)
Set origin airport ICAO code.
const CFlightPlanRemarks & getFlightPlanRemarks() const
Get the parsable remarks.
ColumnIndex
Properties by index.
const physical_quantities::CSpeed & getCruiseTrueAirspeed() const
Get planned cruise TAS.
void setOriginAirportIcao(const QString &originAirportIcao)
Set origin airport ICAO code.
void setCruiseTrueAirspeed(const physical_quantities::CSpeed &cruiseTrueAirspeed)
Set planned cruise TAS.
void setAlternateAirportIcao(const QString &alternateAirportIcao)
Set alternate destination airport ICAO code.
void setFuelTime(const physical_quantities::CTime &fuelTime)
Set amount of fuel load in time.
const QString & getRoute() const
Get route string.
FlightRules
Flight rules (VFR or IFR)
@ IFR
Instrument flight rules.
@ SVFR
Special VFR (reserved for ATC use),.
void setDestinationAirportIcao(const CAirportIcaoCode &destinationAirportIcao)
Set destination airport ICAO code.
const QDateTime & getTakeoffTimePlanned() const
Get planned takeoff time (planned)
static const QString & flightRulesToString(FlightRules rules)
Rules to string.
FlightRules getFlightRules() const
Get flight rules as in FlightRules.
void setTakeoffTimePlanned(const QString &time)
Set planned takeoff time hh:mm.
const QString & getRemarks() const
Get remarks string.
bool hasCallsign() const
Has callsign?
QString getEnrouteTimeHourMin() const
Get planned enroute flight time.
void setCruiseAltitudeString(const QString &altitudeString)
Cruising altitude already as string.
const CAirportIcaoCode & getAlternateAirportIcao() const
Get alternate destination airport ICAO code.
const CAltitude & getCruiseAltitude() const
Cruising altitudes.
const physical_quantities::CTime & getEnrouteTime() const
Get planned enroute flight time.
void setTakeoffTimeActual(const QString &time)
Set actual takeoff time hh:mm.
qint64 timeDiffSentOrLoadedMs() const
Received before n ms.
void setEnrouteTime(const physical_quantities::CTime &enrouteTime)
Set planned enroute flight time.
const CAirportIcaoCode & getOriginAirportIcao() const
Get origin airport ICAO code.
const QDateTime whenLastSentOrLoaded() const
When last sent.
void setWhenLastSentOrLoaded(const QDateTime &dateTime)
When last sent.
const CAirportIcaoCode & getDestinationAirportIcao() const
Get destination airport ICAO code.
void setDestinationAirportIcao(const QString &destinationAirportIcao)
Set destination airport ICAO code.
const QDateTime & getTakeoffTimeActual() const
Get actual takeoff time (actual)
const QString & getCruiseAltitudeString() const
Cruising altitude already as string.
void setCruiseAltitude(const CAltitude &cruiseAltitude)
Set planned cruise altitude.
CFlightPlanAircraftInfo getAircraftInfo() const
Get ICAO aircraft NAV/COM equipment.
void setAlternateAirportIcao(const CAirportIcaoCode &alternateAirportIcao)
Set alternate destination airport ICAO code.
Value object encapsulating information for voice capabilities.
PQ & switchUnit(const MU &newUnit)
Change unit, and convert value to maintain the same quantity.
static CTimeUnit hrmin()
Hours, minutes.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...