Route manager: Support list of waypoint specifications in dialog input
Allow multiple, space-separated waypoint specifications to be added to a route, rather than having to type each one and press the add button each time. If no waypoint is selected as the insertion point, show a message and leave the waypoint input intact, rather than just clearing it. Update the help label to reflect the change and include a note of how to create offset waypoints using a radial and distance.
This commit is contained in:
parent
c3c246c3da
commit
d2886ffe20
1 changed files with 18 additions and 10 deletions
|
@ -44,19 +44,27 @@ command interface /autopilot/route-manager/input:
|
|||
|
||||
var insert = func {
|
||||
var insertIndex = sel_index();
|
||||
if (insertIndex >= 0) {
|
||||
# when selection index is valid, insert *after* the waypoint
|
||||
insertIndex = insertIndex + 1;
|
||||
if (insertIndex < 0) {
|
||||
var msg = "Select the waypoint after which new waypoints should be added";
|
||||
setprop("sim/messages/copilot", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
cmd.setValue("@insert" ~ insertIndex ~ ":" ~ input.getValue());
|
||||
input.setValue("");
|
||||
# Input is a list of space-separated waypoint specifications
|
||||
var argv = split(" ", input.getValue());
|
||||
foreach (var arg; argv) {
|
||||
# When argument is not empty (caused by multiple space
|
||||
# separators) insert *after* waypoint
|
||||
if (size(arg) > 0) {
|
||||
insertIndex += 1;
|
||||
cmd.setValue("@insert" ~ insertIndex ~ ":" ~ arg);
|
||||
}
|
||||
}
|
||||
|
||||
if (insertIndex >= 0) {
|
||||
input.setValue("");
|
||||
selection.setValue(insertIndex);
|
||||
gui.dialog_update("route-manager");
|
||||
}
|
||||
}
|
||||
|
||||
var remove = func {
|
||||
flightplan().deleteWP(sel_index());
|
||||
|
@ -645,7 +653,7 @@ command interface /autopilot/route-manager/input:
|
|||
|
||||
<text>
|
||||
<padding>1</padding>
|
||||
<label>Format: (airport|fix|nav|lon,lat)[@alt] -- e.g. "KSFO@900"</label>
|
||||
<label>Format: list of (airport|fix|nav|nav/rad/dst|lon,lat)[@alt] -- e.g. "KSFO@900", "SAHEY CIITY@6000"</label>
|
||||
<color>
|
||||
<red>0.7</red>
|
||||
<green>0.7</green>
|
||||
|
|
Loading…
Reference in a new issue