<Gauge Name="JELAIR_kmh-display" Version="1.0">

   <Image Name="LCDglass-grey-light03goldOFF-100x25.bmp" ImageSizes="100,25"/>




<!-- JEL program boot -->
<Element Name="BOOT">

	<Element><Select><Value>
	(L:JELAIR-SAS-BOOT, enum) 0 ==
	if{
		3 (>L:JELAIR-SAS-MFDscreen, enum)

		5000 (>L:JELAIR-SAS-Throttle-StabilityTensionMultiplier, enum)
		57 (>L:JELAIR-SAS-CruiseControlKMH-UserControlSetting, enum)

		0 (>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingOUTSIDE, enum)
		0 (>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)

		1 (>L:JELAIR-SAS-BOOT, enum)
	}
	</Value></Select></Element>

</Element>








<!-- JEL safety-approved programs -->
<Element Name="safety-approved auto-programs">

	<Comment>program begin</Comment>
	<Element><Select><Value>
	(A:AUTOPILOT THROTTLE ARM, bool) 0 ==
	if{
		0 (>L:JELAIR-SAS-Engine-ControlProgram, bool)
	}
	</Value></Select></Element>
	<Comment>program end</Comment>



<Comment>
			(P:Local time,seconds) (L:JELAIR-SAS-TimeStampSecondsTEMP, enum) - 1 &gt;
			if{

				(P:Local time,seconds) (>L:JELAIR-SAS-TimeStampSecondsTEMP, enum)


			(A:AIRSPEED INDICATED, knots) 5 - (A:AIRSPEED BARBER POLE, knots) &gt;
			if{
				(>K:THROTTLE_CUT)
				(>K:SPOILERS_ON)
			}

			(A:AIRSPEED INDICATED, knots) (A:AIRSPEED BARBER POLE, knots) &gt;
			if{
				(>K:THROTTLE_DECR_SMALL)
				(>K:SPOILERS_OFF)
			}

</Comment>



	<Comment>program begin</Comment>
	<Element><Select><Value>
	(L:JELAIR-SAS-Engine-ControlProgram, bool) 1 ==
	if{
		(A:AIRSPEED INDICATED, knots) 50 + (A:AIRSPEED BARBER POLE, knots) &lt;
		if{
			(L:JELAIR-SAS-CruiseControlKMH-UserControlSetting, enum)
			(A:GROUND VELOCITY, kilometer per hour) - 10 /
			(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingOUTSIDE, enum)

			(P:Local time,seconds) (L:JELAIR-SAS-TimeStampSecondsTEMP, enum) - 0 &gt;
			if{
				(A:AIRSPEED INDICATED, knots) 400 &lt;
				if{
					(A:GENERAL ENG1 THROTTLE LEVER POSITION, percent) 100 &lt;
					if{
						(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum) 0.1 +
						(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
					}
				}
				els{
					(A:AIRSPEED INDICATED, knots) 0.2 - (L:JELAIR-SAS-AirspeedStampTEMP, enum) &gt;
					if{
						(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum) 0.01 -
						(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
					}
					els{
						(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum) 0.01 +
						(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
					}
				}

				(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum) 0 &lt;
				if{
					0 (>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
				}

				(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
				(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingOUTSIDE, enum) &gt;
				if{
					(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingOUTSIDE, enum)
					(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
				}

				(A:AIRSPEED INDICATED, knots) (>L:JELAIR-SAS-AirspeedStampTEMP, enum)
				(P:Local time,seconds) (>L:JELAIR-SAS-TimeStampSecondsTEMP, enum)
			}


			(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
			(L:JELAIR-SAS-Throttle-StabilityTensionMultiplier, enum) *
			(>K:THROTTLE_SET)
		}
		els{
			(L:JELAIR-SAS-CruiseControlKMH-UserControlSetting, enum)
			(A:GROUND VELOCITY, kilometer per hour) - 40 /
			(>L:JELAIR-SAS-TEMPtransfer-RemainingEGT, enum)

			(A:AIRSPEED INDICATED, knots) 50 + (A:AIRSPEED BARBER POLE, knots) -
			(L:JELAIR-SAS-TEMPtransfer-RemainingEGT, enum) *
			(A:GROUND VELOCITY, kilometer per hour) +
			(>L:JELAIR-SAS-TEMPtransfer-RemainingEGT, enum)

			(L:JELAIR-SAS-CruiseControlKMH-UserControlSetting, enum)
			(L:JELAIR-SAS-TEMPtransfer-RemainingEGT, enum) - 10 /
			(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingOUTSIDE, enum)

			(P:Local time,seconds) (L:JELAIR-SAS-TimeStampSecondsTEMP, enum) - 0 &gt;
			if{
				(A:AIRSPEED INDICATED, knots) 0.2 - (L:JELAIR-SAS-AirspeedStampTEMP, enum) &gt;
				if{
					(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum) 0.01 -
					(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
				}
				els{
					(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum) 0.01 +
					(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
				}

				(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum) 0 &lt;
				if{
					0 (>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
				}

				(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
				(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingOUTSIDE, enum) &gt;
				if{
					(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingOUTSIDE, enum)
					(>L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
				}

				(A:AIRSPEED INDICATED, knots) (>L:JELAIR-SAS-AirspeedStampTEMP, enum)
				(P:Local time,seconds) (>L:JELAIR-SAS-TimeStampSecondsTEMP, enum)
			}

			(L:JELAIR-SAS-TEMPtransfer-THROTTLE_SET-settingINSIDE, enum)
			(L:JELAIR-SAS-Throttle-StabilityTensionMultiplier, enum) *
			(>K:THROTTLE_SET)
		}
	}
	</Value></Select></Element>
	<Comment>program end</Comment>



</Element>
<Comment>the safety-approved programs</Comment>

















<Element Name="MFDscreen ALL">
<Visible> (A:CIRCUIT GENERAL PANEL ON, bool) 1 == </Visible>


	<Element><Visible> (L:JELAIR-SAS-Engine-ControlProgram, bool) 0 == </Visible>
		<Element><Position X="0" Y="0"/>
		<Image Name="LCDglass-grey-light03goldDIM-100x25.bmp" Bright="Yes" ImageSizes="100,25"/>
		</Element>
	</Element>
	<Element><Visible> (L:JELAIR-SAS-Engine-ControlProgram, bool) 1 == </Visible>
		<Element><Position X="0" Y="0"/>
		<Image Name="LCDglass-grey-light03goldON-100x25.bmp" Bright="Yes" ImageSizes="100,25"/>
		</Element>
	</Element>

		<Element><Position X="0" Y="0"/>
		<Text X="100" Y="20" Length="100" Font="Arial" Bright="Yes" Color="Red" Adjust="Center" VerticalAdjust="Center" Multiline="No">
		<String>%((A:GROUND VELOCITY, kilometer per hour) )%!d! Km/h</String> 
  		</Text></Element>



</Element>
<Comment>end MFDscreenALL</Comment>


<Comment>
---------------------------------------------------------------------------------------------------
</Comment>

      <Failures>
         <SYSTEM_ELECTRICAL_PANELS Action="NoDraw"/>
      </Failures>

   <Mouse>

	<Area Left="0" Right="25" Top="0" Bottom="25">
	<Visible> (A:CIRCUIT GENERAL PANEL ON, bool) 1 == </Visible>
	<Cursor Type="DownArrow"/>
	<Click Repeat="Yes">
		(L:JELAIR-SAS-CruiseControlKMH-UserControlSetting, enum) 1 -
		(>L:JELAIR-SAS-CruiseControlKMH-UserControlSetting, enum)
	</Click>
	</Area>


	<Area Left="25" Right="75" Top="0" Bottom="25">
	<Visible> (A:CIRCUIT GENERAL PANEL ON, bool) 1 == </Visible>
	<Cursor Type="Hand"/>
	<Click Repeat="Yes">
		(L:JELAIR-SAS-Engine-ControlProgram, bool) ! (>L:JELAIR-SAS-Engine-ControlProgram, bool)
	</Click>
	</Area>


	<Area Left="75" Right="100" Top="0" Bottom="25">
	<Visible> (A:CIRCUIT GENERAL PANEL ON, bool) 1 == </Visible>
	<Cursor Type="UpArrow"/>
	<Click Repeat="Yes">
		(L:JELAIR-SAS-CruiseControlKMH-UserControlSetting, enum) 1 +
		(>L:JELAIR-SAS-CruiseControlKMH-UserControlSetting, enum)
	</Click>
	</Area>


   </Mouse>

</Gauge>
