mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Ref T280, fixed usage for aircraft change
* calculate only simple changes (without deviations) if those are not needed * return "change" object so it can be re-used
This commit is contained in:
@@ -57,8 +57,7 @@ namespace BlackMisc
|
|||||||
if (this->isEmpty()) { return 0; }
|
if (this->isEmpty()) { return 0; }
|
||||||
|
|
||||||
Q_ASSERT_X(m_tsAdjustedSortHint == CAircraftSituationList::AdjustedTimestampLatestFirst || this->isSortedAdjustedLatestFirstWithoutNullPositions(), Q_FUNC_INFO, "Need sorted situations without NULL positions");
|
Q_ASSERT_X(m_tsAdjustedSortHint == CAircraftSituationList::AdjustedTimestampLatestFirst || this->isSortedAdjustedLatestFirstWithoutNullPositions(), Q_FUNC_INFO, "Need sorted situations without NULL positions");
|
||||||
const CAircraftSituationChange change(*this, model.getCG(), model.isVtol(), true, true);
|
const CAircraftSituationChange simpleChange(*this, model.getCG(), model.isVtol(), true, false);
|
||||||
if (changeOut) { *changeOut = change; } // copy over
|
|
||||||
int c = 0;
|
int c = 0;
|
||||||
bool latest = true;
|
bool latest = true;
|
||||||
|
|
||||||
@@ -69,11 +68,18 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
// change is only valid for the latest situation
|
// change is only valid for the latest situation
|
||||||
// this will do nothing if not appropriate
|
// this will do nothing if not appropriate
|
||||||
s.guessOnGround(latest ? change : CAircraftSituationChange::null(), model);
|
s.guessOnGround(latest ? simpleChange : CAircraftSituationChange::null(), model);
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
latest = false;
|
latest = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changeOut)
|
||||||
|
{
|
||||||
|
const CAircraftSituationChange change(*this, model.getCG(), model.isVtol(), true, true);
|
||||||
|
*changeOut = change;
|
||||||
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user