mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T275, added "latestOnGroundProviderElevation" to improve average elevation
This commit is contained in:
@@ -540,6 +540,7 @@ namespace BlackMisc
|
||||
if (this->size() < minValues) { return CElevationPlane::null(); } // no change to succeed
|
||||
|
||||
QList<double> valuesInFt;
|
||||
int count = 0;
|
||||
for (const CAircraftSituation &situation : *this)
|
||||
{
|
||||
if (situation.getGroundElevationInfo() != CAircraftSituation::FromProvider) { continue; }
|
||||
@@ -548,8 +549,11 @@ namespace BlackMisc
|
||||
if (!situation.isWithinRange(reference, range)) { continue; }
|
||||
const double elvFt = situation.getGroundElevationPlane().getAltitude().value(CLengthUnit::ft());
|
||||
valuesInFt.push_back(elvFt);
|
||||
count++;
|
||||
if (count > 5 && valuesInFt.size() > 3 * minValues) { break; }
|
||||
}
|
||||
if (valuesInFt.size() < minValues) { return CElevationPlane::null(); }
|
||||
|
||||
if (count < minValues) { return CElevationPlane::null(); }
|
||||
|
||||
static const double MaxDevFt = CAircraftSituationChange::allowedAltitudeDeviation().value(CLengthUnit::ft());
|
||||
const QPair<double, double> elvStdDevMean = CMathUtils::standardDeviationAndMean(valuesInFt);
|
||||
|
||||
Reference in New Issue
Block a user