mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Ref T270, interpolator optimization by passing aircraft number
Rational: Except for FS9 we interpolate all aircraft in one loop at the same time. This can cause that some steps are always done at the same time for all aircraft of that loop. By passing the number we can more equally distribute such tasks, avoiding peaks.
This commit is contained in:
@@ -711,6 +711,7 @@ namespace BlackSimPlugin
|
||||
PlanesPositions planesPositions;
|
||||
PlanesSurfaces planesSurfaces;
|
||||
|
||||
int aircraftNumber = 0;
|
||||
for (const CXPlaneMPAircraft &xplaneAircraft : xplaneAircraftList)
|
||||
{
|
||||
const CCallsign callsign(xplaneAircraft.getCallsign());
|
||||
@@ -720,7 +721,7 @@ namespace BlackSimPlugin
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupConsolidated(callsign);
|
||||
|
||||
// interpolated situation/parts
|
||||
const CInterpolationResult result = xplaneAircraft.getInterpolation(currentTimestamp, setup);
|
||||
const CInterpolationResult result = xplaneAircraft.getInterpolation(currentTimestamp, setup, aircraftNumber++);
|
||||
if (result.getInterpolationStatus().hasValidSituation())
|
||||
{
|
||||
const CAircraftSituation interpolatedSituation(result);
|
||||
@@ -767,7 +768,7 @@ namespace BlackSimPlugin
|
||||
|
||||
} // all callsigns
|
||||
|
||||
if (! planesPositions.isEmpty())
|
||||
if (!planesPositions.isEmpty())
|
||||
{
|
||||
m_trafficProxy->setPlanesPositions(planesPositions);
|
||||
}
|
||||
|
||||
@@ -48,10 +48,10 @@ namespace BlackSimPlugin
|
||||
return m_interpolator->attachLogger(logger);
|
||||
}
|
||||
|
||||
CInterpolationResult CXPlaneMPAircraft::getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup) const
|
||||
CInterpolationResult CXPlaneMPAircraft::getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, int aircraftNumber) const
|
||||
{
|
||||
Q_ASSERT(m_interpolator);
|
||||
return m_interpolator->getInterpolation(currentTimeSinceEpoc, setup);
|
||||
return m_interpolator->getInterpolation(currentTimeSinceEpoc, setup, aircraftNumber);
|
||||
}
|
||||
|
||||
CCallsignSet CXPlaneMPAircraftObjects::getAllCallsigns() const
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace BlackSimPlugin
|
||||
void setSituationAsSent(const BlackMisc::Aviation::CAircraftSituation &position) { m_situationAsSent = position; }
|
||||
|
||||
//! Same as sent
|
||||
//! \deprecated KB T273
|
||||
bool isSameAsSent(const BlackMisc::Aviation::CAircraftSituation &position) const;
|
||||
|
||||
//! VTOL?
|
||||
@@ -77,7 +78,7 @@ namespace BlackSimPlugin
|
||||
void attachInterpolatorLogger(BlackMisc::Simulation::CInterpolationLogger *logger) const;
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::CInterpolator::getInterpolation
|
||||
BlackMisc::Simulation::CInterpolationResult getInterpolation(qint64 currentTimeSinceEpoc, const BlackMisc::Simulation::CInterpolationAndRenderingSetupPerCallsign &setup) const;
|
||||
BlackMisc::Simulation::CInterpolationResult getInterpolation(qint64 currentTimeSinceEpoc, const BlackMisc::Simulation::CInterpolationAndRenderingSetupPerCallsign &setup, int aircraftNumber) const;
|
||||
|
||||
//! Interpolator
|
||||
BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() const { return m_interpolator.data(); }
|
||||
|
||||
Reference in New Issue
Block a user