<Gauge Name="APLOGIC2" Version="1.0">
	<Update Hidden="Yes">

	(L:DC_ESS_Avail, number) (&gt; L:AB_MPL_ND_Power, bool) 
	<!-- Simplifed OPT ALTCRZ -->
	
	(L:CABINWAIT, bool) 1 ==
	if{
		
		(A:LIGHT CABIN, bool) 0 ==
		if{
			(&gt;K:TOGGLE_CABIN_LIGHTS) }
		
		0 (&gt; L:AB_Dome_Reset, number) 
		0 (&gt; L:CABINWAIT, bool) }
	
	(A:LIGHT NAV, bool) 1 ==
	(A:LIGHT BEACON, bool) 1 == &amp;&amp;
	(L:AB_Dome_Reset, number) 1 == &amp;&amp;
	(L:CABINWAIT, bool) 0 == &amp;&amp;
	if{
		(A:LIGHT CABIN, bool) 1 ==
		if{
			(&gt;K:TOGGLE_CABIN_LIGHTS) }
		1 (&gt; L:CABINWAIT, bool) }
	
	(A:LIGHT CABIN, bool) 1 ==
	(A:LIGHT NAV, bool) 0 ==
	(A:LIGHT BEACON, bool) 0 == || &amp;&amp;
	if{	
		1 (&gt; L:AB_Dome_Reset, number) }
	
	(A:LIGHT CABIN, bool) 0 ==
	(L:CABINWAIT, bool) 0 == &amp;&amp;
	(L:AB_Dome_Reset, number) 1 == &amp;&amp;
	if{	
		0 (&gt; L:AB_Dome_Reset, number) }
	
	<!-- FLAPS -->
	
	(L:FLAPS_HND_hist, number) (A:FLAPS HANDLE PERCENT, percent) 100 / 5 * !=
	if{
		
		(A:FLAPS HANDLE PERCENT, percent) 60 &gt;=
		if{	
			(A:FLAPS HANDLE PERCENT, percent) 100 / 5 * (&gt; L:FLAPS_LVR, number) }
		els{
			
			(A:FLAPS HANDLE PERCENT, percent) 0 ==
			if{	
				0 (&gt; L:FLAPS_LVR, number) }
			els{
				(L:FLAPS_LVR_hist, number) 3 &gt;=
				if{
					(A:Airspeed indicated, knots) 210 &gt;=
					if{
						1 (&gt; L:FLAPS_LVR, number)
						0 (&gt; L:FLAPS_DEC, number) }
					els{
						2 (&gt; L:FLAPS_LVR, number)
						0 (&gt; L:FLAPS_DEC, number) }
				}

				(L:FLAPS_LVR_hist, number) 0 ==
				if{
					
					(A:Airspeed indicated, knots) 100 &gt;=
					if{	
						1 (&gt; L:FLAPS_LVR, number) }
					els{
						2 (&gt; L:FLAPS_LVR, number) } } 

			}
		}
		
	}
	
	<!-- INCREMENT CMD -->
	(L:FLAPS_LVR_hist, number) 1 ==
	(L:FLAPS_INC, number) 1 == &amp;&amp;
	if{
		3 (&gt; L:FLAPS_LVR, number)
		0 (&gt; L:FLAPS_INC, number) } 
	
	(L:FLAPS_LVR_hist, number) 0 ==
	(L:FLAPS_INC, number) 1 == &amp;&amp;
	if{
		
		(A:Airspeed indicated, knots) 100 &gt;=
		if{	
			1 (&gt; L:FLAPS_LVR, number) 
			0 (&gt; L:FLAPS_INC, number) }
		els{
			2 (&gt; L:FLAPS_LVR, number)
			0 (&gt; L:FLAPS_INC, number) } }
	

	<!-- AUTO RETR -->
	(L:FLAPS_LVR, number) 2 ==
	(L:FLAPS_DEC, number) 0 == &amp;&amp;
	if{
		
		(A:Airspeed indicated, knots) 210 &gt;=
		if{
			1 (&gt; L:FLAPS_LVR, number) } }
	
	(A:Airspeed indicated, knots) 100 &lt;
	(L:FLAPS_LVR, number) 1 == &amp;&amp;
	(L:FLAPS_INC, number) 0 == &amp;&amp;
	if{
		2 (&gt; L:FLAPS_LVR, number) }
	
	<!-- DECREMENT CMD -->
	(L:FLAPS_LVR_hist, number) 2 ==
	(L:FLAPS_DEC, number) 1 == &amp;&amp;
	if{
		0 (&gt; L:FLAPS_LVR, number)
		0 (&gt; L:FLAPS_DEC, number) }
	
	(L:FLAPS_LVR_hist, number) 3 ==
	(L:FLAPS_DEC, number) 1 == &amp;&amp;
	if{
		
		(A:Airspeed indicated, knots) 210 &gt;=
		if{
			1 (&gt; L:FLAPS_LVR, number)
			0 (&gt; L:FLAPS_DEC, number) }
		els{
			2 (&gt; L:FLAPS_LVR, number)
			0 (&gt; L:FLAPS_DEC, number) } }
	
	(A:FLAPS HANDLE INDEX, number) (L:FLAPS_LVR, number) !=
	if{
		(L:FLAPS_LVR, number) 5 / 16383 * (&gt; K:FLAPS_SET) }
	
	(L:FLAPS_LVR, number) (&gt; L:FLAPS_LVR_hist, number)
	(A:FLAPS HANDLE PERCENT, percent) 20 / (&gt; L:FLAPS_HND_hist, number)
	
	0 (&gt; L:FLAPS_INC, number)
	0 (&gt; L:FLAPS_DEC, number)
	0 (&gt; L:FLAPS_KBD, number)
	
	(A:LEADING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:LEADING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / (&gt; L:SLAT_EXT_ANGR, number)
	
	(A:ATC MODEL, string) 'A321CFM' scmp 0 ==
	if{
		42 (&gt; L:AB_TypeIdent, number) }
	
	(A:ATC MODEL, string) 'A321IAE' scmp 0 ==
	if{
		41 (&gt; L:AB_TypeIdent, number) }
	
	(A:ATC MODEL, string) 'A320CFM' scmp 0 ==
	if{
		32 (&gt; L:AB_TypeIdent, number) }
	
	(A:ATC MODEL, string) 'A320IAE' scmp 0 ==
	if{
		31 (&gt; L:AB_TypeIdent, number) }
	
	(A:ATC MODEL, string) 'A319CFM' scmp 0 ==
	if{
		22 (&gt; L:AB_TypeIdent, number) }
	
	(A:ATC MODEL, string) 'A319IAE' scmp 0 ==
	if{
		21 (&gt; L:AB_TypeIdent, number) }
	
	(A:ATC MODEL, string) 'A318CFM' scmp 0 ==
	if{
		12 (&gt; L:AB_TypeIdent, number) }
	
	<!-- EXT MDL -->
	(A:ATC MODEL, string) 'A320CFM' scmp 0 ==
	if{
		<!-- 
		22 : 28.6% (10°)
		60 : 42.9% (15°)
		70 : 57.1% (20°)
		100 : 100% (35°) -->

		(L:FLAP_PeCT, number) 25 min 25 / 10 *
		(L:FLAP_PeCT, number) 25 - 0 max 25 min 25 / 10 * +
		(L:FLAP_PeCT, number) 50 - 0 max 25 min 25 / 5 * + 
		(L:FLAP_PeCT, number) 75 - 0 max 25 min 25 / 10 * + (&gt; L:FLAP_EXT_ANGR, number)
		(L:FLAP_EXT_ANGR, number) (&gt; L:FLAP_EXT_ANGL, number) }
	
	
	(A:ATC MODEL, string) 'A320IAE' scmp 0 ==
	(A:ATC MODEL, string) 'A319IAE' scmp 0 == ||
	(A:ATC MODEL, string) 'A319CFM' scmp 0 == ||
	(A:ATC MODEL, string) 'A318CFM' scmp 0 == ||
	if{
		<!-- 
		22 : 25.0% (10°)
		60 : 37.5% (15°)
		70 : 50.0% (20°)
		100 : 100% (40°) -->

		(L:FLAP_PeCT, number) 25 min 25 / 10 *
		(L:FLAP_PeCT, number) 25 - 0 max 25 min 25 / 10 * +
		(L:FLAP_PeCT, number) 50 - 0 max 25 min 25 / 5 * + 
		(L:FLAP_PeCT, number) 75 - 0 max 25 min 25 / 15 * + (&gt; L:FLAP_EXT_ANGR, number)
		(L:FLAP_EXT_ANGR, number) (&gt; L:FLAP_EXT_ANGL, number) }
	
	(A:ATC MODEL, string) 'A321CFM' scmp 0 ==
	if{
		<!-- 
		32  : 40.0% (10°)
		68 : 56.0% (14°)
		84 : 84.0% (21°)
		100 : 100% (25°) -->

		(L:FLAP_PeCT, number) 25 min 25 / 16 *
		(L:FLAP_PeCT, number) 25 - 0 max 25 min 25 / 14 * +
		(L:FLAP_PeCT, number) 50 - 0 max 25 min 25 / 6 * + 
		(L:FLAP_PeCT, number) 75 - 0 max 25 min 25 / 4 * + (&gt; L:FLAP_EXT_ANGR, number)
		(L:FLAP_EXT_ANGR, number) (&gt; L:FLAP_EXT_ANGL, number) }
	
	(A:ATC MODEL, string) 'A321IAE' scmp 0 ==
	if{
		<!-- 
		32  : 40.0% (10°)
		68 : 56.0% (14°)
		84 : 84.0% (21°)
		100 : 100% (25°) -->

		(L:FLAP_PeCT, number) 25 min 25 / 16 *
		(L:FLAP_PeCT, number) 25 - 0 max 25 min 25 / 14 * +
		(L:FLAP_PeCT, number) 50 - 0 max 25 min 25 / 6 * + 
		(L:FLAP_PeCT, number) 75 - 0 max 25 min 25 / 4 * + (&gt; L:FLAP_EXT_ANGR, number)
		(L:FLAP_EXT_ANGR, number) (&gt; L:FLAP_EXT_ANGL, number) }

	<!-- DATA -->
	(A:ATC MODEL, string) 'A319IAE' scmp 0 ==
	if{
		<!-- 22  : 28.6% (10°)
		60 : 42.9% (15°)
		70 : 57.1% (20°)
		100 : 100% (35°) -->

		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 9 min 9 / 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 9 - 0 max 15 min 15 / + 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 24 - 0 max 4 min 4 / + 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 28 - 0 max 12 min 7 / + 4 / 100 * (&gt; L:FLAP_PeCT, number)	}
	
	(A:ATC MODEL, string) 'A320IAE' scmp 0 ==
	(A:ATC MODEL, string) 'A320CFM' scmp 0 == ||
	(A:ATC MODEL, string) 'A319CFM' scmp 0 == ||
	(A:ATC MODEL, string) 'A318CFM' scmp 0 == ||
	if{
		<!-- 22  : 25.0% (10°)
		60 : 37.5% (15°)
		70 : 50.0% (20°)
		100 : 100% (40°) -->

		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 9 min 9 / 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 9 - 0 max 15 min 15 / + 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 24 - 0 max 4 min 4 / + 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 28 - 0 max 12 min 12 / + 4 / 100 * (&gt; L:FLAP_PeCT, number) }
	
	(A:ATC MODEL, string) 'A321CFM' scmp 0 ==
	if{
		<!-- 	0 : 0
		32  : 40.0% (10°)
		68 : 56.0% (14°)
		84 : 84.0% (21°)
		100 : 100% (25°) -->
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 8 min 8 / 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 8 - 0 max 9 min 9 / + 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 17 - 0 max 4 min 4 / + 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 21 - 0 max 4 min 4 / + 4 / 100 * (&gt; L:FLAP_PeCT, number) }
	
	(A:ATC MODEL, string) 'A321IAE' scmp 0 ==
	if{
		<!-- 	0 : 0
		32  : 40.0% (10°)
		68 : 56.0% (14°)
		84 : 84.0% (21°)
		100 : 100% (25°) -->
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 8 min 8 / 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 8 - 0 max 9 min 9 / + 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 17 - 0 max 4 min 4 / + 
		(A:TRAILING EDGE FLAPS LEFT ANGLE, Radians) rddg (A:TRAILING EDGE FLAPS RIGHT ANGLE, Radians) rddg + 2 / 21 - 0 max 4 min 4 / + 4 / 100 * (&gt; L:FLAP_PeCT, number) }

	<!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
	(L:MCDU_FLT_PHS, number) 0 ==
	if{
		<!-- Reset -->
	}
	<!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
	
	(A:INDICATED ALTITUDE, feet) (L:MCDU_THR_RED, number) &lt;
	(A:SIM ON GROUND, bool) 1 == &amp;&amp;
	(L:FADEC_FLXTEMP, number) 0 != &amp;&amp;
	(A:GENERAL ENG COMBUSTION:1, bool) 1 ==
	(A:GENERAL ENG COMBUSTION:2, bool) 1 == || &amp;&amp;
	if{
		1 (&gt; L:FADEC_FLXENB, bool) }
	
	(A:INDICATED ALTITUDE, feet) (L:MCDU_THR_RED, number) &gt;
	(L:FADEC_FLXENB, bool) 1 == &amp;&amp;
	(L:Throttle_ani_fix_L, number) 75 !=
	(L:Throttle_ani_fix_R, number) 75 != || &amp;&amp; 
	(L:FADEC_FLXTEMP, number) 0 == ||
	if{
		0 (&gt; L:FADEC_FLXTEMP, number)
		0 (&gt; L:FADEC_FLXENB, bool) }
		
	(L:FADEC_Load, bool) 0 ==
	if{
		1 (&gt;L:FADEC_Load, bool)
		
		0 (&gt; L:Reverse_hasbeenonL, bool)
		0 (&gt; K:THROTTLE1_SET)
		0 (&gt; L:AP_FADECLpidOut2, number)
		0 (&gt; L:Reverse_hasbeenonR, bool)
		0 (&gt; K:THROTTLE2_SET)
		0 (&gt; L:AP_FADECRpidOut2, number)
		
		0 (&gt;L:AP_FADEC_IDLTHR,number)
		1 (&gt;L:AP_FADEC_CLBTHR,number)
		
		1 (&gt; L:AB_AP_HDGmode_setDisp, number)
		1 (&gt; L:AB_AP_HDGmode_set, number)
		
		0 (&gt; L:AB_AP_KNOBALT, bool)
		1 (&gt; L:AP_AP_ALT_Mode99, number)
		1 (&gt; L:AP_AP_ALT_Mode, number)
		100 (&gt; L:AB_AP_SPEED_Selected, number)
	}

	
	<!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
	(L:DESDist, number) 0 &gt; 
	(L:AB_AP_VdevAlt_hist, number) (L:AB_AP_VdevAlt, number) - abs 1000 &lt;= &amp;&amp;
	
	(L:MCDU_FLT_PHS, number) 3 &lt;= ||
	if{
		(L:AB_AP_VdevAlt_hists, number) (&gt; L:AB_AP_VdevAlt_histss, number)			
		(L:AB_AP_VdevAlt, number) (&gt; L:AB_AP_VdevAlt_hists, number) }	
	
	(L:AB_AP_VdevAlt_hist, number) (L:AB_AP_VdevAlt, number) - abs 1000 &gt;=
	if{
		(L:2INDICATED ALTITUDE, feet) (&gt; L:AB_AP_VdevAlt_hists, number)
		(L:2INDICATED ALTITUDE, feet) (&gt; L:AB_AP_VdevAlt_histss, number)	}
	
	8 (&gt; L:LOOPAPLOGIC2, number) 
	
	:45
	(L:LOOPAPLOGIC2, number) 0 &gt;
	if{
		
		<!-- TOC 321-->
		<!-- 		(A:Airspeed mach, machs) 0.78 - 0.2 / 0.5 * (&gt; L:AB_AP_TOCFPA_fx, number)
		(A:TOTAL WEIGHT, pounds) 0.000453592 * 70 - 10 / 0.6 * (&gt; L:AB_AP_TOCFPA_Wfx, number)	
		(L:INDICATED ALTITUDE, feet) 100 / 2 pow 0.000006 * 0.023 (L:INDICATED ALTITUDE, feet) 100 / * - 9.432 + (L:AB_AP_TOCFPA_fx, number) - (L:AB_AP_TOCFPA_Wfx, number)	- (&gt; L:AB_AP_TOCFPA, number)
		-->
		
		(L:MCDU_Cruisealt, number) (L:2INDICATED ALTITUDE, feet) - 0 max 100 / <!-- 10 / --> near <!-- 1 max  -->(&gt; L:AB_AP_TOC1, number)
		
		(L:TOC_CYC_COUNTER, number) 1 + (&gt; L:TOC_CYC_COUNTER, number)
		
		(L:TOC_CYC_COUNTER, number) (L:AB_AP_TOC1, number) &gt;
		if{
			0 (&gt; L:TOC_CYC_COUNTER, number)
			
			(A:INDICATED ALTITUDE, feet) (&gt; L:2INDICATED ALTITUDE, feet)  
			
			(L:AB_AP_TOC, number) (L:0MCDU_WPT_DEST_Dist, number) &lt;
			(L:AB_AP_TOC, number) 0 &gt;= &amp;&amp;
			if{
				
				(L:AB_AP_KNOBALT, bool) 1 ==
				if{
					(L:AB_AP_ALT_Selected, number) (L:2INDICATED ALTITUDE, feet) - 0 max 100 / (A:VELOCITY WORLD Y,feet per minute) 60 / (A:AIRSPEED TRUE,knots) 1.68781 * / asin rddg / 1.1 * (&gt; L:AB_AP_DIST2TOC, number) }
				els{
					(L:AB_AP_TOC, number) (&gt; L:AB_AP_DIST2TOC2, number)
					<!-- (L:AB_AP_TOC, number) (&gt; L:AB_AP_DIST2TOC, number) --> } }
			
			0 (&gt; L:AB_AP_TOC, number) }
		
		els{
			(L:AB_AP_TOC, number) (L:AB_AP_TOCDIST, number) + (&gt; L:AB_AP_TOC, number) }
		
		<!-- (L:AB_AP_ALT_Selected, number) -->(L:TOC_CYC_COUNTER, number) (L:2INDICATED ALTITUDE, feet) 100 / + <!-- (L:MCDU_Cruisealt, number) 100 / --> (&gt; L:AB_AP_TOC_X, number)
		
		<!-- IAS -->	
		(L:AB_AP_SPDmode_set, number) 0 &gt;= 
		if{
			(L:MCDU_SEL_SPD, number) (&gt; L:AB_AP_TOC_SPD, number)
			
			(L:AB_AP_TOC_X, number) 100 &lt;=
			if{
				(L:MCDU_SEL_SPD, number) 250 min (&gt; L:AB_AP_TOC_SPD, number) }
			
			(L:AB_AP_TOC_X, number) 20 &lt;=
			if{
				(L:MCDU_SEL_SPD, number) 160 min (&gt; L:AB_AP_TOC_SPD, number) } }
		els{
			(L:AB_AP_SPEED_Selected, number) (&gt; L:AB_AP_TOC_SPD, number) }
		
		(L:AB_AP_TOC_SPD, number) 220 - 30 / -0.6 * (&gt; L:AB_AP_TOCFPA_fx, number)
		(A:TOTAL WEIGHT, pounds) 0.000453592 * 60 - 10 / -0.8 * (&gt; L:AB_AP_TOCFPA_Wfx, number)	
		(L:AB_AP_TOC_X, number) (L:AB_AP_TOC_X, number) * 0.00003 * (L:AB_AP_TOC_X, number) 0.040 * - 11.1 + (L:AB_AP_TOCFPA_fx, number) + (L:AB_AP_TOCFPA_Wfx, number) - 0.1 - (&gt; L:AB_AP_TOCFPAIAS, number)
		
		(L:AB_AP_SPDmode_set, number) 0 &gt;= 
		if{
			(L:AB_AP_TOC_X, number) 00 &gt;=
			(L:AB_AP_TOC_X, number) 20 &lt;= &amp;&amp;
			if{
				3 (&gt; L:AB_AP_TOCFPAIAS, number) }
			
			(L:AB_AP_TOC_X, number) 20 &gt;=
			(L:AB_AP_TOC_X, number) 23 &lt;= &amp;&amp;
			if{
				1.2 (&gt; L:AB_AP_TOCFPAIAS, number) }
			
			(L:AB_AP_TOC_X, number) 100 &gt;=
			(L:AB_AP_TOC_X, number) 103 &lt;= &amp;&amp;
			if{
				1.2 (&gt; L:AB_AP_TOCFPAIAS, number) } }
		
		<!-- MACH -->
		(L:AB_AP_SPDmode_set, number) 0 &gt;= 
		if{
			(L:MCDU_SEL_Mach, number) (&gt; L:AB_AP_TOC_Mach, number) }
		els{
			(L:AB_AP_Mach_Selected, number) (&gt; L:AB_AP_TOC_Mach, number) }
		
		(L:AB_AP_TOC_Mach, number) 0.78 - 0.2 / 0.5 * (&gt; L:AB_AP_TOCMach_fx, number)
		(A:TOTAL WEIGHT, pounds) 0.000453592 * 70 - 10 / 0.6 * (&gt; L:AB_AP_TOCMach_Wfx, number)
		(L:AB_AP_TOC_X, number) (L:AB_AP_TOC_X, number) * 0.000100 * (L:AB_AP_TOC_X, number) 0.082 * - 17.71 + (L:AB_AP_TOCMach_fx, number) - (L:AB_AP_TOCMach_Wfx, number) - 0.1 - (&gt; L:AB_AP_TOCFPAMach, number)
		
		310 (L:MCDU_SEL_SPD, number) 10 / - (L:AB_AP_TOC_X, number) &lt;
		if{
			1 (&gt; L:VNAVMACH,bool)
			1 (L:AB_AP_TOCFPAMach, number) / (&gt; L:AB_AP_TOCDIST, number) }
		els{
			0 (&gt; L:VNAVMACH,bool)
			1 (L:AB_AP_TOCFPAIAS, number) / (&gt; L:AB_AP_TOCDIST, number) }	
		
		(L:MCDU_FLT_PHS, number) 3 &gt;=
		if{
			-1 (&gt; L:AB_AP_DIST2TOC, number) }
		
		<!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
		
		<!-- VDEV -->	
		<!-- DECEL -->
		(L:MCDU_FLT_PHS, number) 5 !=
		if{
		(L:MCDU_FAF2Dest_Dist, number) 250 (L:MCDU_TO_0,number) - 0 max 0.0001 * 2 pow 0.1030 250 (L:MCDU_TO_0,number) - 0 max * + 0.0052 + 1.5 * + (&gt; L:MCDU_Decel2Dest_Dist, number) }
		
		(L:MCDU_HOLD_DECEL_ACTIVE, bool) 1 !=
		(L:MCDU_HOLD_Dist, number) -2 != &amp;&amp;
		if{
			(L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max * + 0.0052 + 1.25 * + (&gt; L:MCDU_HOLD_DECEL_Dist, number) }
		els{
			0 (&gt; L:MCDU_HOLD_DECEL_Dist, number) }
		<!-- Speed Factor -->
		

		(L:INDICATED ALTITUDE, feet) 100 / 110 &gt;
		if{					
			(L:AB_AP_SpdTAS_DES, number) (L:AB_AP_MACHTAS_DES, number) &lt;
			if{
				(L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min <!-- (L:MCDU_WPT_SPDCSTRlast, number) min  --> (&gt; L:AB_AP_VdevFPAIAS_SPD, number) }
			els{
				(A:Airspeed indicated, knots) (A:Airspeed mach, machs) / (L:MCDU_SEL_Mach, number) * (L:MCDU_ECON_SPD_DES, number) min (A:Airspeed indicated, knots) min (&gt; L:AB_AP_VdevFPAIAS_SPD, number) } 
		}
		els{
			(A:Airspeed indicated, knots) (L:MCDU_ECON_SPD_DES, number) min (L:MCDU_TO_0,number) max <!-- (L:MCDU_WPT_SPDCSTRlast, number) min  --> (&gt; L:AB_AP_VdevFPAIAS_SPD, number) }
		
		(L:AB_AP_VdevFPAIAS_SPD, number) 250 - 30 / 0.4 220 (L:AB_AP_VdevFPAIAS_SPD, number) / / * (&gt; L:AB_AP_VdevFPAIAS_fx, number)
		(A:TOTAL WEIGHT, pounds) 0.000453592 * 50 - 10 / 0.2 220 (L:AB_AP_VdevFPAIAS_SPD, number) / 3 pow / * (&gt; L:AB_AP_VdevFPAIAS_Wfx, number) 	
		<!-- (A:TRAILING EDGE FLAPS LEFT PERCENT, percent) 100 / 2 * (&gt; L:AB_AP_VdevFPAIAS_Flapfx, number)  -->
		
		(L:GEODESCEND, number) 0 ==
		if{
			(A:ATC MODEL, string) 'A320CFM' scmp 0 ==
			(A:ATC MODEL, string) 'A319CFM' scmp 0 == ||
			(A:ATC MODEL, string) 'A320IAE' scmp 0 == ||
			if{
				(L:INDICATED ALTITUDE, feet) 100 / 3 pow 0.0000000487 * (L:INDICATED ALTITUDE, feet) 100 / 2 pow 0.0000229533 * - (L:INDICATED ALTITUDE, feet) 100 / 0.0013673215 * + 3.5971791153 + (L:AB_AP_VdevFPAIAS_fx, number) + (L:AB_AP_VdevFPAIAS_Wfx, number) - (L:AB_AP_VdevFPAIAS_Flapfx, number) + (&gt; L:AB_AP_VdevFPAIAS, number) }
			els{
				(L:INDICATED ALTITUDE, feet) 100 / 3 pow 0.0000000487 * (L:INDICATED ALTITUDE, feet) 100 / 2 pow 0.0000229533 * - (L:INDICATED ALTITUDE, feet) 100 / 0.0013673215 * + 3.5971791153 + (L:AB_AP_VdevFPAIAS_fx, number) + (L:AB_AP_VdevFPAIAS_Wfx, number) - (L:AB_AP_VdevFPAIAS_Flapfx, number) + 0.2 + (&gt; L:AB_AP_VdevFPAIAS, number) } 
			
			(A:ATC MODEL, string) 'A319IAE' scmp 0 ==
			if{
				(L:INDICATED ALTITUDE, feet) 100 / 3 pow 0.0000000487 * (L:INDICATED ALTITUDE, feet) 100 / 2 pow 0.0000229533 * - (L:INDICATED ALTITUDE, feet) 100 / 0.0013673215 * + 3.5971791153 + (L:AB_AP_VdevFPAIAS_fx, number) + (L:AB_AP_VdevFPAIAS_Wfx, number) - (L:AB_AP_VdevFPAIAS_Flapfx, number) + 0.35 + (&gt; L:AB_AP_VdevFPAIAS, number) }

			}
		els{
			(L:INDICATED ALTITUDE, feet) 100 / 3 pow 0.0000000487 * (L:INDICATED ALTITUDE, feet) 100 / 2 pow 0.0000229533 * - (L:INDICATED ALTITUDE, feet) 100 / 0.0013673215 * + 3.5971791153 + (L:AB_AP_VdevFPAIAS_fx, number) + (L:AB_AP_VdevFPAIAS_Wfx, number) - (A:TRAILING EDGE FLAPS LEFT PERCENT, percent) 100 / 2 * 0.2 + (&gt; L:AB_AP_IdleFPA, number) }		
		
		
		0 (&gt; L:AB_AP_CSTR_DIST, number)	
		(L:MCDU_VNAV_Dist, number) (&gt; L:DESDist, number) 
		
		(L:AB_AP_ALT_Selected_LOG2, number) 0 !=
		if{
			<!-- 0 (&gt; L:DECELCSTRCLEAN, number)
			0 (&gt; L:DECELCSTR250, number)
			0 (&gt; L:DECEL250, number)
			0 (&gt; L:DECELCLEAN, number) -->
			
			(L:AB_AP_ALT_Selected_LOG2, number) 11000 &lt;
			(L:AB_AP_ALT_Selected_LOG2, number) (L:AB_AP_MCDU_RWYALT, number) 100 + 8200 + &lt;= ||
			if{	
				
				(L:VDEV_SPDC, number) 400 == 
				if{
					1 (&gt; L:DECEL250, number)
					0 (&gt; L:DECELCSTR250, number) } 
				els{ 
					
					(L:VDEV_SPDC, number) 250 &gt;
					if{
						1 (&gt; L:DECELCSTR250, number)
						1 (&gt; L:DECEL250, number)	}
					els{
						0 (&gt; L:DECELCSTR250, number)
						0 (&gt; L:DECEL250, number) } }
				
				
				(L:AB_AP_ALT_Selected_LOG2, number) (L:AB_AP_MCDU_RWYALT, number) 100 + 8200 + &lt;=
				if{	
					(L:VDEV_SPDC, number) 400 == 
					if{
						(L:MCDU_Decel2Dest_Dist, number) (L:MCDU_WPT_DEST_Dist, number) (L:MCDU_VNAV_Dist, number) - &gt; 
						if{
							1 (&gt; L:DECELCLEAN, number) }
						els{
							0 (&gt; L:DECELCLEAN, number) }	
						
						0 (&gt; L:DECELCSTRCLEAN, number) } 
					els{
						
						(L:VDEV_SPDC, number) (L:MCDU_TO_0,number) &gt;
						(L:MCDU_Decel2Dest_Dist, number) (L:MCDU_WPT_DEST_Dist, number) (L:MCDU_VNAV_Dist, number) - &gt; &amp;&amp;
						if{
							1 (&gt; L:DECELCSTRCLEAN, number)
							1 (&gt; L:DECELCLEAN, number) }
						els{
							0 (&gt; L:DECELCSTRCLEAN, number)
							0 (&gt; L:DECELCLEAN, number) } }
				}
				els{
					0 (&gt; L:DECELCSTRCLEAN, number)
					0 (&gt; L:DECELCLEAN, number) }
				
			}
			
			
			(L:AB_AP_ALT_Selected_LOG2, number) 11000 &gt;=
			if{		
				0 (&gt; L:DECELCSTRCLEAN, number)
				0 (&gt; L:DECELCSTR250, number)
				0 (&gt; L:DECEL250, number)
				0 (&gt; L:DECELCLEAN, number) }
			
			0 (&gt; L:0CSTRDist, number)
			0 (&gt; L:0CSTRAlt, number)
			
			(L:MCDU_FLT_PHS, number) 3 &lt;=
			(L:AB_AP_ALT_Selected_LOG2, number) (L:AB_AP_ALT_Selected_LOG2_hist, number) != &amp;&amp;
			if{
				(L:MCDU_Cruisealt, number) (&gt; L:AB_AP_ALT_Selected_LOG2_hist2, number)
				(L:AB_AP_ALT_Selected_LOG2, number) (&gt; L:AB_AP_ALT_Selected_LOG2_hist, number) }
			
			(L:MCDU_FLT_PHS, number) 4 &gt;=
			(L:AB_AP_ALT_Selected_LOG2_hist, number) 0 != &amp;&amp;
			(L:AB_AP_ALT_Selected_LOG2, number) (L:AB_AP_ALT_Selected_LOG2_hist, number) != &amp;&amp;
			(L:COND1_DES_Changed, bool) 1 != &amp;&amp;
			(L:COND2_DES_Changed, bool) 1 != &amp;&amp;
			(L:COND3_DES_Changed, bool) 1 != &amp;&amp;
			(L:COND4_DES_Changed, bool) 1 != &amp;&amp;
			(L:DESDist, number) 0 &gt; &amp;&amp;
			if{
				(L:AB_AP_ALT_Selected_LOG2_hist, number) (L:AB_AP_VdevAlt_hist, number) max (&gt; L:AB_AP_ALT_Selected_LOG2_hist2, number)
				(L:AB_AP_ALT_Selected_LOG2, number) (&gt; L:AB_AP_ALT_Selected_LOG2_hist, number)
				
				(L:MCDU_WPT_DEST_Dist, number) (&gt; L:DESDist22, number)
				
				1 (&gt; L:GEODESCEND, number) }
			
			(L:AB_AP_ALT_Selected_LOG2_hist2, number) 0 ==
			if{
				(L:AB_AP_ALT_Selected_LOG2_hist, number) (&gt; L:AB_AP_ALT_Selected_LOG2_hist2, number) } 
			
			
			(L:MCDU_WPT_SPDCSTR_2, number) 0 !=
			(L:MCDU_WPT_SPDCSTR_2_Dist, number) 4 + (L:MCDU_WPT_DEST_Dist, number) &lt; &amp;&amp;
			(L:MCDU_WPT_SPDCSTR_2_Dist, number) (L:MCDU_VNAV_Dist, number) 0.01 + &lt;= &amp;&amp;
			(L:DESDist, number) 0 &gt; &amp;&amp;
			if{
				(L:VDEV_SPDC, number) (L:MCDU_WPT_SPDCSTR_2, number) min (&gt; L:VDEV_SPDC, number) }
			
			(L:VDEV_SPDC, number) (L:VDEV_SPDC_histlast, number) !=
			if{
				
				(L:VDEV_SPDC, number) (&gt; L:VDEV_SPDC_histlast, number) 
				
				(L:MCDU_FLT_PHS, number) 4 &gt;= &amp;&amp;
				if{				
					1 (&gt; L:GEODESCEND, number) 
					
					(L:AB_AP_VdevAlt_hist, number) (&gt; L:AB_AP_ALT_Selected_LOG2_hist2, number)	
					(L:AB_AP_VdevAlt_hist, number) (&gt; L:AB_AP_ALT_Selected_VdevLast, number)
					(L:MCDU_WPT_DEST_Dist, number) (&gt; L:MCDU_WPT_DEST_Dist_LAST, number)
					(L:MCDU_WPT_DEST_Dist, number) (&gt; L:DESDist22, number) } }
			
		}
		
		<!-- NONGEOMETRIC DESCEND -->
		(L:GEODESCEND, number) 0 ==
		if{
			
			<!-- DIST SPDCSTR/IDLE CALCS -->
			(L:DECEL250, number) 1 ==
			(L:DECELCSTR250, number) 0 == &amp;&amp;
			if{
				
				<!-- (A:INDICATED ALTITUDE, feet) 11000 &lt;
				if{ -->
					(L:DESDist, number) (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min 250 - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min 250 - 0 max * + 0.0052 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min 250 - 20 / 0 max 1 min * + - (&gt; L:DESDist, number) <!-- }
				els{
					(L:DESDist, number) (L:MCDU_ECON_SPD_DES, number) 250 - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) 250 - 0 max * + 0.0052 + - (&gt; L:DESDist, number) }  -->
				
			}
			
			(L:DECEL250, number) 1 ==
			(L:DECELCSTR250, number) 1 == &amp;&amp;
			if{
				
				<!-- (A:INDICATED ALTITUDE, feet) 11000 &lt;
				if{ -->
					(L:DESDist, number) (L:MCDU_ECON_SPD_DES, number) (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min 250 - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min 250 - 0 max * + 0.0052 (L:MCDU_ECON_SPD_DES, number) (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min 250 - 20 / 0 max 1 min * + - (&gt; L:DESDist, number) <!-- }
				els{
					(L:DESDist, number) (L:MCDU_ECON_SPD_DES, number) (L:VDEV_SPDC, number) min 250 - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) (L:VDEV_SPDC, number) min 250 - 0 max * + 0.0052 + - (&gt; L:DESDist, number) }  --> 
				
			}
			
			
			(L:DECELCLEAN, number) 1 ==
			(L:DECELCSTRCLEAN, number) 0 == &amp;&amp;
			if{
				
				<!-- (A:INDICATED ALTITUDE, feet) 11000 &lt;
				(L:MCDU_FLT_PHS, number) 5 == &amp;&amp;
				if{			 -->		
					(L:DESDist, number) 250 (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max 0.0001 * 2 pow 0.1030 250 (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max * + 0.0052 250 (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 20 / 0 max 0.75 min * + - (&gt; L:DESDist, number)<!--  }
				
				els{
					(L:DESDist, number) 250 (L:MCDU_TO_0,number) - 0 max 0.0001 * 2 pow 0.1030 250 (L:MCDU_TO_0,number) - 0 max * + 0.0052 + - (&gt; L:DESDist, number) }  -->
				
			}			
			
			(L:DECELCLEAN, number) 1 ==
			(L:DECELCSTRCLEAN, number) 1 == &amp;&amp;
			if{
				
				<!-- (A:INDICATED ALTITUDE, feet) 11000 &lt;
				(L:MCDU_FLT_PHS, number) 5 == &amp;&amp;
				if{	 -->				
					(L:DESDist, number) 250 (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max 0.0001 * 2 pow 0.1030 250 (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max * + 0.0052 250 (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 20 / 0 max 0.75 min * + - (&gt; L:DESDist, number) <!-- }
				
				els{
					(L:DESDist, number) 250 (L:VDEV_SPDC, number) min (L:MCDU_TO_0,number) - 0 max 0.0001 * 2 pow 0.1180 250 (L:VDEV_SPDC, number) min (L:MCDU_TO_0,number) - 0 max * + 0.0052 + - (&gt; L:DESDist, number) }  -->
				
			}
			
			(L:VDEV_SPDC, number) 0 ==
			(L:MCDU_FLT_PHS, number) 2 &lt;= ||
			if{
				400 (&gt; L:VDEV_SPDC, number) }
			
			(L:MCDU_FLT_PHS, number) 3 ==
			if{
				(L:MCDU_WPT_SPDCSTR_2, number) 0 != 
				(L:MCDU_WPT_SPDCSTR_2_Dist, number) 4 + (L:MCDU_WPT_DEST_Dist, number) &lt; &amp;&amp;
				(L:MCDU_WPT_SPDCSTR_2_Dist, number) (L:MCDU_VNAV_Dist, number) 0.01 + &lt;= &amp;&amp;
				if{
					(L:VDEV_SPDC, number) (&gt; L:VDEV_SPDC, number) } 
				els{
					400 (&gt; L:VDEV_SPDC, number) } }
			
			(L:VDEV_SPDC, number) 400 != 
			if{
				
				(L:0CSTRDist, number) (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 0 max * + 0.0052 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 20 / 0 max 1 min * + - (&gt; L:0CSTRDist, number)
				
				(L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min 250 - 30 / 0.4 220 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min / / * (&gt; L:CSTR_FX, number)
				(L:CSTR_FX, number) (L:VDEV_SPDC, number) 250 - 30 / 0.4 220 (L:VDEV_SPDC, number) / / * - (L:DESDist, number) (L:0CSTRDist, number) + (L:MCDU_WPT_SPDCSTR_2_Dist, number) - * 100 * 0 max (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 20 / 0 max 1 min * (&gt; L:0CSTRAlt, number) }
			
			(L:DESDist, number) (L:0CSTRDist, number) 1.25 * + (&gt; L:DESDist, number)
			
			(L:DESDist22, number) (L:MCDU_WPT_DEST_Dist, number) (L:DESDist, number) - - (&gt; L:DESDist2, number) 
			
		}
		
		
		<!-- GEOMETRIC DESCEND -->
		(L:GEODESCEND, number) 1 ==
		if{
			
			(L:AB_AP_ALT_Selected_LOG2_hist2, number) (L:AB_AP_ALT_Selected_LOG2, number) - 100 / (L:DESDist22, number) (L:MCDU_WPT_DEST_Dist, number) (L:DESDist, number) - - / (&gt; L:AB_AP_VdevFPAIAS, number) 
			
			<!-- DIST SPDCSTR/IDLE CALCS -->
			(L:DECEL250, number) 1 ==
			(L:DECELCSTR250, number) 0 == &amp;&amp;
			if{
				
				250 (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) max 250 - 30 / 0.4 220 250 (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) max / / * (&gt; L:AB_AP_VdevFPAIAS_fx, number)
				(A:TOTAL WEIGHT, pounds) 0.000453592 * 50 - 10 / 0.2 220 (L:AB_AP_VdevFPAIAS_SPD, number) / 3 pow / * (&gt; L:AB_AP_VdevFPAIAS_Wfx, number)
				11000 100 / 3 pow 0.0000000487 * 11000 100 / 2 pow 0.0000229533 * - 11000 100 / 0.0013673215 * + 3.5971791153 + (L:AB_AP_VdevFPAIAS_fx, number) + (L:AB_AP_VdevFPAIAS_Wfx, number) - (L:AB_AP_VdevFPAIAS_Flapfx, number) + 0.2 + (&gt; L:IdleFPACSTR, number)
				
				(L:DESDist, number) (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min 250 - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min 250 - 0 max * + 0.0052 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min 250 - 20 / 0 max 1 min * + (L:IdleFPACSTR, number) (L:AB_AP_VdevFPAIAS, number) / / - (&gt; L:DESDist, number) 
				
			}
			
			(L:DECEL250, number) 1 ==
			(L:DECELCSTR250, number) 1 == &amp;&amp;
			if{
				
				250 (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) min (L:MCDU_TO_0,number) max 250 - 30 / 0.4 220 250 (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) min (L:MCDU_TO_0,number) max / / * (&gt; L:AB_AP_VdevFPAIAS_fx, number)
				(A:TOTAL WEIGHT, pounds) 0.000453592 * 50 - 10 / 0.2 220 (L:AB_AP_VdevFPAIAS_SPD, number) / 3 pow / * (&gt; L:AB_AP_VdevFPAIAS_Wfx, number)
				11000 100 / 3 pow 0.0000000487 * 11000 100 / 2 pow 0.0000229533 * - 11000 100 / 0.0013673215 * + 3.5971791153 + (L:AB_AP_VdevFPAIAS_fx, number) + (L:AB_AP_VdevFPAIAS_Wfx, number) - (L:AB_AP_VdevFPAIAS_Flapfx, number) + 0.2 + (&gt; L:IdleFPACSTR, number)
				
				(L:DESDist, number) (L:MCDU_ECON_SPD_DES, number) (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min 250 - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min 250 - 0 max * + 0.0052 (L:MCDU_ECON_SPD_DES, number) (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min 250 - 20 / 0 max 1 min * + (L:IdleFPACSTR, number) (L:AB_AP_VdevFPAIAS, number) / / - (&gt; L:DESDist, number)
				
			}
			
			
			(L:DECELCLEAN, number) 1 ==
			(L:DECELCSTRCLEAN, number) 0 == &amp;&amp;
			if{
				
				(L:MCDU_TO_0,number) 250 - 30 / 0.4 220 250 (L:MCDU_TO_0,number) / / * (&gt; L:AB_AP_VdevFPAIAS_fx, number)
				(A:TOTAL WEIGHT, pounds) 0.000453592 * 50 - 10 / 0.2 220 (L:AB_AP_VdevFPAIAS_SPD, number) / 3 pow / * (&gt; L:AB_AP_VdevFPAIAS_Wfx, number)
				3200 (L:AB_AP_MCDU_RWYALT, number) + 100 / 3 pow 0.0000000487 * 3200 (L:AB_AP_MCDU_RWYALT, number) + 100 / 2 pow 0.0000229533 * - 3200 (L:AB_AP_MCDU_RWYALT, number) + 100 / 0.0013673215 * + 3.5971791153 + (L:AB_AP_VdevFPAIAS_fx, number) + (L:AB_AP_VdevFPAIAS_Wfx, number) - (L:AB_AP_VdevFPAIAS_Flapfx, number) + 0.2 + (&gt; L:IdleFPACSTR, number)
				
				(L:DESDist, number) 250 (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max 0.0001 * 2 pow 0.1030 250 (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max * + 0.0052 250 (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 20 / 0 max 1 min * + (L:IdleFPACSTR, number) (L:AB_AP_VdevFPAIAS, number) / / - (&gt; L:DESDist, number)
				
			}			
			
			(L:DECELCLEAN, number) 1 ==
			(L:DECELCSTRCLEAN, number) 1 == &amp;&amp;
			if{
				
				(L:MCDU_TO_0,number) 250 - 30 / 0.4 220 250 (L:MCDU_TO_0,number) / / * (&gt; L:AB_AP_VdevFPAIAS_fx, number)
				(A:TOTAL WEIGHT, pounds) 0.000453592 * 50 - 10 / 0.2 220 (L:AB_AP_VdevFPAIAS_SPD, number) / 3 pow / * (&gt; L:AB_AP_VdevFPAIAS_Wfx, number)
				3200 (L:AB_AP_MCDU_RWYALT, number) + 100 / 3 pow 0.0000000487 * 3200 (L:AB_AP_MCDU_RWYALT, number) + 100 / 2 pow 0.0000229533 * - 3200 (L:AB_AP_MCDU_RWYALT, number) + 100 / 0.0013673215 * + 3.5971791153 + (L:AB_AP_VdevFPAIAS_fx, number) + (L:AB_AP_VdevFPAIAS_Wfx, number) - (L:AB_AP_VdevFPAIAS_Flapfx, number) + 0.2 + (&gt; L:IdleFPACSTR, number)
				
				(L:DESDist, number) 250 (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max 0.0001 * 2 pow 0.1030 250 (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 0 max * + 0.0052 250 (L:VDEV_SPDC, number) min (A:Airspeed indicated, knots) min (L:MCDU_TO_0,number) - 20 / 0 max 1 min * + (L:IdleFPACSTR, number) (L:AB_AP_VdevFPAIAS, number) / / - (&gt; L:DESDist, number) 
				
			}
			
			(L:VDEV_SPDC, number) 0 ==
			(L:MCDU_FLT_PHS, number) 2 &lt;= ||
			if{
				400 (&gt; L:VDEV_SPDC, number) }
			
			
			(L:VDEV_SPDC, number) 400 != 
			if{
				
				(L:0CSTRDist, number) (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 0 max 0.0001 * 2 pow 0.1030 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 0 max * + 0.0052 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 20 / 0 max 1 min * + - (&gt; L:0CSTRDist, number)
				
				(L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min 250 - 30 / 0.4 220 (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min / / * (&gt; L:CSTR_FX, number) }
			
			(L:DESDist, number) (&gt; L:Orig_DESDist, number)
			(L:DESDist22, number) (L:MCDU_WPT_DEST_Dist, number) (L:Orig_DESDist, number) - - (&gt; L:Orig_DESDist2, number) 	

			(L:DESDist, number) (L:0CSTRDist, number) 1.25 * + (&gt; L:DESDist, number)	
			(L:DESDist22, number) (L:MCDU_WPT_DEST_Dist, number) (L:DESDist, number) - - (&gt; L:DESDist2, number) 	
			
			(L:AB_AP_ALT_Selected_LOG2_hist2, number) (L:AB_AP_ALT_Selected_LOG2, number) - 100 / (L:Orig_DESDist2, number) / (&gt; L:ORIGCSTR_FPAIAS, number) 
			
			(L:0CSTRDist, number) /-/ (L:ORIGCSTR_FPAIAS, number) * 100 * (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 5 / 0 max 1 min * 0 max (&gt; L:ExpectedLossAlt, number)
			(L:0CSTRDist, number) /-/ (L:ORIGCSTR_FPAIAS, number) * 100 * (L:MCDU_ECON_SPD_DES, number) (A:Airspeed indicated, knots) min (L:VDEV_SPDC, number) - 5 / 0 max 1 min * (&gt; L:ExpectedLossAlt2, number)
			
			(L:AB_AP_ALT_Selected_LOG2_hist2, number) (L:AB_AP_ALT_Selected_LOG2, number) - 100 / (L:DESDist2, number) / (&gt; L:AB_AP_VdevFPAIAS, number)
			

			
		}
		
		(L:AB_AP_VdevFPAIAS, number) (L:DESDist, number) 0 max * 100 * <!-- (L:0CSTRAlt, number) 4 / - --> (L:AB_AP_ALT_Selected_LOG2, number) + (&gt; L:AB_AP_VdevAlt, number)
		
		(L:AB_AP_VdevAlt_histss, number) (&gt; L:AB_AP_VdevAlt_hist, number)
		
		<!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
		
		(L:LOOPAPLOGIC2, number) 1 - (&gt; L:LOOPAPLOGIC2, number)
		g45
	}

	</Update>
</Gauge>	