<PropertyList>
       
<path>LOWI_garage_main.ac</path>





	<nasal>
		<load>
		if (!contains(globals, "scenery")) globals["scenery"] = {};
		if (!contains(scenery, "LOWI")) scenery["LOWI"] = {};
		if (!contains(scenery.LOWI, "garage")) scenery.LOWI["garage"] = [nil];
		scenery.LOWI.garage[0] =
			{ door :
			[aircraft.door.new("/scenery/LOWI/garage[0]/door[0]", 3),
			aircraft.door.new("/scenery/LOWI/garage[0]/door[1]", 3)
			
			]
		};
		
		#this is the switch target sim time sun rad
		var limwswitch = 1.48;
		var limwswitch1 = 1.25;
		var limwswitch2 = 1.35;
		
		var loop_id = 0;

		var loop = func(id) {
				id == loop_id or return;
				var limwsun = getprop("/sim/time/sun-angle-rad");
				var doorstate = getprop("/scenery/LOWI/garage[0]/door[0]/position-norm");
				var doorstate1 = getprop("/scenery/LOWI/garage[0]/door[1]/position-norm");
					#print ("limwsun  ", limwsun);
				
				#door0
				if ((limwsun &gt; limwswitch) and (doorstate == 0)){
					scenery.LOWI.garage[0].door[0].toggle();
					#print ("toggle door  ");
					};
				
				if ((limwsun &lt; limwswitch) and (doorstate == 1)){
					scenery.LOWI.garage[0].door[0].toggle();
					#print ("toggle door  ");
					};
				
				#door1
				if ((limwsun &gt; limwswitch2) and (doorstate1 == 0)){
					scenery.LOWI.garage[0].door[1].toggle();
					#print ("toggle door  ");
					};
				
				if ((limwsun &lt; limwswitch1) and (doorstate1 == 1)){
					scenery.LOWI.garage[0].door[1].toggle();
					#print ("toggle door  ");
					};
		
			settimer(func { loop(id) }, 4);
			}
			loop(loop_id += 1);
	
		</load>
		<unload>loop_id += 1</unload>
	
	</nasal>





	
	

	<animation>
		<name>door_main_1_all</name>
			<object-name>door_main_1_1</object-name>
			<object-name>door_main_1_2</object-name>
			<object-name>door_main_1_3</object-name>
			<object-name>door_main_1_4</object-name>
			<object-name>door_main_1_5</object-name>
	</animation>

	<animation>
		<name>door_main_2_all</name>
			<object-name>door_main_2_1</object-name>
			<object-name>door_main_2_2</object-name>
			<object-name>door_main_2_3</object-name>
			<object-name>door_main_2_4</object-name>
			<object-name>door_main_2_5</object-name>
	</animation>
	
	<animation>
		<name>door_fire_1_all</name>
			<object-name>door_fire_1_1</object-name>
			<object-name>door_fire_1_2</object-name>
	</animation>
	
	<animation>
		<name>door_fire_2_all</name>
			<object-name>door_fire_2_1</object-name>
			<object-name>door_fire_2_2</object-name>
	</animation>
	
	<animation>
		<name>door_fire_3_all</name>
			<object-name>door_fire_3_1</object-name>
			<object-name>door_fire_3_2</object-name>
	</animation>
	
	<animation>
		<name>door_fire_4_all</name>
			<object-name>door_fire_4_1</object-name>
			<object-name>door_fire_4_2</object-name>
	</animation>
	
	<animation>
		<name>door_fire_5_all</name>
			<object-name>door_fire_5_1</object-name>
			<object-name>door_fire_5_2</object-name>
	</animation>


	

	<animation>
		<type>translate</type>
		<object-name>door_main_1_all</object-name>
		<property>/scenery/LOWI/garage[0]/door[0]/position-norm</property>
		<factor>1</factor>
			<interpolation>
				<entry><ind> 0.00 </ind><dep> 5.00 </dep></entry>
				<entry><ind> 1.00 </ind><dep> 0.00 </dep></entry>
			</interpolation>
		<axis>
			<x>0</x>
			<y>0</y>
			<z>1</z>
		</axis>
	</animation>
	
	
	<animation>
		<type>select</type> 
		<object-name>door_main_1_1</object-name>
		<condition>		
			<greater-than>		
				<property>/scenery/LOWI/garage[0]/door[0]/position-norm</property>
				<value>0.75</value>
			</greater-than>
		</condition>
	</animation>
	
	<animation>
		<type>select</type> 
		<object-name>door_main_1_2</object-name>
		<condition>		
			<greater-than>		
				<property>/scenery/LOWI/garage[0]/door[0]/position-norm</property>
				<value>0.55</value>
			</greater-than>
		</condition>
	</animation>
	
	<animation>
		<type>select</type> 
		<object-name>door_main_1_3</object-name>
		<condition>		
			<greater-than>		
				<property>/scenery/LOWI/garage[0]/door[0]/position-norm</property>
				<value>0.35</value>
			</greater-than>
		</condition>
	</animation>
	
	<animation>
		<type>select</type> 
		<object-name>door_main_1_4</object-name>
		<condition>		
			<greater-than>		
				<property>/scenery/LOWI/garage[0]/door[0]/position-norm</property>
				<value>0.15</value>
			</greater-than>
		</condition>
	</animation>
	

	<animation>
		<type>translate</type>
		<object-name>door_fire_2_all</object-name>
		<object-name>door_fire_3_all</object-name>
		<property>/scenery/LOWI/garage[0]/door[0]/position-norm</property>
		<factor>1</factor>
			<interpolation>
				<entry><ind> 0.00 </ind><dep> 4.10 </dep></entry>
				<entry><ind> 1.00 </ind><dep> 0.00 </dep></entry>
			</interpolation>
		<axis>
			<x>0</x>
			<y>0</y>
			<z>1</z>
		</axis>
	</animation>
	
	
	<animation>
		<type>select</type> 
		<object-name>door_fire_2_1</object-name>
		<object-name>door_fire_3_1</object-name>
		<condition>		
			<greater-than>		
				<property>/scenery/LOWI/garage[0]/door[0]/position-norm</property>
				<value>0.45</value>
			</greater-than>
		</condition>
	</animation>


	<animation>
		<type>translate</type>
		<object-name>door_fire_1_all</object-name>
		<object-name>door_fire_4_all</object-name>
		<property>/scenery/LOWI/garage[0]/door[1]/position-norm</property>
		<factor>1</factor>
			<interpolation>
				<entry><ind> 0.00 </ind><dep> 4.10 </dep></entry>
				<entry><ind> 1.00 </ind><dep> 0.00 </dep></entry>
			</interpolation>
		<axis>
			<x>0</x>
			<y>0</y>
			<z>1</z>
		</axis>
	</animation>
	
	
	<animation>
		<type>select</type> 
		<object-name>door_fire_1_1</object-name>
		<object-name>door_fire_4_1</object-name>
		<condition>		
			<greater-than>		
				<property>/scenery/LOWI/garage[0]/door[1]/position-norm</property>
				<value>0.45</value>
			</greater-than>
		</condition>
	</animation>
	
	

	<animation>
		<type>material</type> 
			<object-name>windows_main_office</object-name>
			<object-name>windows_main_gate</object-name>
			<object-name>windows_main_roof</object-name>
			<object-name>windows_main_r2</object-name>
			<object-name>windows_fire_roof</object-name>
			
			<object-name>door_main</object-name>
			<object-name>door_main_1_all</object-name>
			<object-name>door_main_2_all</object-name>
		<condition>		
			<greater-than>		
				<property>/sim/time/sun-angle-rad</property>
				<value>1.52</value>
			</greater-than>
		</condition>
		<emission>	
			<red>0.7</red>	
			<green>0.7</green>	
			<blue>0.7</blue>
		</emission>
	</animation>
	
	<animation>
		<type>select</type> 
		<object-name>windows_main_office</object-name>
		<object-name>windows_main_gate</object-name>
			<condition>		
				<greater-than>
					<property>/sim/time/sun-angle-rad</property>
					<value>1.52</value>
				</greater-than>
			</condition>
	</animation>
	

	<animation>
		<type>material</type> 
			<object-name>app_lights_main_01</object-name>
		<condition>		
			<greater-than>		
				<property>/sim/time/sun-angle-rad</property>
				<value>1.52</value>
			</greater-than>
		</condition>
		<emission>	
			<red>0.9</red>	
			<green>0.9</green>	
			<blue>0.9</blue>
		</emission>
	</animation>




</PropertyList>