Commit 9c9e2d14 authored by DonLakeFlyer's avatar DonLakeFlyer

Be careful of climb rates of 0

parent c168ed75
......@@ -500,7 +500,7 @@ int TransectStyleComplexItem::_maxPathHeight(const TerrainPathQuery::PathHeightI
void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
{
double maxClimbRate = _terrainAdjustMaxClimbRateFact.rawValue().toDouble();
double maxDescentRate = -_terrainAdjustMaxDescentRateFact.rawValue().toDouble();
double maxDescentRate = _terrainAdjustMaxDescentRateFact.rawValue().toDouble();
double flightSpeed = _missionFlightStatus.vehicleSpeed;
if (qIsNaN(flightSpeed) || (maxClimbRate == 0 && maxDescentRate == 0)) {
......@@ -510,6 +510,7 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
return;
}
if (maxClimbRate > 0) {
// Adjust climb rates
bool climbRateAdjusted;
do {
......@@ -534,9 +535,12 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
}
}
} while (climbRateAdjusted);
}
if (maxDescentRate > 0) {
// Adjust descent rates
bool descentRateAdjusted;
maxDescentRate = -maxDescentRate;
do {
//qDebug() << "descent rate pass";
descentRateAdjusted = false;
......@@ -559,6 +563,7 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
}
}
} while (descentRateAdjusted);
}
}
void TransectStyleComplexItem::_adjustForTolerance(QList<CoordInfo_t>& transect)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment