<?xml version="1.0" encoding="UTF-8"?>
<!--
Altimeter based on Bendix/King KX155 COMM/NAV radio model
http://
Created by Torsten Dreyer, October 2008 - Adapted by Pavel Cueto and Fernando Espinosa, January 2012
License: GPL

Settings for use as COMM1/NAV1
  -->

<PropertyList>

  <path>BendixKing_KX155.ac</path>

  <animation>
    <object-name>Base</object-name>
  </animation>

  <params>
    <comm-serviceable>instrumentation/comm[0]/serviceable</comm-serviceable>
    <nav-serviceable>instrumentation/nav[0]/serviceable</nav-serviceable>
    <power>instrumentation/comm[0]/power-btn</power>

    <comm-frq-swp>instrumentation/comm[0]/frq-swap-btn</comm-frq-swp>
    <comm-frq-selected>instrumentation/comm[0]/frequencies/selected-mhz</comm-frq-selected>
    <comm-frq-standby>instrumentation/comm[0]/frequencies/standby-mhz</comm-frq-standby>
    <comm-volume>instrumentation/comm[0]/volume</comm-volume>
    <comm-test>instrumentation/comm[0]/test-btn</comm-test>

    <nav-frq-swp>instrumentation/nav[0]/frq-swap-btn</nav-frq-swp>
    <nav-frq-selected>instrumentation/nav[0]/frequencies/selected-mhz</nav-frq-selected>
    <nav-frq-standby>instrumentation/nav[0]/frequencies/standby-mhz</nav-frq-standby>
    <nav-volume>instrumentation/nav[0]/volume</nav-volume>
    <nav-audio>instrumentation/nav[0]/audio-btn</nav-audio>

    <dimming>instrumentation/comm[0]/dimming-norm</dimming>

    <nav-electrical>/systems/electrical/outputs/nav[0]</nav-electrical>
  </params>

  <animation>
    <type>select</type>
    <object-name>Digit_COMM01</object-name>
    <object-name>Digit_COMM02</object-name>
    <object-name>Digit_COMM03</object-name>
    <object-name>Digit_COMM04</object-name>
    <object-name>Digit_COMM05</object-name>
    <object-name>Digit_COMM06</object-name>
    <object-name>Digit_COMM07</object-name>
    <object-name>Digit_COMM08</object-name>
    <object-name>Digit_COMM09</object-name>
    <object-name>Digit_COMM10</object-name>
    <object-name>Digit_NAV01</object-name>
    <object-name>Digit_NAV02</object-name>
    <object-name>Digit_NAV03</object-name>
    <object-name>Digit_NAV04</object-name>
    <object-name>Digit_NAV05</object-name>
    <object-name>Digit_NAV06</object-name>
    <object-name>Digit_NAV07</object-name>
    <object-name>Digit_NAV08</object-name>
    <object-name>Digit_NAV09</object-name>
    <object-name>Digit_NAV10</object-name>
    <object-name>Digit_P</object-name>
    <object-name>Digit_R</object-name>
    <object-name>Digit_T</object-name>
    <condition>
      <property alias="../../../params/comm-serviceable"/>
      <property alias="../../../params/nav-serviceable"/>
      <property alias="../../../params/power"/>
      <property alias="../../../params/nav-electrical"/>
    </condition>
  </animation> 

  <animation>
    <type>select</type>
    <object-name>Digit_R</object-name>
    <object-name>Digit_T</object-name>
    <visible>false</visible>
  </animation> 

  <!-- LIGHTS -->

  <animation>
    <type>material</type>
    <object-name>Knob_COMM01</object-name>
    <object-name>Knob_COMM02</object-name>
    <object-name>Knob_COMM03</object-name>
    <object-name>Knob_NAV01</object-name>
    <object-name>Knob_NAV02</object-name>
    <object-name>Knob_NAV03</object-name>
    <object-name>Btn_COMM</object-name>
    <object-name>Btn_NAV</object-name>
    <condition>
      <property>systems/electrical/outputs/panel-lights</property>
    </condition>
    <emission>
      <red>0.7</red>
      <green>0.7</green>
      <blue>0.7</blue>
      <factor-prop>controls/lighting/panel-norm</factor-prop>  <!-- <factor-prop>systems/electrical/outputs/instrument-lights</factor-prop> -->
    </emission>
  </animation>

  <animation>
    <type>material</type>
    <object-name>Digit_COMM01</object-name>
    <object-name>Digit_COMM02</object-name>
    <object-name>Digit_COMM03</object-name>
    <object-name>Digit_COMM04</object-name>
    <object-name>Digit_COMM05</object-name>
    <object-name>Digit_COMM06</object-name>
    <object-name>Digit_COMM07</object-name>
    <object-name>Digit_COMM08</object-name>
    <object-name>Digit_COMM09</object-name>
    <object-name>Digit_COMM10</object-name>
    <object-name>Digit_NAV01</object-name>
    <object-name>Digit_NAV02</object-name>
    <object-name>Digit_NAV03</object-name>
    <object-name>Digit_NAV04</object-name>
    <object-name>Digit_NAV05</object-name>
    <object-name>Digit_NAV06</object-name>
    <object-name>Digit_NAV07</object-name>
    <object-name>Digit_NAV08</object-name>
    <object-name>Digit_NAV09</object-name>
    <object-name>Digit_NAV10</object-name>
    <object-name>Digit_P</object-name>
    <object-name>Digit_R</object-name>
    <object-name>Digit_T</object-name>
    <emission>
      <red>-1.0</red>
      <green>-1.0</green>
      <blue>-1.0</blue>
      <factor-prop alias="../../../params/dimming"/>
      <offset>1</offset>
    </emission>
  </animation> 

  <!-- COMM DISPLAY -->

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM01</object-name>
    <property alias="../../params/comm-frq-selected"/>
    <step>100</step>
    <factor>0.001</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM02</object-name>
    <property alias="../../params/comm-frq-selected"/>
    <step>10</step>
    <factor>0.01</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM03</object-name>
    <property alias="../../params/comm-frq-selected"/>
    <step>1</step>
    <factor>0.1</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM04</object-name>
    <property alias="../../params/comm-frq-selected"/>
    <step>0.1</step>
    <factor>1</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM05</object-name>
    <property alias="../../params/comm-frq-selected"/>
    <step>0.01</step>
    <factor>10</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM06</object-name>
    <property alias="../../params/comm-frq-standby"/>
    <step>100</step>
    <factor>0.001</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM07</object-name>
    <property alias="../../params/comm-frq-standby"/>
    <step>10</step>
    <factor>0.01</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM08</object-name>
    <property alias="../../params/comm-frq-standby"/>
    <step>1</step>
    <factor>0.1</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM09</object-name>
    <property alias="../../params/comm-frq-standby"/>
    <step>0.1</step>
    <factor>1</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_COMM10</object-name>
    <property alias="../../params/comm-frq-standby"/>
    <step>0.01</step>
    <factor>10</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <!-- NAV DISPLAY -->

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV01</object-name>
    <property alias="../../params/nav-frq-selected"/>
    <step>100</step>
    <factor>0.001</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV02</object-name>
    <property alias="../../params/nav-frq-selected"/>
    <step>10</step>
    <factor>0.01</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV03</object-name>
    <property alias="../../params/nav-frq-selected"/>
    <step>1</step>
    <factor>0.1</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV04</object-name>
    <property alias="../../params/nav-frq-selected"/>
    <step>0.1</step>
    <factor>1</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV05</object-name>
    <property alias="../../params/nav-frq-selected"/>
    <step>0.01</step>
    <factor>10</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV06</object-name>
    <property alias="../../params/nav-frq-standby"/>
    <step>100</step>
    <factor>0.001</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV07</object-name>
    <property alias="../../params/nav-frq-standby"/>
    <step>10</step>
    <factor>0.01</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV08</object-name>
    <property alias="../../params/nav-frq-standby"/>
    <step>1</step>
    <factor>0.1</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV09</object-name>
    <property alias="../../params/nav-frq-standby"/>
    <step>0.1</step>
    <factor>1</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_NAV10</object-name>
    <property alias="../../params/nav-frq-standby"/>
    <step>0.01</step>
    <factor>10</factor>
    <bias>0.0001</bias>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <!-- BUTTONS & KNOBS -->

  <animation>
    <type>translate</type>
    <object-name>Btn_COMM</object-name>
    <property alias="../../params/comm-frq-swp"/>
    <factor>-0.002</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Btn_NAV</object-name>
    <property alias="../../params/nav-frq-swp"/>
    <factor>-0.002</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Knob_COMM01</object-name>
    <property alias="../../params/comm-volume"/>
    <factor>-270</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
    <center>
      <x-m> 0.004417</x-m>
      <y-m>-0.06177 </y-m>
      <z-m>-0.015   </z-m>
    </center>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Knob_COMM01</object-name>
    <property alias="../../params/comm-test"/>
    <factor>0.002</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Knob_COMM02</object-name>
    <object-name>Knob_COMM03</object-name>
    <property alias="../../params/comm-frq-standby"/>
    <factor>-360</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
    <center>
      <x-m> 0.01319</x-m>
      <y-m>-0.022  </y-m>
      <z-m>-0.01052</z-m>
    </center>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Knob_NAV01</object-name>
    <property alias="../../params/nav-volume"/>
    <factor>-270</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
    <center>
      <x-m> 0.004417</x-m>
      <y-m> 0.01823 </y-m>
      <z-m>-0.015   </z-m>
    </center>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Knob_NAV01</object-name>
    <property alias="../../params/nav-audio"/>
    <factor>0.002</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Knob_NAV02</object-name>
    <object-name>Knob_NAV03</object-name>
    <property alias="../../params/nav-frq-standby"/>
    <factor>-360</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
    <center>
      <x-m> 0.01319</x-m>
      <y-m> 0.058  </y-m>
      <z-m>-0.01052</z-m>
    </center>
  </animation>

  <!-- ACTIONS COMM RADIO -->

  <animation>
    <type>pick</type>
    <object-name>Knob_COMM01</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>property-toggle</command>
        <property alias="../../../../params/comm-test"/>
      </binding>
    </action>
    <action>
      <button>3</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/comm-volume"/>
        <step>0.1</step>
        <min>0.0</min>
        <max>1.0</max>
        <wrap>false</wrap>
      </binding>
      <binding>
        <command>property-assign</command>
        <property alias="../../../../params/power"/>
        <value>1</value>
        <condition>
          <greater-than>
            <property alias="../../../../../../params/comm-volume"/>
            <value>0.05</value>
          </greater-than>
        </condition>
      </binding>
    </action>
    <action>
      <button>4</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/comm-volume"/>
        <step>-0.1</step>
        <min>0.0</min>
        <max>1.0</max>
        <wrap>false</wrap>
      </binding>
      <binding>
        <command>property-assign</command>
        <property alias="../../../../params/power"/>
        <value>0</value>
        <condition>
          <less-than>
            <property alias="../../../../../../params/comm-volume"/>
            <value>0.05</value>
          </less-than>
        </condition>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>Knob_COMM02</object-name>
    <object-name>Knob_COMM03</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>true</repeatable>
      <binding>
        <condition>
          <not>
            <property>devices/status/keyboard/shift</property>
          </not>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/comm-frq-standby"/>
        <step>0.025</step>
        <min>0.0</min>
        <max>1.0</max>
        <resolution>0.025</resolution>
        <wrap>true</wrap>
        <mask>decimal</mask>
      </binding>
    </action>
    <action>
      <button>1</button>
      <repeatable>true</repeatable>
      <binding>
        <condition>
          <not>
            <property>devices/status/keyboard/shift</property>
          </not>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/comm-frq-standby"/>
        <step>-0.025</step>
        <min>0.0</min>
        <max>1.0</max>
        <resolution>0.025</resolution>
        <wrap>true</wrap>
        <mask>decimal</mask>
      </binding>
    </action>
    <action>
      <button>3</button>
      <repeatable>false</repeatable>
      <binding>
        <condition>
          <not>
            <property>devices/status/keyboard/shift</property>
          </not>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/comm-frq-standby"/>
        <step>1</step>
        <min>118.0</min>
        <max>137.0</max>
        <wrap>true</wrap>
        <mask>integer</mask>
      </binding>
    </action>
    <action>
      <button>4</button>
      <repeatable>false</repeatable>
      <binding>
        <condition>
          <not>
            <property>devices/status/keyboard/shift</property>
          </not>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/comm-frq-standby"/>
        <step>-1</step>
        <min>118.0</min>
        <max>137.0</max>
        <wrap>true</wrap>
        <mask>integer</mask>
      </binding>
    </action>
  </animation>

  <!-- ACTIONS NAV RADIO -->

  <animation>
    <type>pick</type>
    <object-name>Knob_NAV01</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>property-toggle</command>
        <property alias="../../../../params/nav-audio"/>
      </binding>
    </action>
    <action>
      <button>3</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/nav-volume"/>
        <step>0.1</step>
        <min>0.0</min>
        <max>1.0</max>
        <wrap>false</wrap>
      </binding>
    </action>
    <action>
      <button>4</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/nav-volume"/>
        <step>-0.1</step>
        <min>0.0</min>
        <max>1.0</max>
        <wrap>false</wrap>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>Knob_NAV02</object-name>
    <object-name>Knob_NAV03</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>true</repeatable>
      <binding>
        <condition>
          <not>
            <property>devices/status/keyboard/shift</property>
          </not>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/nav-frq-standby"/>
        <step>0.025</step>
        <min>0.0</min>
        <max>1.0</max>
        <resolution>0.025</resolution>
        <wrap>true</wrap>
        <mask>decimal</mask>
      </binding>
    </action>
    <action>
      <button>1</button>
      <repeatable>true</repeatable>
      <binding>
        <condition>
          <not>
            <property>devices/status/keyboard/shift</property>
          </not>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/nav-frq-standby"/>
        <step>-0.025</step>
        <min>0.0</min>
        <max>1.0</max>
        <resolution>0.025</resolution>
        <wrap>true</wrap>
        <mask>decimal</mask>
      </binding>
    </action>
    <action>
      <button>3</button>
      <repeatable>false</repeatable>
      <binding>
        <condition>
          <not>
            <property>devices/status/keyboard/shift</property>
          </not>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/nav-frq-standby"/>
        <step>1</step>
        <min>108.0</min>
        <max>118.0</max>
        <wrap>true</wrap>
        <mask>integer</mask>
      </binding>
    </action>
    <action>
      <button>4</button>
      <repeatable>false</repeatable>
      <binding>
        <condition>
          <not>
            <property>devices/status/keyboard/shift</property>
          </not>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/nav-frq-standby"/>
        <step>-1</step>
        <min>108.0</min>
        <max>118.0</max>
        <wrap>true</wrap>
        <mask>integer</mask>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>Btn_COMM</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>property-assign</command>
        <property alias="../../../../params/comm-frq-swp"/>
        <value type="int">1</value>
      </binding>
      <binding>
        <command>property-swap</command>
        <property alias="../../../../params/comm-frq-selected"/>
        <property alias="../../../../params/comm-frq-standby"/>
      </binding>
      <mod-up>
        <binding>
          <command>property-assign</command>
          <property alias="../../../../../params/comm-frq-swp"/>
          <value type="int">0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>Btn_NAV</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>property-assign</command>
        <property alias="../../../../params/nav-frq-swp"/>
        <value type="int">1</value>
      </binding>
      <binding>
        <command>property-swap</command>
        <property alias="../../../../params/nav-frq-selected"/>
        <property alias="../../../../params/nav-frq-standby"/>
      </binding>
      <mod-up>
        <binding>
          <command>property-assign</command>
          <property alias="../../../../../params/nav-frq-swp"/>
          <value type="int">0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

<!-- Label Text -->

<text>
  <name>LabelText</name>
  <type type="string">literal</type>
  <text type="string">COMM/NAV Radio 1</text>
  <draw-text type="bool">true</draw-text>
  <font>Helvetica.txf</font>
  <character-size type="double">0.012</character-size>
  <character-aspect-ratio type="double">1.0</character-aspect-ratio>
  <axis-alignment>yz-plane</axis-alignment>
  <max-height>0.2</max-height>
  <max-width>0.07</max-width>
  <font-resolution>
    <width type="int">32</width>
    <height type="int">32</height>
  </font-resolution>
  <alignment>center-center</alignment>
  <offsets>
    <x-m> 0.01</x-m>
    <y-m> 0.0 </y-m>
    <z-m> 0.01</z-m>
  </offsets>
</text>

<animation>
  <type>material</type>
  <object-name>LabelText</object-name>
  <emission>
    <red>1.0</red>
    <green>0.8</green>
    <blue>0.0</blue>
  </emission>
</animation>

<animation>
  <type>select</type>
  <object-name>LabelText</object-name>
  <condition>
    <property>/sim/panel-hotspots</property>
  </condition>
</animation>

</PropertyList>
