Ref T259, Ref T243 added functions to use guessed parts in

* sim object
* XPlane aircraft
* forward aircraft model to interpolator for guessing
This commit is contained in:
Klaus Basan
2018-04-06 00:34:14 +02:00
committed by Roland Winklmeier
parent e3d17859a0
commit f1faeef84a
6 changed files with 36 additions and 29 deletions

View File

@@ -24,11 +24,13 @@ namespace BlackSimPlugin
CSimConnectObject::CSimConnectObject(const CSimulatedAircraft &aircraft,
DWORD requestId,
ISimulationEnvironmentProvider *p1, IInterpolationSetupProvider *p2, IRemoteAircraftProvider *p3,
ISimulationEnvironmentProvider *simEnvProvider, IInterpolationSetupProvider *setupProvider, IRemoteAircraftProvider *remoteAircraftProvider,
CInterpolationLogger *logger) :
m_aircraft(aircraft), m_requestId(requestId), m_validRequestId(true),
m_interpolator(QSharedPointer<CInterpolatorMulti>::create(aircraft.getCallsign(), p1, p2, p3, logger))
{ }
m_interpolator(QSharedPointer<CInterpolatorMulti>::create(aircraft.getCallsign(), simEnvProvider, setupProvider, remoteAircraftProvider, logger))
{
m_interpolator->initCorrespondingModel(aircraft.getModel());
}
void CSimConnectObject::invalidatePartsAsSent()
{
@@ -146,6 +148,15 @@ namespace BlackSimPlugin
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);
}
const CAircraftSituation &CSimConnectObject::getLastInterpolatedSituation() const
{
if (!m_interpolator) { return CAircraftSituation::null(); }

View File

@@ -32,7 +32,8 @@ namespace BlackSimPlugin
//! Constructor providing initial situation/parts
CSimConnectObject(const BlackMisc::Simulation::CSimulatedAircraft &aircraft,
DWORD requestId,
BlackMisc::Simulation::ISimulationEnvironmentProvider *p1, BlackMisc::Simulation::IInterpolationSetupProvider *p2, BlackMisc::Simulation::IRemoteAircraftProvider *p3,
BlackMisc::Simulation::ISimulationEnvironmentProvider *simEnvProvider, BlackMisc::Simulation::IInterpolationSetupProvider *setupProvider,
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
BlackMisc::Simulation::CInterpolationLogger *logger);
//! Destructor
@@ -134,6 +135,9 @@ namespace BlackSimPlugin
//! VTOL?
bool isVtol() const { return m_aircraft.isVtol(); }
//! Engine count
int getEngineCount() const { return m_aircraft.getEnginesCount(); }
//! Was the object really added to simulator
bool hasValidRequestAndObjectId() const;
@@ -161,6 +165,12 @@ namespace BlackSimPlugin
const BlackMisc::Simulation::CInterpolationAndRenderingSetupPerCallsign &setup,
BlackMisc::Simulation::CPartsStatus &partsStatus, bool log) const;
//! \copydoc BlackMisc::Simulation::CInterpolator::getInterpolatedOrGuessedParts
BlackMisc::Aviation::CAircraftParts getInterpolatedOrGuessedParts(
qint64 currentTimeSinceEpoc,
const BlackMisc::Simulation::CInterpolationAndRenderingSetupPerCallsign &setup,
BlackMisc::Simulation::CPartsStatus &partsStatus, bool log) const;
//! Last interpolated situation
const BlackMisc::Aviation::CAircraftSituation &getLastInterpolatedSituation() const;