1 contributor
<?xml version="1.0"?>
<PropertyList>
<multikey>
<nasal>
<script><![CDATA[
var zkv1000_devices = [];
foreach (var c; zkv1000.zkv.getChildren()) {
if (c.getNode('status') != nil) {
var name = c.getName();
var role = substr(name, 0, 3);
if (role == 'MFD' or role == 'PFD') {
append(zkv1000_devices, name);
printf("ZKV1000 multikey added %s (:z%u)", name, size(zkv1000_devices));
}
}
}
var zkv1000_device_available = func (device) {
return contains(zkv1000.flightdeck, device)
and zkv1000.zkv.getNode(device).getValue("status") == 1;
}
var zkv1000_pushButton = func (device_id, button) {
if (device_id > 0 and device_id <= size(zkv1000_devices)) {
var device_name = zkv1000_devices[device_id - 1];
if (zkv1000_device_available(device_name))
call(zkv1000.flightdeck[device_name].buttons[button], [0], zkv1000.flightdeck[device_name].buttons);
}
}
var zkv1000_turnKnob = func (device_id, knob, dir, display_name) {
if (device_id > 0 and device_id <= size(zkv1000_devices)) {
var device_name = zkv1000_devices[device_id - 1];
if (zkv1000_device_available(device_name)) {
_ = sprintf("%s %s", device_name, display_name, dir > 0 ? "clockwise" : "counterclockwise");
call(zkv1000.flightdeck[device_name].knobs[knob], [ dir ], zkv1000.flightdeck[device_name].knobs);
}
}
}
]]></script>
</nasal>
<key n="122">
<name>z</name>
<desc>ZKV1000 commands</desc>
<key n="111">
<name>o</name>
<desc>Power ON device</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.powerOn();</script>
</binding>
</key>
<key n="100">
<name>d</name>
<desc>display list of available devices and their numeric label</desc>
<no-exit/>
<binding>
<command>nasal</command>
<script>
var list = "List of available ZKV1000 devices";
forindex (var i; zkv1000_devices)
list ~= sprintf("\n%u: %s", i+1, zkv1000_devices[i]);
gui.popupTip(list);
</script>
</binding>
</key>
<key n="107">
<name>k</name>
<desc>ALT HDG CRS BARO COMM NAV knobs</desc>
<key n="97">
<name>a</name>
<desc>ALT knob</desc>
<key n="97">
<name>a</name>
<desc>push ALT knob</desc>
<exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>zkv1000.flightdeck['PFD'].buttons.ALT();</script>
</binding>
</key>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/afcs/selected-alt-ft</property>
<step>10</step>
<min>0</min>
<max>16000</max>
<wrap>false</wrap>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/afcs/selected-alt-ft</property>
<step>-10</step>
<min>0</min>
<max>16000</max>
<wrap>false</wrap>
</binding>
</key>
</key>
<key n="98">
<name>b</name>
<desc>BARO knob</desc>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/altimeter/setting-inhg</property>
<step>0.01</step>
<min>28.500</min>
<max>33.000</max>
<wrap>false</wrap>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>counterclockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/altimeter/setting-inhg</property>
<step>-0.01</step>
<min>28.500</min>
<max>33.000</max>
<wrap>false</wrap>
</binding>
</key>
</key>
<key n="99">
<name>c</name>
<desc>CRS knob</desc>
<no-exit/>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
<not>
<equals>
<property>/instrumentation/zkv1000/cdi/source</property>
<value>GPS</value>
</equals>
<equals>
<property>/instrumentation/gps/mode</property>
<value>obs</value>
</equals>
</not>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/cdi/course</property>
<step>1</step>
<min>0</min>
<max>359</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
<equals>
<property>/instrumentation/zkv1000/cdi/source</property>
<value>GPS</value>
</equals>
<equals>
<property>/instrumentation/gps/mode</property>
<value>obs</value>
</equals>
</condition>
<command>property-adjust</command>
<property>/instrumentation/gps/selected-course-deg</property>
<step>1</step>
<min>0</min>
<max>359</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
foreach (var c; keys(zkv1000.flightdeck))
if (zkv1000.flightdeck[c].role == 'PFD')
zkv1000.flightdeck[c].display.updateCRS();
</script>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>counterclockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
<not>
<equals>
<property>/instrumentation/zkv1000/cdi/source</property>
<value>GPS</value>
</equals>
<equals>
<property>/instrumentation/gps/mode</property>
<value>obs</value>
</equals>
</not>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/cdi/course</property>
<step>-1</step>
<min>0</min>
<max>359</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
<equals>
<property>/instrumentation/zkv1000/cdi/source</property>
<value>GPS</value>
</equals>
<equals>
<property>/instrumentation/gps/mode</property>
<value>obs</value>
</equals>
</condition>
<command>property-adjust</command>
<property>/instrumentation/gps/selected-course-deg</property>
<step>-1</step>
<min>0</min>
<max>359</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
foreach (var c; keys(zkv1000.flightdeck))
if (zkv1000.flightdeck[c].role == 'PFD')
zkv1000.flightdeck[c].display.updateCRS();
</script>
</binding>
</key>
</key>
<key n="104">
<name>h</name>
<desc>HDG knob</desc>
<key n="104">
<name>h</name>
<desc>push HDG knob</desc>
<exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-assign</command>
<property>/instrumentation/zkv1000/afcs/heading-bug-deg</property>
<property>/orientation/heading-magnetic-deg</property>
</binding>
</key>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/afcs/heading-bug-deg</property>
<step>1</step>
<min>0</min>
<max>359</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
foreach (var c; keys(zkv1000.flightdeck))
if (zkv1000.flightdeck[c].role == 'PFD')
zkv1000.flightdeck[c].display.updateHDG();
</script>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>counterclockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/afcs/heading-bug-deg</property>
<step>-1</step>
<min>0</min>
<max>359</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
foreach (var c; keys(zkv1000.flightdeck))
if (zkv1000.flightdeck[c].role == 'PFD')
zkv1000.flightdeck[c].display.updateHDG();
</script>
</binding>
</key>
</key>
<key n="108">
<name>n</name>
<desc>NAV knob</desc>
<key n="108">
<name>n</name>
<desc>push NAV knob</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-toggle</command>
<property>/instrumentation/zkv1000/radios/nav-tune</property>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
zkv1000.setNavTune();
var n = getprop('/instrumentation/zkv1000/radios/nav-tune');
foreach (var c; keys(zkv1000.flightdeck))
zkv1000.flightdeck[c].display.updateNAV({tune:n});
</script>
</binding>
</key>
<key n="115">
<name>s</name>
<desc>Switch NAV freq STBY<->SEL</desc>
<exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>zkv1000.flightdeck['PFD'].buttons.AsSwitchNAV(0);</script>
</binding>
</key>
<key n="118">
<name>v</name>
<desc>NAV Volume knob</desc>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/radios/comm-volume</property>
<step>0.05</step>
<min>0</min>
<max>1</max>
<wrap>false</wrap>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>counterclockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/radios/comm-volume</property>
<step>-0.05</step>
<min>0</min>
<max>1</max>
<wrap>false</wrap>
</binding>
</key>
</key>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/radios/nav-freq-mhz</property>
<step>0.05</step>
<min>108.000</min>
<max>118.000</max>
<wrap>true></wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
foreach (var c; keys(zkv1000.flightdeck))
zkv1000.flightdeck[c].display.updateNAV({set:1});
</script>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>counterclockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/radios/nav-freq-mhz</property>
<step>-0.05</step>
<min>108.000</min>
<max>118.000</max>
<wrap>true></wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
foreach (var c; keys(zkv1000.flightdeck))
zkv1000.flightdeck[c].display.updateNAV({set:1});
</script>
</binding>
</key>
</key>
<key n="109">
<name>o</name>
<desc>COMM knob</desc>
<key n="109">
<name>o</name>
<desc>push COMM knob</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-toggle</command>
<property>/instrumentation/zkv1000/radios/comm-tune</property>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
zkv1000.setCommTune();
var n = getprop('/instrumentation/zkv1000/radios/comm-tune');
foreach (var c; keys(zkv1000.flightdeck))
zkv1000.flightdeck[c].display.updateCOMM({tune:n});
</script>
</binding>
</key>
<key n="114">
<name>e</name>
<desc>Emergency frequency (delay 2 seconds)</desc>
<exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
call(zkv1000.flightdeck['PFD'].buttons.AsSwitchCOM, [1], zkv1000.flightdeck['PFD'].buttons);
var e_delay = maketimer(2.1, func {
call(zkv1000.flightdeck['PFD'].buttons.AsSwitchCOM, [0], zkv1000.flightdeck['PFD'].buttons);
});
e_delay.singleShot = 1;
e_delay.start();
</script>
</binding>
</key>
<key n="115">
<name>s</name>
<desc>Switch COMM freq SEL<->STBY</desc>
<exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
call(zkv1000.flightdeck['PFD'].buttons.AsSwitchCOM, [1], zkv1000.flightdeck['PFD'].buttons);
call(zkv1000.flightdeck['PFD'].buttons.AsSwitchCOM, [0], zkv1000.flightdeck['PFD'].buttons);
</script>
</binding>
</key>
<key n="118">
<name>v</name>
<desc>COMM Volume knob</desc>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/radios/comm-volume</property>
<step>0.05</step>
<min>0</min>
<max>1</max>
<wrap>false</wrap>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>counterclockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/radios/comm-volume</property>
<step>-0.05</step>
<min>0</min>
<max>1</max>
<wrap>false</wrap>
</binding>
</key>
</key>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/radios/comm-freq-mhz</property>
<step>0.025</step>
<min>118.000</min>
<max>137.975</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
foreach (var c; keys(zkv1000.flightdeck))
zkv1000.flightdeck[c].display.updateCOMM({set:1});
</script>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>counterclockwise</desc>
<no-exit/>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>property-adjust</command>
<property>/instrumentation/zkv1000/radios/comm-freq-mhz</property>
<step>-0.025</step>
<min>118.000</min>
<max>137.975</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<property>/instrumentation/zkv1000/PFD/status</property>
</condition>
<command>nasal</command>
<script>
foreach (var c; keys(zkv1000.flightdeck))
zkv1000.flightdeck[c].display.updateCOMM({set:1});
</script>
</binding>
</key>
</key>
</key>
<key n="902">
<name>%u</name>
<desc>zkv1000 device index %u</desc>
<key n="100">
<name>d</name>
<desc>DirectTo</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "DirectTo");</script>
</binding>
</key>
<key n="109">
<name>m</name>
<desc>MENU</desc>
<no-exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "MENU");</script>
</binding>
</key>
<key n="102">
<name>f</name>
<desc>FPL</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "FPL");</script>
</binding>
</key>
<key n="112">
<name>p</name>
<desc>PROC</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "PROC");</script>
</binding>
</key>
<key n="99">
<name>c</name>
<desc>CLR</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "CLR");</script>
</binding>
</key>
<key n="101">
<name>e</name>
<desc>ENT</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "ENT");</script>
</binding>
</key>
<key n="105">
<name>i</name>
<desc>FMS inner knob</desc>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<command>nasal</command>
<script>zkv1000_turnKnob(arg[0], "FmsInner", 1, "FMS inner");</script>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<command>nasal</command>
<script>zkv1000_turnKnob(arg[0], "FmsInner", -1, "FMS inner");</script>
</binding>
</key>
<key n="99">
<name>c</name>
<desc>CLR</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "CLR");</script>
</binding>
</key>
<key n="101">
<name>e</name>
<desc>ENT</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "ENT");</script>
</binding>
</key>
</key>
<key n="111">
<name>o</name>
<desc>FMS outer knob</desc>
<key n="94">
<name>^</name>
<desc>clockwise</desc>
<no-exit/>
<binding>
<command>nasal</command>
<script>zkv1000_turnKnob(arg[0], "FmsOuter", -1, "FMS outer");</script>
</binding>
</key>
<key n="95">
<name>_</name>
<desc>counterclockwise</desc>
<no-exit/>
<binding>
<command>nasal</command>
<script>zkv1000_turnKnob(arg[0], "FmsOuter", 1, "FMS outer");</script>
</binding>
</key>
<key n="99">
<name>c</name>
<desc>CLR</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "CLR");</script>
</binding>
</key>
<key n="101">
<name>e</name>
<desc>ENT</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000_pushButton(arg[0], "ENT");</script>
</binding>
</key>
</key>
</key>
<key n="97">
<name>a</name>
<desc>Autopilot buttons</desc>
<key n="111">
<name>o</name>
<desc>AP</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('L', 0, 1);</script>
</binding>
</key>
<key n="102">
<name>f</name>
<desc>FD</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('L', 1, 1);</script>
</binding>
</key>
<key n="110">
<name>n</name>
<desc>NAV</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('L', 2, 1);</script>
</binding>
</key>
<key n="97">
<name>a</name>
<desc>ALT</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('L', 3, 1);</script>
</binding>
</key>
<key n="118">
<name>v</name>
<desc>VS</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('L', 4, 1);</script>
</binding>
</key>
<key n="99">
<name>c</name>
<desc>FLC</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('L', 5, 1);</script>
</binding>
</key>
<key n="121">
<name>y</name>
<desc>YD</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('R', 0, 1);</script>
</binding>
</key>
<key n="104">
<name>h</name>
<desc>HDG</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('R', 1, 1);</script>
</binding>
</key>
<key n="65">
<name>A</name>
<desc>APR</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('R', 2, 1);</script>
</binding>
</key>
<key n="">
<name>V</name>
<desc>VNV</desc>
<exit/>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('R', 3, 1);</script>
</binding>
</key>
<key n="117">
<name>u</name>
<desc>nose UP</desc>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('R', 4, 1);</script>
</binding>
</key>
<key n="100">
<name>d</name>
<desc>nose DOWN</desc>
<binding>
<command>nasal</command>
<script>zkv1000.autopilot.softkey('R', 5, 1);</script>
</binding>
</key>
</key>
</key>
</multikey>
</PropertyList>