mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T260, ext. version of updating ground elevation, allows to guess gnd. again with updated elevation
This commit is contained in:
committed by
Roland Winklmeier
parent
075ffa8ccb
commit
d0addd547a
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user