<!-- This guage is for Tds787Wings mid flex    -->
<Gauge Name="TdsWingflex" Version="1.0">
<copyright>(c)2012 Hiroshi Igami</copyright>

<Size X="20" Y="20"/>
<Element>
<Select>
<Value> 

<!-- +++++++++++++ -->
<!-- Ground Effect -->
<!-- +++++++++++++ -->
(A:PLANE ALT ABOVE GROUND, meter)  70 &lt; if{
    1 (A:PLANE ALT ABOVE GROUND, meter)  70 / - 2 * 0 max 2 min 10 + 10 /
}
els{
    1
}
(>L:TdsGROUNDEFFECT,enum) 

<!-- +++++++++++++++ -->
<!-- Weight Percent  -->
<!-- +++++++++++++++ -->
(A:TOTAL WEIGHT,kilogram) (A:EMPTY WEIGHT,kilogram) -
(A:MAX GROSS WEIGHT,kilogram) (A:EMPTY WEIGHT,kilogram)  - 
 /
(>L:TdsWEIGHTPERCENT,enum) 

<!-- +++++++++++++++++++ -->
<!-- Ground Wind Effect  -->
<!-- +++++++++++++++++++ -->
(A:PLANE ALT ABOVE GROUND, meter)  60 /   0 max 1 min 
(>L:TdsGROUNDWIND,enum) 

<!-- +++++++++++++++++++ -->
<!-- Left spoiler Effect -->
<!-- +++++++++++++++++++ -->
1 (A:SPOILERS LEFT POSITION,number) -
(>L:TdsLEFTSPOILEREFFECT,number) 


<!-- +++++++++++++++++++ -->
<!-- RIGHT spoiler Effect -->
<!-- +++++++++++++++++++ -->
1 (A:SPOILERS RIGHT POSITION,number) -
(>L:TdsRIGHTSPOILEREFFECT,number) 


<!-- +++++++++++++++++++ -->
<!--         Wingroot    -->
<!-- +++++++++++++++++++ -->

<!-- AirSpeed as a base  -->
(A:AIRSPEED INDICATED,knot)

<!-- Flap Effect -->
(A:TRAILING EDGE FLAPS LEFT PERCENT,number) 
(A:TRAILING EDGE FLAPS RIGHT PERCENT,number) max
0.25 * 
(L:TdsLEFTSPOILEREFFECT,number)  (L:TdsLEFTSPOILEREFFECT,number)  max *
1 +  +

<!-- Aircraft Weight -->
2 / s0
l0 (L:TdsWEIGHTPERCENT,enum)  * l0 +

<!-- Ground effect -->
(L:TdsGROUNDEFFECT,enum) *

0 max 500 min
(>L:TDSWINGROOTFLEX, percent) 0 max 500 min


<!-- +++++++++++++++++++ -->
<!--     Left Mid Flex   -->
<!-- +++++++++++++++++++ -->

<!-- AirSpeed as a base  -->
(A:AIRSPEED INDICATED,knot) 

<!-- Aircraft pitch -->
(A:PLANE PITCH DEGREES, degree) -6.66 * +

<!-- Flap Effect -->
(A:TRAILING EDGE FLAPS LEFT PERCENT,number)  0.25 *  
(L:TdsLEFTSPOILEREFFECT,number) * 1 +  *
<!-- Aircraft Weight -->
2 / s1
l1 (L:TdsWEIGHTPERCENT,enum)  * l1 +

<!-- Ground Effect   -->
(L:TdsGROUNDEFFECT,enum) *

<!-- Winds  -->
(A:RELATIVE WIND VELOCITY BODY Y,knot) -3 * 
(A:RELATIVE WIND VELOCITY BODY X,knot) 2 * - 
(L:TdsGROUNDWIND,enum) * +

 0 max 500 min
(>L:TdsB8LWINGMIDFLEX, percent) 0 max 500 min


<!-- +++++++++++++++++++ -->
<!--    Right Mid Flex   -->
<!-- +++++++++++++++++++ -->

<!-- AirSpeed as a base  -->
(A:AIRSPEED INDICATED,knot) 
<!-- Aircraft pitch -->
(A:PLANE PITCH DEGREES, degree) -6.66 * +
<!-- Flap Effect -->
(A:TRAILING EDGE FLAPS RIGHT PERCENT,number)  0.25 *  
(L:TdsRIGHTSPOILEREFFECT,number) * 1 +  *
<!-- Aircraft Weight -->
2 / s1
l1 (L:TdsWEIGHTPERCENT,enum)  * l1 +
<!-- Ground Effect   -->
(L:TdsGROUNDEFFECT,enum) *

<!-- Winds  -->
(A:RELATIVE WIND VELOCITY BODY Y,knot) -3 * 
(A:RELATIVE WIND VELOCITY BODY X,knot) 2 * + 
(L:TdsGROUNDWIND,enum) * +

0 max 500 min
(>L:TdsB8RWINGMIDFLEX, percent) 0 max 500 min

<!-- +++++++++++++++++++ -->
<!--     Left Tip Flex   -->
<!-- +++++++++++++++++++ -->

<!-- AirSpeed as a base  -->
(A:AIRSPEED INDICATED,knot) 
<!-- Aircraft pitch -->
(A:PLANE PITCH DEGREES, degree) -6.66 * +
<!-- Flap Effect -->
(A:TRAILING EDGE FLAPS LEFT PERCENT,number)  0.25 *  
(L:TdsLEFTSPOILEREFFECT,number) * 1 +  *
<!-- Aircraft Weight -->
2 / s1
l1 (L:TdsWEIGHTPERCENT,enum)  * l1 +
<!-- Ground Effect   -->
(L:TdsGROUNDEFFECT,enum) *
<!-- Winds  -->
(A:RELATIVE WIND VELOCITY BODY Y,knot) -5 * 
(A:RELATIVE WIND VELOCITY BODY X,knot) 4 * - 
(L:TdsGROUNDWIND,enum) * +

 0 max 500 min
(>L:TdsB8LWINGTIPFLEX, percent) 0 max 500 min


<!-- +++++++++++++++++++ -->
<!--    Right Tip Flex   -->
<!-- +++++++++++++++++++ -->

<!-- AirSpeed as a base  -->
(A:AIRSPEED INDICATED,knot) 
<!-- Aircraft pitch -->
(A:PLANE PITCH DEGREES, degree) -6.66 * +
<!-- Flap Effect -->
(A:TRAILING EDGE FLAPS RIGHT PERCENT,number)  0.25 *  
(L:TdsRIGHTSPOILEREFFECT,number) * 1 +  *
<!-- Aircraft Weight -->
2 / s1
l1 (L:TdsWEIGHTPERCENT,enum)  * l1 +
<!-- Ground Effect   -->
(L:TdsGROUNDEFFECT,enum) *
<!-- Winds  -->
(A:RELATIVE WIND VELOCITY BODY Y,knot) -5 * 
(A:RELATIVE WIND VELOCITY BODY X,knot)  4 * + 
(L:TdsGROUNDWIND,enum) * +

0 max 500 min
(>L:TdsB8RWINGTIPFLEX, percent) 0 max 500 min




</Value>
</Select>
</Element>  
</Gauge>
