Ref T260, ext. version of updating ground elevation, allows to guess gnd. again with updated elevation

This commit is contained in:
Klaus Basan
2018-04-18 05:05:21 +02:00
committed by Roland Winklmeier
parent 075ffa8ccb
commit d0addd547a
4 changed files with 35 additions and 8 deletions

View File

@@ -14,6 +14,7 @@
#include "blackmisc/verify.h"
using namespace BlackMisc::Aviation;
using namespace BlackMisc::PhysicalQuantities;
using namespace BlackMisc::Geo;
using namespace BlackMisc::Json;
@@ -355,6 +356,11 @@ namespace BlackMisc
}
int CRemoteAircraftProvider::updateAircraftGroundElevation(const CCallsign &callsign, const CElevationPlane &elevation)
{
return this->updateAircraftGroundElevationExt(callsign, elevation, false, CLength::null(), false);
}
int CRemoteAircraftProvider::updateAircraftGroundElevationExt(const CCallsign &callsign, const CElevationPlane &elevation, bool isVtol, const CLength &cg, bool autoGuessGnd)
{
if (!this->isAircraftInRange(callsign)) { return 0; }
@@ -363,7 +369,10 @@ namespace BlackMisc
int updated = 0;
{
QWriteLocker l(&m_lockSituations);
updated = m_situationsByCallsign[callsign].setGroundElevationChecked(elevation);
CAircraftSituationList situations = m_situationsByCallsign[callsign];
updated = autoGuessGnd ?
situations.setGroundElevationCheckedAndGuessGround(elevation, isVtol, cg) :
situations.setGroundElevationChecked(elevation);
if (updated < 1) { return 0; }
m_situationsLastModified[callsign] = ts;
}

View File

@@ -356,6 +356,10 @@ namespace BlackMisc
//! \threadsafe
void storeAircraftSituation(const Aviation::CAircraftSituation &situation);
//! An extended of IRemoteAircraftProvider::updateAircraftGroundElevation version which allows also guessing of ground
//! \sa IRemoteAircraftProvider::updateAircraftGroundElevation
int updateAircraftGroundElevationExt(const Aviation::CCallsign &callsign, const Geo::CElevationPlane &elevation, bool isVtol, const PhysicalQuantities::CLength &cg, bool autoGuessGnd);
//! Store an aircraft part
//! \remark latest parts are kept first
//! \threadsafe