refs #865, allow to override in setGroundElevationFromHint

This commit is contained in:
Klaus Basan
2017-01-29 00:06:06 +01:00
committed by Mathew Sutcliffe
parent 085f25fa86
commit bc3bd41c97
2 changed files with 4 additions and 4 deletions

View File

@@ -321,9 +321,9 @@ namespace BlackMisc
this->m_interpolationLogs.clear(); this->m_interpolationLogs.clear();
} }
void IInterpolator::setGroundElevationFromHint(const CInterpolationHints &hints, CAircraftSituation &situation) void IInterpolator::setGroundElevationFromHint(const CInterpolationHints &hints, CAircraftSituation &situation, bool override)
{ {
if (situation.hasGroundElevation()) { return; } if (!override && situation.hasGroundElevation()) { return; }
const CAltitude elevation = hints.getGroundElevation(situation); const CAltitude elevation = hints.getGroundElevation(situation);
if (elevation.isNull()) { return; } if (elevation.isNull()) { return; }
situation.setGroundElevation(elevation); situation.setGroundElevation(elevation);

View File

@@ -193,8 +193,8 @@ namespace BlackMisc
//! \threadsafe //! \threadsafe
static QString getHtmlPartsLog(const QList<PartsLog> &logs); static QString getHtmlPartsLog(const QList<PartsLog> &logs);
//! Set the ground elevation from hints, if possible and not already set //! Set the ground elevation from hints
static void setGroundElevationFromHint(const CInterpolationHints &hints, BlackMisc::Aviation::CAircraftSituation &situation); static void setGroundElevationFromHint(const CInterpolationHints &hints, BlackMisc::Aviation::CAircraftSituation &situation, bool override = true);
//! Set on ground flag //! Set on ground flag
static void setGroundFlagFromInterpolator(const CInterpolationHints &hints, double groundFactor, BlackMisc::Aviation::CAircraftSituation &situation); static void setGroundFlagFromInterpolator(const CInterpolationHints &hints, double groundFactor, BlackMisc::Aviation::CAircraftSituation &situation);