mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #863 Change interpolation setup member to be a method parameter instead.
This commit is contained in:
@@ -162,6 +162,18 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
void CFs9Client::setInterpolationSetup(const CInterpolationAndRenderingSetup &setup)
|
||||
{
|
||||
QWriteLocker lock(&m_interpolationSetupMutex);
|
||||
m_interpolationSetup = setup;
|
||||
}
|
||||
|
||||
CInterpolationAndRenderingSetup CFs9Client::getInterpolationSetup() const
|
||||
{
|
||||
QReadLocker lock(&m_interpolationSetupMutex);
|
||||
return m_interpolationSetup;
|
||||
}
|
||||
|
||||
void CFs9Client::timerEvent(QTimerEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
@@ -172,7 +184,7 @@ namespace BlackSimPlugin
|
||||
IInterpolator::InterpolationStatus status;
|
||||
CInterpolationHints hints; // \fixme 201701 #865 KB if there is an elevation provider for FS9 add it here or set elevation
|
||||
hints.setLoggingInterpolation(this->m_interpolator->getInterpolatorSetup().getLogCallsigns().contains(m_callsign));
|
||||
const CAircraftSituation situation = this->m_interpolator->getInterpolatedSituation(m_callsign, -1, hints, status);
|
||||
const CAircraftSituation situation = this->m_interpolator->getInterpolatedSituation(m_callsign, -1, this->m_interpolationSetup, hints, status);
|
||||
|
||||
// Test only for successful interpolation. FS9 requires constant positions
|
||||
if (!status.didInterpolationSucceed()) { return; }
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include <QMutex>
|
||||
#include <QScopedPointer>
|
||||
#include <QReadWriteLock>
|
||||
|
||||
//! \file
|
||||
|
||||
@@ -49,6 +50,9 @@ namespace BlackSimPlugin
|
||||
//! Set DirectPlay host address
|
||||
void setHostAddress(const QString &hostAddress);
|
||||
|
||||
//! Set interpolation setup
|
||||
//! \threadsafe
|
||||
void setInterpolationSetup(const BlackMisc::Simulation::CInterpolationAndRenderingSetup &setup);
|
||||
|
||||
public slots:
|
||||
//! Send new text message
|
||||
@@ -88,8 +92,12 @@ namespace BlackSimPlugin
|
||||
void sendMultiplayerParamaters();
|
||||
void sendMultiplayerChangePlayerPlane();
|
||||
|
||||
BlackMisc::Simulation::CInterpolationAndRenderingSetup getInterpolationSetup() const;
|
||||
|
||||
BlackMisc::PhysicalQuantities::CTime m_updateInterval;
|
||||
BlackMisc::Simulation::IInterpolator *m_interpolator = nullptr;
|
||||
BlackMisc::Simulation::CInterpolationAndRenderingSetup m_interpolationSetup;
|
||||
mutable QReadWriteLock m_interpolationSetupMutex;
|
||||
QString m_modelName;
|
||||
int m_timerId = 0;
|
||||
|
||||
|
||||
@@ -906,14 +906,16 @@ namespace BlackSimPlugin
|
||||
const bool logInterpolationAndParts = callsignsToLog.contains(callsign);
|
||||
IInterpolator::PartsStatus partsStatus;
|
||||
partsStatus.setSupportsParts(useAircraftParts);
|
||||
const CAircraftParts parts = useAircraftParts ? this->m_interpolator->getInterpolatedParts(callsign, -1, partsStatus, logInterpolationAndParts) : CAircraftParts();
|
||||
|
||||
const CInterpolationAndRenderingSetup setup(getInterpolationAndRenderingSetup());
|
||||
const CAircraftParts parts = useAircraftParts ? this->m_interpolator->getInterpolatedParts(callsign, -1, setup, partsStatus, logInterpolationAndParts) : CAircraftParts();
|
||||
|
||||
// get interpolated situation
|
||||
IInterpolator::InterpolationStatus interpolatorStatus;
|
||||
CInterpolationHints hints(m_hints[simObj.getCallsign()]);
|
||||
hints.setAircraftParts(useAircraftParts ? parts : CAircraftParts(), useAircraftParts);
|
||||
hints.setLoggingInterpolation(logInterpolationAndParts);
|
||||
const CAircraftSituation interpolatedSituation = this->m_interpolator->getInterpolatedSituation(callsign, currentTimestamp, hints, interpolatorStatus);
|
||||
const CAircraftSituation interpolatedSituation = this->m_interpolator->getInterpolatedSituation(callsign, currentTimestamp, setup, hints, interpolatorStatus);
|
||||
|
||||
if (interpolatorStatus.allTrue())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user