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,18 +44,26 @@ command interface /autopilot/route-manager/input:
|
||||||
|
|
||||||
var insert = func {
|
var insert = func {
|
||||||
var insertIndex = sel_index();
|
var insertIndex = sel_index();
|
||||||
if (insertIndex >= 0) {
|
if (insertIndex < 0) {
|
||||||
# when selection index is valid, insert *after* the waypoint
|
var msg = "Select the waypoint after which new waypoints should be added";
|
||||||
insertIndex = insertIndex + 1;
|
setprop("sim/messages/copilot", msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.setValue("@insert" ~ insertIndex ~ ":" ~ input.getValue());
|
|
||||||
input.setValue("");
|
input.setValue("");
|
||||||
|
selection.setValue(insertIndex);
|
||||||
if (insertIndex >= 0) {
|
gui.dialog_update("route-manager");
|
||||||
selection.setValue(insertIndex);
|
|
||||||
gui.dialog_update("route-manager");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var remove = func {
|
var remove = func {
|
||||||
|
@ -645,7 +653,7 @@ command interface /autopilot/route-manager/input:
|
||||||
|
|
||||||
<text>
|
<text>
|
||||||
<padding>1</padding>
|
<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>
|
<color>
|
||||||
<red>0.7</red>
|
<red>0.7</red>
|
||||||
<green>0.7</green>
|
<green>0.7</green>
|
||||||
|
|
Loading…
Reference in a new issue