<?xml version="1.0"?>
<!--
ADF Indicator, based on Bendix-King KI-227 model
http://commerce.honeywell.com/
Author: Pavel Cueto, adapted from the original work of Torsten Dreyer
License: GPL
-->

<PropertyList>

  <path>KI-227.ac</path>

  <params>
    <model>instrumentation/adf[0]/model</model>
    <rotation-deg>instrumentation/adf[0]/rotation-deg</rotation-deg>
    <adf-bearing-deg>instrumentation/adf[0]/indicated-bearing-deg</adf-bearing-deg>
    <vor-bearing-deg>instrumentation/nav[0]/radials/reciprocal-radial-deg</vor-bearing-deg>
    <indicated-heading>instrumentation/heading-indicator/indicated-heading-deg</indicated-heading>
  </params>

  <animation>
    <type>material</type>
    <object-name>Ring</object-name>
    <object-name>Base_02</object-name>
    <object-name>Marker</object-name>
    <object-name>Knob</object-name>
    <object-name>Aircraft</object-name>
    <object-name>Needle</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>
    </emission>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Ring</object-name>
    <property alias="../../params/rotation-deg"/>
    <condition>
      <not>
        <equals>
          <property alias="../../../../../params/model"/>
          <value>ki228</value>
        </equals>
      </not>
    </condition>
    <factor>-1</factor>
    <axis>
      <x>-1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Ring</object-name>
    <property alias="../../params/indicated-heading"/>
    <condition>
      <equals>
        <property alias="../../../../params/model"/>
        <value>ki228</value>
      </equals>
    </condition>
    <factor>-1</factor>
    <axis>
      <x>-1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Needle</object-name>
    <property alias="../../params/adf-bearing-deg"/>
    <axis>
      <x>-1</x>
      <y>0</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Knob</object-name>
    <property alias="../../params/rotation-deg"/>
    <factor>8.0</factor>
    <axis>
      <x>1.0</x>
      <y>0.0</y>
      <z>0.0</z>
    </axis>
    <center>
      <x-m> 0    </x-m>
      <y-m>-0.032</y-m>
      <z-m>-0.028</z-m>
    </center>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>Knob</object-name>
    <visible>true</visible>
    <action>
      <name>Small up</name>
      <button>0</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step> 1</step>
        <min>  0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
    <action>
      <name>Small down</name>
      <button>1</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step>-1</step>
        <min>  0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
    <action>
      <name>Big up</name>
      <button>3</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step> 5</step>
        <min>  0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
    <action>
      <name>Big down</name>
      <button>4</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step>-5</step>
        <min>  0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
  </animation>
<!--
  <animation>
    <type>pick</type>
    <object-name>HDGSelectorPick.L</object-name>
    <visible>false</visible>
    <action>
      <button>0</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step>-1</step>
        <min>0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
    <action>
      <button>1</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step>-10</step>
        <min>0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>HDGSelectorPick.R</object-name>
    <visible>false</visible>
    <action>
      <button>0</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step>1</step>
        <min>0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
    <action>
      <button>1</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step>10</step>
        <min>0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>HDGSelector</object-name>
    <visible>true</visible>
    <action>
      <button>3</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step>-1</step>
        <min>0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
    <action>
      <button>4</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/rotation-deg"/>
        <step>1</step>
        <min>0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
  </animation>
-->
<!-- Label Text -->

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