Ref T259, Ref T243 situation detects under and overflow

* details about altitude correction AltitudeCorrection
* function to correct altitude by detecting under/overflow
This commit is contained in:
Klaus Basan
2018-03-30 03:09:19 +02:00
parent 852abf1232
commit 63e5f75a1d
2 changed files with 79 additions and 12 deletions

View File

@@ -93,6 +93,17 @@ namespace BlackMisc
OutOnGroundOwnAircraft //!< sending on ground
};
//! How was altitude corrected
enum AltitudeCorrection
{
NoCorrection,
Underflow,
DraggedToGround,
AGL,
NoElevation,
UnknownCorrection
};
//! Default constructor.
CAircraftSituation();
@@ -248,7 +259,10 @@ namespace BlackMisc
//! Get altitude under consideration of ground elevation and ground flag
//! \remark with dragToGround it will also compensate overflows, otherwise ony underflow
CAltitude getCorrectedAltitude(const PhysicalQuantities::CLength &centerOfGravity = PhysicalQuantities::CLength::null(), bool dragToGround = true, bool *corrected = nullptr) const;
CAltitude getCorrectedAltitude(const PhysicalQuantities::CLength &centerOfGravity = PhysicalQuantities::CLength::null(), bool enableDragToGround = true, AltitudeCorrection *correctetion = nullptr) const;
//! Set the corrected altitude from CAircraftSituation::getCorrectedAltitude
AltitudeCorrection correctAltitude(const PhysicalQuantities::CLength &centerOfGravity = PhysicalQuantities::CLength::null(), bool enableDragToGround = true);
//! Set altitude
void setAltitude(const CAltitude &altitude) { m_position.setGeodeticHeight(altitude); }
@@ -324,6 +338,9 @@ namespace BlackMisc
//! Enum to string
static const QString &onGroundDetailsToString(OnGroundDetails reliability);
//! Enum to string
static const QString &altitudeCorrectionToString(AltitudeCorrection correction);
//! Delta distance, near to ground
static const PhysicalQuantities::CLength &deltaNearGround();