diff --git a/gui/dialogs/autopilot.xml b/gui/dialogs/autopilot.xml index ec07f9b6e..2a0335658 100644 --- a/gui/dialogs/autopilot.xml +++ b/gui/dialogs/autopilot.xml @@ -23,18 +23,6 @@ - ## 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* diff --git a/gui/dialogs/route-manager.xml b/gui/dialogs/route-manager.xml index fced9f498..bae169320 100644 --- a/gui/dialogs/route-manager.xml +++ b/gui/dialogs/route-manager.xml @@ -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);