<!--
Boeing style chronometer, by Syd Adams
-->

<PropertyList>
 
    <path>chronometer.ac</path>

    <animation>
        <type>rotate</type>
        <object-name>Chrono.needle</object-name>
        <property>instrumentation/clock/ET-sec</property>
        <factor>6</factor>
        <center>
            <x-m>0.0</x-m>
            <y-m>0</y-m>
            <z-m>0.0</z-m>
        </center>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>ET.switch</object-name>
        <property>instrumentation/clock/et-knob</property>
        <interpolation>
            <entry><ind>-1</ind><dep>-144</dep></entry>
            <entry><ind>0</ind><dep>0</dep></entry>
            <entry><ind>1</ind><dep>35</dep></entry>
        </interpolation>
        <center>
            <x-m>0</x-m>
            <y-m>-0.032</y-m>
            <z-m>-0.033</z-m>
        </center>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>SET.switch</object-name>
        <property>instrumentation/clock/set-knob</property>
        <interpolation>
            <entry><ind>0</ind><dep>0</dep></entry>
            <entry><ind>1</ind><dep>30</dep></entry>
            <entry><ind>2</ind><dep>60</dep></entry>
            <entry><ind>3</ind><dep>90</dep></entry>
        </interpolation>
        <center>
            <x-m>0</x-m>
            <y-m>0.029</y-m>
            <z-m>-0.033</z-m>
        </center>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>UTC.switch</object-name>
        <property>instrumentation/clock/time-knob</property>
        <interpolation>
            <entry><ind>-1</ind><dep>-135</dep></entry>
            <entry><ind>0</ind><dep>0</dep></entry>
            <entry><ind>1</ind><dep>35</dep></entry>
        </interpolation>
        <center>
            <x-m>0</x-m>
            <y-m>0.032</y-m>
            <z-m>0.034</z-m>
        </center>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>
    </animation>

<!-- Digital displays -->

    <animation>
        <type>textranslate</type>
        <object-name>Hr.10</object-name>
        <property>instrumentation/clock/indicated-hour</property>
        <factor>0.01</factor>
        <step>10</step>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>Hr.01</object-name>
        <property>instrumentation/clock/indicated-hour</property>
        <factor>0.1</factor>
        <step>1</step>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>
 
    <animation>
        <type>textranslate</type>
        <object-name>Mn.10</object-name>
        <property>instrumentation/clock/indicated-min</property>
        <factor>0.01</factor>
        <step>10</step>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>Mn.01</object-name>
        <property>instrumentation/clock/indicated-min</property>
        <factor>0.1</factor>
        <step>1</step>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>ET10</object-name>
        <property>instrumentation/clock/ET-display</property>
        <factor>0.0001</factor>
        <step>1000</step>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>ET01</object-name>
        <property>instrumentation/clock/ET-display</property>
        <factor>0.001</factor>
        <step>100</step>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>ET.10</object-name>
        <property>instrumentation/clock/ET-display</property>
        <factor>0.01</factor>
        <step>10</step>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>textranslate</type>
        <object-name>ET.01</object-name>
        <property>instrumentation/clock/ET-display</property>
        <factor>0.1</factor>
        <step>1</step>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>select</type>
        <object-name>ET10</object-name>
        <object-name>ET01</object-name>
        <condition>
            <greater-than>
                <property>instrumentation/clock/ET-display</property>
                <value>99.99</value>
            </greater-than>
        </condition>
    </animation>

<!--  Hotspots -->

    <hotspot-action-script>
		if (!contains(aircraft, "boeing_chronometer"))
		{
			aircraft.boeing_chronometer = aircraft.timer.new("/instrumentation/clock/ET-sec", 1);
			aircraft.boeing_chronometer.stop();
			props.globals.initNode("/instrumentation/clock/ET-display",0,"INT");
			props.globals.initNode("/instrumentation/clock/time-display",0,"INT");
			props.globals.initNode("/instrumentation/clock/time-knob",0,"INT");
			props.globals.initNode("/instrumentation/clock/et-knob",0,"INT");
			props.globals.initNode("/instrumentation/clock/set-knob",0,"INT");
			print("Boeing chronometer ... initialized");
		}

		var tmp = props.globals.getNode("/instrumentation/clock/et-knob").getValue();
		if (tmp == -1)
		{
			aircraft.boeing_chronometer.reset();
		}
		elsif (tmp == 0)
		{
			aircraft.boeing_chronometer.stop();
		}
		elsif (tmp == 1)
		{
			aircraft.boeing_chronometer.start();
		}
    </hotspot-action-script>

    <animation>
        <type>pick</type>
        <object-name>ET.run</object-name>
        <action>
            <button>0</button>
            <repeatable>false</repeatable>
             <binding>
                <command>property-assign</command>
                <property>instrumentation/clock/et-knob</property>
                <value>1</value>
            </binding>
            <binding>
               <command>nasal</command>
               <script alias="../../../../hotspot-action-script" />
            </binding>
        </action>
    </animation>

    <animation>
        <type>pick</type>
        <object-name>ET.hld</object-name>
        <action>
            <button>0</button>
            <repeatable>false</repeatable>
             <binding>
                <command>property-assign</command>
                <property>instrumentation/clock/et-knob</property>
                <value>0</value>
            </binding>
            <binding>
               <command>nasal</command>
               <script alias="../../../../hotspot-action-script" />
            </binding>
        </action>
    </animation>

    <animation>
        <type>pick</type>
        <object-name>ET.reset</object-name>
        <action>
            <button>0</button>
            <repeatable>false</repeatable>
            <binding>
                <command>property-assign</command>
                <property>instrumentation/clock/et-knob</property>
                <value>-1</value>
            </binding>
            <binding>
               <command>nasal</command>
               <script alias="../../../../hotspot-action-script" />
            </binding>
            <mod-up>
                <binding>
                    <command>property-assign</command>
                    <property>instrumentation/clock/et-knob</property>
                    <value>0</value>
                </binding>
                <binding>
                   <command>nasal</command>
                   <script alias="../../../../../hotspot-action-script" />
                </binding>
            </mod-up>
        </action>
    </animation>

    <animation>
        <type>pick</type>
        <object-name>ET.switch</object-name>
        <action>
            <button>0</button>
            <repeatable>false</repeatable>
             <binding>
                <command>property-toggle</command>
                <property>instrumentation/clock/et-knob</property>
            </binding>
            <binding>
               <command>nasal</command>
               <script alias="../../../../hotspot-action-script" />
            </binding>
        </action>
        <action>
            <button>1</button>
            <repeatable>false</repeatable>
            <binding>
                <command>property-assign</command>
                <property>instrumentation/clock/et-knob</property>
                <value>-1</value>
            </binding>
            <binding>
               <command>nasal</command>
               <script alias="../../../../hotspot-action-script" />
            </binding>
            <mod-up>
                <binding>
                    <command>property-assign</command>
                    <property>instrumentation/clock/et-knob</property>
                    <value>0</value>
                </binding>
                <binding>
                   <command>nasal</command>
                   <script alias="../../../../../hotspot-action-script" />
                </binding>
            </mod-up>
        </action>
    </animation>

</PropertyList>