<?xml version="1.0" encoding="UTF-8" ?>

<PropertyList>

 <path>LGSM_Tower.ac</path>

 <animation>
  <name>Shifting</name>
<object-name>Antenna</object-name>
<object-name>Antenna.001</object-name>
<object-name>Antenna.002</object-name>
<object-name>Antenna.003</object-name>
<object-name>Antenna.004</object-name>
<object-name>Antenna.005</object-name>
<object-name>Box</object-name>
<object-name>HekH</object-name>
<object-name>HekL</object-name>
<object-name>Plateau</object-name>
<object-name>TGlass</object-name>
<object-name>LightStand</object-name>
<object-name>Tower</object-name>
<object-name>Tower_0</object-name>
<object-name>Tower_1</object-name>
<object-name>Wall-Roof</object-name>
 </animation>

 <animation>
  <object-name>Shifting</object-name>
  <type>textranslate</type>
    <property>/sim/time/sun-angle-rad</property>
    <step>1.57</step>
    <factor>0.318471338</factor>
  <axis>
   <x>-1</x>
   <y>0</y>
  </axis>
 </animation>

  <animation>
    <type>material</type> 
    <object-name>Shifting</object-name> 
    <condition>		
     <greater-than-equals>		
      <property>/sim/time/sun-angle-rad</property>
      <value>1.57</value>
     </greater-than-equals>
    </condition>
    <emission>	
     <red>0.25</red>	
     <green>0.25</green>	
     <blue>0.3</blue>
    </emission>
  </animation>

  <animation>
    <type>material</type> 
    <object-name>Light</object-name> 
    <condition>		
     <greater-than-equals>		
      <property>/sim/time/sun-angle-rad</property>
      <value>1.57</value>
     </greater-than-equals>
    </condition>
    <emission>	
     <red>0.5</red>	
     <green>0.</green>	
     <blue>0.</blue>
    </emission>
  </animation>

  <animation>
   <type>material</type> 
   <object-name>Flash</object-name> 
   <condition>		
      <greater-than-equals>		
         <property>/sim/time/sun-angle-rad</property>
         <value>1.57</value>
      </greater-than-equals>
   </condition>
   <emission>	
      <red>0.9</red>	
      <green>0.</green>	
      <blue>0.</blue>
   </emission>
  </animation>

 <animation>
    <type>select</type>
    <object-name>Flash</object-name>
    <condition>		
      <greater-than>		
       <property>/sim/temp/LGSM_Flash</property>
       <value>0</value>
      </greater-than>
   </condition>
 </animation>

 <animation>
  <type>billboard</type>
  <object-name>Flash</object-name>
  <spherical type="bool">true</spherical>
 <condition>		
  <greater-than>		
   <property>/sim/temp/LGSM_Flash</property>
   <value>0</value>
  </greater-than>
 </condition>
 </animation>

<!--
 Not Working.
 <animation>
  <type>timed</type>
  <object-name>Flash</object-name>
  <object-name>Sphere</object-name>
  <use-personality type="bool">true</use-personality>
  <branch-duration-sec>0.1</branch-duration-sec>
  <branch-duration-sec>0.9</branch-duration-sec>
 </animation>
-->

<nasal>
  <load>
   <![CDATA[
    print("Loading LGSM ...");  
    var t = getprop("/sim/temp/LGSM_Flash");
    # No double timers after reload 
    if( (t == nil) or (t == -99) ){
      # LGSM_Flash does not exist, so make one
      setprop("/sim/temp/LGSM_Flash",0);
      var FlashTimer = maketimer(120, func {

        if(getprop("/sim/time/sun-angle-rad")>1.57){

           if(getprop("/sim/temp/LGSM_Flash") == 1){
              setprop("/sim/temp/LGSM_Flash",0);
              FlashTimer.restart(0.8);
           }else{
              setprop("/sim/temp/LGSM_Flash",1);
              FlashTimer.restart(0.2);
           }

        }else{
           setprop("/sim/temp/LGSM_Flash",0);
           # Test every 2 mins for sun-angle
           FlashTimer.restart(120);
        }

      });
      FlashTimer.restart(1);
    };

   ]]>
  </load>
  <unload>
    <![CDATA[
      print("Unloading LGSM ...");
      FlashTimer.stop();
      setprop("/sim/temp/LGSM_Flash",-99);
      FlashTimer = nil;
    ]]>
  </unload>
</nasal>

</PropertyList>

