mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
[PQ] implemented "comparePropertyByIndex" for CAltitude for correct sorting
Bug report: https://discordapp.com/channels/539048679160676382/594962359441948682/651162172717662239
This commit is contained in:
committed by
Mat Sutcliffe
parent
e1498adc8e
commit
fc9bb1277d
@@ -118,6 +118,12 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
int CAltitude::comparePropertyByIndex(const CPropertyIndex &index, const CAltitude &compareValue) const
|
||||
{
|
||||
if (index.isMyself()) { return this->compare(compareValue); }
|
||||
return CLength::comparePropertyByIndex(index, compareValue);
|
||||
}
|
||||
|
||||
bool CAltitude::toFlightLevel()
|
||||
{
|
||||
if (m_datum != MeanSeaLevel && m_datum != FlightLevel) { return false; }
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace BlackMisc
|
||||
public PhysicalQuantities::CLength,
|
||||
public Mixin::MetaType<CAltitude>,
|
||||
public Mixin::EqualsByMetaClass<CAltitude>,
|
||||
public Mixin::CompareByMetaClass<CAltitude>,
|
||||
// public Mixin::CompareByMetaClass<CAltitude>,
|
||||
public Mixin::HashByMetaClass<CAltitude>,
|
||||
public Mixin::DBusByMetaClass<CAltitude>,
|
||||
public Mixin::DBusByMetaClass<CAltitude, LosslessTag>,
|
||||
@@ -88,9 +88,6 @@ namespace BlackMisc
|
||||
TrueAltitude //!< Height of the airplane above Mean Sea Level (MSL)
|
||||
};
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! Default constructor: 0m Altitude MSL
|
||||
CAltitude() : CLength(0, PhysicalQuantities::CLengthUnit::m()), m_datum(MeanSeaLevel) {}
|
||||
|
||||
@@ -197,6 +194,12 @@ namespace BlackMisc
|
||||
//! \copydoc PhysicalQuantities::CPhysicalQuantity::compare
|
||||
int compare(const CAltitude &otherAltitude) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! \copydoc Mixin::Index::setPropertyByIndex
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CAltitude &compareValue) const;
|
||||
|
||||
//! Round to the nearest 100ft, like needed for China and Russia
|
||||
//! \remark https://en.wikipedia.org/wiki/Flight_level
|
||||
CAltitude roundedToNearest100ft(bool roundDown) const;
|
||||
|
||||
Reference in New Issue
Block a user