Remove C++ ATC Dialog
This commit is contained in:
parent
d240a9b138
commit
fe894466bf
3 changed files with 72 additions and 9 deletions
|
@ -1,5 +1,33 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<PropertyList>
|
<PropertyList>
|
||||||
|
<nasal>
|
||||||
|
<open>
|
||||||
|
<![CDATA[
|
||||||
|
var self = cmdarg();
|
||||||
|
var icao = self.getNode("nasal/params/param/icao");
|
||||||
|
if (props.getNode("/sim/atc/freq-airport")!=nil) {
|
||||||
|
icao = props.getNode("/sim/atc/freq-airport");
|
||||||
|
}
|
||||||
|
var dialogTitle = sprintf("Airportfrequencies %s", icao.getValue());
|
||||||
|
self.getNode("text/label").setValue(dialogTitle);
|
||||||
|
var apt = airportinfo(icao.getValue());
|
||||||
|
var frequencies = apt.comms();
|
||||||
|
var textgroup = self.getNode("group").getNode("group-template");
|
||||||
|
var i = 0;
|
||||||
|
foreach (var c; frequencies) {
|
||||||
|
var target = self.getNode("group").getChild("group", i, 1);
|
||||||
|
props.copy(textgroup, target);
|
||||||
|
i = i + 1;
|
||||||
|
target.getNode("text/label").setValue(c.ident);
|
||||||
|
var formattedFreq = sprintf("%.3f MHz", c.frequency);
|
||||||
|
target.getNode("text[1]/label").setValue(formattedFreq);
|
||||||
|
target.getNode("button/binding/value").setValue(c.frequency);
|
||||||
|
target.getNode("button[1]/binding/value").setValue(c.frequency);
|
||||||
|
target.getNode("enabled").setValue(1);
|
||||||
|
}
|
||||||
|
]]>
|
||||||
|
</open>
|
||||||
|
</nasal>
|
||||||
<name>atc-freq-display</name>
|
<name>atc-freq-display</name>
|
||||||
<layout>vbox</layout>
|
<layout>vbox</layout>
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,37 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<PropertyList>
|
<PropertyList>
|
||||||
|
<nasal>
|
||||||
|
<open>
|
||||||
|
<![CDATA[
|
||||||
|
var self = cmdarg();
|
||||||
|
var dlgname = self.getNode("name").getValue();
|
||||||
|
|
||||||
|
self.getNode("group").removeChildren("button");
|
||||||
|
|
||||||
|
var textgroup = self.getNode("group").getNode("button-template");
|
||||||
|
|
||||||
|
var apts = findAirportsWithinRange(50);
|
||||||
|
if (size(apts) > 0) {
|
||||||
|
forindex (var i; apts) {
|
||||||
|
var target = self.getNode("group").getChild("button", i, 1);
|
||||||
|
props.copy(textgroup, target);
|
||||||
|
target.getNode("legend").setValue(apts[i].id);
|
||||||
|
target.getNode("binding/value").setValue(apts[i].id);
|
||||||
|
target.getNode("enabled").setValue(1);
|
||||||
|
}
|
||||||
|
props.dump(target);
|
||||||
|
} else {
|
||||||
|
self.getNode("text/enabled").setValue(1);
|
||||||
|
}
|
||||||
|
]]>
|
||||||
|
</open>
|
||||||
|
</nasal>
|
||||||
<name>atc-freq-search</name>
|
<name>atc-freq-search</name>
|
||||||
<layout>vbox</layout>
|
<layout>vbox</layout>
|
||||||
|
|
||||||
<text>
|
<text>
|
||||||
<label>Display Airport Frequencies</label>
|
<label>Display Nearest Airport Frequencies</label>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<hrule/>
|
<hrule/>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
|
@ -17,8 +42,13 @@
|
||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
<legend>ICAO</legend>
|
<legend>ICAO</legend>
|
||||||
<binding>
|
<binding>
|
||||||
<command>ATC-freq-display</command>
|
<command>property-assign</command>
|
||||||
<icao type="string">ICAO</icao>
|
<property>/sim/atc/freq-airport</property>
|
||||||
|
<value type="string">ICAO</value>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-show</command>
|
||||||
|
<dialog-name>atc-freq-display</dialog-name>
|
||||||
</binding>
|
</binding>
|
||||||
<binding>
|
<binding>
|
||||||
<command>dialog-close</command>
|
<command>dialog-close</command>
|
||||||
|
@ -53,14 +83,20 @@
|
||||||
<empty><stretch>true</stretch></empty>
|
<empty><stretch>true</stretch></empty>
|
||||||
|
|
||||||
<button>
|
<button>
|
||||||
<legend>OK</legend>
|
<legend>Search</legend>
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
<equal>true</equal>
|
<equal>true</equal>
|
||||||
<binding>
|
<binding>
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
<binding>
|
<binding>
|
||||||
<command>ATC-freq-display</command>
|
<command>dialog-show</command>
|
||||||
|
<dialog-name>atc-freq-display</dialog-name>
|
||||||
|
<!--
|
||||||
|
<params>
|
||||||
|
<icao type="string">ICAO</icao>
|
||||||
|
</params>
|
||||||
|
-->
|
||||||
</binding>
|
</binding>
|
||||||
<binding>
|
<binding>
|
||||||
<command>dialog-close</command>
|
<command>dialog-close</command>
|
||||||
|
@ -77,8 +113,6 @@
|
||||||
<command>dialog-close</command>
|
<command>dialog-close</command>
|
||||||
</binding>
|
</binding>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<empty><stretch>true</stretch></empty>
|
<empty><stretch>true</stretch></empty>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
|
@ -592,7 +592,8 @@
|
||||||
<item>
|
<item>
|
||||||
<name>atc-in-range</name>
|
<name>atc-in-range</name>
|
||||||
<binding>
|
<binding>
|
||||||
<command>ATC-freq-search</command>
|
<command>dialog-show</command>
|
||||||
|
<dialog-name>atc-freq-search</dialog-name>
|
||||||
</binding>
|
</binding>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue