1
0
Fork 0

Procedures: be defensive about STAR/approach choice.

Current GUI allows selected mis-matched STAR and approach. Low risk
fix is to detect and deal with this case by just routing direct. Real
fix involves a slicker GUI or inserting a route discontinuity (possible
in FG 3.6 hopefully)
This commit is contained in:
James Turner 2015-01-10 19:37:58 +00:00
parent f786e57c96
commit e370899a93

View file

@ -66,9 +66,27 @@ var RouteManagerDelegate = {
} }
if (me.flightplan.approach != nil) { if (me.flightplan.approach != nil) {
printlog('info', 'routing via approach ' ~ me.flightplan.approach.id);
var wps = me.flightplan.approach.route(initialApproachFix); var wps = me.flightplan.approach.route(initialApproachFix);
if ((initialApproachFix != nil) and (wps == nil)) {
# current GUI allows selected approach then STAR; but STAR
# might not be possible for the approach (no transition).
# since fixing the GUI flow is hard, let's route assuming no
# IAF. This will likely cause an ugly direct leg, but that's
# what the user asked for.
printlog('info', "couldn't route approach based on specified IAF "
~ initialApproachFix.wp_name);
wps = me.flightplan.approach.route(nil);
}
if (wps == nil) {
printlog('warn', 'routing via approach ' ~ me.flightplan.approach.id
~ ' failed entirely.');
} else {
printlog('info', 'routing via approach ' ~ me.flightplan.approach.id);
me.flightplan.insertWaypoints(wps, -1); me.flightplan.insertWaypoints(wps, -1);
}
} else { } else {
printlog('info', 'routing direct to runway ' ~ me.flightplan.destination_runway.id); printlog('info', 'routing direct to runway ' ~ me.flightplan.destination_runway.id);
# no approach, just use the runway waypoint # no approach, just use the runway waypoint