mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +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");
|
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "missing callsign");
|
||||||
|
|
||||||
// setup
|
// setup
|
||||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign);
|
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupConsolidated(callsign);
|
||||||
const bool useAircraftParts = aircraftWithParts.contains(callsign) && setup.isAircraftPartsEnabled();
|
|
||||||
const bool logInterpolationAndParts = setup.logInterpolation();
|
const bool logInterpolationAndParts = setup.logInterpolation();
|
||||||
CPartsStatus partsStatus(useAircraftParts);
|
|
||||||
|
|
||||||
// interpolated situation
|
// interpolated situation
|
||||||
CInterpolationStatus interpolatorStatus;
|
CInterpolationStatus interpolatorStatus;
|
||||||
const CAircraftSituation interpolatedSituation = xplaneAircraft.getInterpolatedSituation(currentTimestamp, setup, interpolatorStatus);
|
const CAircraftSituation interpolatedSituation = xplaneAircraft.getInterpolatedSituation(currentTimestamp, setup, interpolatorStatus);
|
||||||
|
|
||||||
// perts
|
// 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())
|
if (interpolatorStatus.hasValidSituation())
|
||||||
{
|
{
|
||||||
@@ -727,10 +726,7 @@ namespace BlackSimPlugin
|
|||||||
<< interpolatorStatus.toQString();
|
<< interpolatorStatus.toQString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useAircraftParts)
|
this->updateRemoteAircraftParts(xplaneAircraft, parts, partsStatus);
|
||||||
{
|
|
||||||
this->updateRemoteAircraftParts(xplaneAircraft, parts, partsStatus);
|
|
||||||
}
|
|
||||||
} // all callsigns
|
} // all callsigns
|
||||||
|
|
||||||
const qint64 dt = QDateTime::currentMSecsSinceEpoch() - currentTimestamp;
|
const qint64 dt = QDateTime::currentMSecsSinceEpoch() - currentTimestamp;
|
||||||
|
|||||||
@@ -78,6 +78,15 @@ namespace BlackSimPlugin
|
|||||||
return m_interpolator->getInterpolatedParts(currentTimeSinceEpoc, setup, partsStatus, log);
|
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
|
CCallsignSet CXPlaneMPAircraftObjects::getAllCallsigns() const
|
||||||
{
|
{
|
||||||
return CCallsignSet(this->keys());
|
return CCallsignSet(this->keys());
|
||||||
|
|||||||
@@ -94,6 +94,12 @@ namespace BlackSimPlugin
|
|||||||
const BlackMisc::Simulation::CInterpolationAndRenderingSetupPerCallsign &setup,
|
const BlackMisc::Simulation::CInterpolationAndRenderingSetupPerCallsign &setup,
|
||||||
BlackMisc::Simulation::CPartsStatus &partsStatus, bool log) const;
|
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
|
//! Interpolator
|
||||||
BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() const { return m_interpolator.data(); }
|
BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() const { return m_interpolator.data(); }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user