<!-- This guage is for Posky 777  for making the Low speed Aileron action   -->
<Gauge Name="PkyLSAileronL" Version="1.0">
<copyright>(c)2007 Hiroshi Igami</copyright>

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

(A:AIRSPEED TRUE,knot) 250 &lt; if{

<!-- Left_Lowspeed Aileron-->
    (A:SIM ON GROUND, bool) 1 == 
    (A:SPOILERS LEFT POSITION,percent) 75 &gt; &amp;  if{
        200
    }
    els{
       (A:AILERON LEFT DEFLECTION PCT,percent) 300 +
       (A:TRAILING EDGE FLAPS LEFT PERCENT,percent) 0.75 * +
    }
}
els{ 
   300
}
(>L:TdsLSAileronL, percent)

<!-- Right_Lowspeed Aileron-->
(A:AIRSPEED TRUE,knot) 250 &lt; if{
   (A:SIM ON GROUND, bool) 1 == 
   (A:SPOILERS RIGHT POSITION,percent) 75 &gt; &amp;  if{
       200
   }
   els{
      300 (A:AILERON RIGHT DEFLECTION PCT,percent) -
      (A:TRAILING EDGE FLAPS RIGHT PERCENT,percent) 0.75 * +
   }
}
els{ 
   300
}
(>L:TdsLSAileronR, percent)




<!-- Left Flaperon -->
<!-- Left Flaperon -->
<!-- Left Flaperon -->
<!-- Standard action of LEFT flaperon -->
(A:AILERON LEFT DEFLECTION PCT,percent) 0 &gt; if{
   (A:AILERON LEFT DEFLECTION PCT,percent) 2 /
}
els{
   (A:AILERON LEFT DEFLECTION PCT,percent)
}
(A:TRAILING EDGE FLAPS LEFT PERCENT,percent) +  300 +
(L:Tds_TEVCFLAPERON, number) +
(>L:TdsB8flaperonL_STD, number)

(A:SIM ON GROUND, bool) 1 == if{
    (A:SPOILERS LEFT POSITION,percent) 75 &gt;  if{
        <!-- In case Spoiler full up on ground -->
        200
    }
    els{
        (A:TRAILING EDGE FLAPS LEFT PERCENT,percent) 0 &gt;
        (A:TURB ENG N1:1, percent) 70 &gt; 
        (A:AIRSPEED INDICATED,knot) 90 &lt; &amp; &amp; if{
           (A:AIRSPEED INDICATED,knot) 60 &lt; if{
               400   (A:AIRSPEED INDICATED,knot) 2 *  -   
               (>L:TdsB8flaperonL_TARGET, number)
           }
           els{
               (L:TdsB8flaperonL_STD, number)
               (>L:TdsB8flaperonL_TARGET, number)
           }
           
           (L:TdsB8flaperonL, percent) (L:TdsB8flaperonL_TARGET, number) == if{
               (L:TdsB8flaperonL_STD, number)
           }
           els{
              (L:TdsB8flaperonL, percent) (L:TdsB8flaperonL_TARGET, number) &gt; if{
                  (L:TdsB8flaperonL, percent) 1 - 
              }
              (L:TdsB8flaperonL, percent) (L:TdsB8flaperonL_TARGET, number) &lt; if{
                  (L:TdsB8flaperonL, percent) 1 +
              }
           }
        }
        els{
            (L:TdsB8flaperonL_STD, number)
        }
    }
}
els{
   (L:TdsB8flaperonL_STD, number)
}
200 max 400 min
(>L:TdsB8flaperonL, percent)


<!-- Right Flaperon -->
<!-- Right Flaperon -->
<!-- Right Flaperon -->
<!-- Standard action of Right flaperon -->
(A:AILERON RIGHT DEFLECTION PCT,percent) 0 &lt; if{
   (A:AILERON RIGHT DEFLECTION PCT,percent) 2 /
}
els{
   (A:AILERON RIGHT DEFLECTION PCT,percent)
}
-1 *
(A:TRAILING EDGE FLAPS RIGHT PERCENT,percent) +  300 +
(L:Tds_TEVCFLAPERON, number) +
(>L:TdsB8flaperonR_STD, number)


(A:SIM ON GROUND, bool) 1 == if{
    (A:SPOILERS RIGHT POSITION,percent) 75 &gt;  if{
        <!-- In case Spoiler full up on ground -->
        200
    }
    els{
        (A:TRAILING EDGE FLAPS RIGHT PERCENT,percent) 0 &gt; 
        (A:TURB ENG N1:2, percent) 70 &gt; 
        (A:AIRSPEED INDICATED,knot) 90 &lt; &amp; &amp; if{
           (A:AIRSPEED INDICATED,knot) 60 &lt; if{
               400   (A:AIRSPEED INDICATED,knot) 2 *  -   
               (>L:TdsB8flaperonR_TARGET, number)
           }
           els{
               (L:TdsB8flaperonR_STD, number)
               (>L:TdsB8flaperonR_TARGET, number)
           }
           
           (L:TdsB8flaperonR, percent) (L:TdsB8flaperonR_TARGET, number) == if{
               (L:TdsB8flaperonR_STD, number)
           }
           els{
              (L:TdsB8flaperonR, percent) (L:TdsB8flaperonR_TARGET, number) &gt; if{
                  (L:TdsB8flaperonR, percent) 1 - 
              }
              (L:TdsB8flaperonR, percent) (L:TdsB8flaperonR_TARGET, number) &lt; if{
                  (L:TdsB8flaperonR, percent) 1 +
              }
           }
        }
        els{
            (L:TdsB8flaperonR_STD, number)
        }
    }
}
els{
   (L:TdsB8flaperonR_STD, number)
}
200 max 400 min
(>L:TdsB8flaperonR, percent)



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