<?xml version="1.0" encoding="UTF-8"?>
<SimBase.Document
        Type="AceXML"
        version="1,0"
        id="AB_startup">
    <Descr>AceXML Document</Descr>
    <Filename>AB_startup.xml</Filename>
    <SimGauge.Gauge id="Gauge">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Update_When_Hidden>True</Update_When_Hidden>
        <Update id="AB_startup">
		<Frequency>4</Frequency>
<Script>
(L:Pause_code, bool) 0 ==
if{
	(L:Save_Init_Timer, number) 20 &lt;
	(L:ASC_Save_Avail, bool) 1 == &amp;&amp;
	(L:Exits_conf, bool) 0 == &amp;&amp;
	if{
		(L:Save_Init_Timer, number) 1 + (&gt; L:Save_Init_Timer, number)
	}

	(L:Save_Init_Timer, number) 15 &gt;
	if{
		0 (&gt;L:Loadup_ASC_Save, bool)
	}
	
	(L:Loadup_ASC_Load, number) 0 ==
	(L:Loadup_ASC_Save, bool) 0 == &amp;&amp;
	(L:Load2, bool) 1 == &amp;&amp;
	(L:Save_Init_Timer, number) 20 &gt;= &amp;&amp;
	(L:ASC_AP_VNav_Load, bool) 0 == &amp;&amp;
	if{
		(A:GEAR HANDLE POSITION, bool) (&gt; L:ASC_Landinggear, number)
		(A:BRAKE PARKING INDICATOR, bool) (&gt; L:ASC_Parkbrake, number)
		(A:LIGHT NAV, bool) (&gt; L:ASC_Navlight, number)
		(L:LIGHT_BEACON, bool) (&gt; L:ASC_Beaconlight, number)
		(A:LIGHT LANDING, bool) (&gt; L:ASC_Landinglight, number)
		(A:LIGHT WING, bool) (&gt; L:ASC_Winglight, number)
		(A:LIGHT PANEL, bool) (&gt; L:ASC_Panellight, number)
		(A:MARKER SOUND, bool) (&gt; L:ASC_Markersound, number)
		(A:LIGHT LOGO, bool) (&gt; L:ASC_Logolight, number)
			
		(L:Spoiler_lv_Anim, number) 0 ==
		if{
			1 (&gt; L:ASC_Spoiler_armed, number)
		}
			els{
				0 (&gt; L:ASC_Spoiler_armed, number)
			}

		(A:SPOILERS HANDLE POSITION, percent) 163.85 * (&gt; L:ASC_Spoiler_Pos, number)

		(A:ANTISKID BRAKES ACTIVE, bool) (&gt; L:ASC_Antiskid, bool)
				
		(A:ELEVATOR TRIM PCT, percent) 163.85 * (&gt; L:ASC_Elevatortrim, number)
		(A:AILERON TRIM PCT, percent) (&gt; L:ASC_Ailerontrim, number)
		(A:RUDDER TRIM PCT, percent) (&gt; L:ASC_Ruddertrim, number)

		(A:COM ACTIVE FREQUENCY:1, Mhz) (&gt; L:ASC_Com1_Afrq, number)
		(A:COM ACTIVE FREQUENCY:2, Mhz) (&gt; L:ASC_Com2_Afrq, number)
		(A:COM STANDBY FREQUENCY:1, Mhz) (&gt; L:ASC_Com1_Sfrq, number)
		(A:COM STANDBY FREQUENCY:2, Mhz) (&gt; L:ASC_Com2_Sfrq, number)
		
		<!-- (A:NAV ACTIVE FREQUENCY:1, Mhz) (&gt; L:ASC_Nav1_Afrq, number)
		(A:NAV ACTIVE FREQUENCY:2, Mhz) (&gt; L:ASC_Nav2_Afrq, number)
		(A:NAV STANDBY FREQUENCY:1, Mhz) (&gt; L:ASC_Nav1_Sfrq, number)
		(A:NAV STANDBY FREQUENCY:2, Mhz) (&gt; L:ASC_Nav2_Sfrq, number)
		
		(A:ADF ACTIVE FREQUENCY:1, Khz) (&gt; L:ASC_ADF1_Afrq, number)
		(A:ADF ACTIVE FREQUENCY:2, Khz) (&gt; L:ASC_ADF2_Afrq, number) -->
		
		(A:TRANSPONDER1 CODE, number) (&gt; L:ASC_Xpondernumber, number)
		
		(A:NAV SOUND:1, bool) (&gt; L:ASC_Navsound1, number)
		(A:NAV SOUND:2, bool) (&gt; L:ASC_Navsound2, number)
		(A:ADF SOUND, bool) (&gt; L:ASC_ADFsound1, number)
		(L:ADF2_toggle, bool) (&gt; L:ASC_ADFsound2, number)
		
		(A:GENERAL ENG COMBUSTION:1, bool) 1 ==
		(A:GENERAL ENG COMBUSTION:2, bool) 1 == ||
		if{
			1 (&gt; L:ASC_Engines_running, number)
		}
		(A:GENERAL ENG COMBUSTION:1, bool) 0 ==
		(A:GENERAL ENG COMBUSTION:2, bool) 0 == &amp;&amp;
		if{
			0 (&gt; L:ASC_Engines_running, number)
		}
		
		(A:EXIT OPEN:0, percent) (&gt; L:ASC_Exit_0, number)
		(A:EXIT OPEN:1, percent) (&gt; L:ASC_Exit_1, number)
		(A:EXIT OPEN:2, percent) (&gt; L:ASC_Exit_2, number)
		(A:EXIT OPEN:3, percent) (&gt; L:ASC_Exit_3, number)
		
		(A:KOHLSMAN SETTING MB:1, millibars) (&gt; L:ASC_Kohlsmann, number)
		(L:Kohlsman_isis_mem, number) (&gt; L:ASC_Kohlsmann2, number)
		
		(L:MCDU_cones, bool) (&gt; L:ASC_MCDU_cones, number)
		(L:MCDU_Wheelchocks, bool) (&gt; L:ASC_MCDU_Wheelchocks, number)
		(L:MCDU_EXTPOWERCART, bool) (&gt; L:ASC_MCDU_EXTPOWERCART, number)
		(L:MCDU_EXTPOWER, bool) (&gt; L:ASC_MCDU_EXTPOWER, number)
		(L:Autobrake_position, number) (&gt; L:ASC_Autobrake_position, number)
		(L:AB_OVH_APU_START_LIGHT_AVAIL, number) (&gt; L:ASC_APU_avail, bool)
		
		(L:AB_AP_SPEED_Select, number) (&gt;L:ASC_AB_AP_SPEED_Selected, number)
		(L:AB_AP_VS_Select2, number) (&gt;L:ASC_AB_AP_VS_Select2, number)
		(L:AB_AP_VSset, number) (&gt;L:ASC_AB_AP_VSset, number)
		(L:AB_AP_KNOBALT, bool) (&gt; L:ASC_AB_AP_KNOBALT, number)
		(L:FCU_Managed_HDGdisp_override, bool) (&gt;L:ASC_FCU_Managed_HDGdisp_override, number)
		(L:AB_AP_HDGmode_setDisp, number) (&gt;L:ASC_AP_HDGmode_Load, number)
		(L:UPD_BF, bool) (&gt;L:ASC_UPD_BF, number)

		(L:MCDU2_Page, number) (&gt;L:ASC_MCDU2_Page, number)
		(L:AB_CL_Auto,bool) (&gt;L:ASC_AB_CL_Auto, number)
		(L:AB_Copilot,bool) (&gt;L:ASC_AB_Copilot, number)

		(A:LIGHT CABIN, bool) (&gt; L:AB_OVH_Dome_Light, number)
		(L:APU_avail, bool) (&gt;L:ASC_APU_avail, bool)
		(L:AB_MPL_CHRONO, number) (&gt;L:ASC_AB_MPL_CHRONO, number)
		(L:AB_MPL_CHRONO_VALUE, number) (&gt;L:ASC_AB_MPL_CHRONO_OFFSET, number)

		0 (&gt; L:Save_Init_Timer, number)
		0 (&gt; L:ASC_SAVE_TRIGGER, number)
		1 (&gt; L:Loadup_ASC_Save, bool)
	}

	(L:ASC_LOAD_TRIGGER, number) 1 ==
	(L:ASC_AUTOLOAD_TRIGGER, number) 1 == ||
	(L:Load2, bool) 1 == &amp;&amp;
	(L:Loadup_ASC_Load, number) 0 == &amp;&amp;
	if{
		(L:ASC_Spoiler_armed, number) 1 ==
		if{
			0 (&gt;L:Spoiler_lv_Anim, number)
		}
			els{
				 10 (&gt;L:Spoiler_lv_Anim, number)
			}

		(L:ASC_Antiskid, bool) (A:ANTISKID BRAKES ACTIVE, bool) !=
		if{
			(&gt; K:ANTISKID_BRAKES_TOGGLE)
		}
		
		(L:ASC_Elevatortrim, number) (&gt; K:ELEVATOR_TRIM_SET)
		(L:ASC_Ailerontrim, number) (&gt; K:AILERON_TRIM_SET)
		(L:ASC_Ruddertrim, number) (&gt; K:RUDDER_TRIM_SET)

		(L:ASC_Com1_Afrq, number) 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (&gt; K:COM_RADIO_SET)
		(L:ASC_Com1_Sfrq, number) 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (&gt; K:COM_STBY_RADIO_SET) 	
		(L:ASC_Com2_Afrq, number) 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (&gt; K:COM2_RADIO_SET)
		(L:ASC_Com2_Sfrq, number) 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (&gt; K:COM2_STBY_RADIO_SET)
		(L:ASC_Xpondernumber, number) int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (&gt; K:XPNDR_SET) 
		
		(L:ASC_Landinggear, number) (A:GEAR HANDLE POSITION, bool) !=
		if{
			(&gt; K:GEAR_TOGGLE)
		}
				
		(L:ASC_Parkbrake, number) (A:BRAKE PARKING INDICATOR, bool) !=
		if{
			(&gt; K:PARKING_BRAKES)
		}
				
		(L:ASC_Navlight, number) (A:LIGHT NAV, bool) !=
		if{
			(&gt; K:TOGGLE_NAV_LIGHTS)
		}
				
		(L:ASC_Winglight, number) (A:LIGHT WING, bool) !=
		if{
			(&gt; K:TOGGLE_WING_LIGHTS)
		}
		
		(L:ASC_Beaconlight, number) (&gt;L:LIGHT_BEACON, bool)
				
		(L:ASC_Landinglight, number) (A:LIGHT LANDING, bool) !=
		if{
			(&gt; K:LANDING_LIGHTS_TOGGLE)
		}

		(L:ASC_filetoload,number) 0 ==
		(L:ASC_Panellight, number) (A:LIGHT PANEL, bool) != &amp;&amp;

		(L:ASC_filetoload,number) 1 ==
		(A:LIGHT PANEL, bool) 1 == &amp;&amp; ||
		if{
			(&gt; K:PANEL_LIGHTS_TOGGLE)
		}

		(L:ASC_filetoload,number) 2 ==
		(L:ASC_filetoload,number) 3 == ||
		(L:ASC_filetoload,number) 4 == ||
		(E:TIME OF DAY,enum) 1 &lt;=
		(A:LIGHT PANEL, bool) 1 == &amp;&amp;
		(E:TIME OF DAY,enum) 2 &gt;=
		(A:LIGHT PANEL, bool) 0 == &amp;&amp; || &amp;&amp;
		if{
			(&gt; K:PANEL_LIGHTS_TOGGLE)
		}
			
		(L:AB_OVH_Dome_Light, number) (A:LIGHT CABIN, bool) !=
		if{
			(&gt;K:TOGGLE_CABIN_LIGHTS)
		}
				
		(L:ASC_Markersound, number) (A:MARKER SOUND, bool) !=
		if{
			(&gt; K:MARKER_SOUND_TOGGLE)
		}
				
		(L:ASC_Logolight, number) (A:LIGHT LOGO, bool) !=
		if{
			(&gt; K:TOGGLE_LOGO_LIGHTS)
		}
					
		(L:ASC_Navsound1, number) (A:NAV SOUND:1, bool) !=
		if{
			(&gt; K:RADIO_VOR1_IDENT_TOGGLE)
		}
				
		(L:ASC_Navsound2, number) (A:NAV SOUND:2, bool) !=
		if{
			(&gt; K:RADIO_VOR2_IDENT_TOGGLE)
		}
				
		(L:ASC_ADFsound1, number) (A:ADF SOUND, bool) !=
		if{
			(&gt; K:RADIO_ADF_IDENT_ENABLE)
		}
		
		(L:ASC_ADFsound2, number) 1 ==
		(L:ADF2_toggle, bool) 0 == &amp;&amp;
		if{
			(&gt; K:RADIO_ADF2_IDENT_ENABLE)
			1 (&gt; L:ADF2_toggle, bool)
		}
		(L:ASC_ADFsound2, bool) 0 ==
		(L:ADF2_toggle, bool) 1 == &amp;&amp;
		if{
			(&gt; K:RADIO_ADF2_IDENT_DISABLE)
			0 (&gt; L:ADF2_toggle, bool)
		}

		(L:ASC_Engines_running, number) 1 ==
		(A:GENERAL ENG COMBUSTION:1, bool) 0 == 
		(A:GENERAL ENG COMBUSTION:2, bool) 0 == || &amp;&amp;
		if{
			1 (&gt; K:ENGINE_AUTO_START)
		}	

		(L:ASC_Engines_running, number) 2 ==
		if{
			(L:AB_PDS_Eng1Master, number) 0 ==
			if{
				(A:Turb Eng Master Starter Switch:1, bool) 1 ==
				if{
					1 (&gt; K:TOGGLE_MASTER_STARTER_SWITCH)
				}
				(A:TURB ENG IGNITION SWITCH:1, bool) 1 ==
				if{
					1 (&gt; K:TURBINE_IGNITION_SWITCH_TOGGLE)
				}
				(A:GENERAL ENG FUEL VALVE:1, bool) 1 ==
				if{
					(&gt; K:TOGGLE_FUEL_VALVE_ENG1)
				}
			}

			(L:AB_PDS_Eng2Master, number) 0 ==
			if{
				(A:Turb Eng Master Starter Switch:2, bool) 1 ==
				if{
					2 (&gt; K:TOGGLE_MASTER_STARTER_SWITCH)
				}
				(A:TURB ENG IGNITION SWITCH:2, bool) 1 ==
				if{
					2 (&gt; K:TURBINE_IGNITION_SWITCH_TOGGLE)
				}
				(A:GENERAL ENG FUEL VALVE:2, bool) 1 ==
				if{
					(&gt; K:TOGGLE_FUEL_VALVE_ENG2)
				}
			}
		}
		
		(L:ASC_Kohlsmann, number) 16 * (&gt; K:KOHLSMAN_SET)
		<!--(L:ASC_Kohlsmann2, number) (&gt;L:Kohlsman_isis_mem, number)-->
		
		(L:Table1_pos, number) 0 !=
		if{
			1 (&gt;L:Table1_open, bool)
		}

		(L:Table2_pos, number) 0 !=
		if{
			1 (&gt;L:Table2_open, bool)
		}

		1 (&gt; L:Exits_conf, bool)

		(L:ASC_filetoload, number) 1 &gt;
		if{
			0 (&gt; L:Exit_conf0_set, bool)
			0 (&gt; L:Exit_conf1_set, bool)
			0 (&gt; L:Exit_conf2_set, bool)
			0 (&gt; L:Exit_conf3_set, bool)
		}

		(L:ASC_AP_HDGmode_Load, number) (&gt;L:AB_AP_HDGmode, number)
		(L:ASC_FCU_Managed_HDGdisp_override, number) (&gt;L:FCU_Managed_HDGdisp_override, bool)
		(L:ASC_UPD_BF, number) (&gt;L:UPD_BF, bool)

		(L:Flightmode, number) 6 ==
		(L:AB_AP_AP1, number) 1 ==
		(L:AB_AP_AP2, number) 1 == || &amp;&amp;
		(L:ASC_AP_Load, bool) 0 == &amp;&amp;
		if{
			1 (&gt;L:ASC_AP_Load, bool)
		}

		(L:ASC_AUTOLOAD_TRIGGER, number) 1 ==
		if{
			(L:ASC_MCDU2_Page, number) (&gt;L:MCDU2_Page, number)
		}

		(L:ASC_APU_avail, bool) (&gt;L:APU_avail, bool)

		0 (&gt;L:AB_CL_Auto,bool)
		0 (&gt;L:AB_CL_Auto_Stop,bool)
		0 (&gt;L:AB_Checklist_Active,bool)
		0 (&gt;L:AB_Copilot,bool)
		0 (&gt;L:ASC_LOAD_TRIGGER, number)
		1 (&gt;L:Loadup_ASC_Load, number)
	}

	(L:Loadup_ASC_Load, number) 1 ==
	if{
		(L:ASC_Loadreset_timer, number) 1 + (&gt;L:ASC_Loadreset_timer, number)
		(L:ASC_Loadreset_timer, number) 15 &gt;
		if{
			(L:ASC_MCDU_cones, number) (&gt; L:MCDU_cones, bool)
			(L:ASC_MCDU_Wheelchocks, number) (&gt; L:MCDU_Wheelchocks, bool)
			(L:ASC_MCDU_EXTPOWERCART, number) (&gt; L:MCDU_EXTPOWERCART, bool)
			(L:ASC_MCDU_EXTPOWER, number) (&gt; L:MCDU_EXTPOWER, bool)
			1 (&gt; L:ASC_CL_Init, bool)
			(L:ASC_APU_avail, bool) 1 ==
			if{
				1 (&gt; L:AB_OVH_APU_START, number)
			}

			(L:ASC_TO_Memo_normal, number) 1 ==
			if{
				1 (&gt;L:AB_ECAM_TOCFG, bool)
				1 (&gt;L:AB_ECAM_TOconf, bool)
				1 (&gt;L:AB_ECAM_TOconf_Hasbeentested, bool)
				1 (&gt;L:AB_ECAM_RCL, bool)
			}

			(L:ASC_Load_Pax, number) 84 * (&gt;L:AB_MCDU2_LD_PAX, number)

			(L:AB_MCDU2_LS_CG, number) (&gt;L:AB_MCDU2_LD_CG, number)
			(L:ASC_Load_Cargo, number) (&gt;L:AB_MCDU2_LD_CARGO, number)

			(L:ASC_Load_Fuel, number) (&gt; L:AB_MCDU2_LD_FUEL, number)

			(L:ASC_AB_CL_Auto, number) (&gt;L:AB_CL_Auto,bool)
			(L:ASC_AB_Copilot, number) (&gt;L:AB_Copilot,bool)

			(L:ASC_AUTOLOAD_TRIGGER, number) 1 ==
			(L:ASC_AB_MPL_CHRONO, number) 0 != &amp;&amp;
			if{
				(L:ASC_AB_MPL_CHRONO_OFFSET, number) (&gt;L:AB_MPL_CHRONO_OFFSET, number)
				(L:ASC_AB_MPL_CHRONO, number) (&gt;L:AB_MPL_CHRONO, number)
			}
			
			(L:ASC_AUTOLOAD_TRIGGER, number) 0 == 
			if{
				4 (&gt; L:AB_MCDU2_LD_LOAD, number) }
			els{			
				0 (&gt; L:ASC_AUTOLOAD_TRIGGER, number) }

			0 (&gt; L:ASC_Loadreset_timer, number)
			1 (&gt; L:ASC_Save_Avail, bool)
			0 (&gt; L:Loadup_ASC_Load, number)
		}
	}
	
	<!-- delayed AP Load -->
	(L:Throttle_ani_fix_L, number) 25 ==
	(L:Throttle_ani_fix_R, number) 25 == &amp;&amp;
	(L:AB_AP_SPEED_Selected, number) 0 != &amp;&amp;
	(L:ASC_AP_Load, bool) 1 == &amp;&amp;
	if{
		(L:ASC_AB_AP_KNOBALT, number) 0 ==
		if{
			0 (&gt;L:AB_AP_VSenb, bool)
			(L:AB_AP_ALTmode_set, number) (&gt;L:AB_AP_ALTmode, number)
		}

		(L:ASC_AB_AP_KNOBALT, number) 1 ==
		if{
			1 (&gt;L:AB_AP_VSenb, bool)
			1 (&gt;L:AB_AP_KNOBALT, bool)
			-1 (&gt;L:AB_AP_VSlevel, number)
			(L:ASC_AB_AP_VSset, number) (&gt;L:AB_AP_VSset, number)
		}

		(L:ASC_AB_AP_VS_Select2, number) (&gt;L:AB_AP_VS_Select2, number)
		0 (&gt;L:ASC_AP_Load, bool)
	}
}

</Script>
    </Update>
    </SimGauge.Gauge>
</SimBase.Document>
