2003-01-21 15:47:37 +00:00
|
|
|
<?xml version="1.0"?>
|
2006-03-31 10:30:46 +00:00
|
|
|
|
2003-01-21 15:47:37 +00:00
|
|
|
<PropertyList>
|
2004-05-12 15:37:17 +00:00
|
|
|
<name>location-on-ground</name>
|
|
|
|
<layout>vbox</layout>
|
2006-03-31 10:30:46 +00:00
|
|
|
|
2010-12-27 20:19:31 +00:00
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
2012-03-31 15:07:25 +00:00
|
|
|
<empty><stretch>1</stretch></empty>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
|
|
|
<text>
|
|
|
|
<label>Position Aircraft On Ground</label>
|
|
|
|
</text>
|
|
|
|
|
2012-03-31 15:07:25 +00:00
|
|
|
<empty><stretch>1</stretch></empty>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
|
|
|
<button>
|
|
|
|
<pref-width>16</pref-width>
|
|
|
|
<pref-height>16</pref-height>
|
|
|
|
<legend></legend>
|
|
|
|
<keynum>27</keynum>
|
|
|
|
<border>2</border>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
</group>
|
2006-03-31 10:30:46 +00:00
|
|
|
|
2007-03-26 15:25:27 +00:00
|
|
|
<hrule/>
|
2006-03-31 10:30:46 +00:00
|
|
|
|
|
|
|
<nasal>
|
|
|
|
<open>
|
2007-10-04 15:47:54 +00:00
|
|
|
var dlg = props.globals.getNode("/sim/gui/dialogs/location-on-ground", 1);
|
|
|
|
var apt = dlg.getNode("airport", 1);
|
2012-04-26 10:00:15 +00:00
|
|
|
var aptname = dlg.getNode("airport-name", 1);
|
2012-01-03 14:29:23 +00:00
|
|
|
apt.setValue(getprop("/sim/presets/airport-id"));
|
2007-10-04 15:47:54 +00:00
|
|
|
var rwy = dlg.getNode("runway", 1);
|
2006-03-31 10:30:46 +00:00
|
|
|
rwy.setValue("");
|
2008-12-12 20:09:55 +00:00
|
|
|
var parkpos = dlg.getNode("parkpos", 1);
|
|
|
|
parkpos.setValue("");
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2008-12-12 20:09:55 +00:00
|
|
|
var mode = {
|
2012-01-03 14:29:23 +00:00
|
|
|
runway: dlg.getNode("use_runway", 1),
|
|
|
|
bestrunway: dlg.getNode("use_best_runway", 1),
|
|
|
|
parkpos: dlg.getNode("use_parkpos", 1)
|
2008-12-12 20:09:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var set_radio = func(m) {
|
|
|
|
foreach (k; keys(mode)) {
|
|
|
|
mode[k].setBoolValue(m == k);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var initialized = 0;
|
|
|
|
foreach (k; keys(mode)) {
|
|
|
|
if (mode[k].getType() == "NONE" or initialized) {
|
|
|
|
mode[k].setBoolValue(0);
|
|
|
|
} else {
|
|
|
|
initialized += mode[k].getBoolValue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!initialized) {
|
2012-06-12 18:28:04 +00:00
|
|
|
set_radio("bestrunway");
|
2010-12-15 12:43:09 +00:00
|
|
|
}
|
2010-12-27 20:19:31 +00:00
|
|
|
|
|
|
|
var runways = dlg.getNode("available-runways", 1);
|
2012-04-25 15:10:28 +00:00
|
|
|
var parking = dlg.getNode("available-parking", 1);
|
|
|
|
|
|
|
|
var updateAirport = func {
|
2012-04-26 10:00:15 +00:00
|
|
|
var icao = apt.getValue();
|
2010-12-27 20:19:31 +00:00
|
|
|
runways.removeChildren("value");
|
2012-04-25 15:10:28 +00:00
|
|
|
parking.removeChildren("value");
|
|
|
|
|
2012-04-26 10:00:15 +00:00
|
|
|
var a = airportinfo(icao);
|
|
|
|
if (a == nil) {
|
|
|
|
aptname.setValue("");
|
2012-04-25 15:10:28 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-04-26 10:00:15 +00:00
|
|
|
aptname.setValue(a.name);
|
2012-04-25 15:10:28 +00:00
|
|
|
var i=0;
|
2012-04-26 10:00:15 +00:00
|
|
|
foreach (var rwy; keys(a.runways)) {
|
2012-04-25 15:10:28 +00:00
|
|
|
runways.getNode("value[" ~ i ~ "]", 1).setValue(rwy);
|
|
|
|
i += 1;
|
2010-12-15 12:43:09 +00:00
|
|
|
}
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2012-04-26 10:00:15 +00:00
|
|
|
i = 0;
|
|
|
|
foreach (var park; a.parking()) {
|
2012-07-31 21:22:16 +00:00
|
|
|
parking.getNode("value[" ~ i ~ "]", 1).setValue(park.name);
|
2012-04-25 15:10:28 +00:00
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
|
2010-12-27 20:19:31 +00:00
|
|
|
gui.dialog_update("location-on-ground");
|
2008-12-12 20:09:55 +00:00
|
|
|
}
|
2012-01-03 14:29:23 +00:00
|
|
|
|
2012-04-25 15:10:28 +00:00
|
|
|
updateAirport();
|
2006-03-31 10:30:46 +00:00
|
|
|
</open>
|
|
|
|
</nasal>
|
|
|
|
|
2004-05-12 15:37:17 +00:00
|
|
|
<group>
|
|
|
|
<layout>table</layout>
|
|
|
|
<halign>center</halign>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2004-05-12 15:37:17 +00:00
|
|
|
<text>
|
2008-12-12 20:09:55 +00:00
|
|
|
<row>0</row><col>1</col>
|
|
|
|
<halign>right</halign>
|
2004-05-12 15:37:17 +00:00
|
|
|
<label>Airport:</label>
|
|
|
|
</text>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2004-05-12 15:37:17 +00:00
|
|
|
<input>
|
2008-12-12 20:09:55 +00:00
|
|
|
<row>0</row><col>2</col>
|
2012-03-31 15:07:25 +00:00
|
|
|
<live>true</live>
|
2006-03-31 10:30:46 +00:00
|
|
|
<property>/sim/gui/dialogs/location-on-ground/airport</property>
|
2010-12-27 20:19:31 +00:00
|
|
|
<binding>
|
2010-12-15 12:43:09 +00:00
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
2010-12-27 20:19:31 +00:00
|
|
|
<binding>
|
2010-12-15 12:43:09 +00:00
|
|
|
<command>nasal</command>
|
2012-04-25 15:10:28 +00:00
|
|
|
<script>
|
|
|
|
updateAirport();
|
|
|
|
</script>
|
2010-12-15 12:43:09 +00:00
|
|
|
</binding>
|
2004-05-12 15:37:17 +00:00
|
|
|
</input>
|
2008-12-12 20:09:55 +00:00
|
|
|
|
2012-04-26 10:00:15 +00:00
|
|
|
<text>
|
|
|
|
<row>1</row>
|
|
|
|
<col>1</col>
|
|
|
|
<format>%s</format>
|
|
|
|
<property>/sim/gui/dialogs/location-on-ground/airport-name</property>
|
|
|
|
<live>true</live>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
<halign>fill</halign>
|
|
|
|
</text>
|
|
|
|
|
2008-12-12 20:09:55 +00:00
|
|
|
<radio>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>2</row><col>0</col>
|
2012-01-03 14:29:23 +00:00
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_best_runway</property>
|
|
|
|
<live>true</live>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>set_radio("bestrunway")</script>
|
|
|
|
</binding>
|
|
|
|
</radio>
|
|
|
|
|
|
|
|
<text>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>2</row><col>1</col>
|
2012-01-03 14:29:23 +00:00
|
|
|
<halign>right</halign>
|
|
|
|
<label>Best runway</label>
|
|
|
|
<enable>
|
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_best_runway</property>
|
|
|
|
</enable>
|
|
|
|
</text>
|
|
|
|
<text>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>2</row><col>2</col>
|
2012-01-03 14:29:23 +00:00
|
|
|
<halign>right</halign>
|
|
|
|
<label>(based on wind)</label>
|
|
|
|
<enable>
|
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_best_runway</property>
|
|
|
|
</enable>
|
|
|
|
</text>
|
|
|
|
|
|
|
|
<radio>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>3</row><col>0</col>
|
2008-12-12 20:09:55 +00:00
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_runway</property>
|
|
|
|
<live>true</live>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>set_radio("runway")</script>
|
|
|
|
</binding>
|
|
|
|
</radio>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2008-12-12 20:09:55 +00:00
|
|
|
<text>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>3</row><col>1</col>
|
2008-12-12 20:09:55 +00:00
|
|
|
<halign>right</halign>
|
2004-05-12 15:37:17 +00:00
|
|
|
<label>Runway:</label>
|
2012-01-03 14:29:23 +00:00
|
|
|
<enable>
|
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_runway</property>
|
|
|
|
</enable>
|
2004-05-12 15:37:17 +00:00
|
|
|
</text>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2012-01-03 14:29:23 +00:00
|
|
|
<combo>
|
2010-12-15 12:43:09 +00:00
|
|
|
<name>runway</name>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>3</row><col>2</col>
|
2010-12-15 12:43:09 +00:00
|
|
|
<pref-width>85</pref-width>
|
2010-12-27 20:19:31 +00:00
|
|
|
<enable>
|
2010-12-15 12:43:09 +00:00
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_runway</property>
|
|
|
|
</enable>
|
|
|
|
<property>sim/gui/dialogs/location-on-ground/runway</property>
|
|
|
|
<editable>false</editable>
|
|
|
|
<properties>sim/gui/dialogs/location-on-ground/available-runways</properties>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>runway</object-name>
|
|
|
|
</binding>
|
|
|
|
</combo>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2008-12-12 20:09:55 +00:00
|
|
|
<radio>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>4</row><col>0</col>
|
2008-12-12 20:09:55 +00:00
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_parkpos</property>
|
|
|
|
<live>true</live>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>set_radio("parkpos")</script>
|
|
|
|
</binding>
|
|
|
|
</radio>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2008-12-12 20:09:55 +00:00
|
|
|
<text>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>4</row><col>1</col>
|
2008-12-12 20:09:55 +00:00
|
|
|
<halign>right</halign>
|
|
|
|
<label>Parking:</label>
|
2012-01-03 14:29:23 +00:00
|
|
|
<enable>
|
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_parkpos</property>
|
|
|
|
</enable>
|
2008-12-12 20:09:55 +00:00
|
|
|
</text>
|
2012-04-25 15:10:28 +00:00
|
|
|
|
|
|
|
<combo>
|
|
|
|
<name>parking</name>
|
2012-04-26 10:00:15 +00:00
|
|
|
<row>4</row><col>2</col>
|
2012-04-25 15:10:28 +00:00
|
|
|
<pref-width>85</pref-width>
|
2010-12-27 20:19:31 +00:00
|
|
|
<enable>
|
2010-12-15 12:43:09 +00:00
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_parkpos</property>
|
|
|
|
</enable>
|
2008-12-12 20:09:55 +00:00
|
|
|
<property>/sim/gui/dialogs/location-on-ground/parkpos</property>
|
2012-04-25 15:10:28 +00:00
|
|
|
<editable>false</editable>
|
|
|
|
<properties>sim/gui/dialogs/location-on-ground/available-parking</properties>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>parking</object-name>
|
|
|
|
</binding>
|
|
|
|
</combo>
|
2004-05-12 15:37:17 +00:00
|
|
|
</group>
|
2003-01-21 15:47:37 +00:00
|
|
|
|
2010-12-27 20:19:31 +00:00
|
|
|
<hrule/>
|
|
|
|
|
2004-05-12 15:37:17 +00:00
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<default-padding>10</default-padding>
|
|
|
|
<empty><stretch>true</stretch></empty>
|
2003-01-21 15:47:37 +00:00
|
|
|
|
2004-05-12 15:37:17 +00:00
|
|
|
<button>
|
|
|
|
<legend>OK</legend>
|
|
|
|
<default>true</default>
|
|
|
|
<equal>true</equal>
|
|
|
|
<binding>
|
2006-03-31 10:30:46 +00:00
|
|
|
<command>dialog-apply</command>
|
2004-05-12 15:37:17 +00:00
|
|
|
</binding>
|
2012-03-31 15:07:25 +00:00
|
|
|
<enable>
|
|
|
|
<not>
|
|
|
|
<and>
|
|
|
|
<property>/sim/gui/dialogs/location-on-ground/use_runway</property>
|
|
|
|
<equals>
|
|
|
|
<property>/sim/gui/dialogs/location-on-ground/runway</property>
|
|
|
|
<value></value>
|
|
|
|
</equals>
|
|
|
|
</and>
|
|
|
|
</not>
|
|
|
|
</enable>
|
2004-05-12 15:37:17 +00:00
|
|
|
<binding>
|
2006-03-31 10:30:46 +00:00
|
|
|
<command>nasal</command>
|
|
|
|
<script>
|
|
|
|
setprop("/sim/presets/airport-id", apt.getValue());
|
2012-01-03 14:29:23 +00:00
|
|
|
if (mode["bestrunway"].getBoolValue()) {
|
|
|
|
setprop("/sim/presets/runway", "");
|
|
|
|
setprop("/sim/presets/parkpos", "");
|
|
|
|
} else if (mode["runway"].getBoolValue()) {
|
2008-12-12 20:09:55 +00:00
|
|
|
setprop("/sim/presets/runway", rwy.getValue());
|
|
|
|
setprop("/sim/presets/parkpos", "");
|
|
|
|
} else {
|
|
|
|
setprop("/sim/presets/runway", "");
|
|
|
|
setprop("/sim/presets/parkpos", parkpos.getValue());
|
|
|
|
}
|
2006-03-31 10:30:46 +00:00
|
|
|
setprop("/sim/presets/longitude-deg", -9999);
|
|
|
|
setprop("/sim/presets/latitude-deg", -9999);
|
|
|
|
setprop("/sim/presets/altitude-ft", -9999);
|
|
|
|
setprop("/sim/presets/airspeed-kt", 0);
|
2008-05-01 21:15:40 +00:00
|
|
|
setprop("/sim/presets/offset-distance-nm", 0);
|
|
|
|
setprop("/sim/presets/offset-azimuth-nm", 0);
|
2006-03-31 10:30:46 +00:00
|
|
|
setprop("/sim/presets/glideslope-deg", 0);
|
2007-10-04 15:47:54 +00:00
|
|
|
setprop("/sim/presets/heading-deg", 9999);
|
2006-03-31 10:30:46 +00:00
|
|
|
</script>
|
2004-05-12 15:37:17 +00:00
|
|
|
</binding>
|
|
|
|
<binding>
|
2006-03-31 10:30:46 +00:00
|
|
|
<command>presets-commit</command>
|
2004-05-12 15:37:17 +00:00
|
|
|
</binding>
|
|
|
|
<binding>
|
2006-03-31 10:30:46 +00:00
|
|
|
<command>dialog-close</command>
|
2004-05-12 15:37:17 +00:00
|
|
|
</binding>
|
|
|
|
</button>
|
2003-01-21 15:47:37 +00:00
|
|
|
|
2004-05-12 15:37:17 +00:00
|
|
|
<empty><stretch>true</stretch></empty>
|
2003-01-21 15:47:37 +00:00
|
|
|
|
2004-05-12 15:37:17 +00:00
|
|
|
<button>
|
|
|
|
<legend>Cancel</legend>
|
2006-03-31 10:30:46 +00:00
|
|
|
<equal>true</equal>
|
2005-11-05 18:42:28 +00:00
|
|
|
<key>Esc</key>
|
2004-05-12 15:37:17 +00:00
|
|
|
<binding>
|
2006-03-31 10:30:46 +00:00
|
|
|
<command>dialog-close</command>
|
2004-05-12 15:37:17 +00:00
|
|
|
</binding>
|
|
|
|
</button>
|
2003-01-21 15:47:37 +00:00
|
|
|
|
2004-05-12 15:37:17 +00:00
|
|
|
<empty><stretch>true</stretch></empty>
|
|
|
|
</group>
|
2003-01-27 19:55:48 +00:00
|
|
|
</PropertyList>
|