Ref T231, Ref T236, Ref T238 improvements of interpolator

* keep last interpolated sitation, removed m_isFirstInterpolation
* allow to obtain the old/new situation
* transfer of elevations to newer situations
This commit is contained in:
Klaus Basan
2018-01-28 05:17:47 +01:00
parent cd5fdfaf14
commit 0a06ad223f
8 changed files with 67 additions and 52 deletions

View File

@@ -43,13 +43,13 @@ namespace BlackMisc
return c;
}
int CAircraftSituationList::setGroundElevationChecked(const CElevationPlane &elevationPlane, qint64 newerThan, bool ignoreNullValues, bool overrideExisting)
int CAircraftSituationList::setGroundElevationChecked(const CElevationPlane &elevationPlane, qint64 newerThanAdjustedMs, bool ignoreNullValues, bool overrideExisting)
{
if (ignoreNullValues && elevationPlane.isNull()) { return 0; }
int c = 0;
for (CAircraftSituation &s : *this)
{
if (s.getMSecsSinceEpoch() <= newerThan) { continue; }
if (s.getAdjustedMSecsSinceEpoch() <= newerThanAdjustedMs) { continue; }
const bool set = s.setGroundElevationChecked(elevationPlane, ignoreNullValues, overrideExisting);
if (set) { c++; }
}