mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 05:55:33 +08:00
Ref T259, Ref T243 use elevation plane for altitude
general idea: by using the plane class, we can set a elevation and then find a better one * use elevation plane in situation * adjusted depending classes such as hints, lists * using setGroundElevationChecked so elevation can be gradually improved
This commit is contained in:
@@ -89,15 +89,16 @@ namespace BlackMisc
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexRadius:
|
||||
m_radius.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
default:
|
||||
CCoordinateGeodetic::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
case IndexRadius: m_radius.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||
default: CCoordinateGeodetic::setPropertyByIndex(index, variant); break;
|
||||
}
|
||||
}
|
||||
|
||||
int CElevationPlane::comparePropertyByIndex(const CPropertyIndex &index, const CElevationPlane &elevationPlane) const
|
||||
{
|
||||
return this->getAltitude().comparePropertyByIndex(index, elevationPlane.getAltitude());
|
||||
}
|
||||
|
||||
// 100km/h 27,8m/s
|
||||
// 50km/h 13,9m/s
|
||||
// 100kts 51,4m/s
|
||||
@@ -118,5 +119,11 @@ namespace BlackMisc
|
||||
static const CLength l(1000.0, CLengthUnit::m());
|
||||
return l;
|
||||
}
|
||||
|
||||
const CElevationPlane &CElevationPlane::null()
|
||||
{
|
||||
static const CElevationPlane p;
|
||||
return p;
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -12,14 +12,15 @@
|
||||
#ifndef BLACKMISC_GEO_ELEVATIONPLANE_H
|
||||
#define BLACKMISC_GEO_ELEVATIONPLANE_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Geo
|
||||
{
|
||||
//! Plane of same elevation, can be a single point or larger area (e.g. airport)
|
||||
//! \remark 100km/h 1sec => 28m
|
||||
class BLACKMISC_EXPORT CElevationPlane :
|
||||
public CValueObject<CElevationPlane, CCoordinateGeodetic>
|
||||
{
|
||||
@@ -73,6 +74,9 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Compare by index
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CElevationPlane &elevationPlane) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -85,6 +89,9 @@ namespace BlackMisc
|
||||
//! Radius for major airport
|
||||
static const PhysicalQuantities::CLength &majorAirportRadius();
|
||||
|
||||
//! NULL plane
|
||||
static const CElevationPlane &null();
|
||||
|
||||
private:
|
||||
PhysicalQuantities::CLength m_radius { 0, nullptr }; //!< elevation is valid in radius
|
||||
|
||||
|
||||
Reference in New Issue
Block a user