mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T268, compare for CAltitude
This commit is contained in:
@@ -8,11 +8,12 @@
|
||||
*/
|
||||
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/iconlist.h"
|
||||
#include "blackmisc/icons.h"
|
||||
#include "blackmisc/pq/measurementunit.h"
|
||||
#include "blackmisc/pq/constants.h"
|
||||
#include "blackmisc/pq/pqstring.h"
|
||||
#include "blackmisc/comparefunctions.h"
|
||||
#include "blackmisc/iconlist.h"
|
||||
#include "blackmisc/icons.h"
|
||||
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
@@ -337,6 +338,15 @@ namespace BlackMisc
|
||||
return BlackMisc::CIcon::iconByIndex(CIcons::GeoPosition);
|
||||
}
|
||||
|
||||
int CAltitude::compare(const CAltitude &otherAltitude) const
|
||||
{
|
||||
if (this->getReferenceDatum() != otherAltitude.getReferenceDatum())
|
||||
{
|
||||
return Compare::compare(static_cast<int>(this->getReferenceDatum()), static_cast<int>(otherAltitude.getReferenceDatum()));
|
||||
}
|
||||
return CLength::compare(*this, otherAltitude);
|
||||
}
|
||||
|
||||
const CAltitude &CAltitude::null()
|
||||
{
|
||||
static const CAltitude null(0, CAltitude::MeanSeaLevel, CLengthUnit::nullUnit());
|
||||
|
||||
@@ -67,9 +67,9 @@ namespace BlackMisc
|
||||
*/
|
||||
enum ReferenceDatum
|
||||
{
|
||||
MeanSeaLevel = 0, //!< MSL
|
||||
AboveGround, //!< AGL
|
||||
FlightLevel //!< Flight level
|
||||
MeanSeaLevel = 0, //!< MSL
|
||||
AboveGround, //!< AGL
|
||||
FlightLevel //!< Flight level
|
||||
};
|
||||
|
||||
//! Altitude type
|
||||
@@ -185,6 +185,9 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon
|
||||
BlackMisc::CIcon toIcon() const;
|
||||
|
||||
//! \copydoc PhysicalQuantities::CPhysicalQuantity::compare
|
||||
int compare(const CAltitude &otherAltitude) const;
|
||||
|
||||
//! Null altitude (MSL)
|
||||
static const CAltitude &null();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user