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:
Klaus Basan
2018-03-07 01:53:10 +01:00
parent 0c877e1575
commit 83b6578e69
16 changed files with 307 additions and 110 deletions

View File

@@ -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

View File

@@ -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