swift
|
Altitude as used in aviation, can be AGL or MSL altitude. More...
Public Types | |
enum | ReferenceDatum { MeanSeaLevel = 0 , AboveGround , FlightLevel } |
Enum type to distinguish between MSL and AGL. More... | |
enum | AltitudeType { PressureAltitude , TrueAltitude } |
Altitude type. More... | |
using | base_type = physical_quantities::CLength |
Base type. | |
using | MetricTuple = std::tuple< int, int > |
Metric tuple. | |
![]() | |
enum | ColumnIndex |
Index. | |
![]() | |
enum | ColumnIndex { IndexPixmap = 10 , IndexIcon , IndexString } |
Base class enums. | |
![]() | |
enum | ColumnIndex |
Base class enums. | |
Public Member Functions | |
CAltitude () | |
Default constructor: 0m Altitude MSL. | |
CAltitude (double value, ReferenceDatum datum, const physical_quantities::CLengthUnit &unit) | |
Constructor. | |
CAltitude (double value, ReferenceDatum datum, AltitudeType type, const physical_quantities::CLengthUnit &unit) | |
Constructor. | |
CAltitude (double value, const physical_quantities::CLengthUnit &unit) | |
Constructor, value as CAltitude::MeanSeaLevel. | |
CAltitude (double value, const physical_quantities::CLengthUnit &unit, const physical_quantities::CLengthUnit &switchUnit) | |
Constructor, value as CAltitude::MeanSeaLevel. | |
CAltitude (const QString &altitudeAsString, physical_quantities::CPqString::SeparatorMode mode=physical_quantities::CPqString::SeparatorBestGuess) | |
Altitude as string. | |
CAltitude (const physical_quantities::CLength &altitude, ReferenceDatum datum) | |
Constructor by CLength. | |
CAltitude | withOffset (const CLength &offset) const |
Altitude with offset. More... | |
void | addOffset (const CLength &offset) |
Add offset value. | |
CAltitude & | switchUnit (const physical_quantities::CLengthUnit &newUnit) |
Value in switched unit. | |
CAltitude | switchedUnit (const physical_quantities::CLengthUnit &newUnit) const |
Value in switched unit. | |
bool | isAboveGroundLevel () const |
AGL Above ground level? | |
bool | isMeanSeaLevel () const |
MSL Mean sea level? | |
bool | isFlightLevel () const |
Flight level? | |
ReferenceDatum | getReferenceDatum () const |
Get reference datum (MSL or AGL) | |
bool | toFlightLevel () |
MSL to flightlevel. | |
bool | toMeanSeaLevel () |
Flightlevel to MSL. | |
bool | hasMeanSeaLevelValue () const |
Non-NULL MSL value? | |
AltitudeType | getAltitudeType () const |
Current altitude type. | |
void | convertToPressureAltitude (const physical_quantities::CPressure &seaLevelPressure) |
Converts this to pressure altitude. Requires the current barometric pressure at MSL. | |
CAltitude | toPressureAltitude (const physical_quantities::CPressure &seaLevelPressure) const |
Returns the altitude converted to pressure altitude. Requires the current barometric pressure at MSL. | |
void | parseFromString (const QString &value) |
Parse value from string. | |
void | parseFromString (const QString &value, physical_quantities::CPqString::SeparatorMode mode) |
Parse value from string, with specified separator. | |
bool | parseFromFpAltitudeString (const QString &value, CStatusMessageList *msgs=nullptr) |
Parse from FP altitude string. More... | |
bool | isValidFpAltitude (CStatusMessageList *msgs=nullptr) const |
Is this a valid FP altitude. More... | |
QString | asFpICAOAltitudeString () const |
Altitude string (official version) More... | |
QString | asFpVatsimAltitudeString () const |
As simple VATSIM string, only FLxxx or altitude as ft. | |
swift::misc::CIcons::IconIndex | toIcon () const |
As icon, not implemented by all classes. More... | |
int | compare (const CAltitude &otherAltitude) const |
Return negative, zero, or positive if a is less than, equal to, or greater than b. More... | |
QString | convertToQString (bool i18n=false) const |
Cast as QString. More... | |
int | comparePropertyByIndex (CPropertyIndexRef index, const CAltitude &compareValue) const |
Set property by index. More... | |
CAltitude | roundedToNearest100ft (bool roundDown) const |
Round to the nearest 100ft, like needed for China and Russia. More... | |
![]() | |
CLength () | |
Default constructor. | |
CLength (double value, const CLengthUnit &unit) | |
Init by double value. | |
CLength (double value, const CLengthUnit &unit, const CLengthUnit &switchUnit) | |
Init by double value and switch unit. | |
CLength (const QString &unitString) | |
Constructor by parsed string, e.g. 10m. More... | |
![]() | |
int | compare (const CLength &other) const |
Compare with other PQ. | |
const CLengthUnit & | getUnit () const |
Unit. | |
void | setUnit (const CLengthUnit &unit) |
Simply set unit, do no calclulate conversion. More... | |
void | setUnitBySymbol (const QString &unitName) |
Set unit by string. | |
QString | getUnitSymbol () const |
Unit. | |
CLength & | switchUnit (const CLengthUnit &newUnit) |
Change unit, and convert value to maintain the same quantity. | |
CLength | switchedUnit (const CLengthUnit &newUnit) const |
Return copy with switched unit. | |
bool | isNull () const |
Is quantity null? | |
void | setNull () |
Set null. | |
double | value (CLengthUnit unit) const |
Value in given unit. | |
double | value () const |
Value in current unit. | |
void | setCurrentUnitValue (double value) |
Set value in current unit. | |
int | valueInteger (CLengthUnit unit) const |
As integer value. | |
int | valueInteger () const |
As integer value in current unit. | |
QString | valueIntegerAsString (CLengthUnit unit) const |
As integer value. | |
QString | valueIntegerAsString () const |
As integer value in current unit. | |
bool | isInteger () const |
Is value an integer. | |
double | valueRounded (CLengthUnit unit, int digits=-1) const |
Rounded value in given unit. More... | |
double | valueRounded (int digits=-1) const |
Rounded value in current unit. More... | |
QString | valueRoundedAsString (CLengthUnit unit, int digits=-1) const |
Rounded value in given unit. More... | |
QString | valueRoundedWithUnit (const CLengthUnit &unit, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const |
Value to QString with the given unit, e.g. "5.00m". More... | |
QString | valueRoundedWithUnit (int digits=-1, bool withGroupSeparator=false, bool i18n=false) const |
Value to QString with the current unit, e.g. "5.00m". More... | |
void | roundToEpsilon () |
Round current value in current unit to epsilon. More... | |
void | setValueSameUnit (double value) |
Change value without changing unit. | |
void | addValueSameUnit (double value) |
Add to the value in the current unit. | |
void | substractValueSameUnit (double value) |
Substract from the value in the current unit. | |
CPhysicalQuantity & | operator*= (double multiply) |
Multiply operator *=. | |
CPhysicalQuantity & | operator/= (double divide) |
Divide operator /=. | |
CLength | operator* (double multiply) const |
Operator *. | |
CLength | operator/ (double divide) const |
Operator /. | |
CLength | operator- () const |
Unary operator -. | |
CPhysicalQuantity & | operator+= (const CPhysicalQuantity &other) |
Plus operator +=. | |
CPhysicalQuantity & | operator-= (const CPhysicalQuantity &other) |
Minus operator-=. | |
bool | isZeroEpsilonConsidered () const |
Quantity value <= epsilon. | |
bool | isPositiveWithEpsilonConsidered () const |
Value >= 0 epsilon considered. | |
bool | isNegativeWithEpsilonConsidered () const |
Value <= 0 epsilon considered. | |
const CLength & | makePositive () |
Make value always positive. | |
const CLength & | makeNegative () |
Make value always negative. | |
CLength | abs () const |
Absolute value (always >=0) | |
void | marshallToDbus (QDBusArgument &argument) const |
Marshall without begin/endStructure, for when composed within another object. More... | |
void | marshallToDbus (QDBusArgument &argument, LosslessTag) const |
Marshal to DBus, preserving the measurement unit. | |
void | unmarshallFromDbus (const QDBusArgument &argument) |
Unmarshall without begin/endStructure, for when composed within another object. More... | |
void | unmarshallFromDbus (const QDBusArgument &argument, LosslessTag) |
Unmarshal from DBus, with preserved measurement unit. | |
void | marshalToDataStream (QDataStream &stream) const |
Marshal a value to a QDataStream. More... | |
void | unmarshalFromDataStream (QDataStream &stream) |
Unmarshal a value from a QDataStream. More... | |
size_t | getValueHash () const |
qHash overload, needed for storing value in a QSet. More... | |
QJsonObject | toJson () const |
Cast to JSON object. More... | |
void | convertFromJson (const QJsonObject &json) |
Assign from JSON object. More... | |
QVariant | propertyByIndex (CPropertyIndexRef index) const |
Property by index. More... | |
void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
Set property by index. More... | |
int | comparePropertyByIndex (CPropertyIndexRef index, const CLength &pq) const |
Compare for index. More... | |
QString | convertToQString (bool i18n=false) const |
Cast as QString. More... | |
void | parseFromString (const QString &value) |
Parse value from string. | |
void | parseFromString (const QString &value, CPqString::SeparatorMode mode) |
Parse to string, with specified separator. | |
void | parseFromString (const QString &value, CPqString::SeparatorMode mode, const CLengthUnit &defaultUnitIfMissing) |
Parse to string, with specified separator. | |
![]() | |
CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
Update by variant map. More... | |
void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
Set property by index. | |
QVariant | propertyByIndex (CPropertyIndexRef index) const |
Property by index. | |
int | comparePropertyByIndex (CPropertyIndexRef index, const Derived &compareValue) const |
Compare for index. | |
bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
Is given variant equal to value of property index? | |
![]() | |
int | getMetaTypeId () const |
Returns the Qt meta type ID of this object. More... | |
QString | getClassName () const |
Class name. | |
bool | isA (int metaTypeId) const |
Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses. | |
![]() | |
QString | toQString (bool i18n=false) const |
Cast as QString. | |
std::string | toStdString (bool i18n=false) const |
To std string. | |
QString | stringForStreaming () const |
String for streaming operators. | |
![]() | |
CIcons::IconIndex | toIcon () const |
As icon, not implemented by all classes. | |
![]() | |
int | getMetaTypeId () const |
Returns the Qt meta type ID of this object. More... | |
QString | getClassName () const |
Class name. | |
bool | isA (int metaTypeId) const |
Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses. | |
![]() | |
void | marshallToDbus (QDBusArgument &arg, Tags...) const |
Marshall without begin/endStructure, for when composed within another object. | |
void | unmarshallFromDbus (const QDBusArgument &arg, Tags...) |
Unmarshall without begin/endStructure, for when composed within another object. | |
![]() | |
void | marshallToDbus (QDBusArgument &arg, Tags...) const |
Marshall without begin/endStructure, for when composed within another object. | |
void | unmarshallFromDbus (const QDBusArgument &arg, Tags...) |
Unmarshall without begin/endStructure, for when composed within another object. | |
![]() | |
void | marshalToDataStream (QDataStream &stream) const |
Marshal a value to a QDataStream. | |
void | unmarshalFromDataStream (QDataStream &stream) |
Unmarshal a value from a QDataStream. | |
![]() | |
QJsonObject | toJson () const |
Cast to JSON object. | |
QString | toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const |
Convenience function JSON as string. | |
void | convertFromJson (const QJsonObject &json) |
Assign from JSON object. | |
void | convertFromJson (const QString &jsonString, bool acceptCacheFormat=false) |
Assign from JSON object string. | |
![]() | |
QString | toQString (bool i18n=false) const |
Cast as QString. | |
std::string | toStdString (bool i18n=false) const |
To std string. | |
QString | stringForStreaming () const |
String for streaming operators. | |
![]() | |
CIcons::IconIndex | toIcon () const |
As icon, not implemented by all classes. | |
![]() | |
CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
Update by variant map. More... | |
void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
Set property by index. | |
QVariant | propertyByIndex (CPropertyIndexRef index) const |
Property by index. | |
int | comparePropertyByIndex (CPropertyIndexRef index, const CAltitude &compareValue) const |
Compare for index. | |
bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
Is given variant equal to value of property index? | |
Static Public Member Functions | |
static const QRegularExpression & | fpAltitudeRegExp () |
Checking FP altitude strings like "A20", "FL100". More... | |
static QString | fpAltitudeInfo (const QString &separator=", ") |
Info for FP altitude strings. More... | |
static QString | fpAltitudeExamples () |
Examples of FP altitude strings. | |
static const CAltitude & | null () |
Null altitude (MSL) | |
static physical_quantities::CLengthUnit | defaultUnit () |
Default unit for calculations. More... | |
static const physical_quantities::CPressure & | standardISASeaLevelPressure () |
Standard pressure 1013.25mbar/hPa. | |
static void | registerMetadata () |
Register metadata. | |
static int | findMetricAltitude (int feet) |
Search the corresponding feet <-> metric / metric <-> feet. | |
static int | findAltitudeForMetricAltitude (int metric) |
Search the corresponding feet <-> metric / metric <-> feet. | |
![]() | |
static int | compare (const CLength &a, const CLength &b) |
Implementation of compare. | |
static const CLength & | maxValue (const CLength &pq1, const CLength &pq2) |
Maximum of 2 quantities. | |
static const CLength & | minValue (const CLength &pq1, const CLength &pq2) |
Minimum of 2 quantities. | |
static const CLength & | null () |
NULL PQ. | |
static CLength | parsedFromString (const QString &value, CPqString::SeparatorMode mode=CPqString::SeparatorBestGuess) |
Parsed from given string. | |
static CLength | parsedFromString (const QString &value, CPqString::SeparatorMode mode, const CLengthUnit &defaultUnitIfMissing) |
Parsed from given string. | |
![]() | |
static void | registerMetadata () |
Register metadata. | |
![]() | |
static void | registerMetadata () |
Register metadata. | |
![]() | |
static DerivedObj | fromJson (const QJsonObject &json) |
Get object from QJsonObject. | |
static DerivedObj | fromJson (const QString &jsonString, bool acceptCacheJson=false) |
Get object from JSON string. | |
static DerivedObj | fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg) |
Get object from JSON string. | |
Additional Inherited Members | |
![]() | |
CPhysicalQuantity (double value, CLengthUnit unit) | |
Constructor with double. | |
CPhysicalQuantity (const QString &unitString) | |
Constructor by parsed string, e.g. 10m. | |
Altitude as used in aviation, can be AGL or MSL altitude.
Definition at line 39 of file altitude.h.
Altitude type.
Enumerator | |
---|---|
PressureAltitude | Altitude above the standard datum plane. |
TrueAltitude | Height of the airplane above Mean Sea Level (MSL) |
Definition at line 80 of file altitude.h.
Enum type to distinguish between MSL and AGL.
Enumerator | |
---|---|
MeanSeaLevel | MSL. |
AboveGround | AGL. |
FlightLevel | Flight level. |
Definition at line 72 of file altitude.h.
QString swift::misc::aviation::CAltitude::asFpICAOAltitudeString | ( | ) | const |
Altitude string (official version)
Definition at line 340 of file altitude.cpp.
int swift::misc::aviation::CAltitude::compare | ( | const CAltitude & | otherAltitude | ) | const |
Return negative, zero, or positive if a is less than, equal to, or greater than b.
Definition at line 399 of file altitude.cpp.
int swift::misc::aviation::CAltitude::comparePropertyByIndex | ( | CPropertyIndexRef | index, |
const CAltitude & | compareValue | ||
) | const |
Set property by index.
Definition at line 99 of file altitude.cpp.
QString swift::misc::aviation::CAltitude::convertToQString | ( | bool | i18n = false | ) | const |
Cast as QString.
Definition at line 86 of file altitude.cpp.
|
static |
Default unit for calculations.
Definition at line 445 of file altitude.cpp.
|
static |
Info for FP altitude strings.
Definition at line 381 of file altitude.cpp.
|
static |
Checking FP altitude strings like "A20", "FL100".
Definition at line 374 of file altitude.cpp.
bool swift::misc::aviation::CAltitude::isValidFpAltitude | ( | CStatusMessageList * | msgs = nullptr | ) | const |
Is this a valid FP altitude.
Definition at line 290 of file altitude.cpp.
bool swift::misc::aviation::CAltitude::parseFromFpAltitudeString | ( | const QString & | value, |
CStatusMessageList * | msgs = nullptr |
||
) |
Parse from FP altitude string.
Definition at line 188 of file altitude.cpp.
CAltitude swift::misc::aviation::CAltitude::roundedToNearest100ft | ( | bool | roundDown | ) | const |
Round to the nearest 100ft, like needed for China and Russia.
Definition at line 409 of file altitude.cpp.
CIcons::IconIndex swift::misc::aviation::CAltitude::toIcon | ( | ) | const |
As icon, not implemented by all classes.
Definition at line 397 of file altitude.cpp.
Altitude with offset.
Definition at line 61 of file altitude.cpp.