Ref T423, aligned "emulated driver"

* renamed to "updateRemoteAircraft"
* use new force update functions
This commit is contained in:
Klaus Basan
2018-11-06 01:40:44 +01:00
parent 64b0ec87b1
commit a7a1578775
2 changed files with 9 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ namespace BlackSimPlugin
connect(qApp, &QApplication::aboutToQuit, this, &CSimulatorEmulated::closeMonitor); connect(qApp, &QApplication::aboutToQuit, this, &CSimulatorEmulated::closeMonitor);
connect(sGui, &CGuiApplication::aboutToShutdown, this, &CSimulatorEmulated::closeMonitor, Qt::QueuedConnection); connect(sGui, &CGuiApplication::aboutToShutdown, this, &CSimulatorEmulated::closeMonitor, Qt::QueuedConnection);
connect(&m_interpolatorFetchTimer, &QTimer::timeout, this, &CSimulatorEmulated::fetchFromInterpolator); connect(&m_interpolatorFetchTimer, &QTimer::timeout, this, &CSimulatorEmulated::updateRemoteAircraft);
// connect own signals for monitoring // connect own signals for monitoring
this->connectOwnSignals(); this->connectOwnSignals();
@@ -431,16 +431,18 @@ namespace BlackSimPlugin
Qt::QueuedConnection)); Qt::QueuedConnection));
} }
void CSimulatorEmulated::fetchFromInterpolator() void CSimulatorEmulated::updateRemoteAircraft()
{ {
const qint64 now = QDateTime::currentMSecsSinceEpoch(); const qint64 now = QDateTime::currentMSecsSinceEpoch();
const bool updateAllAircraft = this->isUpdateAllRemoteAircraft(now);
int aircraftNumber = 0; int aircraftNumber = 0;
for (const CSimulatedAircraft &aircraft : m_renderedAircraft) for (const CSimulatedAircraft &aircraft : m_renderedAircraft)
{ {
const CCallsign cs = aircraft.getCallsign(); const CCallsign callsign = aircraft.getCallsign();
if (!m_interpolators.contains(cs)) { continue; } if (!m_interpolators.contains(callsign)) { continue; }
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(cs); // threadsafe copy const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupConsolidated(callsign, updateAllAircraft);
CInterpolatorMulti *im = m_interpolators[cs]; CInterpolatorMulti *im = m_interpolators[callsign];
Q_ASSERT_X(im, Q_FUNC_INFO, "interpolator missing"); Q_ASSERT_X(im, Q_FUNC_INFO, "interpolator missing");
const CInterpolationResult result = im->getInterpolation(now, setup, aircraftNumber++); const CInterpolationResult result = im->getInterpolation(now, setup, aircraftNumber++);
const CAircraftSituation s = result; const CAircraftSituation s = result;

View File

@@ -152,7 +152,7 @@ namespace BlackSimPlugin
//! Fetch data from interpolator //! Fetch data from interpolator
//! \remarks basically does the same as a real driver, obtains data from the interpolator //! \remarks basically does the same as a real driver, obtains data from the interpolator
void fetchFromInterpolator(); void updateRemoteAircraft();
bool m_log = false; //!< from settings bool m_log = false; //!< from settings
bool m_paused = false; bool m_paused = false;