mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T270, mark interpolator as unit test
* if we use "recycled" parts, we have to store also the last status * mark unit test so "recycling" is disabled * status flag for "reused"
This commit is contained in:
@@ -292,6 +292,8 @@ namespace BlackMisc
|
||||
Q_ASSERT_X(m_partsToSituationInterpolationRatio >= 1 && m_partsToSituationInterpolationRatio < 11, Q_FUNC_INFO, "Wrong ratio");
|
||||
if (!m_unitTest && !m_lastParts.isNull() && ((m_interpolatedSituationsCounter + aircraftNumber) % m_partsToSituationInterpolationRatio) == 0)
|
||||
{
|
||||
m_currentPartsStatus = m_lastPartsStatus;
|
||||
m_currentPartsStatus.setReusedParts(true);
|
||||
return m_lastParts;
|
||||
}
|
||||
|
||||
@@ -312,6 +314,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
m_lastParts = parts;
|
||||
m_lastPartsStatus = m_currentPartsStatus;
|
||||
return parts;
|
||||
}
|
||||
|
||||
@@ -513,6 +516,7 @@ namespace BlackMisc
|
||||
void CPartsStatus::reset()
|
||||
{
|
||||
m_supportsParts = false;
|
||||
m_resusedParts = false;
|
||||
}
|
||||
|
||||
// see here for the reason of thess forward instantiations
|
||||
|
||||
@@ -96,11 +96,18 @@ namespace BlackMisc
|
||||
//! Set support flag
|
||||
void setSupportsParts(bool supports) { m_supportsParts = supports; }
|
||||
|
||||
//! Is a reused parts, means using last value again
|
||||
bool isReusedPArts() const { return m_resusedParts; }
|
||||
|
||||
//! Mark as reused
|
||||
void setReusedParts(bool reused) { m_resusedParts = reused; }
|
||||
|
||||
//! Reset to default values
|
||||
void reset();
|
||||
|
||||
private:
|
||||
bool m_supportsParts = false; //!< supports parts for given callsign
|
||||
bool m_resusedParts = false; //!< reusing from last step
|
||||
};
|
||||
|
||||
//! Combined results
|
||||
@@ -248,6 +255,7 @@ namespace BlackMisc
|
||||
CInterpolationAndRenderingSetupPerCallsign m_currentSetup; //!< used setup
|
||||
CInterpolationStatus m_currentInterpolationStatus; //!< this step's status
|
||||
CPartsStatus m_currentPartsStatus; //!< this step's status
|
||||
CPartsStatus m_lastPartsStatus; //!< status for last parts, used when last parts are re-used because of m_partsToSituationInterpolationRatio
|
||||
int m_partsToSituationInterpolationRatio = 2; //!< ratio between parts and situation interpolation, 1..always, 2..every 2nd situation
|
||||
Aviation::CAircraftSituation m_lastSituation { Aviation::CAircraftSituation::null() }; //!< latest interpolation
|
||||
Aviation::CAircraftParts m_lastParts { Aviation::CAircraftParts::null() }; //!< latest parts
|
||||
|
||||
Reference in New Issue
Block a user