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

<!-- ______________________________________________________________________________
     kap140 Two Axis with Altitude Preselect autopilot instrument.

     3D version started 2007 by Ron Jensen, wino@jentronics.com.
     Based on 2D version started 2004 by Roy Vegard Ovesen, rvovesen@tiscali.no.

     This is an instrument configuration file for the open-source flight
     simulator FlightGear (www.flightgear.org).  The file is an XML-encoded
     FlightGear property list defining the instrument's animations and actions.

     Actions are hotspots on the instrument that will respond to a mouse
     click.  Actions always modify the values of properties, either by
     adjusting them, toggling them, or swaping them with other
     properties' values.
-->
<PropertyList include="kap140-config.xml">

  <name>kap140TwoAxisAlt</name>
  <path>kap140.ac</path>

  <animation>
    <object-name>base</object-name>
    <object-name>fond</object-name>

    <object-name>base-frame</object-name>

    <object-name>knob-outer</object-name>
    <object-name>knob-inner</object-name>

    <object-name>btn-ap</object-name>
    <object-name>btn-hdg</object-name>
    <object-name>btn-nav</object-name>
    <object-name>btn-apr</object-name>
    <object-name>btn-rev</object-name>
    <object-name>btn-alt</object-name>
    <object-name>btn-down</object-name>
    <object-name>btn-up</object-name>
    <object-name>btn-arm</object-name>
    <object-name>btn-baro</object-name>

    <object-name>ann-ap-act</object-name>
    <object-name>ann-ap-on</object-name>
    <object-name>ann-yd</object-name>

    <object-name>ann-mode1-ap</object-name>
    <object-name>ann-mode1-rol</object-name>
    <object-name>ann-mode1-hdg</object-name>
    <object-name>ann-mode1-nav</object-name>
    <object-name>ann-mode1-apr</object-name>
    <object-name>ann-mode1-rev</object-name>

    <object-name>ann-arm1</object-name>
    <object-name>ann-arm1-nav</object-name>
    <object-name>ann-arm1-apr</object-name>
    <object-name>ann-arm1-rev</object-name>
    <object-name>ann-arm1-gs</object-name>

    <object-name>ann-mode2-pft</object-name>
    <object-name>ann-mode2-vs</object-name>
    <object-name>ann-mode2-alt</object-name>
    <object-name>ann-mode2-gs</object-name>
    <object-name>ann-mode2-fail</object-name>

    <object-name>ann-arm2</object-name>
    <object-name>ann-arm2-alt</object-name>

    <object-name>ann-pt-up</object-name>
    <object-name>ann-pt</object-name>
    <object-name>ann-pt-down</object-name>

    <object-name>ann-decimal</object-name>
    <object-name>ann-digit1</object-name>
    <object-name>ann-digit2</object-name>
    <object-name>ann-digit3</object-name>
    <object-name>ann-digit4</object-name>
    <object-name>ann-digit5</object-name>
    <object-name>ann-digit-minus</object-name>

    <object-name>ann-alt-alert</object-name>
    <object-name>ann-fpm</object-name>
    <object-name>ann-ft</object-name>
    <object-name>ann-hpa</object-name>
    <object-name>ann-inhg</object-name>

    <object-name>ann-test</object-name>

    <object-name>base-sensor</object-name>
    <object-name>ann-fail-pitch</object-name>
    <object-name>ann-fail-roll</object-name>
    <object-name>glass</object-name>
  </animation>

  <animation>
    <type>noshadow</type>
    <object-name>base</object-name>
    <object-name>fond</object-name>
    <object-name>base-frame</object-name>
    <object-name>knob-outer</object-name>
    <object-name>knob-inner</object-name>
    <object-name>btn-ap</object-name>
    <object-name>btn-hdg</object-name>
    <object-name>btn-nav</object-name>
    <object-name>btn-apr</object-name>
    <object-name>btn-rev</object-name>
    <object-name>btn-alt</object-name>
    <object-name>btn-down</object-name>
    <object-name>btn-up</object-name>
    <object-name>btn-arm</object-name>
    <object-name>btn-baro</object-name>
    <object-name>ann-ap-act</object-name>
    <object-name>ann-ap-on</object-name>
    <object-name>ann-yd</object-name>
    <object-name>ann-mode1-ap</object-name>
    <object-name>ann-mode1-rol</object-name>
    <object-name>ann-mode1-hdg</object-name>
    <object-name>ann-mode1-nav</object-name>
    <object-name>ann-mode1-apr</object-name>
    <object-name>ann-mode1-rev</object-name>
    <object-name>ann-arm1</object-name>
    <object-name>ann-arm1-nav</object-name>
    <object-name>ann-arm1-apr</object-name>
    <object-name>ann-arm1-rev</object-name>
    <object-name>ann-arm1-gs</object-name>
    <object-name>ann-mode2-pft</object-name>
    <object-name>ann-mode2-vs</object-name>
    <object-name>ann-mode2-alt</object-name>
    <object-name>ann-mode2-gs</object-name>
    <object-name>ann-mode2-fail</object-name>
    <object-name>ann-arm2</object-name>
    <object-name>ann-arm2-alt</object-name>
    <object-name>ann-pt-up</object-name>
    <object-name>ann-pt</object-name>
    <object-name>ann-pt-down</object-name>
    <object-name>ann-decimal</object-name>
    <object-name>ann-digit1</object-name>
    <object-name>ann-digit2</object-name>
    <object-name>ann-digit3</object-name>
    <object-name>ann-digit4</object-name>
    <object-name>ann-digit5</object-name>
    <object-name>ann-digit-minus</object-name>
    <object-name>ann-alt-alert</object-name>
    <object-name>ann-fpm</object-name>
    <object-name>ann-ft</object-name>
    <object-name>ann-hpa</object-name>
    <object-name>ann-inhg</object-name>
    <object-name>ann-test</object-name>
    <object-name>base-sensor</object-name>
    <object-name>ann-fail-pitch</object-name>
    <object-name>ann-fail-roll</object-name>
    <object-name>glass</object-name>
  </animation>

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

  <animation>
    <name>annunciators</name>

    <object-name>ann-ap-act</object-name>
    <object-name>ann-ap-on</object-name>
    <object-name>ann-yd</object-name>

    <object-name>ann-mode1-ap</object-name>
    <object-name>ann-mode1-rol</object-name>
    <object-name>ann-mode1-hdg</object-name>
    <object-name>ann-mode1-nav</object-name>
    <object-name>ann-mode1-apr</object-name>
    <object-name>ann-mode1-rev</object-name>

    <object-name>ann-arm1</object-name>
    <object-name>ann-arm1-nav</object-name>
    <object-name>ann-arm1-apr</object-name>
    <object-name>ann-arm1-rev</object-name>
    <object-name>ann-arm1-gs</object-name>

    <object-name>ann-mode2-pft</object-name>
    <object-name>ann-mode2-vs</object-name>
    <object-name>ann-mode2-alt</object-name>
    <object-name>ann-mode2-gs</object-name>
    <object-name>ann-mode2-fail</object-name>

    <object-name>ann-arm2</object-name>
    <object-name>ann-arm2-alt</object-name>

    <object-name>ann-pt-up</object-name>
    <object-name>ann-pt</object-name>
    <object-name>ann-pt-down</object-name>

    <object-name>ann-decimal</object-name>
    <object-name>ann-digit1</object-name>
    <object-name>ann-digit2</object-name>
    <object-name>ann-digit3</object-name>
    <object-name>ann-digit4</object-name>
    <object-name>ann-digit5</object-name>
    <object-name>ann-digit-minus</object-name>

    <object-name>ann-alt-alert</object-name>
    <object-name>ann-fpm</object-name>
    <object-name>ann-ft</object-name>
    <object-name>ann-hpa</object-name>
    <object-name>ann-inhg</object-name>

    <object-name>ann-test</object-name>
  </animation>

  <animation>
    <name>buttons</name>
    <object-name>btn-ap</object-name>
    <object-name>btn-hdg</object-name>
    <object-name>btn-nav</object-name>
    <object-name>btn-apr</object-name>
    <object-name>btn-rev</object-name>
    <object-name>btn-alt</object-name>
    <object-name>btn-down</object-name>
    <object-name>btn-up</object-name>
    <object-name>btn-arm</object-name>
    <object-name>btn-baro</object-name>
  </animation>

  <animation>
    <type>material</type>
    <object-name>annunciators</object-name>
    <emission>
      <red>   1.0 </red>
      <green> 0.7 </green>
      <blue>  0.0 </blue>
    </emission>
  </animation>

  <animation>
    <type>material</type>
    <object-name>ann-fail-pitch</object-name>
    <object-name>ann-fail-roll</object-name>
    <emission>
      <red>   1.0 </red>
      <green> 0.7 </green>
      <blue>  0.7 </blue>
    </emission>
  </animation>

  <animation>
    <type>material</type>
    <object-name>buttons</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>material</type>
    <object-name>base-frame</object-name>
    <object-name>display-frame</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>select</type>
    <condition>
      <greater-than>
        <property alias="../../../../params/model"/>
        <value>1</value>
      </greater-than>
    </condition>
    <object-name>btn-alt</object-name>
    <object-name>btn-down</object-name>
    <object-name>btn-up</object-name>
    <object-name>base-frame-inner</object-name>
  </animation>

  <animation>
    <type>select</type>
    <condition>
      <greater-than>
        <property alias="../../../../params/model"/>
        <value>2</value>
      </greater-than>
    </condition>
    <object-name>btn-arm</object-name>
    <object-name>btn-baro</object-name>
    <object-name>knob-inner</object-name>
    <object-name>knob-outer</object-name>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-decimal</object-name>
    <object-name>ann-digit1</object-name>
    <object-name>ann-digit2</object-name>
    <object-name>ann-digit3</object-name>
    <object-name>ann-digit4</object-name>
    <object-name>ann-digit5</object-name>
    <object-name>ann-digit-minus</object-name>
    <condition>
      <or>
        <equals>
          <property>autopilot/kap140/panel/digit-timer</property>
          <value>0</value>
        </equals>
        <less-than>
          <expression>
            <mod>
              <product>
                <dif>
                  <property>sim/time/elapsed-sec</property>
                  <property>autopilot/kap140/panel/digit-timer</property>
                </dif>
                <value>2</value>
              </product>
              <value>2</value>
            </mod>
          </expression>
          <value>1</value>
        </less-than>
      </or>
    </condition>
  </animation>

  <!-- Annunciators -->
  <animation>
    <type>select</type>
    <object-name>annunciators</object-name>
    <object-name>roll-axis-fail</object-name>
    <object-name>pitch-axis-fail</object-name>
    <condition>
      <property>autopilot/kap140/powered</property>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-fail-roll</object-name>
    <name>Roll Axis Failure</name>
    <condition>
      <or>
        <greater-than>
          <property>autopilot/kap140/panel/state</property>
          <value>2</value>
        </greater-than>
        <less-than>
          <property>autopilot/kap140/panel/state</property>
          <value>0</value>
        </less-than>
      </or>
      <property>autopilot/kap140/roll-axis-fail</property>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-fail-pitch</object-name>
    <name>Pitch Axis Failure</name>
    <condition>
      <or>
        <greater-than>
          <property>autopilot/kap140/panel/state</property>
          <value>2</value>
        </greater-than>
        <less-than>
          <property>autopilot/kap140/panel/state</property>
          <value>0</value>
        </less-than>
      </or>
      <property>autopilot/kap140/pitch-axis-fail</property>
    </condition>
  </animation>

  <!-- not in use -->
  <animation>
    <type>select</type>
    <object-name>ann-yd</object-name>
    <condition>
      <greater-than>
        <property>autopilot/kap140/panel/state</property>
        <value>9</value>
      </greater-than>
    </condition>
  </animation>

  <!-- activ annun -->
  <!-- digits -->
  <animation>
    <type>textranslate</type>
    <object-name>ann-digit1</object-name>
    <property>autopilot/kap140/panel/digit</property>
    <factor>0.00001</factor>
    <step>10000</step>
    <axis>
      <x>1</x>
      <y>0</y>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>ann-digit2</object-name>
    <property>autopilot/kap140/panel/digit</property>
    <factor>0.0001</factor>
    <step>1000</step>
    <axis>
      <x>1</x>
      <y>0</y>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>ann-digit3</object-name>
    <property>autopilot/kap140/panel/digit</property>
    <factor>0.001</factor>
    <step>100</step>
    <axis>
      <x>1</x>
      <y>0</y>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>ann-digit4</object-name>
    <property>autopilot/kap140/panel/digit</property>
    <factor>0.01</factor>
    <step>10</step>
    <axis>
      <x>1</x>
      <y>0</y>
    </axis>
  </animation>

  <animation>
    <type>textranslate</type>
    <object-name>ann-digit5</object-name>
    <property>autopilot/kap140/panel/digit</property>
    <factor>0.1</factor>
    <step>1</step>
    <axis>
      <x>1</x>
      <y>0</y>
    </axis>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-digit1</object-name>
    <condition>
      <or>
        <equals>
          <property>autopilot/kap140/panel/state</property>
          <value>1</value>
        </equals>
        <equals>
          <property>autopilot/kap140/panel/state</property>
          <value>2</value>
        </equals>
        <and>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </equals>
          <property>autopilot/kap140/bad-condition</property>
        </and>
        <and>
          <property>autopilot/kap140/panel/digit-mode</property>
          <or>
            <greater-than>
              <property>autopilot/kap140/panel/digit</property>
              <value>9999</value>
            </greater-than>
            <less-than>
              <property>autopilot/kap140/panel/digit</property>
              <value>-9999</value>
            </less-than>
          </or>
        </and>
      </or>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-digit2</object-name>
    <object-name>ann-decimal</object-name>
    <condition>
      <and>
        <property>autopilot/kap140/panel/digit-mode</property>
        <or>
          <greater-than>
            <property>autopilot/kap140/panel/digit</property>
            <value>999</value>
          </greater-than>
          <less-than>
            <property>autopilot/kap140/panel/digit</property>
            <value>-999</value>
          </less-than>
        </or>
      </and>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-digit3</object-name>
    <condition>
      <and>
        <property>autopilot/kap140/panel/digit-mode</property>
        <or>
          <greater-than>
            <property>autopilot/kap140/panel/digit</property>
            <value>99</value>
          </greater-than>
          <less-than>
            <property>autopilot/kap140/panel/digit</property>
            <value>-99</value>
          </less-than>
        </or>
      </and>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-digit4</object-name>
    <condition>
      <and>
        <property>autopilot/kap140/panel/digit-mode</property>
        <or>
          <greater-than>
            <property>autopilot/kap140/panel/digit</property>
            <value>9</value>
          </greater-than>
          <less-than>
            <property>autopilot/kap140/panel/digit</property>
            <value>-9</value>
          </less-than>
        </or>
      </and>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-digit5</object-name>
    <condition>
      <or>
        <equals>
          <property>autopilot/kap140/panel/digit-mode</property>
          <value>1</value>
        </equals>
        <equals>
          <property>autopilot/kap140/panel/digit-mode</property>
          <value>2</value>
        </equals>
        <and>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>3</value>
          </equals>
          <equals>
            <property>autopilot/kap140/panel/baro-mode</property>
            <value>1</value>
          </equals>
        </and>
      </or>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-digit-minus</object-name>
    <condition>
      <or>
        <and>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>1</value>
          </equals>
          <less-than>
            <property>autopilot/internal/target-altitude</property>
            <value>0</value>
          </less-than>
        </and>
        <and>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>2</value>
          </equals>
          <less-than>
            <property>autopilot/internal/target-climb-rate</property>
            <value>0</value>
          </less-than>
        </and>
      </or>
    </condition>
  </animation>

  <!-- pre-flight-test -->
  <animation>
    <type>select</type>
    <name>PFT Annunciator</name>
    <object-name>ann-mode2-pft</object-name>
    <condition>
      <or>
        <equals>
          <property>autopilot/kap140/panel/state</property>
          <value>1</value>
        </equals>
        <equals>
          <property>autopilot/kap140/panel/state</property>
          <value>2</value>
        </equals>
        <and>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </equals>
          <property>autopilot/kap140/bad-condition</property>
        </and>
      </or>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-mode2-fail</object-name>
    <name>Fail Annunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/panel/state</property>
        <value>-1</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-test</object-name>
    <name>Test Annunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/panel/state</property>
        <value>3</value>
      </equals>
      <not><property>autopilot/kap140/bad-condition</property></not>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-ap-on</object-name>
    <object-name>ann-ap-act</object-name>
    <name>AP Anunciator</name>
    <condition>
      <or>
        <equals>
          <property>autopilot/kap140/panel/state</property>
          <value>6</value>
        </equals>
        <and>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>5</value>
          </equals>
          <greater-than>
            <property>autopilot/kap140/panel/ap-timer</property>
            <value>0</value>
          </greater-than>
          <less-than>
            <expression>
              <mod>
                <product>
                  <dif>
                    <property>autopilot/kap140/panel/ap-timer</property>
                    <property>sim/time/elapsed-sec</property>
                  </dif>
                  <value>2</value>
                </product>
                <value>2</value>
              </mod>
            </expression>
            <value>1</value>
          </less-than>
        </and>
      </or>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-ap-act</object-name>
    <name>AP Anunciator</name>
    <condition>
      <not><property>autopilot/kap140/settings/cws</property></not>
    </condition>
  </animation>

  <!-- mode1 -->
  <animation>
    <type>select</type>
    <object-name>ann-mode1-ap</object-name>
    <name>AP Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/panel/state</property>
        <value>5</value>
      </equals>
      <greater-than>
        <property>autopilot/kap140/panel/ap-timer</property>
        <value>0</value>
      </greater-than>
      <less-than>
        <expression>
          <mod>
            <product>
              <dif>
                <property>autopilot/kap140/panel/ap-timer</property>
                <property>sim/time/elapsed-sec</property>
              </dif>
              <value>2</value>
            </product>
            <value>2</value>
          </mod>
        </expression>
        <value>1</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-mode1-rol</object-name>
    <name>ROL Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/lateral-mode</property>
        <value>1</value>
      </equals>
      <equals>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <value>0</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-mode1-hdg</object-name>
    <name>HDG Anunciator</name>
    <condition>
      <or>
        <equals>
          <property>autopilot/kap140/settings/lateral-mode</property>
          <value>2</value>
        </equals>
        <and>
          <greater-than>
            <property>autopilot/kap140/panel/hdg-timer</property>
            <value>0</value>
          </greater-than>
          <less-than>
            <expression>
              <mod>
                <product>
                  <dif>
                    <property>sim/time/elapsed-sec</property>
                    <property>autopilot/kap140/panel/hdg-timer</property>
                  </dif>
                  <value>2</value>
                </product>
                <value>2</value>
              </mod>
            </expression>
            <value>1</value>
          </less-than>
        </and>
      </or>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-mode1-nav</object-name>
    <name>NAV Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/lateral-mode</property>
        <value>3</value>
      </equals>
      <equals>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <value>0</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-mode1-apr</object-name>
    <name>APR Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/lateral-mode</property>
        <value>4</value>
      </equals>
      <equals>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <value>0</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-mode1-rev</object-name>
    <name>REV Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/lateral-mode</property>
        <value>5</value>
      </equals>
      <equals>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <value>0</value>
      </equals>
    </condition>
  </animation>

  <!-- arm1 -->
  <animation>
    <type>select</type>
    <object-name>ann-arm1</object-name>
    <name>ARM1 Anunciator</name>
    <condition>
      <or>
        <greater-than>
          <property>autopilot/kap140/settings/lateral-arm</property>
          <value>0</value>
        </greater-than>
        <equals>
          <property>autopilot/kap140/settings/vertical-arm</property>
          <value>2</value>
        </equals>
      </or>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-arm1-nav</object-name>
    <name>NAV-ARM Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>1</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-arm1-apr</object-name>
    <name>APR-ARM Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>2</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-arm1-rev</object-name>
    <name>REV-ARM Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>3</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-arm1-gs</object-name>
    <name>GS-ARM Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/vertical-arm</property>
        <value>2</value>
      </equals>
    </condition>
  </animation>

  <!-- mode2 -->
  <animation>
    <type>select</type>
    <object-name>ann-mode2-vs</object-name>
    <name>VS Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/vertical-mode</property>
        <value>1</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-mode2-alt</object-name>
    <name>ALT Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/vertical-mode</property>
        <value>2</value>
      </equals>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-mode2-gs</object-name>
    <name>GS Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/vertical-mode</property>
        <value>3</value>
      </equals>
    </condition>
  </animation>

  <!-- arm2 -->
  <animation>
    <type>select</type>
    <object-name>ann-arm2</object-name>
    <object-name>ann-arm2-alt</object-name>
    <name>ALT-ARM Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/settings/vertical-arm</property>
        <value>1</value>
      </equals>
    </condition>
  </animation>

  <!-- pt -->
  <animation>
    <type>select</type>
    <object-name>ann-pt</object-name>
    <object-name>ann-pt-up</object-name>
    <object-name>ann-pt-down</object-name>
    <name>Pitch trim annunciator</name>
    <condition>
      <greater-than>
        <property>autopilot/kap140/panel/state</property>
        <value>4</value>
      </greater-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-pt</object-name>
    <name>Pitch trim annunciator</name>
    <condition>
      <or>
        <and>
          <greater-than>
            <property>autopilot/kap140/sensors/pitch-trim</property>
            <value>1.0</value>
          </greater-than>
          <greater-than>
            <property>sim/time/elapsed-sec</property>
            <property>autopilot/kap140/sensors/pitch-trim</property>
          </greater-than>
        </and>
        <and>
          <greater-than>
            <property>autopilot/kap140/sensors/pitch-up</property>
            <value>1.0</value>
          </greater-than>
          <greater-than>
            <property>sim/time/elapsed-sec</property>
            <property>autopilot/kap140/sensors/pitch-up</property>
          </greater-than>
          <less-than>
            <expression>
              <mod>
                <product>
                  <dif>
                    <property>sim/time/elapsed-sec</property>
                    <property>autopilot/kap140/sensors/pitch-up</property>
                  </dif>
                  <value>2</value>
                </product>
                <value>2</value>
              </mod>
            </expression>
            <value>1</value>
          </less-than>
        </and>
        <and>
          <greater-than>
            <property>autopilot/kap140/sensors/pitch-down</property>
            <value>1.0</value>
          </greater-than>
          <greater-than>
            <property>sim/time/elapsed-sec</property>
            <property>autopilot/kap140/sensors/pitch-down</property>
          </greater-than>
          <less-than>
            <expression>
              <mod>
                <product>
                  <dif>
                    <property>sim/time/elapsed-sec</property>
                    <property>autopilot/kap140/sensors/pitch-down</property>
                  </dif>
                  <value>2</value>
                </product>
                <value>2</value>
              </mod>
            </expression>
            <value>1</value>
          </less-than>
        </and>
      </or>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-pt-up</object-name>
    <name>Pitch trim up annunciator</name>
    <condition>
      <greater-than>
        <property>autopilot/kap140/sensors/pitch-up</property>
        <value>1.0</value>
      </greater-than>
      <greater-than>
        <property>sim/time/elapsed-sec</property>
        <property>autopilot/kap140/sensors/pitch-up</property>
      </greater-than>
      <less-than>
        <expression>
          <mod>
            <product>
              <dif>
                <property>sim/time/elapsed-sec</property>
                <property>autopilot/kap140/sensors/pitch-up</property>
              </dif>
              <value>2</value>
            </product>
            <value>2</value>
          </mod>
        </expression>
        <value>1</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ann-pt-down</object-name>
    <name>Pitch trim down annunciator</name>
    <condition>
      <greater-than>
        <property>autopilot/kap140/sensors/pitch-down</property>
        <value>1.0</value>
      </greater-than>
      <greater-than>
        <property>sim/time/elapsed-sec</property>
        <property>autopilot/kap140/sensors/pitch-down</property>
      </greater-than>
      <less-than>
        <expression>
          <mod>
            <product>
              <dif>
                <property>sim/time/elapsed-sec</property>
                <property>autopilot/kap140/sensors/pitch-down</property>
              </dif>
              <value>2</value>
            </product>
            <value>2</value>
          </mod>
        </expression>
        <value>1</value>
      </less-than>
    </condition>
  </animation>

  <!-- alt alerter -->
  <animation>
    <type>select</type>
    <object-name>ann-alt-alert</object-name>
    <name>ALERT Anunciator</name>
    <condition>
      <or>

        <and>
          <not-equals>
            <property>autopilot/kap140/panel/alt-alert-arm</property>
            <value>0</value>
          </not-equals>
          <less-than>
            <expression>
              <dif>
                <property>sim/time/elapsed-sec</property>
                <property>autopilot/kap140/panel/alt-alert-arm</property>
              </dif>
            </expression>
            <value>0.5</value>
          </less-than>
        </and>

        <and>
          <greater-than>
            <property>autopilot/kap140/panel/alt-alert</property>
            <value>0</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/alt-alert-arm</property>
            <value>0</value>
          </equals>
        </and>

        <and>
          <greater-than>
            <property>autopilot/kap140/panel/alt-alert</property>
            <value>0</value>
          </greater-than>
          <not-equals>
            <property>autopilot/kap140/panel/alt-alert-arm</property>
            <value>0</value>
          </not-equals>
          <less-than>
            <expression>
              <dif>
                <property>sim/time/elapsed-sec</property>
                <property>autopilot/kap140/panel/alt-alert</property>
              </dif>
            </expression>
            <value>5</value>
          </less-than>
          <less-than>
            <expression>
              <mod>
                <product>
                  <dif>
                    <property>sim/time/elapsed-sec</property>
                    <property>autopilot/kap140/panel/alt-alert</property>
                  </dif>
                  <value>2</value>
                </product>
                <value>2</value>
              </mod>
            </expression>
            <value>1</value>
          </less-than>
        </and>

        <and>
          <greater-than>
            <property>autopilot/kap140/panel/alt-alert</property>
            <value>0</value>
          </greater-than>
          <not-equals>
            <property>autopilot/kap140/panel/alt-alert-arm</property>
            <value>0</value>
          </not-equals>
          <greater-than>
            <expression>
              <dif>
                <property>sim/time/elapsed-sec</property>
                <property>autopilot/kap140/panel/alt-alert</property>
              </dif>
            </expression>
            <value>5</value>
          </greater-than>
        </and>

      </or>
    </condition>
  </animation>

  <!-- alt-setting -->
  <animation>
    <type>select</type>
    <object-name>ann-ft</object-name>
    <name>FPM Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/panel/digit-mode</property>
        <value>1</value>
      </equals>
    </condition>
  </animation>

  <!-- vs-setting -->
  <animation>
    <type>select</type>
    <object-name>ann-fpm</object-name>
    <name>FPM Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/panel/digit-mode</property>
        <value>2</value>
      </equals>
    </condition>
  </animation>

  <!-- inhg-setting -->
  <animation>
    <type>select</type>
    <object-name>ann-inhg</object-name>
    <name>INHG Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/panel/digit-mode</property>
        <value>3</value>
      </equals>
      <equals>
        <property>autopilot/kap140/panel/baro-mode</property>
        <value>0</value>
      </equals>
    </condition>
  </animation>

  <!-- hpa-setting -->
  <animation>
    <type>select</type>
    <object-name>ann-hpa</object-name>
    <name>hPa Anunciator</name>
    <condition>
      <equals>
        <property>autopilot/kap140/panel/digit-mode</property>
        <value>3</value>
      </equals>
      <equals>
        <property>autopilot/kap140/panel/baro-mode</property>
        <value>1</value>
      </equals>
    </condition>
  </animation>

  <!-- Actions -->
  <animation>
    <type>pick</type>
    <object-name>btn-ap</object-name>
    <action>
      <name>AP Button</name>
      <button>0</button>
      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>4</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/state-old</property>
        <property>autopilot/kap140/panel/state</property>
      </binding>
      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>4</value>
          </greater-than>
          <not><property>autopilot/kap140/pitch-axis-fail</property></not>
          <not><property>autopilot/kap140/roll-axis-fail</property></not>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/button-ap</property>
        <property>sim/time/elapsed-sec</property>
      </binding>
      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>4</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/internal/target-climb-rate</property>
        <property>autopilot/internal/vert-speed-fpm</property>
      </binding>
      <mod-up>
        <binding>
          <command>property-assign</command>
          <property>autopilot/kap140/panel/button-ap</property>
          <value>0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-hdg</object-name>
    <action>
      <name>HDG Button</name>
      <button>0</button>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <greater-than>
            <property>autopilot/kap140/settings/lateral-mode</property>
            <value>1</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-mode</property>
        <value>-1</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <greater-than>
            <property>autopilot/kap140/settings/lateral-mode</property>
            <value>0</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-mode</property>
        <value>2</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-mode</property>
            <value>-1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-mode</property>
        <value>1</value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>0</value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>autopilot/internal/target-roll-deg</property>
        <value>0</value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>autopilot/internal/target-intercept-angle</property>
        <value>0</value>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-nav</object-name>
    <action>
      <name>NAV Button</name>
      <button>0</button>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>-1</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <greater-than>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>-1</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>1</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>-1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>0</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>1</value>
          </equals>
          <not><property alias="../../../../../../params/hsi-installed"/></not>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <property>sim/time/elapsed-sec</property>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>0</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <value>0</value>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-apr</object-name>
    <action>
      <name>APR Button</name>
      <button>0</button>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>2</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>-1</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <greater-than>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>-1</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>2</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>-1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>0</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>2</value>
          </equals>
          <not><property alias="../../../../../../params/hsi-installed"/></not>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <property>sim/time/elapsed-sec</property>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>0</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <value>0</value>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-rev</object-name>
    <action>
      <name>REV Button</name>
      <button>0</button>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>3</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>-1</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <greater-than>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>-1</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>3</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>-1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/lateral-arm</property>
        <value>0</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>3</value>
          </equals>
          <not><property alias="../../../../../../params/hsi-installed"/></not>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <property>sim/time/elapsed-sec</property>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/lateral-arm</property>
            <value>0</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/hdg-timer</property>
        <value>0</value>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-alt</object-name>
    <action>
      <name>ALT Button</name>
      <button>0</button>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>2</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/vertical-mode</property>
        <value>0</value>
      </binding>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/vertical-mode</property>
        <value>2</value>
      </binding>
      <!-- avoid flickering -->
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>0</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/vertical-mode</property>
        <value>1</value>
      </binding>

      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/internal/target-pressure</property>
        <value>0.0</value>
      </binding>

      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>2</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/internal/target-pressure</property>
        <property>environment/pressure-inhg</property>
      </binding>

      <binding>
        <condition>
          <not-equals>
            <property>autopilot/kap140/settings/vertical-arm</property>
            <value>0</value>
          </not-equals>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>2</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/vertical-arm</property>
        <value>0</value>
      </binding>

    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-down</object-name>
    <action>
      <name>DOWN Button</name>
      <button>0</button>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>1</value>
          </equals>
          <greater-than>
            <property>autopilot/kap140/panel/fpm-timer</property>
            <value>0</value>
          </greater-than>
        </condition>
        <command>property-adjust</command>
        <property>autopilot/internal/target-climb-rate</property>
        <step>-100</step>
        <min>-2000</min>
        <max>2000</max>
        <wrap>false</wrap>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/fpm-old</property>
        <property>autopilot/internal/target-climb-rate</property>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/button-down</property>
        <property>sim/time/elapsed-sec</property>
      </binding>
      <!--altitude setting-->
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>2</value>
          </equals>
        </condition>
        <command>property-adjust</command>
        <property>autopilot/internal/target-pressure</property>
        <step>0.022</step>
        <min>26.0</min>
        <max>33.0</max>
        <wrap>false</wrap>
      </binding>
      <mod-up>
        <binding>
          <condition>
            <equals>
              <property>autopilot/kap140/panel/state</property>
              <value>6</value>
            </equals>
            <equals>
              <property>autopilot/kap140/settings/vertical-mode</property>
              <value>2</value>
            </equals>
            <greater-than>
              <property>sim/time/elapsed-sec</property>
              <expression>
                <sum>
                  <property>autopilot/kap140/panel/button-down</property>
                  <value>1</value>
                </sum>
              </expression>
            </greater-than>
          </condition>
          <command>property-assign</command>
          <property>autopilot/internal/target-pressure</property>
          <property>environment/pressure-inhg</property>
        </binding>
        <binding>
          <command>property-assign</command>
          <property>autopilot/kap140/panel/button-down</property>
          <value>0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-up</object-name>
    <action>
      <name>UP Button</name>
      <button>0</button>
      <!-- FPM setting -->
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>1</value>
          </equals>
          <greater-than>
            <property>autopilot/kap140/panel/fpm-timer</property>
            <value>0</value>
          </greater-than>
        </condition>
        <command>property-adjust</command>
        <property>autopilot/internal/target-climb-rate</property>
        <step>100</step>
        <min>-2000</min>
        <max>2000</max>
        <wrap>false</wrap>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/fpm-old</property>
        <property>autopilot/internal/target-climb-rate</property>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/button-up</property>
        <property>sim/time/elapsed-sec</property>
      </binding>
      <!--altitude setting-->
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
          <equals>
            <property>autopilot/kap140/settings/vertical-mode</property>
            <value>2</value>
          </equals>
        </condition>
        <command>property-adjust</command>
        <property>autopilot/internal/target-pressure</property>
        <step>-0.022</step>
        <min>26.0</min>
        <max>33.0</max>
        <wrap>false</wrap>
      </binding>
      <mod-up>
        <binding>
          <condition>
            <equals>
              <property>autopilot/kap140/panel/state</property>
              <value>6</value>
            </equals>
            <equals>
              <property>autopilot/kap140/settings/vertical-mode</property>
              <value>2</value>
            </equals>
            <greater-than>
              <property>sim/time/elapsed-sec</property>
              <expression>
                <sum>
                  <property>autopilot/kap140/panel/button-up</property>
                  <value>1</value>
                </sum>
              </expression>
            </greater-than>
          </condition>
          <command>property-assign</command>
          <property>autopilot/internal/target-pressure</property>
          <property>environment/pressure-inhg</property>
        </binding>
        <binding>
          <command>property-assign</command>
          <property>autopilot/kap140/panel/button-up</property>
          <value>0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-arm</object-name>
    <action>
      <name>ARM Button</name>
      <button>0</button>
      <binding>
        <condition>
          <equals>
            <property>autopilot/kap140/panel/state</property>
            <value>6</value>
          </equals>
        </condition>
        <command>property-toggle</command>
        <property>autopilot/kap140/settings/vertical-arm</property>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>btn-baro</object-name>
    <action>
      <name>BARO Button</name>
      <button>0</button>
      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/baro-mode-old</property>
        <property>autopilot/kap140/panel/baro-mode</property>
      </binding>
      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </greater-than>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/baro-button</property>
        <property>sim/time/elapsed-sec</property>
      </binding>
      <mod-up>
        <binding>
          <command>property-assign</command>
          <property>autopilot/kap140/panel/baro-button</property>
          <value>0</value>
        </binding>
      </mod-up>
    </action>
  </animation>

  <animation>
    <type>knob</type>
    <object-name>knob-outer</object-name>
    <action>

      <!-- alt preselect setting -->
      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>4</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-adjust</command>
        <property>autopilot/internal/target-altitude</property>
        <factor>1000</factor>
        <min>-1000</min>
        <max>35000</max>
        <wrap>false</wrap>
      </binding>

      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>5</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/vertical-arm</property>
        <value>1</value>
      </binding>

      <!-- baro setting -->
      <binding>
        <condition>
          <not><property alias="../../../../../../params/baro-tied"/></not>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>3</value>
          </equals>
          <equals>
            <property>autopilot/kap140/panel/baro-mode</property>
            <value>0</value>
          </equals>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/baro-inhg"/>
        <factor>0.1</factor>
        <min>26.0</min>
        <max>33.0</max>
        <wrap>false</wrap>
      </binding>

      <binding>
        <condition>
          <not><property alias="../../../../../../params/baro-tied"/></not>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>3</value>
          </equals>
          <equals>
            <property>autopilot/kap140/panel/baro-mode</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/baro-hpa"/>
        <factor>10</factor>
        <min>880</min>
        <max>1118</max>
        <wrap>false</wrap>
      </binding>
      <binding>
        <condition>
          <not><property alias="../../../../../../params/baro-tied"/></not>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>3</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/baro-timer</property>
        <property>sim/time/elapsed-sec</property>
      </binding>

    </action>
  </animation>

  <animation>
    <type>knob</type>
    <object-name>knob-inner</object-name>
    <action>

      <!-- alt preselect setting -->
      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>4</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-adjust</command>
        <property>autopilot/internal/target-altitude</property>
        <factor>100</factor>
        <min>-1000</min>
        <max>35000</max>
        <wrap>false</wrap>
      </binding>

      <binding>
        <condition>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>5</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/settings/vertical-arm</property>
        <value>1</value>
      </binding>

      <!-- baro setting -->
      <binding>
        <condition>
          <not><property alias="../../../../../../params/baro-tied"/></not>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>3</value>
          </equals>
          <equals>
            <property>autopilot/kap140/panel/baro-mode</property>
            <value>0</value>
          </equals>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/baro-inhg"/>
        <factor>0.01</factor>
        <min>26.0</min>
        <max>33.0</max>
        <wrap>false</wrap>
      </binding>
      <binding>
        <condition>
          <not><property alias="../../../../../../params/baro-tied"/></not>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>3</value>
          </equals>
          <equals>
            <property>autopilot/kap140/panel/baro-mode</property>
            <value>1</value>
          </equals>
        </condition>
        <command>property-adjust</command>
        <property alias="../../../../params/baro-hpa"/>
        <factor>1</factor>
        <min>880</min>
        <max>1118</max>
        <wrap>false</wrap>
      </binding>
      <binding>
        <condition>
          <not><property alias="../../../../../../params/baro-tied"/></not>
          <greater-than>
            <property>autopilot/kap140/panel/state</property>
            <value>3</value>
          </greater-than>
          <equals>
            <property>autopilot/kap140/panel/digit-mode</property>
            <value>3</value>
          </equals>
        </condition>
        <command>property-assign</command>
        <property>autopilot/kap140/panel/baro-timer</property>
        <property>sim/time/elapsed-sec</property>
      </binding>
    </action>
  </animation>

</PropertyList>
