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:
parent
f786e57c96
commit
e370899a93
1 changed files with 29 additions and 11 deletions
|
@ -66,9 +66,27 @@ var RouteManagerDelegate = {
|
|||
}
|
||||
|
||||
if (me.flightplan.approach != nil) {
|
||||
printlog('info', 'routing via approach ' ~ me.flightplan.approach.id);
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
printlog('info', 'routing direct to runway ' ~ me.flightplan.destination_runway.id);
|
||||
# no approach, just use the runway waypoint
|
||||
|
|
Loading…
Reference in a new issue