mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +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(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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user