#793 - invalid data on final FP leg.
The Flight-plan leg data computation was omitting certain data for the final waypoint, which in turn made some of the route-manager data bogus when flying the final leg. Fill in some sensible values which we can compute.
This commit is contained in:
parent
f00bcad479
commit
682d78301e
1 changed files with 9 additions and 0 deletions
|
@ -1018,6 +1018,15 @@ void FlightPlan::rebuildLegData()
|
||||||
_legs[l]->_distanceAlongPath = _totalDistance;
|
_legs[l]->_distanceAlongPath = _totalDistance;
|
||||||
_totalDistance += crsDist.second * SG_METER_TO_NM;
|
_totalDistance += crsDist.second * SG_METER_TO_NM;
|
||||||
} // of legs iteration
|
} // of legs iteration
|
||||||
|
|
||||||
|
// set some data on the final leg
|
||||||
|
if (lastLeg > 0) {
|
||||||
|
// keep the same course as the final leg, when passing the final
|
||||||
|
// waypoint
|
||||||
|
_legs[lastLeg]->_courseDeg = _legs[lastLeg - 1]->_courseDeg;
|
||||||
|
_legs[lastLeg]->_pathDistance = 0.0;
|
||||||
|
_legs[lastLeg]->_distanceAlongPath = _totalDistance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlightPlan::lockDelegate()
|
void FlightPlan::lockDelegate()
|
||||||
|
|
Loading…
Add table
Reference in a new issue