<?xml version="1.0" ?>
<!--
 This file is part of FlightGear, the free flight simulator
 http://www.flightgear.org/

 Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 General Public License for more details.
-->
<PropertyList>
  <params>
    <right-display>/instrumentation/adf[0]/right-display</right-display>
    <dimming>instrumentation/adf[0]/dimming-norm</dimming>
  </params>

  <path>KR87.ac</path>

  <animation>
    <type>select</type>
    <object-name>Digit_L1000</object-name>
    <object-name>Digit_L100</object-name>
    <object-name>Digit_L10</object-name>
    <object-name>Digit_L1</object-name>
    <object-name>Digit_R1000</object-name>
    <object-name>Digit_R100</object-name>
    <object-name>Digit_R10</object-name>
    <object-name>Digit_R1</object-name>
    <object-name>Digit_RP</object-name>
    <object-name>Digit_ADF</object-name>
    <object-name>Digit_ANT</object-name>
    <object-name>Digit_BFO</object-name>
    <object-name>Digit_FRQ</object-name>
    <object-name>Digit_FLT</object-name>
    <object-name>Digit_ET</object-name>
    <condition>
      <property>/instrumentation/adf[0]/serviceable</property>
      <property>/instrumentation/adf[0]/power-btn</property>
      <property>systems/electrical/outputs/adf</property>
    </condition>
  </animation>

  <animation>
    <type>range</type>
    <min-m>0</min-m>
    <max-m>10</max-m>
  </animation>

  <animation>
    <type>material</type>
    <object-name>Btn_ADF</object-name>
    <object-name>Btn_BFO</object-name>
    <object-name>Btn_FRQ</object-name>
    <object-name>Btn_FLT</object-name>
    <object-name>Btn_SET</object-name>
    <condition>
      <property>systems/electrical/outputs/panel-lights</property>
    </condition>
    <emission>
      <red>0.7</red>  <!-- <red-prop>/sim/model/instrument-lighting/emission/red</red-prop> -->
      <green>0.7</green>  <!-- <green-prop>/sim/model/instrument-lighting/emission/green</green-prop> -->
      <blue>0.7</blue>  <!-- <blue-prop>/sim/model/instrument-lighting/emission/blue</blue-prop> -->
      <factor-prop>controls/lighting/panel-norm</factor-prop>  <!-- <factor-prop>/controls/lighting/instruments-norm</factor-prop> -->
    </emission>
  </animation> 

  <animation>
    <type>material</type>
    <object-name>Digit_L1000</object-name>
    <object-name>Digit_L100</object-name>
    <object-name>Digit_L10</object-name>
    <object-name>Digit_L1</object-name>
    <object-name>Digit_R1000</object-name>
    <object-name>Digit_R100</object-name>
    <object-name>Digit_R10</object-name>
    <object-name>Digit_R1</object-name>
    <object-name>Digit_RP</object-name>
    <object-name>Digit_ADF</object-name>
    <object-name>Digit_ANT</object-name>
    <object-name>Digit_BFO</object-name>
    <object-name>Digit_FRQ</object-name>
    <object-name>Digit_FLT</object-name>
    <object-name>Digit_ET</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>

  <animation>
    <type>select</type>
    <object-name>Digit_ANT</object-name>
    <condition>
      <not>
        <property>/instrumentation/adf[0]/adf-btn</property>
      </not>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>Digit_ADF</object-name>
    <condition>
      <property>/instrumentation/adf[0]/adf-btn</property>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>Digit_BFO</object-name>
    <condition>
      <property>/instrumentation/adf[0]/bfo-btn</property>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>Digit_FRQ</object-name>
    <condition>
      <equals>
        <property>/instrumentation/adf[0]/display-mode</property>
        <value type="int">0</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>Digit_FLT</object-name>
    <condition>
      <equals>
        <property>/instrumentation/adf[0]/display-mode</property>
        <value type="int">1</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>Digit_ET</object-name>
    <condition>
      <equals>
        <property>/instrumentation/adf[0]/display-mode</property>
        <value type="int">2</value>
      </equals>
    </condition>
  </animation>

  <!-- Use FREQ -->

  <animation>
    <type>select</type>
    <object-name>Digit_L1000</object-name>
    <condition>
      <greater-than-equals>
        <property>/instrumentation/adf[0]/frequencies/selected-khz</property>
        <value type="int">1000</value>
      </greater-than-equals>
    </condition>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_L1000</object-name>
    <property>/instrumentation/adf[0]/frequencies/selected-khz</property>
    <step>1000</step>
    <factor>0.0001</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_L100</object-name>
    <property>/instrumentation/adf[0]/frequencies/selected-khz</property>
    <step>100</step>
    <factor>0.001</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_L10</object-name>
    <property>/instrumentation/adf[0]/frequencies/selected-khz</property>
    <step>10</step>
    <factor>0.01</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_L1</object-name>
    <property>/instrumentation/adf[0]/frequencies/selected-khz</property>
    <step>1</step>
    <factor>0.1</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <!-- STBY FREQ -->

  <animation>
    <type>select</type>
    <object-name>Digit_P</object-name>
    <condition>
      <not-equals>
        <property>/instrumentation/adf[0]/display-mode</property>
        <value type="int">0</value>
      </not-equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>Digit_R1000</object-name>
    <condition>
      <greater-than-equals>
        <property alias="../../../../params/right-display"/>
        <value type="int">1000</value>
      </greater-than-equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>Digit_R100</object-name>
    <condition>
      <greater-than-equals>
        <property alias="../../../../params/right-display"/>
        <value type="int">100</value>
      </greater-than-equals>
    </condition>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_R1000</object-name>
    <property alias="../../params/right-display"/>
    <step>1000</step>
    <factor>0.0001</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_R100</object-name>
    <property alias="../../params/right-display"/>
    <step>100</step>
    <factor>0.001</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_R10</object-name>
    <property alias="../../params/right-display"/>
    <step>10</step>
    <factor>0.01</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>Digit_R1</object-name>
    <property alias="../../params/right-display"/>
    <step>1</step>
    <factor>0.1</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <!-- KNOBS AND BUTTONS -->

  <animation>
    <type>pick</type>
    <visible>true</visible>
    <object-name>Btn_ADF</object-name>
    <action>
      <button>0</button>
      <binding>
        <command>property-toggle</command>
        <property>/instrumentation/adf[0]/adf-btn</property>
      </binding>
    </action>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Btn_ADF</object-name>
    <property>/instrumentation/adf[0]/adf-btn</property>
    <factor>-0.0025</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>pick</type>
    <visible>true</visible>
    <object-name>Btn_BFO</object-name>
    <action>
      <button>0</button>
      <binding>
        <command>property-toggle</command>
        <property>/instrumentation/adf[0]/bfo-btn</property>
      </binding>
    </action>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Btn_BFO</object-name>
    <property>/instrumentation/adf[0]/bfo-btn</property>
    <factor>-0.0025</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>pick</type>
    <visible>true</visible>
    <object-name>Btn_FRQ</object-name>
    <action>
      <button>0</button>
      <binding>
        <command>property-toggle</command>
        <property>/instrumentation/adf[0]/bfo-frq</property>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>/instrumentation/adf[0]/frq-btn</property>
        <value type="int">1</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>/instrumentation/adf[0]/display-mode</property>
            <value type="int">0</value>
          </equals>
        </condition>
        <command>property-swap</command>
        <property>/instrumentation/adf[0]/frequencies/selected-khz</property>
        <property>/instrumentation/adf[0]/frequencies/standby-khz</property>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>/instrumentation/adf[0]/display-mode</property>
        <value type="int">0</value>
      </binding>
      <mod-up>
        <binding>
          <command>property-assign</command>
          <property>/instrumentation/adf[0]/frq-btn</property>
          <value type="int">0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Btn_FRQ</object-name>
    <property>/instrumentation/adf[0]/frq-btn</property>
    <factor>-0.0025</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>pick</type>
    <visible>true</visible>
    <object-name>Btn_FLT</object-name>
    <action>
      <button>0</button>
      <binding>
        <command>property-assign</command>
        <property>/instrumentation/adf[0]/flt-btn</property>
        <value type="int">1</value>
      </binding>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/display-mode</property>
        <step>1</step>
        <min>1</min>
        <max>3</max>
        <wrap>true</wrap>
      </binding>
      <mod-up>
        <binding>
          <command>property-assign</command>
          <property>/instrumentation/adf[0]/flt-btn</property>
          <value type="int">0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Btn_FLT</object-name>
    <property>/instrumentation/adf[0]/flt-btn</property>
    <factor>-0.0025</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>pick</type>
    <visible>true</visible>
    <object-name>Btn_SET</object-name>
    <action>
      <button>0</button>
      <binding>
        <command>property-assign</command>
        <property>/instrumentation/adf[0]/set-btn</property>
        <value type="int">1</value>
      </binding>
      <mod-up>
        <binding>
          <command>property-assign</command>
          <property>/instrumentation/adf[0]/set-btn</property>
          <value type="int">0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Btn_SET</object-name>
    <property>/instrumentation/adf[0]/set-btn</property>
    <factor>-0.0025</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>pick</type>
    <visible>true</visible>
    <object-name>Knob_Volume</object-name>
    <action>
      <button>0</button>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/volume-norm</property>
        <step>0.1</step>
        <min>0</min>
        <max>1.0</max>
      </binding>
      <binding>
        <condition>
          <greater-than>
            <property>/instrumentation/adf[0]/volume-norm</property>
            <value>0.0</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>/instrumentation/adf[0]/power-btn</property>
        <value type="bool">1</value>
      </binding>
    </action>
    <action>
      <button>1</button>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/volume-norm</property>
        <step>-0.1</step>
        <min>0</min>
        <max>1.0</max>
      </binding>
      <binding>
        <condition>
          <less-than>
            <property>/instrumentation/adf[0]/volume-norm</property>
            <value>0.1</value>
          </less-than>
        </condition>
        <command>property-assign</command>
        <property>/instrumentation/adf[0]/power-btn</property>
        <value type="bool">0</value>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <visible>true</visible>
    <object-name>Knob_Volume</object-name>
    <action>
      <button>3</button>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/volume-norm</property>
        <step>0.1</step>
        <min>0</min>
        <max>1.0</max>
      </binding>
      <binding>
        <condition>
          <greater-than>
            <property>/instrumentation/adf[0]/volume-norm</property>
            <value>0.0</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>/instrumentation/adf[0]/power-btn</property>
        <value type="bool">1</value>
      </binding>
    </action>
    <action>
      <button>4</button>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/volume-norm</property>
        <step>-0.1</step>
        <min>0</min>
        <max>1.0</max>
      </binding>
      <binding>
        <condition>
          <less-than>
            <property>/instrumentation/adf[0]/volume-norm</property>
            <value>0.1</value>
          </less-than>
        </condition>
        <command>property-assign</command>
        <property>/instrumentation/adf[0]/power-btn</property>
        <value type="bool">0</value>
      </binding>
    </action>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Knob_Volume</object-name>
    <property>/instrumentation/adf[0]/volume-norm</property>
    <factor>-270</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
    <center>
      <x-m> 0    </x-m>
      <y-m> 0.037</y-m>
      <z-m>-0.006</z-m>
    </center>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>Knob_FREQ01</object-name>
    <object-name>Knob_FREQ02</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/frequencies/standby-khz</property>
        <step>1</step>
        <min>200</min>
        <max>1800</max>
        <resolution>1</resolution>
        <wrap>true</wrap>
      </binding>
    </action>
    <action>
      <button>1</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/frequencies/standby-khz</property>
        <step>-1</step>
        <min>200</min>
        <max>1800</max>
        <wrap>true</wrap>
        <mask>integer</mask>
      </binding>
    </action>
    <action>
      <button>3</button>
      <repeatable>false</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/frequencies/standby-khz</property>
        <step>100</step>
        <min>200</min>
        <max>1800</max>
        <wrap>true</wrap>
        <mask>integer</mask>
      </binding>
    </action>
    <action>
      <button>4</button>
      <repeatable>false</repeatable>
      <binding>
        <command>property-adjust</command>
        <property>/instrumentation/adf[0]/frequencies/standby-khz</property>
        <step>-100</step>
        <min>200</min>
        <max>1800</max>
        <wrap>true</wrap>
        <mask>integer</mask>
      </binding>
    </action>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Knob_FREQ01</object-name>
    <object-name>Knob_FREQ02</object-name>
    <property>/instrumentation/adf[0]/frequencies/standby-khz</property>
    <factor>-270</factor>
    <axis>
      <x>1</x>
      <y>0</y>
      <z>0</z>
    </axis>
    <center>
      <x-m> 0    </x-m>
      <y-m> 0.062</y-m>
      <z-m>-0.001</z-m>
    </center>
  </animation>

<!-- Label Text -->

<text>
  <name>LabelText</name>
  <type type="string">literal</type>
  <text type="string">ADF</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>
