mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
refs #863 Change callsign parameter to be a member instead.
This commit is contained in:
@@ -37,14 +37,15 @@ namespace BlackMisc
|
||||
namespace Simulation
|
||||
{
|
||||
template <typename Derived>
|
||||
CInterpolator<Derived>::CInterpolator(const QString &objectName, QObject *parent) :
|
||||
QObject(parent)
|
||||
CInterpolator<Derived>::CInterpolator(const QString &objectName, const BlackMisc::Aviation::CCallsign &callsign, QObject *parent) :
|
||||
QObject(parent),
|
||||
m_callsign(callsign)
|
||||
{
|
||||
this->setObjectName(objectName);
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
CAircraftSituation CInterpolator<Derived>::getInterpolatedSituation(const CCallsign &callsign, qint64 currentTimeMsSinceEpoc,
|
||||
CAircraftSituation CInterpolator<Derived>::getInterpolatedSituation(qint64 currentTimeMsSinceEpoc,
|
||||
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status)
|
||||
{
|
||||
status.reset();
|
||||
@@ -113,7 +114,7 @@ namespace BlackMisc
|
||||
if (hints.isLoggingInterpolation())
|
||||
{
|
||||
log.timestamp = currentTimeMsSinceEpoc;
|
||||
log.callsign = callsign;
|
||||
log.callsign = m_callsign;
|
||||
log.vtolAircraft = hints.isVtolAircraft();
|
||||
log.currentSituation = currentSituation;
|
||||
log.useParts = hints.hasAircraftParts();
|
||||
@@ -173,7 +174,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
CAircraftParts CInterpolator<Derived>::getInterpolatedParts(const CCallsign &callsign, qint64 currentTimeMsSinceEpoch,
|
||||
CAircraftParts CInterpolator<Derived>::getInterpolatedParts(qint64 currentTimeMsSinceEpoch,
|
||||
const CInterpolationAndRenderingSetup &setup, CPartsStatus &partsStatus, bool log)
|
||||
{
|
||||
Q_UNUSED(setup);
|
||||
@@ -227,7 +228,7 @@ namespace BlackMisc
|
||||
if (log)
|
||||
{
|
||||
PartsLog log;
|
||||
log.callsign = callsign;
|
||||
log.callsign = m_callsign;
|
||||
log.timestamp = currentTimeMsSinceEpoch;
|
||||
log.parts = currentParts;
|
||||
CInterpolator::logParts(log);
|
||||
|
||||
@@ -44,13 +44,11 @@ namespace BlackMisc
|
||||
|
||||
//! Current interpolated situation
|
||||
BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
|
||||
const BlackMisc::Aviation::CCallsign &callsign, qint64 currentTimeSinceEpoc,
|
||||
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status);
|
||||
qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status);
|
||||
|
||||
//! Parts before given offset time (aka pending parts)
|
||||
BlackMisc::Aviation::CAircraftParts getInterpolatedParts(
|
||||
const Aviation::CCallsign &callsign, qint64 cutoffTime,
|
||||
const CInterpolationAndRenderingSetup &setup, CPartsStatus &partsStatus, bool log = false);
|
||||
qint64 cutoffTime, const CInterpolationAndRenderingSetup &setup, CPartsStatus &partsStatus, bool log = false);
|
||||
|
||||
//! Add a new aircraft situation
|
||||
void addAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
@@ -81,6 +79,7 @@ namespace BlackMisc
|
||||
protected:
|
||||
BlackMisc::Aviation::CAircraftSituationList m_aircraftSituations; //!< recent situations
|
||||
BlackMisc::Aviation::CAircraftPartsList m_aircraftParts; //!< recent parts
|
||||
BlackMisc::Aviation::CCallsign m_callsign; //!< callsign
|
||||
|
||||
//! Log for interpolation
|
||||
struct InterpolationLog
|
||||
@@ -108,7 +107,7 @@ namespace BlackMisc
|
||||
};
|
||||
|
||||
//! Constructor
|
||||
CInterpolator(const QString &objectName, QObject *parent);
|
||||
CInterpolator(const QString &objectName, const BlackMisc::Aviation::CCallsign &callsign, QObject *parent);
|
||||
|
||||
//! Log current interpolation cycle, only stores in memory, for performance reasons
|
||||
//! \remark const to allow const interpolator functions
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace BlackMisc
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
CInterpolatorLinear(QObject *parent = nullptr) :
|
||||
CInterpolator("CInterpolatorLinear", parent)
|
||||
CInterpolatorLinear(const BlackMisc::Aviation::CCallsign &callsign, QObject *parent = nullptr) :
|
||||
CInterpolator("CInterpolatorLinear", callsign, parent)
|
||||
{}
|
||||
|
||||
//! Linear function that performs the actual interpolation
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace BlackMisc
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
CInterpolatorSpline(QObject *parent = nullptr) :
|
||||
CInterpolator("CInterpolatorSpline", parent)
|
||||
CInterpolatorSpline(const BlackMisc::Aviation::CCallsign &callsign, QObject *parent = nullptr) :
|
||||
CInterpolator("CInterpolatorSpline", callsign, parent)
|
||||
{}
|
||||
|
||||
//! Cubic function that performs the actual interpolation
|
||||
|
||||
Reference in New Issue
Block a user