<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
  Animations for the ki525 hsi indicator
  Maintainer: Torsten Dreyer

  Updated for lancair 235 : 02/2021 BARANGER Emmanuel
-->
<PropertyList include="kcs55.xml">

  <path>ki525a.ac</path>

  <params>
  
    <has-gs>instrumentation/nav-source/has-gs</has-gs>
    <gs-needle-deflection>instrumentation/nav-source/gs-needle-deflection</gs-needle-deflection>

    <cdi-needle-deflection>instrumentation/nav-source/heading-needle-deflection-norm</cdi-needle-deflection>

    <selected-heading>instrumentation/kcs55/ki525/selected-heading-deg</selected-heading>
    <selected-course>instrumentation/kcs55/ki525/selected-course-deg</selected-course>
    <to-flag>instrumentation/kcs55/ki525/to-flag</to-flag>
    <from-flag>instrumentation/kcs55/ki525/from-flag</from-flag>
    <nav-flag>instrumentation/kcs55/ki525/nav-flag</nav-flag>

    <indicated-heading>orientation/heading-magnetic-deg</indicated-heading>
    <hdg-flag>instrumentation/heading-indicator/serviceable</hdg-flag>

    <heading-bug>autopilot/settings/heading-bug-deg</heading-bug>
  </params>

  <animation>
    <object-name>fond</object-name>
    <object-name>cache</object-name>
    <object-name>GS</object-name>
    <object-name>CompassRose</object-name>
    <object-name>OBSSelector</object-name>
    <object-name>HDGSelector</object-name>
    <object-name>CDIPlate</object-name>
    <object-name>HDGBug</object-name>
    <object-name>FROM</object-name>
    <object-name>TO</object-name>
    <object-name>Marker</object-name>
    <object-name>ArrowHead</object-name>
    <object-name>ArrowBody</object-name>
    <object-name>LubberLine</object-name>
    <object-name>ArrowTail</object-name>
    <object-name>NAV</object-name>
    <object-name>HDG</object-name>
    <object-name>AircraftSymbol</object-name>
    <object-name>DC</object-name>
    <object-name>scale</object-name>
    <object-name>star</object-name>

    <object-name>vitre</object-name>
  </animation>

  <animation>
    <type>noshadow</type>
    <object-name>fond</object-name>
    <object-name>cache</object-name>
    <object-name>GS</object-name>
    <object-name>CompassRose</object-name>
    <object-name>OBSSelector</object-name>
    <object-name>HDGSelector</object-name>
    <object-name>CDIPlate</object-name>
    <object-name>HDGBug</object-name>
    <object-name>FROM</object-name>
    <object-name>TO</object-name>
    <object-name>Marker</object-name>
    <object-name>ArrowHead</object-name>
    <object-name>ArrowBody</object-name>
    <object-name>LubberLine</object-name>
    <object-name>ArrowTail</object-name>
    <object-name>NAV</object-name>
    <object-name>HDG</object-name>
    <object-name>AircraftSymbol</object-name>
    <object-name>DC</object-name>
    <object-name>scale</object-name>
    <object-name>star</object-name>
    <object-name>vitre</object-name>
  </animation>

  <!-- working for Compositor -->
  <effect>
    <inherits-from>../../../../Effects/Glass/glass</inherits-from>
    <object-name>vitre</object-name>
  </effect>

  <animation>
    <type>material</type>
    <object-name>GS</object-name>
    <object-name>CompassRose</object-name>
    <object-name>OBSSelector</object-name>
    <object-name>HDGSelector</object-name>
    <object-name>CDIPlate</object-name>
    <object-name>HDGBug</object-name>
    <object-name>FROM</object-name>
    <object-name>TO</object-name>
    <object-name>Marker</object-name>
    <object-name>ArrowHead</object-name>
    <object-name>ArrowBody</object-name>
    <object-name>LubberLine</object-name>
    <object-name>ArrowTail</object-name>
    <object-name>NAV</object-name>
    <object-name>HDG</object-name>
    <object-name>AircraftSymbol</object-name>
    <object-name>DC</object-name>
    <object-name>scale</object-name>
    <object-name>star</object-name>
    <condition>
      <property>controls/electric/battery-switch</property>
    </condition>
    <emission>
      <factor-prop>controls/lighting/instruments-norm</factor-prop>
      <red>   0.50 </red>
      <green> 0.40 </green>
      <blue>  0.30 </blue>
    </emission>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>CompassRose</object-name>
    <property alias="../../params/indicated-heading"/>
    <factor> -1 </factor>
    <axis>
      <x> -1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>HDGBug</object-name>
    <property alias="../../params/indicated-heading"/>
    <factor> 1 </factor>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>HDGBug</object-name>
    <property alias="../../params/heading-bug"/>
    <factor> -1 </factor>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>HDGSelector</object-name>
    <property alias="../../params/selected-heading"/>
    <factor> -8 </factor>
    <center>
      <x-m>  0.00623 </x-m>
      <y-m>  0.03454 </y-m>
      <z-m> -0.03062 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>HDGSelector</object-name>
    <property alias="../../params/indicated-heading"/>
    <factor> 8 </factor>
    <center>
      <x-m>  0.00623 </x-m>
      <y-m>  0.03454 </y-m>
      <z-m> -0.03062 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>OBSSelector</object-name>
    <property alias="../../params/selected-course"/>
    <factor> -8 </factor>
    <center>
      <x-m>  0.00623 </x-m>
      <y-m> -0.03454 </y-m>
      <z-m> -0.03062 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>OBSSelector</object-name>
    <property alias="../../params/indicated-heading"/>
    <factor> 8 </factor>
    <center>
      <x-m>  0.00623 </x-m>
      <y-m> -0.03456 </y-m>
      <z-m> -0.03065 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>CDIPlate</object-name>
    <object-name>ArrowHead</object-name>
    <object-name>ArrowTail</object-name>
    <object-name>ArrowBody</object-name>
    <object-name>TO</object-name>
    <object-name>FROM</object-name>
    <property alias="../../params/indicated-heading"/>
    <factor>1.0</factor>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>CDIPlate</object-name>
    <object-name>ArrowHead</object-name>
    <object-name>ArrowTail</object-name>
    <object-name>ArrowBody</object-name>
    <object-name>TO</object-name>
    <object-name>FROM</object-name>
    <property alias="../../params/selected-course"/>
    <factor>-1.0</factor>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </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/selected-heading"/>
        <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/selected-heading"/>
        <step>1</step>
        <min>0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>OBSSelector</object-name>
    <visible>true</visible>
    <action>
      <button>3</button>
      <repeatable>true</repeatable>
      <binding>
        <command>property-adjust</command>
        <property alias="../../../../params/selected-course"/>
        <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/selected-course"/>
        <step>1</step>
        <min>0</min>
        <max>360</max>
        <wrap>1</wrap>
      </binding>
    </action>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>NAV</object-name>
    <property alias="../../params/nav-flag"/>
    <interpolation>
      <entry><ind> 0.0 </ind><dep>  0 </dep></entry>
      <entry><ind> 0.5 </ind><dep> 10 </dep></entry>
      <entry><ind> 0.9 </ind><dep> 30 </dep></entry>
      <entry><ind> 1.0 </ind><dep> 60 </dep></entry>
    </interpolation>
    <center>
      <x-m> -0.00204 </x-m>
      <y-m> -0.02422 </y-m>
      <z-m>  0.02502 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>HDG</object-name>
    <property alias="../../params/hdg-flag"/>
    <interpolation>
      <entry><ind> 0 </ind><dep>  0 </dep></entry>
      <entry><ind> 1 </ind><dep> -40 </dep></entry>
    </interpolation>
    <center>
      <x-m> -0.00202 </x-m>
      <y-m>  0.02422 </y-m>
      <z-m>  0.02502 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>TO</object-name>
    <property alias="../../params/to-flag"/>
    <factor>0.00712488</factor>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>FROM</object-name>
    <property alias="../../params/from-flag"/>
    <factor>-0.00712488</factor>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>GS</object-name>
    <property alias="../../params/gs-needle-deflection"/>
    <!--  bitw wip    -->
    <!--factor>0.004535342857142857143</factor-->
    <offset-m>-0.022</offset-m>
    <factor>0.005</factor>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <type>select</type>
    <object-name>GS</object-name>
    <condition>
      <property alias="../../../params/has-gs"/>
      <greater-than>
        <property alias="../../../../params/gs-needle-deflection"/>
        <value>-5</value>
      </greater-than>
      <less-than>
        <property alias="../../../../params/gs-needle-deflection"/>
        <value>5.0</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>ArrowBody</object-name>
    <property alias="../../params/cdi-needle-deflection"/>
    <!--  bitw    -->
    <!--factor>2.5</factor-->
    <factor>0.02</factor>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

</PropertyList>
