Ref T261, further unify interpolator handling

* return interpolation results parts/situation in one step
* base class init for each interpolation step, less redundant code
* removed old interpolation/parts function
* adjusted unit tests and simulator objects (such as SimObject)
This commit is contained in:
Klaus Basan
2018-05-06 03:54:11 +02:00
committed by Roland Winklmeier
parent bac3d14d50
commit 0808cdb223
21 changed files with 422 additions and 438 deletions

View File

@@ -413,13 +413,11 @@ namespace BlackSimPlugin
const CCallsign cs = aircraft.getCallsign();
if (!m_interpolators.contains(cs)) { continue; }
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(cs); // threadsafe copy
const bool log = setup.logInterpolation();
CInterpolatorMulti *im = m_interpolators[cs];
CInterpolationStatus statusInterpolation;
CPartsStatus statusParts;
Q_ASSERT_X(im, Q_FUNC_INFO, "interpolator missing");
const CAircraftSituation s = im->getInterpolatedSituation(now, setup, statusInterpolation);
const CAircraftParts p = im->getInterpolatedOrGuessedParts(now, setup, statusParts, log);
CInterpolationResult result = im->getInterpolation(now, setup);
const CAircraftSituation s = result;
const CAircraftParts p = result;
m_countInterpolatedParts++;
m_countInterpolatedSituations++;
Q_UNUSED(s);