Switch route-manager to use Nasal APIs for more commands.
Airways routing is now driven via Nasal.
This commit is contained in:
parent
465ff76b27
commit
3389049325
1 changed files with 19 additions and 4 deletions
|
@ -38,7 +38,8 @@ command interface /autopilot/route-manager/input:
|
||||||
}
|
}
|
||||||
|
|
||||||
var clear = func {
|
var clear = func {
|
||||||
cmd.setValue("@clear");
|
#cmd.setValue("@clear");
|
||||||
|
flightplan().cleanPlan();
|
||||||
selection.setIntValue(-1);
|
selection.setIntValue(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,15 +60,29 @@ command interface /autopilot/route-manager/input:
|
||||||
}
|
}
|
||||||
|
|
||||||
var remove = func {
|
var remove = func {
|
||||||
cmd.setValue("@delete" ~ sel_index());
|
#cmd.setValue("@delete" ~ sel_index());
|
||||||
|
flightplan().deleteWP(sel_index());
|
||||||
}
|
}
|
||||||
|
|
||||||
var route = func {
|
var route = func {
|
||||||
cmd.setValue("@route" ~ sel_index());
|
#cmd.setValue("@route" ~ sel_index());
|
||||||
|
|
||||||
|
var fp = flightplan();
|
||||||
|
var from = fp.getWP(sel_index() - 1);
|
||||||
|
var to = fp.getWP(sel_index());
|
||||||
|
|
||||||
|
if ((from == nil ) or (to == nil)) {
|
||||||
|
debug.dump('unable to route, invalid start ad end points');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var route = airwaysRoute(from, to);
|
||||||
|
fp.insertWaypoints(route, sel_index());
|
||||||
}
|
}
|
||||||
|
|
||||||
var jump_to = func {
|
var jump_to = func {
|
||||||
cmd.setValue("@jump" ~ sel_index());
|
#cmd.setValue("@jump" ~ sel_index());
|
||||||
|
flightplan().current = sel_index();
|
||||||
}
|
}
|
||||||
|
|
||||||
var load_route = func(path) {
|
var load_route = func(path) {
|
||||||
|
|
Loading…
Reference in a new issue