mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
refactor: Change variable type of aircraftNumber
The aircraft number should always be positive
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
//!
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user