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

@@ -172,14 +172,13 @@ namespace BlackSimPlugin
Q_UNUSED(event);
if (m_clientStatus == Disconnected) { return; }
CInterpolationStatus status;
CInterpolationAndRenderingSetupPerCallsign setup = this->simulator()->getInterpolationSetupPerCallsignOrDefault(m_callsign);
const CAircraftSituation situation = m_interpolator.getInterpolatedSituation(-1, setup, status);
const CInterpolationAndRenderingSetupPerCallsign setup = this->simulator()->getInterpolationSetupConsolidated(m_callsign);
const CInterpolationResult result = m_interpolator.getInterpolation(QDateTime::currentMSecsSinceEpoch(), setup);
// Test only for successful position. FS9 requires constant positions
if (!status.hasValidSituation()) { return; }
if (!result.getInterpolationStatus().hasValidSituation()) { return; }
sendMultiplayerPosition(situation);
sendMultiplayerPosition(result);
sendMultiplayerParamaters();
}