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:
Klaus Basan
2018-06-02 14:16:50 +02:00
parent 84428b1284
commit c6f3d4e2f2
3 changed files with 15 additions and 2 deletions

View File

@@ -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