refactor: Change variable type of aircraftNumber

The aircraft number should always be positive
This commit is contained in:
Lars Toenning
2024-01-04 22:38:00 +01:00
parent 4b05c4200d
commit 78d0dc4435
15 changed files with 17 additions and 19 deletions

View File

@@ -212,13 +212,11 @@ namespace BlackMisc::Simulation
}
template <typename Derived>
CInterpolationResult CInterpolator<Derived>::getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, int aircraftNumber)
CInterpolationResult CInterpolator<Derived>::getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, uint32_t aircraftNumber)
{
CInterpolationResult result;
do
{
// make sure we can also interpolate parts only (needed in unit tests)
if (aircraftNumber < 0) { aircraftNumber = 0; }
const bool init = this->initIniterpolationStepData(currentTimeSinceEpoc, setup, aircraftNumber);
Q_ASSERT_X(!m_currentInterpolationStatus.isInterpolated(), Q_FUNC_INFO, "Expect reset status");
if (!m_unitTest && !init) { break; } // failure in real scenarios, unit tests move on

View File

@@ -193,7 +193,7 @@ namespace BlackMisc
const Aviation::CAircraftSituation &getLastInterpolatedSituation() const { return m_lastSituation; }
//! Parts and situation interpolated
CInterpolationResult getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, int aircraftNumber = -1);
CInterpolationResult getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, uint32_t aircraftNumber);
//! Takes input between 0 and 1 and returns output between 0 and 1 smoothed with an S-shaped curve.
//!

View File

@@ -13,7 +13,7 @@ namespace BlackMisc::Simulation
m_linear(callsign, p1, p2, p3, logger)
{}
CInterpolationResult CInterpolatorMulti::getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, int aircraftNumber)
CInterpolationResult CInterpolatorMulti::getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, uint32_t aircraftNumber)
{
switch (setup.getInterpolatorMode())
{

View File

@@ -22,7 +22,7 @@ namespace BlackMisc::Simulation
CInterpolationLogger *logger = nullptr);
//! \copydoc CInterpolator::getInterpolation
CInterpolationResult getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, int aircraftNumber);
CInterpolationResult getInterpolation(qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetupPerCallsign &setup, uint32_t aircraftNumber);
//! \copydoc CInterpolator::getLastInterpolatedSituation
const Aviation::CAircraftSituation &getLastInterpolatedSituation(CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const;