1
0
Fork 0

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.
This commit is contained in:
James Turner 2013-02-08 13:18:51 +00:00
parent 583f40088e
commit 5d68db3136

View file

@ -163,7 +163,6 @@
}
var longest_runway = 0;
var runway_string = "";
var runways = info.runways;
avail_runways.removeChildren("value");
@ -172,9 +171,30 @@
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;
}
@ -696,8 +716,9 @@
</group>
</group>
<!-- airport info -->
<group>
<layout>vbox</layout>
<layout>table</layout>
<valign>top</valign>
<row>0</row>
<col>0</col>
@ -708,11 +729,11 @@
</equals>
</visible>
<!-- airport info table -->
<group>
<layout>vbox</layout>
<valign>top</valign>
<row>0</row>
<col>0</col>
<group>
<layout>table</layout>
<valign>top</valign>
@ -836,9 +857,11 @@
<property>/sim/gui/dialogs/airports/selected-airport/course-deg</property>
</text>
</group>
</group>
<!-- comms frequencies table -->
<group>
<row>0</row>
<col>1</col>
<layout>table</layout>
<halign>fill</halign>
<default-padding>2</default-padding>
@ -862,7 +885,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[0]/label</property>
</text>
@ -871,7 +894,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[0]/value</property>
</text>
@ -880,7 +903,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[1]/label</property>
</text>
@ -889,7 +912,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[1]/value</property>
</text>
@ -898,7 +921,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[2]/label</property>
</text>
@ -907,7 +930,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[2]/value</property>
</text>
@ -916,7 +939,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[3]/label</property>
</text>
@ -925,7 +948,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[3]/value</property>
</text>
@ -934,7 +957,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[4]/label</property>
</text>
@ -943,7 +966,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[4]/value</property>
</text>
@ -952,7 +975,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[5]/label</property>
</text>
@ -961,7 +984,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[5]/value</property>
</text>
@ -970,7 +993,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[6]/label</property>
</text>
@ -979,7 +1002,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[6]/value</property>
</text>
@ -988,7 +1011,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[7]/label</property>
</text>
@ -997,7 +1020,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[7]/value</property>
</text>
@ -1006,7 +1029,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[8]/label</property>
</text>
@ -1015,7 +1038,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[8]/value</property>
</text>
@ -1024,7 +1047,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[9]/label</property>
</text>
@ -1033,7 +1056,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[9]/value</property>
</text>
@ -1042,7 +1065,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[10]/label</property>
</text>
@ -1051,7 +1074,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[10]/value</property>
</text>
@ -1060,7 +1083,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[11]/label</property>
</text>
@ -1069,7 +1092,7 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[11]/value</property>
</text>
@ -1078,7 +1101,7 @@
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>ACTIVATE LIGHTS ONLY MULTICOM</label>
<label>ACTIVATE LIGHTS</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[12]/label</property>
</text>
@ -1087,12 +1110,308 @@
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>123.456 123.456 123.456</label>
<label>123.456 123.456</label>
<property>/sim/gui/dialogs/airports/selected-airport/comms/freq[12]/value</property>
</text>
</group> <!-- of comm frequencies table -->
<!-- runways table -->
<group>
<row>1</row>
<col>0</col>
<colspan>2</colspan>
<layout>table</layout>
<halign>fill</halign>
<default-padding>2</default-padding>
<group>
<layout>hbox</layout>
<halign>fill</halign>
<row>0</row>
<col>0</col>
<colspan>4</colspan>
<text>
<label>Runways</label>
</text>
<hrule><stretch>1</stretch></hrule>
</group>
</group>
<text>
<row>1</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[0]/label</property>
</text>
<text>
<row>1</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[0]/length-hdg</property>
</text>
<text>
<row>1</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[0]/ils</property>
</text>
<text>
<row>2</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[1]/label</property>
</text>
<text>
<row>2</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[1]/length-hdg</property>
</text>
<text>
<row>2</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[1]/ils</property>
</text>
<text>
<row>3</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[2]/label</property>
</text>
<text>
<row>3</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[2]/length-hdg</property>
</text>
<text>
<row>3</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[2]/ils</property>
</text>
<text>
<row>4</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[3]/label</property>
</text>
<text>
<row>4</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[3]/length-hdg</property>
</text>
<text>
<row>4</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[3]/ils</property>
</text>
<text>
<row>5</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[4]/label</property>
</text>
<text>
<row>5</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[4]/length-hdg</property>
</text>
<text>
<row>5</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[4]/ils</property>
</text>
<text>
<row>6</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[5]/label</property>
</text>
<text>
<row>6</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[5]/length-hdg</property>
</text>
<text>
<row>6</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[5]/ils</property>
</text>
<text>
<row>7</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[6]/label</property>
</text>
<text>
<row>7</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[6]/length-hdg</property>
</text>
<text>
<row>7</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[6]/ils</property>
</text>
<text>
<row>8</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[7]/label</property>
</text>
<text>
<row>8</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[7]/length-hdg</property>
</text>
<text>
<row>8</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[7]/ils</property>
</text>
<text>
<row>9</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[8]/label</property>
</text>
<text>
<row>9</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[8]/length-hdg</property>
</text>
<text>
<row>9</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[8]/ils</property>
</text>
<text>
<row>10</row>
<col>0</col>
<halign>left</halign>
<live>true</live>
<label>28L</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[9]/label</property>
</text>
<text>
<row>10</row>
<col>1</col>
<halign>left</halign>
<live>true</live>
<label>10000'/236*</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[9]/length-hdg</property>
</text>
<text>
<row>10</row>
<col>2</col>
<halign>left</halign>
<live>true</live>
<label>108.90Mhz</label>
<property>/sim/gui/dialogs/airports/selected-airport/runway[9]/ils</property>
</text>
</group> <!-- of runways table -->
</group> <!-- of airport info outer table -->
</group>
</group>
<!-- End of RH Pane -->