## ## These are just GUI helper routines. The autopilot itself is not a ## Nasal module. ## tagSettings = { "hdg-wing" : ["/autopilot/locks/heading", "wing-leveler"], "hdg-bug" : ["/autopilot/locks/heading", "dg-heading-hold"], "hdg-true" : ["/autopilot/locks/heading", "true-heading-hold"], "hdg-nav" : ["/autopilot/locks/heading", "nav1-hold"], "vel-throttle" : ["/autopilot/locks/speed", "speed-with-throttle"], "vel-pitch" : ["/autopilot/locks/speed", "speed-with-pitch-trim"], "alt-vert" : ["/autopilot/locks/altitude", "vertical-speed-hold"], "alt-pitch" : ["/autopilot/locks/altitude", "pitch-hold"], "alt-aoa" : ["/autopilot/locks/altitude", "aoa-hold"], "alt-alt" : ["/autopilot/locks/altitude", "altitude-hold"], "alt-agl" : ["/autopilot/locks/altitude", "agl-hold"], "alt-gs" : ["/autopilot/locks/altitude", "gs1-hold"] }; radioGroups = [["hdg-wing", "hdg-bug", "hdg-true", "hdg-nav"], ["vel-throttle", "vel-pitch"], ["alt-vert", "alt-pitch", "alt-aoa", "alt-alt", "alt-agl", "alt-gs"]]; # Initialize to get the types of the gui properties correct INIT = func { guinode = props.globals.getNode("/autopilot/gui", 1); foreach(tag; keys(tagSettings)) { guinode.getNode(tag, 1).setBoolValue(0); } foreach(tag; ["hdg", "alt", "vel"]) { guinode.getNode(tag ~ "-active", 1).setBoolValue(0); } } settimer(INIT, 0); update = func { # Suck out the values from the dialog fgcommand("dialog-apply", props.Node.new()); # Sanitize the radio buttons such that only one is selected. We are # passed a tag indicating the one that was pressed. if(size(arg) > 0) { tag = arg[0]; foreach(group; radioGroups) { for(i=0; i