From 017e9402fde98d986d670c676bc31a63347b54f2 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 11 Jun 2019 00:37:45 +0200 Subject: [PATCH] Ref T681, use simulator or DB CG as in settings --- src/blackcore/airspacemonitor.cpp | 2 +- src/blackmisc/simulation/interpolator.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index b98061870..8ef16c6e9 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -1193,7 +1193,7 @@ namespace BlackCore } // CG from provider - const CLength cg = this->getSimulatorCG(callsign); // always x-check against simulator to override guessed values and reflect changed CGs + const CLength cg = this->getSimulatorOrDbCG(callsign, this->getCGFromDB(callsign)); // always x-check against simulator to override guessed values and reflect changed CGs if (!cg.isNull()) { correctedSituation.setCG(cg); } // store corrected situation diff --git a/src/blackmisc/simulation/interpolator.cpp b/src/blackmisc/simulation/interpolator.cpp index 1e485a3e2..db99d3858 100644 --- a/src/blackmisc/simulation/interpolator.cpp +++ b/src/blackmisc/simulation/interpolator.cpp @@ -58,7 +58,8 @@ namespace BlackMisc template CLength CInterpolator::getAndFetchModelCG() { - const CLength cg = this->getSimulatorCG(m_callsign); // simulation environment + const CLength cgDB = this->getRemoteAircraftProvider() ? this->getRemoteAircraftProvider()->getCGFromDB(m_callsign) : CLength::null(); + const CLength cg = this->getSimulatorOrDbCG(m_callsign, cgDB); // simulation environment m_model.setCG(cg); m_model.setCallsign(m_callsign); return cg;