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 ...@@ -500,7 +500,7 @@ int TransectStyleComplexItem::_maxPathHeight(const TerrainPathQuery::PathHeightI
void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect) void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
{ {
double maxClimbRate = _terrainAdjustMaxClimbRateFact.rawValue().toDouble(); double maxClimbRate = _terrainAdjustMaxClimbRateFact.rawValue().toDouble();
double maxDescentRate = -_terrainAdjustMaxDescentRateFact.rawValue().toDouble(); double maxDescentRate = _terrainAdjustMaxDescentRateFact.rawValue().toDouble();
double flightSpeed = _missionFlightStatus.vehicleSpeed; double flightSpeed = _missionFlightStatus.vehicleSpeed;
if (qIsNaN(flightSpeed) || (maxClimbRate == 0 && maxDescentRate == 0)) { if (qIsNaN(flightSpeed) || (maxClimbRate == 0 && maxDescentRate == 0)) {
...@@ -510,6 +510,7 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect) ...@@ -510,6 +510,7 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
return; return;
} }
if (maxClimbRate > 0) {
// Adjust climb rates // Adjust climb rates
bool climbRateAdjusted; bool climbRateAdjusted;
do { do {
...@@ -534,9 +535,12 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect) ...@@ -534,9 +535,12 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
} }
} }
} while (climbRateAdjusted); } while (climbRateAdjusted);
}
if (maxDescentRate > 0) {
// Adjust descent rates // Adjust descent rates
bool descentRateAdjusted; bool descentRateAdjusted;
maxDescentRate = -maxDescentRate;
do { do {
//qDebug() << "descent rate pass"; //qDebug() << "descent rate pass";
descentRateAdjusted = false; descentRateAdjusted = false;
...@@ -559,6 +563,7 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect) ...@@ -559,6 +563,7 @@ void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
} }
} }
} while (descentRateAdjusted); } while (descentRateAdjusted);
}
} }
void TransectStyleComplexItem::_adjustForTolerance(QList<CoordInfo_t>& transect) 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