<?xml version="1.0" encoding="utf-8"?>

<Gauge Name="RealEngine - Effect - Throttle Limitation">

<Comment>
*************************************

Limits maximum throttle position.

Returns (L:RE1_ThrLim_ThrottleRealPosition,part) with approximate physical position of the throttle lever.

Credits: TooLowGear http://www.fsdeveloper.com/forum/showthread.php?t=16339

teson1, 2011

**************************************
</Comment> 

<Size X="1" Y="1"/>

<Element><Select><Value>

<!-- ******************************************** EFFECT CALLS ******************************************************* -->

	(L:P61_MPLim_ThrottleLimit,percent) 
	
	(>L:RE1_ThrLim_ThrottleLimit,percent) 
	
<!-- ******************************************** Tweaking ******************************************************* -->

	0.003 (>L:RE1_ThrLim_ThrottleLimitDelta,part)

<!-- ******************************************** CALCULATIONS ******************************************************* -->

	(A:GENERAL ENG THROTTLE LEVER POSITION:1,part) (>L:RE1_ThrLim_Throttle,part) 
	
	<!-- Keep track of real position of throttle -->
	
	(L:RE1_ThrLim_Throttle,part) (L:RE1_ThrLim_ThrottleLimit,part) - abs (L:RE1_ThrLim_ThrottleLimitDelta,part) &gt; 
	(L:RE1_ThrLim_Throttle,part) (L:RE1_ThrLim_ThrottleLimitPrevious,part) - abs (L:RE1_ThrLim_ThrottleLimitDelta,part) &gt; &amp;&amp; 
	if{ (L:RE1_ThrLim_Throttle,part) (>L:RE1_ThrLim_ThrottleRealPosition,part) } 

	<!-- Limit throttle position -->
	
	(L:RE1_ThrLim_Throttle,part) (L:RE1_ThrLim_ThrottleLimit,part) &gt; 
	(L:RE1_ThrLim_ThrottleRealPosition,part) (L:RE1_ThrLim_ThrottleLimit,part) &gt; || 
	if{ (L:RE1_ThrLim_ThrottleLimit,part) 0.5 - 2 * 16383 * 
		(>K:AXIS_THROTTLE1_SET) 
	} 	
	
	(L:RE1_ThrLim_ThrottleLimit,part) (>L:RE1_ThrLim_ThrottleLimitPrevious,part)
	
</Value></Select></Element>

</Gauge>