location-in-air
vbox
left
p = props.globals.getNode("/sim/gui/dialogs/location-in-air/", 1);
mode = {
airport: p.getNode("airport", 1),
lonlat: p.getNode("lonlat", 1),
vor: p.getNode("vor", 1),
ndb: p.getNode("ndb", 1),
fix: p.getNode("fix", 1),
};
set_radio = func(m) {
foreach (k; keys(mode)) {
mode[k].setBoolValue(m == k);
}
}
initialized = 0;
foreach (k; keys(mode)) {
if (mode[k].getType() == "NONE") {
mode[k].setBoolValue(0);
}
initialized += mode[k].getBoolValue();
}
if (!initialized) {
set_radio("airport");
}
# just kept for educational purposes :-)
table
left
0
0
true
/sim/gui/dialogs/location-in-air/airport
dialog-apply
nasal
0
1
0
2
/sim/presets/airport-id
0
3
0
4
/sim/presets/runway
1
0
true
/sim/gui/dialogs/location-in-air/lonlat
dialog-apply
nasal
1
1
1
2
/sim/presets/longitude-deg
1
3
1
4
/sim/presets/latitude-deg
2
0
true
/sim/gui/dialogs/location-in-air/vor
dialog-apply
nasal
2
1
right
2
2
/sim/presets/vor-id
3
0
true
left
/sim/gui/dialogs/location-in-air/ndb
dialog-apply
nasal
3
1
right
3
2
/sim/presets/ndb-id
4
0
true
/sim/gui/dialogs/location-in-air/fix
left
dialog-apply
nasal
4
1
right
4
2
/sim/presets/fix
table
0
0
right
0
1
/sim/presets/offset-distance-nm
0
2
right
0
3
/sim/presets/offset-azimuth-deg
1
0
right
1
1
/sim/presets/altitude-ft
1
2
right
1
3
/sim/presets/glidescope-deg
2
0
right
2
1
/sim/presets/airspeed-kt
2
2
right
2
3
/sim/presets/heading-deg
hbox
10