Jump to content

Throttle Range Display


Buzzer

Recommended Posts

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:

(A:general eng throttle lever position:1,percent) 10

IDL

 

If I try some {IF} statements such as:

(%((A:general eng throttle lever position:1,percent) 10

 

(%((A:general eng throttle lever position:1,percent) 10 > (A:general eng throttle lever position:1,percent) 75

 

(%((A:general eng throttle lever position:1,percent) 75 > (A:general eng throttle lever position:1,percent) 90

 

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

I cannot get anything to work.

 

Any help appreciated.

 

It is obviously a problem with or , but I cannot get anything to work.

Link to comment
Share on other sites

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

 

%((A:Selected DME, number) 2 ==)%{if}%((A:NAV2 DME, nmiles) s0)%{else}%((A:NAV1 DME, nmiles) s0)%{end}%(l0 0 >=)%{if}%(l0 10

 

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.

Edited by PAULCRAIG
Link to comment
Share on other sites

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 and 75
Link to comment
Share on other sites

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 > (A:general eng throttle lever position:1,percent) 90
Link to comment
Share on other sites

Thanks Paul

 

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

 

1

%((A:general eng throttle lever position:1,percent) 10 (A:general eng throttle lever position:1,percent) 30 (A:general eng throttle lever position:1,percent) 75 (A:general eng throttle lever position:1,percent) 90 )%{if}T/OFF%{end}

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...