mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #863 Moved nested status classes to namespace scope.
This commit is contained in:
@@ -35,7 +35,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
BlackMisc::Aviation::CAircraftSituation IInterpolator::getInterpolatedSituation(
|
BlackMisc::Aviation::CAircraftSituation IInterpolator::getInterpolatedSituation(
|
||||||
qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetup &setup,
|
qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetup &setup,
|
||||||
const CInterpolationHints &hints, InterpolationStatus &status) const
|
const CInterpolationHints &hints, CInterpolationStatus &status) const
|
||||||
{
|
{
|
||||||
status.reset();
|
status.reset();
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
CAircraftParts IInterpolator::getInterpolatedParts(const CCallsign &callsign, const CAircraftPartsList &parts, qint64 currentTimeMsSinceEpoch,
|
CAircraftParts IInterpolator::getInterpolatedParts(const CCallsign &callsign, const CAircraftPartsList &parts, qint64 currentTimeMsSinceEpoch,
|
||||||
const CInterpolationAndRenderingSetup &setup, IInterpolator::PartsStatus &partsStatus, bool log) const
|
const CInterpolationAndRenderingSetup &setup, CPartsStatus &partsStatus, bool log) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(setup);
|
Q_UNUSED(setup);
|
||||||
partsStatus.reset();
|
partsStatus.reset();
|
||||||
@@ -109,7 +109,7 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
CAircraftParts IInterpolator::getInterpolatedParts(const CCallsign &callsign, qint64 currentTimeMsSinceEpoch,
|
CAircraftParts IInterpolator::getInterpolatedParts(const CCallsign &callsign, qint64 currentTimeMsSinceEpoch,
|
||||||
const CInterpolationAndRenderingSetup &setup, IInterpolator::PartsStatus &partsStatus, bool log) const
|
const CInterpolationAndRenderingSetup &setup, CPartsStatus &partsStatus, bool log) const
|
||||||
{
|
{
|
||||||
partsStatus.reset();
|
partsStatus.reset();
|
||||||
return this->getInterpolatedParts(callsign, this->m_aircraftParts, currentTimeMsSinceEpoch, setup, partsStatus, log);
|
return this->getInterpolatedParts(callsign, this->m_aircraftParts, currentTimeMsSinceEpoch, setup, partsStatus, log);
|
||||||
@@ -398,23 +398,23 @@ namespace BlackMisc
|
|||||||
return QString("%1 %2 %3").arg(msSinceEpochToTime(t1), msSinceEpochToTime(t2), msSinceEpochToTime(t3));
|
return QString("%1 %2 %3").arg(msSinceEpochToTime(t1), msSinceEpochToTime(t2), msSinceEpochToTime(t3));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IInterpolator::InterpolationStatus::allTrue() const
|
bool CInterpolationStatus::allTrue() const
|
||||||
{
|
{
|
||||||
return m_interpolationSucceeded && m_changedPosition;
|
return m_interpolationSucceeded && m_changedPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IInterpolator::InterpolationStatus::reset()
|
void CInterpolationStatus::reset()
|
||||||
{
|
{
|
||||||
m_changedPosition = false;
|
m_changedPosition = false;
|
||||||
m_interpolationSucceeded = false;
|
m_interpolationSucceeded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IInterpolator::PartsStatus::allTrue() const
|
bool CPartsStatus::allTrue() const
|
||||||
{
|
{
|
||||||
return m_supportsParts;
|
return m_supportsParts;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IInterpolator::PartsStatus::reset()
|
void CPartsStatus::reset()
|
||||||
{
|
{
|
||||||
m_supportsParts = false;
|
m_supportsParts = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ namespace BlackMisc
|
|||||||
namespace Simulation
|
namespace Simulation
|
||||||
{
|
{
|
||||||
class CInterpolationHints;
|
class CInterpolationHints;
|
||||||
|
struct CInterpolationStatus;
|
||||||
|
struct CPartsStatus;
|
||||||
|
|
||||||
//! Interpolator, calculation inbetween positions
|
//! Interpolator, calculation inbetween positions
|
||||||
class BLACKMISC_EXPORT IInterpolator : public QObject
|
class BLACKMISC_EXPORT IInterpolator : public QObject
|
||||||
@@ -40,74 +42,27 @@ namespace BlackMisc
|
|||||||
//! Log category
|
//! Log category
|
||||||
static QString getLogCategory() { return "swift.interpolator"; }
|
static QString getLogCategory() { return "swift.interpolator"; }
|
||||||
|
|
||||||
//! Status of interpolation
|
|
||||||
struct BLACKMISC_EXPORT InterpolationStatus // does not link without export/allTrue, reset
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//! Did interpolation succeed?
|
|
||||||
bool didInterpolationSucceed() const { return m_interpolationSucceeded; }
|
|
||||||
|
|
||||||
//! Set succeeded
|
|
||||||
void setInterpolationSucceeded(bool succeeded) { m_interpolationSucceeded = succeeded; }
|
|
||||||
|
|
||||||
//! Changed position?
|
|
||||||
bool hasChangedPosition() const { return m_changedPosition; }
|
|
||||||
|
|
||||||
//! Set as changed
|
|
||||||
void setChangedPosition(bool changed) { m_changedPosition = changed; }
|
|
||||||
|
|
||||||
//! all OK
|
|
||||||
bool allTrue() const;
|
|
||||||
|
|
||||||
//! Reset to default values
|
|
||||||
void reset();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_changedPosition = false; //!< position was changed
|
|
||||||
bool m_interpolationSucceeded = false; //!< interpolation succeeded (means enough values, etc.)
|
|
||||||
};
|
|
||||||
|
|
||||||
//! Status regarding parts
|
|
||||||
struct BLACKMISC_EXPORT PartsStatus // does not link without export/allTrue, resetx
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//! all OK
|
|
||||||
bool allTrue() const;
|
|
||||||
|
|
||||||
//! Supporting parts
|
|
||||||
bool isSupportingParts() const { return m_supportsParts; }
|
|
||||||
|
|
||||||
//! Set support flag
|
|
||||||
void setSupportsParts(bool supports) { m_supportsParts = supports; }
|
|
||||||
|
|
||||||
//! Reset to default values
|
|
||||||
void reset();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_supportsParts = false; //!< supports parts for given callsign
|
|
||||||
};
|
|
||||||
|
|
||||||
//! Current interpolated situation
|
//! Current interpolated situation
|
||||||
virtual BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
|
virtual BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
|
||||||
const BlackMisc::Aviation::CCallsign &callsign, qint64 currentTimeSinceEpoc,
|
const BlackMisc::Aviation::CCallsign &callsign, qint64 currentTimeSinceEpoc,
|
||||||
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, InterpolationStatus &status) const;
|
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status) const;
|
||||||
|
|
||||||
//! Current interpolated situation, to be implemented by subclass
|
//! Current interpolated situation, to be implemented by subclass
|
||||||
virtual BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
|
virtual BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
|
||||||
const BlackMisc::Aviation::CCallsign &callsign,
|
const BlackMisc::Aviation::CCallsign &callsign,
|
||||||
const BlackMisc::Aviation::CAircraftSituationList &situations, qint64 currentTimeSinceEpoc,
|
const BlackMisc::Aviation::CAircraftSituationList &situations, qint64 currentTimeSinceEpoc,
|
||||||
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, InterpolationStatus &status) const = 0;
|
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status) const = 0;
|
||||||
|
|
||||||
//! Parts before given offset time (aka pending parts)
|
//! Parts before given offset time (aka pending parts)
|
||||||
virtual BlackMisc::Aviation::CAircraftParts getInterpolatedParts(
|
virtual BlackMisc::Aviation::CAircraftParts getInterpolatedParts(
|
||||||
const Aviation::CCallsign &callsign,
|
const Aviation::CCallsign &callsign,
|
||||||
const BlackMisc::Aviation::CAircraftPartsList &parts, qint64 cutoffTime,
|
const BlackMisc::Aviation::CAircraftPartsList &parts, qint64 cutoffTime,
|
||||||
const CInterpolationAndRenderingSetup &setup, PartsStatus &partsStatus, bool log = false) const;
|
const CInterpolationAndRenderingSetup &setup, CPartsStatus &partsStatus, bool log = false) const;
|
||||||
|
|
||||||
//! Parts before given offset time (aka pending parts)
|
//! Parts before given offset time (aka pending parts)
|
||||||
virtual BlackMisc::Aviation::CAircraftParts getInterpolatedParts(
|
virtual BlackMisc::Aviation::CAircraftParts getInterpolatedParts(
|
||||||
const BlackMisc::Aviation::CCallsign &callsign, qint64 cutoffTime,
|
const BlackMisc::Aviation::CCallsign &callsign, qint64 cutoffTime,
|
||||||
const CInterpolationAndRenderingSetup &setup, PartsStatus &partsStatus, bool log = false) const;
|
const CInterpolationAndRenderingSetup &setup, CPartsStatus &partsStatus, bool log = false) const;
|
||||||
|
|
||||||
//! Add a new aircraft situation
|
//! Add a new aircraft situation
|
||||||
void addAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
void addAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||||
@@ -208,6 +163,53 @@ namespace BlackMisc
|
|||||||
mutable QList<PartsLog> m_partsLogs; //!< logs of parts
|
mutable QList<PartsLog> m_partsLogs; //!< logs of parts
|
||||||
mutable QList<InterpolationLog> m_interpolationLogs; //!< logs of interpolation
|
mutable QList<InterpolationLog> m_interpolationLogs; //!< logs of interpolation
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Status of interpolation
|
||||||
|
struct BLACKMISC_EXPORT CInterpolationStatus
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//! Did interpolation succeed?
|
||||||
|
bool didInterpolationSucceed() const { return m_interpolationSucceeded; }
|
||||||
|
|
||||||
|
//! Set succeeded
|
||||||
|
void setInterpolationSucceeded(bool succeeded) { m_interpolationSucceeded = succeeded; }
|
||||||
|
|
||||||
|
//! Changed position?
|
||||||
|
bool hasChangedPosition() const { return m_changedPosition; }
|
||||||
|
|
||||||
|
//! Set as changed
|
||||||
|
void setChangedPosition(bool changed) { m_changedPosition = changed; }
|
||||||
|
|
||||||
|
//! all OK
|
||||||
|
bool allTrue() const;
|
||||||
|
|
||||||
|
//! Reset to default values
|
||||||
|
void reset();
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_changedPosition = false; //!< position was changed
|
||||||
|
bool m_interpolationSucceeded = false; //!< interpolation succeeded (means enough values, etc.)
|
||||||
|
};
|
||||||
|
|
||||||
|
//! Status regarding parts
|
||||||
|
struct BLACKMISC_EXPORT CPartsStatus
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//! all OK
|
||||||
|
bool allTrue() const;
|
||||||
|
|
||||||
|
//! Supporting parts
|
||||||
|
bool isSupportingParts() const { return m_supportsParts; }
|
||||||
|
|
||||||
|
//! Set support flag
|
||||||
|
void setSupportsParts(bool supports) { m_supportsParts = supports; }
|
||||||
|
|
||||||
|
//! Reset to default values
|
||||||
|
void reset();
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_supportsParts = false; //!< supports parts for given callsign
|
||||||
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace BlackMisc
|
|||||||
namespace Simulation
|
namespace Simulation
|
||||||
{
|
{
|
||||||
CAircraftSituation CInterpolatorLinear::getInterpolatedSituation(const CCallsign &callsign, const CAircraftSituationList &situations, qint64 currentTimeMsSinceEpoc,
|
CAircraftSituation CInterpolatorLinear::getInterpolatedSituation(const CCallsign &callsign, const CAircraftSituationList &situations, qint64 currentTimeMsSinceEpoc,
|
||||||
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, InterpolationStatus &status) const
|
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status) const
|
||||||
{
|
{
|
||||||
status.reset();
|
status.reset();
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace BlackMisc
|
|||||||
virtual BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
|
virtual BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
|
||||||
const BlackMisc::Aviation::CCallsign &callsign,
|
const BlackMisc::Aviation::CCallsign &callsign,
|
||||||
const BlackMisc::Aviation::CAircraftSituationList &situations, qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetup &setup,
|
const BlackMisc::Aviation::CAircraftSituationList &situations, qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetup &setup,
|
||||||
const BlackMisc::Simulation::CInterpolationHints &hints, InterpolationStatus &status) const override;
|
const BlackMisc::Simulation::CInterpolationHints &hints, CInterpolationStatus &status) const override;
|
||||||
|
|
||||||
//! Log category
|
//! Log category
|
||||||
static QString getLogCategory() { return "swift.interpolatorlinear"; }
|
static QString getLogCategory() { return "swift.interpolatorlinear"; }
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
if (m_clientStatus == Disconnected) { return; }
|
if (m_clientStatus == Disconnected) { return; }
|
||||||
|
|
||||||
IInterpolator::InterpolationStatus status;
|
CInterpolationStatus status;
|
||||||
CInterpolationHints hints; // \fixme 201701 #865 KB if there is an elevation provider for FS9 add it here or set elevation
|
CInterpolationHints hints; // \fixme 201701 #865 KB if there is an elevation provider for FS9 add it here or set elevation
|
||||||
hints.setLoggingInterpolation(this->getInterpolationSetup().getLogCallsigns().contains(m_callsign));
|
hints.setLoggingInterpolation(this->getInterpolationSetup().getLogCallsigns().contains(m_callsign));
|
||||||
const CAircraftSituation situation = this->m_interpolator.getInterpolatedSituation(m_callsign, -1, this->m_interpolationSetup, hints, status);
|
const CAircraftSituation situation = this->m_interpolator.getInterpolatedSituation(m_callsign, -1, this->m_interpolationSetup, hints, status);
|
||||||
|
|||||||
@@ -899,14 +899,14 @@ namespace BlackSimPlugin
|
|||||||
// fetch parts, as they are needed for ground interpolation
|
// fetch parts, as they are needed for ground interpolation
|
||||||
const bool useAircraftParts = enableAircraftParts && aircraftWithParts.contains(callsign);
|
const bool useAircraftParts = enableAircraftParts && aircraftWithParts.contains(callsign);
|
||||||
const bool logInterpolationAndParts = callsignsToLog.contains(callsign);
|
const bool logInterpolationAndParts = callsignsToLog.contains(callsign);
|
||||||
IInterpolator::PartsStatus partsStatus;
|
CPartsStatus partsStatus;
|
||||||
partsStatus.setSupportsParts(useAircraftParts);
|
partsStatus.setSupportsParts(useAircraftParts);
|
||||||
|
|
||||||
const CInterpolationAndRenderingSetup setup(getInterpolationAndRenderingSetup());
|
const CInterpolationAndRenderingSetup setup(getInterpolationAndRenderingSetup());
|
||||||
const CAircraftParts parts = useAircraftParts ? simObj.getInterpolator()->getInterpolatedParts(callsign, -1, setup, partsStatus, logInterpolationAndParts) : CAircraftParts();
|
const CAircraftParts parts = useAircraftParts ? simObj.getInterpolator()->getInterpolatedParts(callsign, -1, setup, partsStatus, logInterpolationAndParts) : CAircraftParts();
|
||||||
|
|
||||||
// get interpolated situation
|
// get interpolated situation
|
||||||
IInterpolator::InterpolationStatus interpolatorStatus;
|
CInterpolationStatus interpolatorStatus;
|
||||||
CInterpolationHints hints(m_hints[simObj.getCallsign()]);
|
CInterpolationHints hints(m_hints[simObj.getCallsign()]);
|
||||||
hints.setAircraftParts(useAircraftParts ? parts : CAircraftParts(), useAircraftParts);
|
hints.setAircraftParts(useAircraftParts ? parts : CAircraftParts(), useAircraftParts);
|
||||||
hints.setLoggingInterpolation(logInterpolationAndParts);
|
hints.setLoggingInterpolation(logInterpolationAndParts);
|
||||||
@@ -946,7 +946,7 @@ namespace BlackSimPlugin
|
|||||||
m_statsUpdateAircraftTimeAvgMs = m_statsUpdateAircraftTimeTotalMs / m_statsUpdateAircraftCountMs;
|
m_statsUpdateAircraftTimeAvgMs = m_statsUpdateAircraftTimeTotalMs / m_statsUpdateAircraftCountMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSimulatorFsx::guessAndUpdateRemoteAircraftParts(const CSimConnectObject &simObj, const CAircraftSituation &interpolatedSituation, const IInterpolator::InterpolationStatus &interpolationStatus)
|
bool CSimulatorFsx::guessAndUpdateRemoteAircraftParts(const CSimConnectObject &simObj, const CAircraftSituation &interpolatedSituation, const CInterpolationStatus &interpolationStatus)
|
||||||
{
|
{
|
||||||
if (!simObj.hasValidRequestAndObjectId()) { return false; }
|
if (!simObj.hasValidRequestAndObjectId()) { return false; }
|
||||||
if (!interpolationStatus.didInterpolationSucceed()) { return false; }
|
if (!interpolationStatus.didInterpolationSucceed()) { return false; }
|
||||||
@@ -1017,7 +1017,7 @@ namespace BlackSimPlugin
|
|||||||
return this->sendRemoteAircraftPartsToSimulator(simObj, ddRemoteAircraftParts, lights);
|
return this->sendRemoteAircraftPartsToSimulator(simObj, ddRemoteAircraftParts, lights);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSimulatorFsx::updateRemoteAircraftParts(const CSimConnectObject &simObj, const CAircraftParts &parts, const IInterpolator::PartsStatus &partsStatus)
|
bool CSimulatorFsx::updateRemoteAircraftParts(const CSimConnectObject &simObj, const CAircraftParts &parts, const CPartsStatus &partsStatus)
|
||||||
{
|
{
|
||||||
if (!simObj.hasValidRequestAndObjectId()) { return false; }
|
if (!simObj.hasValidRequestAndObjectId()) { return false; }
|
||||||
if (!partsStatus.isSupportingParts()) { return false; }
|
if (!partsStatus.isSupportingParts()) { return false; }
|
||||||
|
|||||||
@@ -189,11 +189,11 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
//! Update remote aircraft parts (send to FSX)
|
//! Update remote aircraft parts (send to FSX)
|
||||||
bool updateRemoteAircraftParts(const CSimConnectObject &simObj,
|
bool updateRemoteAircraftParts(const CSimConnectObject &simObj,
|
||||||
const BlackMisc::Aviation::CAircraftParts &parts, const BlackMisc::Simulation::IInterpolator::PartsStatus &partsStatus);
|
const BlackMisc::Aviation::CAircraftParts &parts, const BlackMisc::Simulation::CPartsStatus &partsStatus);
|
||||||
|
|
||||||
//! Update remote aircraft parts by guessing (send to FSX)
|
//! Update remote aircraft parts by guessing (send to FSX)
|
||||||
bool guessAndUpdateRemoteAircraftParts(const CSimConnectObject &simObj,
|
bool guessAndUpdateRemoteAircraftParts(const CSimConnectObject &simObj,
|
||||||
const BlackMisc::Aviation::CAircraftSituation &interpolatedSituation, const BlackMisc::Simulation::IInterpolator::InterpolationStatus &interpolationStatus);
|
const BlackMisc::Aviation::CAircraftSituation &interpolatedSituation, const BlackMisc::Simulation::CInterpolationStatus &interpolationStatus);
|
||||||
|
|
||||||
//! Send parts to simulator
|
//! Send parts to simulator
|
||||||
bool sendRemoteAircraftPartsToSimulator(const CSimConnectObject &simObj, DataDefinitionRemoteAircraftParts &ddRemoteAircraftParts, const BlackMisc::Aviation::CAircraftLights &lights);
|
bool sendRemoteAircraftPartsToSimulator(const CSimConnectObject &simObj, DataDefinitionRemoteAircraftParts &ddRemoteAircraftParts, const BlackMisc::Aviation::CAircraftLights &lights);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace XBus
|
|||||||
// if the setup is needed more than once, store it here to avoid multiple locks
|
// if the setup is needed more than once, store it here to avoid multiple locks
|
||||||
BlackMisc::Simulation::CInterpolationAndRenderingSetup setup;
|
BlackMisc::Simulation::CInterpolationAndRenderingSetup setup;
|
||||||
BlackMisc::Simulation::CInterpolationHints hints;
|
BlackMisc::Simulation::CInterpolationHints hints;
|
||||||
BlackMisc::Simulation::IInterpolator::CPartsStatus status;
|
BlackMisc::Simulation::CPartsStatus status;
|
||||||
hints.setAircraftParts(interpolator.getInterpolatedParts(callsign, -1, setup, status));
|
hints.setAircraftParts(interpolator.getInterpolatedParts(callsign, -1, setup, status));
|
||||||
hints.setElevationProvider([this](const auto & situation)
|
hints.setElevationProvider([this](const auto & situation)
|
||||||
{
|
{
|
||||||
@@ -333,7 +333,7 @@ namespace XBus
|
|||||||
case xpmpDataType_Position:
|
case xpmpDataType_Position:
|
||||||
{
|
{
|
||||||
BlackMisc::Simulation::CInterpolationAndRenderingSetup setup;
|
BlackMisc::Simulation::CInterpolationAndRenderingSetup setup;
|
||||||
BlackMisc::Simulation::IInterpolator::CInterpolationStatus status;
|
BlackMisc::Simulation::CInterpolationStatus status;
|
||||||
const auto situation = plane->interpolator.getInterpolatedSituation(plane->callsign, -1, setup, plane->hints(), status);
|
const auto situation = plane->interpolator.getInterpolatedSituation(plane->callsign, -1, setup, plane->hints(), status);
|
||||||
if (! status.didInterpolationSucceed()) { return xpmpData_Unavailable; }
|
if (! status.didInterpolationSucceed()) { return xpmpData_Unavailable; }
|
||||||
if (! status.hasChangedPosition()) { return xpmpData_Unchanged; }
|
if (! status.hasChangedPosition()) { return xpmpData_Unchanged; }
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace BlackMiscTest
|
|||||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
|
QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
|
||||||
|
|
||||||
// interpolation functional check
|
// interpolation functional check
|
||||||
IInterpolator::InterpolationStatus status;
|
CInterpolationStatus status;
|
||||||
const CInterpolationHints hints;
|
const CInterpolationHints hints;
|
||||||
const CInterpolationAndRenderingSetup setup;
|
const CInterpolationAndRenderingSetup setup;
|
||||||
double latOld = 360.0;
|
double latOld = 360.0;
|
||||||
@@ -144,7 +144,7 @@ namespace BlackMiscTest
|
|||||||
timer.start();
|
timer.start();
|
||||||
for (qint64 currentTime = ts - 2 * deltaT; currentTime < ts; currentTime += 250)
|
for (qint64 currentTime = ts - 2 * deltaT; currentTime < ts; currentTime += 250)
|
||||||
{
|
{
|
||||||
IInterpolator::PartsStatus partsStatus;
|
CPartsStatus partsStatus;
|
||||||
CAircraftParts pl(interpolator.getInterpolatedParts(cs, ts, setup, partsStatus));
|
CAircraftParts pl(interpolator.getInterpolatedParts(cs, ts, setup, partsStatus));
|
||||||
fetchedParts++;
|
fetchedParts++;
|
||||||
QVERIFY2(partsStatus.isSupportingParts(), "Parts not supported");
|
QVERIFY2(partsStatus.isSupportingParts(), "Parts not supported");
|
||||||
|
|||||||
Reference in New Issue
Block a user