<?xml version="1.0"?>

<!-- F-14B Altimeter by Richard Harrison rjh@zaretto.com 
Bendix Instruments and Life Support Division, Davenport, Iowa, USA AAU-19A/A servoed counter-drum-pointer altimeter 

Barometric input is used in both standby and normal (servoed) modes. 
In standby mode, altimeter functions as a conventional pressure altimeter. 
In normal mode, if indicated barometric pressure altitude matches true pressure altitude from
central air data computer system (ADCS), no correction is made. If there is a difference, 
a synchro overrides the barometric mechanism and positions the pointer to true altitude.
-->
<PropertyList>
    <path>f14-altimeter.ac</path>

    <animation>
        <type>rotate</type>
        <object-name>needle</object-name>
        <!--<condition>
            <greater-than>
                <property>/fdm/jsbsim/systems/electrics/ac-essential-bus1</property>
                <value>0</value>
            </greater-than>
        </condition>-->
        <property>instrumentation/altimeter/indicated-altitude-ft</property>
        <factor>0.36</factor>
        <!--<center>
            <x-m>0.0084</x-m>
            <y-m>0.00000806</y-m>
            <z-m>-0.0012</z-m>
        </center>-->
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>

    </animation>

    <!-- altimeter drum counter -->
    <animation>
        <type>textranslate</type>
        <object-name>drum-1</object-name>
        <!--<condition>
            <greater-than>
                <property>/fdm/jsbsim/systems/electrics/ac-essential-bus1</property>
                <value>0</value>
            </greater-than>
        </condition>-->
        <property>instrumentation/altimeter/indicated-altitude-ft</property>
        <factor>0.001</factor>
        <offset>-100</offset>
        <step>100</step>
        <scroll>10</scroll>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>drum-2</object-name>
        <!--<condition>
            <greater-than>
                <property>/fdm/jsbsim/systems/electrics/ac-essential-bus1</property>
                <value>0</value>
            </greater-than>
        </condition>-->
        <property>instrumentation/altimeter/indicated-altitude-ft</property>
        <factor>0.0001</factor>
        <offset>-1000</offset>
        <step>1000</step>
        <scroll>25</scroll>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>drum-3</object-name>
        <!--<condition>
            <greater-than>
                <property>/fdm/jsbsim/systems/electrics/ac-essential-bus1</property>
                <value>0</value>
            </greater-than>
        </condition>-->
        <property>instrumentation/altimeter/indicated-altitude-ft</property>
        <factor>0.00001</factor>
        <offset>-10000</offset>
        <step>10000</step>
        <scroll>25</scroll>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>
    <animation>
        <type>select</type>
        <object-name>below-1000-flag</object-name>
        <condition>
            <less-than>
                <property>instrumentation/altimeter/indicated-altitude-ft</property>
                <value>1000</value>
            </less-than>
        </condition>
    </animation>
    <animation>
        <type>select</type>
        <object-name>below-10000-flag</object-name>
        <condition>
            <less-than>
                <property>instrumentation/altimeter/indicated-altitude-ft</property>
                <value>10000</value>
            </less-than>
        </condition>
    </animation>

    <animation>
        <type>select</type>
        <object-name>stby-flag</object-name>
        <condition>
            <or>
                <equals>
                    <property>/fdm/jsbsim/systems/electrics/ac-essential-bus1</property>
                    <value>0</value>
                </equals>
                <property>instrumentation/altimeter/setting-stby</property>
            </or>
        </condition>
    </animation>

    <!-- barometer drum counter -->
    <animation>
        <type>textranslate</type>
        <object-name>drum-inhg-1</object-name>
        <property>instrumentation/altimeter/setting-inhg</property>
        <factor>10</factor>
        <offset>-0.01</offset>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>drum-inhg-2</object-name>
        <property>instrumentation/altimeter/setting-inhg</property>
        <factor>1</factor>
        <offset>-0.1</offset>
        <step>0.1</step>
        <scroll>0.01</scroll>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>drum-inhg-3</object-name>
        <property>instrumentation/altimeter/setting-inhg</property>
        <factor>0.1</factor>
        <offset>-1</offset>
        <step>1</step>
        <scroll>0.01</scroll>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>drum-inhg-4</object-name>
        <property>instrumentation/altimeter/setting-inhg</property>
        <factor>0.01</factor>
        <offset>-10</offset>
        <step>10</step>
        <scroll>0.01</scroll>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <!-- Altimeter Ingh Setting Knob -->
    <animation>
        <type>knob</type>
        <object-name>barometric-pressure-knob</object-name>
        <property>instrumentation/altimeter/setting-inhg</property>
        <factor>0</factor>
        <center>
            <x-m>0.0212</x-m>
            <y-m>-0.0354</y-m>
            <z-m>-0.0321</z-m>
        </center>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>

        <action>
            <binding>
                <command>property-adjust</command>
                <property>instrumentation/altimeter/setting-inhg</property>
               
                <factor>0.01</factor>
                <min>27.90</min>
                <max>31.40</max>
                <wrap>false</wrap>
            </binding>
        </action>
    </animation>
    <animation>
        <type>knob</type>
        <object-name>stby-reset-knob</object-name>
        <property>instrumentation/altimeter/setting-stby</property>
        <factor>-90</factor>
        <center>
            <x-m>0.0197</x-m>
            <y-m>0.0336</y-m>
            <z-m>-0.0323</z-m>
        </center>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>

        <action>
            <binding>
                <command>property-adjust</command>
                <property>instrumentation/altimeter/setting-stby</property>

                <factor>1</factor>
                <min>0</min>
                <max>1</max>
                <wrap>false</wrap>
            </binding>
        </action>
    </animation>
    

    <!-- lighting -->
    <animation>
        <object-name>mount</object-name>
        <type>material</type>
        <condition>
            <greater-than>
                <property>/fdm/jsbsim/systems/electrics/ac-essential-bus1</property>
                <value>0</value>
            </greater-than>
            <not>
                <property>/sim/rendering/rembrandt/enabled</property>
            </not>
        </condition>
        <emission>
            <factor-prop>controls/lighting/dome-norm</factor-prop>
            <red>  1.000</red>
            <green>0.576</green>
            <blue> 0.161</blue>
            <red-prop>controls/lighting/panel-red</red-prop>
            <green-prop>controls/lighting/panel-green</green-prop>
            <blue-prop>controls/lighting/panel-blue</blue-prop>

        </emission>
    </animation>

    <animation>
        <object-name>instrument</object-name>
        <type>material</type>
        <condition>
            <greater-than>
                <property>/fdm/jsbsim/systems/electrics/ac-essential-bus1</property>
                <value>0</value>
            </greater-than>
            <greater-than-equals>
                <property>controls/lighting/instruments-norm</property>
                <property>controls/lighting/dome-norm</property>
            </greater-than-equals>
            <not>
                <property>/sim/rendering/rembrandt/enabled</property>
            </not>
        </condition>
        <emission>
            <factor-prop>controls/lighting/instruments-norm</factor-prop>
            <red>  1.1000</red>
            <green>0.576</green>
            <blue> 0.161</blue>
            <red-prop>controls/lighting/instrument-red</red-prop>
            <green-prop>controls/lighting/instrument-green</green-prop>
            <blue-prop>controls/lighting/instrument-blue</blue-prop>

        </emission>
    </animation>
    <animation>
        <object-name>instrument</object-name>
        <type>material</type>
        <condition>
            <greater-than>
                <property>/fdm/jsbsim/systems/electrics/ac-essential-bus1</property>
                <value>0</value>
            </greater-than>
            <greater-than>
                <property>controls/lighting/dome-norm</property>
                <property>controls/lighting/instruments-norm</property>
            </greater-than>
            <not>
                <property>/sim/rendering/rembrandt/enabled</property>
            </not>
        </condition>
        <emission>
            <factor-prop>controls/lighting/dome-norm</factor-prop>
            <red>  1.1000</red>
            <green>0.576</green>
            <blue> 0.161</blue>
            <red-prop>controls/lighting/instrument-red</red-prop>
            <green-prop>controls/lighting/instrument-green</green-prop>
            <blue-prop>controls/lighting/instrument-blue</blue-prop>
        </emission>
    </animation>
    
</PropertyList>
