Results 1 to 6 of 6

Thread: Throttle Range Display

  1. #1

    Default Throttle Range Display

    I am trying to create an XML gauge to show script for ranges of throttle position such as:

    IDLE for a range between 0 and 10%
    CRUISE between 10 and 75%
    CLIMB between 75 and 90%
    TAKE OFF over 90%

    This works for IDLE:
    <Visible>(A:general eng throttle lever position:1,percent) 10 &lt; </Visible>
    <Position X="122" Y="2"/>
    <Text X="70" Y="22" Bright="Yes" Length="6" Font="Arial" FontSize="24" Color="Cyan" BackgroundColor="Black" Adjust="Right" VerticalAdjust="Center">
    <String>IDL</String>
    </Text>


    If I try some {IF} statements such as:
    <String>(%((A:general eng throttle lever position:1,percent) 10 &lt%{if}IDL%{else}

    (%((A:general eng throttle lever position:1,percent) 10 &gt; (A:general eng throttle lever position:1,percent) 75 &lt; &amp)%{if}CRS%{else}

    (%((A:general eng throttle lever position:1,percent) 75 &gt; (A:general eng throttle lever position:1,percent) 90 &lt; &amp)%{if}CLB%{else}

    (%((A:general eng throttle lever position:1,percent) 90 &gt; )%{if}T/O%{end}
    </String>

    I cannot get anything to work.

    Any help appreciated.

    It is obviously a problem with &lt; &gt; or < or > , but I cannot get anything to work.

  2. #2

    Default

    You have not included in your script how you want the digits to be displayed, here's an example:

    <GaugeString>%((A:Selected DME, number) 2 ==)%{if}%((A:NAV2 DME, nmiles) s0)%{else}%((A:NAV1 DME, nmiles) s0)%{end}%(l0 0 &gt;=)%{if}%(l0 10 &lt;=)%{if}%!3.1f!%{else}%!3d!%{end}%{else}---%{end</GaugeString>

    The highlighted code is what determines how the digits are displayed, here's what the SDK says about formating numbers:

    Formatting Numbers
    The format for numbers is contained within the !...! marks.
    The last letter is required and is case-sensitive, is the formatting of the variable, where:

    s = string.
    d = decimal number (integer). If the number is not an integer, it is rounded to the nearest integer. Note that rounding, not truncation occurs.
    f = number (floating point)
    The formatting letter can be preceded by a number, which is the minimum number of digits to display, and is optional. For decimal numbers the following rules apply:
    If d is preceded by the digit ‘0’, then leading zeros are added if necessary.
    If d is preceded by ‘-‘, text is left-aligned.
    If d is preceded by ‘+’, a ‘+’ symbol is indicated in front of the number when the number is greater than 0 (a ‘-‘ is always used to indicate numbers less than 0).
    If d is preceded by ‘ ‘ (space), leading spaces are added if necessary.
    For floating point numbers, the following rule applies:

    If a decimal point is used in the formatting number, the digit after the decimal point specifies the number of digits to display after the decimal point.

    Hope this helps.
    Last edited by PAULCRAIG; 03-14-2021 at 09:56 AM.

  3. #3

    Default

    Thanks Paul, but my problem is not with the display, I am OK with that. My problem is how to link a max and min range value for the throttle with the script display. For example, if I set the throttle range as 10 &lt; (10 and less than) I can make a display for "IDLE", but I need to set a range for, say, 10> and <75 (10 and greater and 90 and less than). Every time I try a range like, 10 &gt; 75&lt; and the gauge fails.

  4. #4

    Default

    You could do it my using seperate elements for each throttle range you wamt to display and use visibilty as a trigger to display each range, so for the "Climb" visibilty you could use ((A:general eng throttle lever position:1,percent) 75 &gt; (A:general eng throttle lever position:1,percent) 90 &lt; &amp.

  5. #5

    Default

    Thanks Paul

    This is what I ended up with. I have also included color changes for the different ranges.

    <Element>
    <Visible>1</Visible>
    <Position X="35" Y="25"/>
    <Text X="78" Y="24" Bright="Yes" Length="8" Font="Arial" FontSize="24" Color="%('White' 'Cyan' (A:general eng throttle lever position:1,percent) 10 &gt; ! ? 'Lime' (A:general eng throttle lever position:1,percent) 30 &gt; ! ? 'Orange' (A:general eng throttle lever position:1,percent) 75 &gt; ! ? 'Red' (A:general eng throttle lever position:1,percent) 90 &gt; ! ? )" BackgroundColor="Black" Adjust="Center" VerticalAdjust="Center">
    <String>%((A:general eng throttle lever position:1,percent) 10 &lt%{if}IDLE%{else}%((A:general eng throttle lever position:1,percent) 10 &gt; (A:general eng throttle lever position:1,percent) 30 &lt; &amp%{if}TAXI%{else}%((A:general eng throttle lever position:1,percent) 30 &gt; (A:general eng throttle lever position:1,percent) 75 &lt; &amp%{if}CRUISE%{else}%((A:general eng throttle lever position:1,percent) 75 &gt; (A:general eng throttle lever position:1,percent) 90 &lt; &amp%{if}CLIMB%{else}%((A:general eng throttle lever position:1,percent) 90 &gt%{if}T/OFF%{end}</String>
    </Text>
    </Element>

  6. #6

    Default

    Glad you got it sorted.

Similar Threads

  1. Display range change A320 anomaly
    By xtp in forum Microsoft Flight Simulator 2020
    Replies: 1
    Last Post: 12-27-2020, 06:04 AM
  2. Replies: 5
    Last Post: 05-14-2007, 11:46 AM
  3. Home on the Range..the Front Range that is
    By davestan_ksan in forum MSFS Screen Shot Forum
    Replies: 3
    Last Post: 03-18-2005, 08:39 AM
  4. Sidewinder II Joy Stick and Throttle Range
    By C172Flyer in forum FS2004
    Replies: 6
    Last Post: 07-20-2004, 12:09 PM
  5. Replies: 7
    Last Post: 09-06-2003, 09:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •