mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Ref T259, Ref T243 use "getInterpolatedOrGuessedParts" in XPlane
This commit is contained in:
committed by
Roland Winklmeier
parent
1ff0607e42
commit
94a334ad75
@@ -693,17 +693,16 @@ namespace BlackSimPlugin
|
||||
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "missing callsign");
|
||||
|
||||
// setup
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign);
|
||||
const bool useAircraftParts = aircraftWithParts.contains(callsign) && setup.isAircraftPartsEnabled();
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupConsolidated(callsign);
|
||||
const bool logInterpolationAndParts = setup.logInterpolation();
|
||||
CPartsStatus partsStatus(useAircraftParts);
|
||||
|
||||
// interpolated situation
|
||||
CInterpolationStatus interpolatorStatus;
|
||||
const CAircraftSituation interpolatedSituation = xplaneAircraft.getInterpolatedSituation(currentTimestamp, setup, interpolatorStatus);
|
||||
|
||||
// perts
|
||||
const CAircraftParts parts = useAircraftParts ? xplaneAircraft.getInterpolatedParts(currentTimestamp, setup, partsStatus, logInterpolationAndParts) : CAircraftParts::guessedParts(interpolatedSituation, xplaneAircraft.isVtol(), xplaneAircraft.getEngineCount());
|
||||
CPartsStatus partsStatus;
|
||||
const CAircraftParts parts = xplaneAircraft.getInterpolatedOrGuessedParts(currentTimestamp, setup, partsStatus, logInterpolationAndParts);
|
||||
|
||||
if (interpolatorStatus.hasValidSituation())
|
||||
{
|
||||
@@ -727,10 +726,7 @@ namespace BlackSimPlugin
|
||||
<< interpolatorStatus.toQString();
|
||||
}
|
||||
|
||||
if (useAircraftParts)
|
||||
{
|
||||
this->updateRemoteAircraftParts(xplaneAircraft, parts, partsStatus);
|
||||
}
|
||||
this->updateRemoteAircraftParts(xplaneAircraft, parts, partsStatus);
|
||||
} // all callsigns
|
||||
|
||||
const qint64 dt = QDateTime::currentMSecsSinceEpoch() - currentTimestamp;
|
||||
|
||||
@@ -78,6 +78,15 @@ namespace BlackSimPlugin
|
||||
return m_interpolator->getInterpolatedParts(currentTimeSinceEpoc, setup, partsStatus, log);
|
||||
}
|
||||
|
||||
CAircraftParts CXPlaneMPAircraft::getInterpolatedOrGuessedParts(
|
||||
qint64 currentTimeSinceEpoc,
|
||||
const CInterpolationAndRenderingSetupPerCallsign &setup,
|
||||
CPartsStatus &partsStatus, bool log) const
|
||||
{
|
||||
Q_ASSERT(m_interpolator);
|
||||
return m_interpolator->getInterpolatedOrGuessedParts(currentTimeSinceEpoc, setup, partsStatus, log);
|
||||
}
|
||||
|
||||
CCallsignSet CXPlaneMPAircraftObjects::getAllCallsigns() const
|
||||
{
|
||||
return CCallsignSet(this->keys());
|
||||
|
||||
@@ -94,6 +94,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;
|
||||
|
||||
//! Interpolator
|
||||
BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() const { return m_interpolator.data(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user