mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Implement interpolator mode for FS9
Summary: This implementation will always return true if we were setting the mode, since we cannot easily access the return value from CInterpolatorMulti::setMode in a thread safe manner. Reviewers: #swift_pilot_client, kbasan, msutcliffe Reviewed By: #swift_pilot_client, kbasan, msutcliffe Subscribers: kbasan, jenkins Differential Revision: https://dev.swift-project.org/D52
This commit is contained in:
committed by
Mathew Sutcliffe
parent
09da34d8f0
commit
27f97e8ac8
@@ -11,7 +11,7 @@
|
||||
#define DIRECTPLAY_CLIENT_H
|
||||
|
||||
#include "directplaypeer.h"
|
||||
#include "blackmisc/simulation/interpolatorlinear.h"
|
||||
#include "blackmisc/simulation/interpolatormulti.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/pq/time.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
@@ -51,7 +51,7 @@ namespace BlackSimPlugin
|
||||
void setHostAddress(const QString &hostAddress);
|
||||
|
||||
//! Get interpolator
|
||||
BlackMisc::Simulation::CInterpolatorLinear *getInterpolator() { return &m_interpolator; }
|
||||
BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() { return &m_interpolator; }
|
||||
|
||||
//! Set interpolation setup
|
||||
//! \threadsafe
|
||||
@@ -94,7 +94,7 @@ namespace BlackSimPlugin
|
||||
BlackMisc::Simulation::CInterpolationAndRenderingSetup getInterpolationSetup() const;
|
||||
|
||||
BlackMisc::PhysicalQuantities::CTime m_updateInterval;
|
||||
BlackMisc::Simulation::CInterpolatorLinear m_interpolator;
|
||||
BlackMisc::Simulation::CInterpolatorMulti m_interpolator;
|
||||
BlackMisc::Simulation::CInterpolationAndRenderingSetup m_interpolationSetup;
|
||||
mutable QReadWriteLock m_interpolationSetupMutex;
|
||||
QString m_modelName;
|
||||
|
||||
@@ -305,10 +305,12 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimulatorFs9::setInterpolatorMode(CInterpolatorMulti::Mode mode, const CCallsign &callsign)
|
||||
{
|
||||
//! \todo (added by KWB 3/17) interpolator mode for FS9 needs implementation
|
||||
Q_UNUSED(mode);
|
||||
Q_UNUSED(callsign);
|
||||
return false;
|
||||
const auto it = m_hashFs9Clients.find(callsign);
|
||||
if (it == m_hashFs9Clients.end()) { return false; }
|
||||
QTimer::singleShot(0, it->data(), [client = *it, mode] { client->getInterpolator()->setMode(mode); });
|
||||
// Always return true if we were setting the mode, since we cannot easily access the return value from
|
||||
// CInterpolatorMulti::setMode in a thread safe manner.
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CSimulatorFs9::isPhysicallyRenderedAircraft(const CCallsign &callsign) const
|
||||
|
||||
Reference in New Issue
Block a user