From 5d68db313607db970fc581ba8957e467e0e33b66 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 8 Feb 2013 13:18:51 +0000 Subject: [PATCH] Show airport runway data in the airport dialog. This is work-in-progress, and the XML is ugly due to PLIB broken-ness, but gives all the airport surface data in a single, usable place. --- gui/dialogs/airports.xml | 395 +++++++++++++++++++++++++++++++++++---- 1 file changed, 357 insertions(+), 38 deletions(-) diff --git a/gui/dialogs/airports.xml b/gui/dialogs/airports.xml index 5bffc695e..cb26005cc 100644 --- a/gui/dialogs/airports.xml +++ b/gui/dialogs/airports.xml @@ -163,7 +163,6 @@ } var longest_runway = 0; - var runway_string = ""; var runways = info.runways; avail_runways.removeChildren("value"); @@ -172,11 +171,32 @@ var i = 0; foreach(var rwy; runway_keys) { - runway_string = runway_string ~ rwy ~ " "; - longest_runway = math.max(longest_runway, runways[rwy].length * 3.28); + var r = runways[rwy]; + longest_runway = math.max(longest_runway, r.length * 3.28); avail_runways.getNode("value[" ~ i ~ "]", 1).setValue(rwy); + + setprop("sim/gui/dialogs/airports/selected-airport/runway[" ~ i ~ "]/label", rwy); + setprop("sim/gui/dialogs/airports/selected-airport/runway[" ~ i ~ "]/length-hdg", + sprintf("%d'/%03d deg", r.length * 3.28, r.heading)); + + if (r.ils != nil) { + setprop("sim/gui/dialogs/airports/selected-airport/runway[" ~ i ~ "]/ils", sprintf("%.3fMhz", r.ils.frequency / 100)); + } else { + setprop("sim/gui/dialogs/airports/selected-airport/runway[" ~ i ~ "]/ils", ""); + } + i += 1; - } + if (i == 10) + break; + } + + while (i < 10) { + # zero remaining runway data + setprop("sim/gui/dialogs/airports/selected-airport/runway[" ~ i ~ "]/label", ""); + setprop("sim/gui/dialogs/airports/selected-airport/runway[" ~ i ~ "]/length-hdg", ""); + setprop("sim/gui/dialogs/airports/selected-airport/runway[" ~ i ~ "]/ils", ""); + i += 1; + } i = 0; foreach (var park; info.parking()) { @@ -696,8 +716,9 @@ + - vbox + table top 0 0 @@ -708,11 +729,11 @@ - - vbox - top - + + 0 + 0 + table top @@ -836,9 +857,11 @@ /sim/gui/dialogs/airports/selected-airport/course-deg - + + 0 + 1 table fill 2 @@ -862,7 +885,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[0]/label @@ -871,7 +894,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[0]/value @@ -880,7 +903,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[1]/label @@ -889,7 +912,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[1]/value @@ -898,7 +921,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[2]/label @@ -907,7 +930,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[2]/value @@ -916,7 +939,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[3]/label @@ -925,7 +948,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[3]/value @@ -934,7 +957,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[4]/label @@ -943,7 +966,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[4]/value @@ -952,7 +975,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[5]/label @@ -961,7 +984,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[5]/value @@ -970,7 +993,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[6]/label @@ -979,7 +1002,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[6]/value @@ -988,7 +1011,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[7]/label @@ -997,7 +1020,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[7]/value @@ -1006,7 +1029,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[8]/label @@ -1015,7 +1038,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[8]/value @@ -1024,7 +1047,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[9]/label @@ -1033,7 +1056,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[9]/value @@ -1042,7 +1065,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[10]/label @@ -1051,7 +1074,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[10]/value @@ -1060,7 +1083,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[11]/label @@ -1069,7 +1092,7 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[11]/value @@ -1078,7 +1101,7 @@ 0 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[12]/label @@ -1087,12 +1110,308 @@ 1 left true - + /sim/gui/dialogs/airports/selected-airport/comms/freq[12]/value - - + + + + + + 1 + 0 + 2 + table + fill + 2 + + + hbox + fill + 0 + 0 + 4 + + + + + + 1 + + + + 1 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[0]/label + + + + 1 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[0]/length-hdg + + + + 1 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[0]/ils + + + + 2 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[1]/label + + + + 2 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[1]/length-hdg + + + + 2 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[1]/ils + + + + 3 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[2]/label + + + + 3 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[2]/length-hdg + + + + 3 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[2]/ils + + + + 4 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[3]/label + + + + 4 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[3]/length-hdg + + + + 4 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[3]/ils + + + + 5 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[4]/label + + + + 5 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[4]/length-hdg + + + + 5 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[4]/ils + + + + 6 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[5]/label + + + + 6 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[5]/length-hdg + + + + 6 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[5]/ils + + + + 7 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[6]/label + + + + 7 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[6]/length-hdg + + + + 7 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[6]/ils + + + + 8 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[7]/label + + + + 8 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[7]/length-hdg + + + + 8 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[7]/ils + + + + 9 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[8]/label + + + + 9 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[8]/length-hdg + + + + 9 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[8]/ils + + + + 10 + 0 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[9]/label + + + + 10 + 1 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[9]/length-hdg + + + + 10 + 2 + left + true + + /sim/gui/dialogs/airports/selected-airport/runway[9]/ils + + + +