<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- #############################################################################
     #    (C) 2007 by Yurik V. Nikiforoff                                        #
     #     yurik@megasignal.com                                                  #
     #     Jul 2007                                                              #
     #                                                                           #
     #    Updated BARANGER Emmanuel    2015                                      #
     #    Updated BARANGER Emmanuel 09/2022                                      #
     #############################################################################
     Clock ACHS-2 3D instrument
-->
<PropertyList>

  <path>achs-2.ac</path>

  <animation>
    <object-name>fond</object-name>
    <object-name>face</object-name>
    <object-name>hour_needle</object-name>
    <object-name>min_needle</object-name>
    <object-name>sec_needle</object-name>
    <object-name>secundomer_needle</object-name>
    <object-name>timer_hour_needle</object-name>
    <object-name>timer_min_needle</object-name>
    <object-name>time.set</object-name>
    <object-name>time.stop</object-name>

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

  <animation>
    <type>noshadow</type>
    <object-name>fond</object-name>
    <object-name>face</object-name>
    <object-name>hour_needle</object-name>
    <object-name>min_needle</object-name>
    <object-name>sec_needle</object-name>
    <object-name>secundomer_needle</object-name>
    <object-name>timer_hour_needle</object-name>
    <object-name>timer_min_needle</object-name>
    <object-name>time.set</object-name>
    <object-name>time.stop</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>face</object-name>
    <object-name>hour_needle</object-name>
    <object-name>min_needle</object-name>
    <object-name>sec_needle</object-name>
    <object-name>secundomer_needle</object-name>
    <object-name>timer_hour_needle</object-name>
    <object-name>timer_min_needle</object-name>
    <object-name>time.set</object-name>
    <object-name>time.stop</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>

  <!--Needles-->
  <animation>
    <type>rotate</type>
    <object-name>hour_needle</object-name>
    <property>/instrumentation/clock/indicated-min</property>
    <factor> -0.5 </factor>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>hour_needle</object-name>
    <property>/instrumentation/clock/local-hour</property>
    <factor> -30 </factor>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>min_needle</object-name>
    <property>/instrumentation/clock/indicated-sec</property>
    <factor> -0.1 </factor>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>sec_needle</object-name>
    <property>/instrumentation/clock/indicated-sec</property>
    <factor> -6 </factor>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- new function: stop watch time.set time.stop-->
  <animation>
    <type>rotate</type>
    <object-name>timer_hour_needle</object-name>
    <property>/instrumentation/stopwatch/flight-time/hours</property>
    <interpolation>
      <entry><ind>  0 </ind><dep>   0 </dep></entry>
      <entry><ind> 60 </ind><dep> 360 </dep></entry>
    </interpolation>
    <center>
      <x-m> -0.00003 </x-m>
      <y-m> -0.00000 </y-m>
      <z-m>  0.01337 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>timer_min_needle</object-name>
    <property>/instrumentation/stopwatch/flight-time/minutes</property>
    <interpolation>
      <entry><ind>  0 </ind><dep>   0 </dep></entry>
      <entry><ind> 60 </ind><dep> 360 </dep></entry>
    </interpolation>
    <center>
      <x-m> -0.00013 </x-m>
      <y-m> -0.00000 </y-m>
      <z-m>  0.01335 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>secundomer_needle</object-name>
    <property>/instrumentation/stopwatch/flight-time/seconds</property>
    <interpolation>
      <entry><ind>  0 </ind><dep>   0 </dep></entry>
      <entry><ind> 60 </ind><dep> 360 </dep></entry>
    </interpolation>
    <center>
      <x-m>  0.0003 </x-m>
      <y-m> -0.0000 </y-m>
      <z-m> -0.0168 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- knobs -->
  <!-- start stop and reset the stopwatch-->
  <animation>
    <type>translate</type>
    <object-name>time.stop</object-name>
    <property>/instrumentation/stopwatch/running</property>
    <factor>0.005</factor>
    <center>
      <x-m>  0.00000 </x-m>
      <y-m>  0.03154 </y-m>
      <z-m> -0.01644 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>time.stop</object-name>
    <action>
      <button>0</button>
      <repeatable>true</repeatable>
      <interval-sec>0.1</interval-sec>
      <binding>
        <command>nasal</command>
        <script>instruments.sw_start_stop();</script>
      </binding>
    </action>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>time.set</object-name>
    <action>
      <button>0</button>
      <repeatable>true</repeatable>
      <interval-sec>0.1</interval-sec>
      <binding>
        <command>nasal</command>
        <script>instruments.sw_reset();</script>
      </binding>
    </action>
  </animation>

</PropertyList>
