mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Ref T423, aligned "emulated driver"
* renamed to "updateRemoteAircraft" * use new force update functions
This commit is contained in:
@@ -48,7 +48,7 @@ namespace BlackSimPlugin
|
||||
|
||||
connect(qApp, &QApplication::aboutToQuit, this, &CSimulatorEmulated::closeMonitor);
|
||||
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
|
||||
this->connectOwnSignals();
|
||||
@@ -431,16 +431,18 @@ namespace BlackSimPlugin
|
||||
Qt::QueuedConnection));
|
||||
}
|
||||
|
||||
void CSimulatorEmulated::fetchFromInterpolator()
|
||||
void CSimulatorEmulated::updateRemoteAircraft()
|
||||
{
|
||||
const qint64 now = QDateTime::currentMSecsSinceEpoch();
|
||||
const bool updateAllAircraft = this->isUpdateAllRemoteAircraft(now);
|
||||
int aircraftNumber = 0;
|
||||
|
||||
for (const CSimulatedAircraft &aircraft : m_renderedAircraft)
|
||||
{
|
||||
const CCallsign cs = aircraft.getCallsign();
|
||||
if (!m_interpolators.contains(cs)) { continue; }
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(cs); // threadsafe copy
|
||||
CInterpolatorMulti *im = m_interpolators[cs];
|
||||
const CCallsign callsign = aircraft.getCallsign();
|
||||
if (!m_interpolators.contains(callsign)) { continue; }
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupConsolidated(callsign, updateAllAircraft);
|
||||
CInterpolatorMulti *im = m_interpolators[callsign];
|
||||
Q_ASSERT_X(im, Q_FUNC_INFO, "interpolator missing");
|
||||
const CInterpolationResult result = im->getInterpolation(now, setup, aircraftNumber++);
|
||||
const CAircraftSituation s = result;
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace BlackSimPlugin
|
||||
|
||||
//! Fetch data from 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_paused = false;
|
||||
|
||||
Reference in New Issue
Block a user