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

@@ -112,37 +112,16 @@ namespace BlackSimPlugin
return m_interpolator->getInterpolatorInfo(mode);
}
void CSimConnectObject::attachInterpolatorLogger(CInterpolationLogger *logger)
void CSimConnectObject::attachInterpolatorLogger(CInterpolationLogger *logger) const
{
Q_ASSERT(m_interpolator);
return m_interpolator->attachLogger(logger);
}
CAircraftSituation CSimConnectObject::getInterpolatedSituation(
qint64 currentTimeSinceEpoc,
const CInterpolationAndRenderingSetupPerCallsign &setup,
CInterpolationStatus &status) const
CInterpolationResult CSimConnectObject::getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup) const
{
Q_ASSERT(m_interpolator);
return m_interpolator->getInterpolatedSituation(currentTimeSinceEpoc, setup, status);
}
CAircraftParts CSimConnectObject::getInterpolatedParts(
qint64 currentTimeSinceEpoc,
const CInterpolationAndRenderingSetupPerCallsign &setup,
CPartsStatus &partsStatus, bool log) const
{
Q_ASSERT(m_interpolator);
return m_interpolator->getInterpolatedParts(currentTimeSinceEpoc, setup, partsStatus, log);
}
CAircraftParts CSimConnectObject::getInterpolatedOrGuessedParts(
qint64 currentTimeSinceEpoc,
const CInterpolationAndRenderingSetupPerCallsign &setup,
CPartsStatus &partsStatus, bool log) const
{
Q_ASSERT(m_interpolator);
return m_interpolator->getInterpolatedOrGuessedParts(currentTimeSinceEpoc, setup, partsStatus, log);
if (!m_interpolator) { CInterpolationResult result; result.reset(); return result; }
return m_interpolator->getInterpolation(currentTimeSinceEpoc, setup);
}
const CAircraftSituation &CSimConnectObject::getLastInterpolatedSituation(CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const