autopilot.xml: pick up initial mode
route-managers.xml: cosmetics
This commit is contained in:
parent
446cc37d3c
commit
3cf9901ce2
2 changed files with 18 additions and 15 deletions
|
@ -23,18 +23,6 @@
|
|||
|
||||
<nasal>
|
||||
<open>
|
||||
## create and initialize input field properties if necessary
|
||||
#
|
||||
var apset = props.globals.getNode("/autopilot/settings", 1);
|
||||
foreach (var p; ["heading-bug-deg", "true-heading-deg", "vertical-speed-fpm",
|
||||
"target-pitch-deg", "target-aoa-deg", "target-altitude-ft",
|
||||
"target-agl-ft", "target-speed-kt"]) {
|
||||
|
||||
if ((var n = apset.getNode(p)) == nil or n.getType() == "NONE") {
|
||||
apset.getNode(p, 1).setDoubleValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
## manage one AP property group with checkbox and radio buttons
|
||||
#
|
||||
Group = {
|
||||
|
@ -59,6 +47,9 @@
|
|||
node.setBoolValue(0);
|
||||
}
|
||||
append(m.options, node);
|
||||
if (m.lock.getValue() == o) {
|
||||
m.mode = o;
|
||||
}
|
||||
}
|
||||
m.listener = setlistener(m.lock, func { m.update(cmdarg().getValue()) }, 1);
|
||||
return m;
|
||||
|
@ -100,6 +91,19 @@
|
|||
},
|
||||
};
|
||||
|
||||
|
||||
## create and initialize input field properties if necessary
|
||||
#
|
||||
var apset = props.globals.getNode("/autopilot/settings", 1);
|
||||
foreach (var p; ["heading-bug-deg", "true-heading-deg", "vertical-speed-fpm",
|
||||
"target-pitch-deg", "target-aoa-deg", "target-altitude-ft",
|
||||
"target-agl-ft", "target-speed-kt"]) {
|
||||
|
||||
if ((var n = apset.getNode(p)) == nil or n.getType() == "NONE") {
|
||||
apset.getNode(p, 1).setDoubleValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
var dlg = props.globals.getNode("/sim/gui/dialogs/autopilot", 1);
|
||||
|
||||
# - first entry ("heading" etc.) is the target property in /autopilot/locks/ *and*
|
||||
|
|
|
@ -54,12 +54,11 @@ command interface /autopilot/route-manager/input:
|
|||
cmd.setValue("@delete" ~ sel_index())
|
||||
}
|
||||
|
||||
listchanged = func {
|
||||
route_changed = func {
|
||||
list.removeChildren("value");
|
||||
var wp = routemgr.getChildren("wp");
|
||||
forindex (var i; wp) {
|
||||
var id = wp[i].getNode("id").getValue();
|
||||
var name = wp[i].getNode("name").getValue();
|
||||
var lon = wp[i].getNode("longitude-deg").getValue();
|
||||
var lat = wp[i].getNode("latitude-deg").getValue();
|
||||
var alt = wp[i].getNode("altitude-ft").getValue();
|
||||
|
@ -75,7 +74,7 @@ command interface /autopilot/route-manager/input:
|
|||
"dialog-name": "route-manager"}));
|
||||
}
|
||||
|
||||
var lst = setlistener("/autopilot/route-manager/route/num", listchanged, 1);
|
||||
var lst = setlistener("/autopilot/route-manager/route/num", route_changed, 1);
|
||||
</open>
|
||||
|
||||
<close>
|
||||
|
|
Loading…
Reference in a new issue