Results 1 to 3 of 3

Thread: Reciprocal number in XML

Hybrid View

  1. #1

    Default Reciprocal number in XML

    I am looking for an "Expression Operator" to convert a string value to its reciprocal. I have made a gauge to display the fuel to air ratio for the mixture using the parameter A:Recip Mixture Ratio, and it displays the ratio as 0.0856:1 (as an example), but I want to convert it to the equivalent ratio for air to fuel, which in this case would be 11.68:1. This, to me at least, is an easier number to get your head around. I can't find an operator that will do this amongst the ones listed in various tutorials etc.

    The gauge coding is:
    <Image Name="Mix Ratio Bkg.bmp" ImageSizes="100,20"
    Luminous="Yes"/>

    <Element>
    <Position X="3" Y="4"/>
    <Text X="45" Y="12" Length="22" Font="Arial" FontSize="12"
    Color="#EBEBEB"
    BackgroundColor="Black" Adjust="Left" VerticalAdjust="Center"
    Luminous="Yes">
    <String>Fuel/Air</String>
    </Text>
    </Element>

    <Element>
    <Visible>(A:Electrical Master Battery, bool) 1 == </Visible>
    <Visible>(A:Circuit Avionics On, bool)</Visible>
    <Position X="48" Y="4"/>
    <Text X="48" Y="12" Bright="Yes" Length="10" Font="Arial"
    FontSize="12" Color="0x55D9FF"
    BackgroundColor="Black" Adjust="Right" VerticalAdjust="Center">
    <String>%((A:Recip Mixture Ratio:1, ratio))%!6.4f!:1</String>
    </Text>
    </Element>

    </Gauge>

    I need a conversion expression in the string to give me the reciprocal of the standard FS mixture ratio.

  2. #2

    Default

    1 (argument) /
    would do

    (argument) -1 pow
    is another method
    Last edited by Wyvern; 03-26-2011 at 11:27 PM.

  3. #3

    Default

    Thanks Wyvern

    Exactly what I wanted. Just changed the number formatting to 5.2 and it gave me 11.68:1. Also had to reverse the text string to Air/Fuel. Many years ago my maths were OK, I found POW on the MS site, but didn't remember that reciprocal was the same as "to the power of -1"

Similar Threads

  1. The reciprocal of V1 is...?
    By uriahms in forum The Outer Marker
    Replies: 2
    Last Post: 03-06-2011, 02:28 PM
  2. Replies: 4
    Last Post: 11-07-2009, 04:50 PM
  3. Displaying XML A:atc flight number, string in GDI+
    By n4gix in forum Panel & Gauge Design
    Replies: 0
    Last Post: 03-15-2006, 08:57 PM
  4. THRUST FOR COMBINED RECIPROCAL/JET AIRCRAFT
    By hh43huskey in forum FS2004
    Replies: 8
    Last Post: 05-24-2005, 01:00 PM
  5. Combined JET & Reciprocal Sound File
    By hh43huskey in forum FS2004
    Replies: 0
    Last Post: 05-21-2005, 02:09 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
  •