Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: Problem with L:Vars in a fuel gauge

  1. #1

    Default Problem with L:Vars in a fuel gauge

    I have been trying to develop an XML gauge to show several fuel parameters, particularly actual fuel load at engine start, as well as fuel flow, fuel used, fuel remaining, range and time to empty. If I use the following coding the gallons units display but when I switch to display pounds (using the G:Var1 parameter) the pounds will not display. If i use only gallons or pounds in separate gauges each will display correctly. But, by trying to combine both into a single gauge, only the (G:Var1,bool) ! option works.

    The flow and fuel remaining work together and work when switched between gallons and pounds. This is probably because they are using standard sim variables and are not relying on the (L:FUELGAL,gallons) parameter.

    I would also like to be able to base the engine combustion requirement on any of the engines (whichever starts first), not just on engine 1. Although there will usually only be an insignificant usage of between, say engine 4 starting and engine 1 starting, I would like to be able to remove that slight difference. I have tried various "OR" options but cannot get anything to work to initiate the L:FUEL parameter.

    Any ideas or suggestions welcome.

    Below is the relevant section(s) of my gauge coding

    //----LOAD AT START
    <Select>
    <Value>
    (A:GENERAL ENG COMBUSTION:1,bool) == if{
    (A:FUEL TOTAL QUANTITY,gallons) (>L:FUELGAL,gallons) }
    </Value>
    </Select>

    <Element>
    <Visible>(G:Var1, bool) ! </Visible>
    <Position X="0" Y="0"/>
    <Text X="83" Y="8" Bright="No" Length="10"
    Font="Arial" FontSize="8" Color="0x55D9FF"
    BackgroundColor="Black" Adjust="Right"
    VerticalAdjust="Center">
    <String>%((L:FUELGAL,gallons))%!5.1f! GAL</String>
    </Text>
    </Element>

    <Element>
    <Visible>(G:Var1, bool)</Visible>
    <Position X="0" Y="9"/>
    <Text X="83" Y="8" Bright="No" Length="10"
    Font="Arial" FontSize="8" Color="0x55D9FF"
    BackgroundColor="Black" Adjust="Right"
    VerticalAdjust="Center">
    <String>%((L:FUELGAL,gallons) 6 * )%!6.1f!
    LBS</String>
    </Text>
    </Element>

    /-------USED

    <Element>
    <Visible>(G:Var1, bool) ! </Visible>

    <Position X="53" Y="88"/>
    <Text X="83" Y="16" Bright="No" Length="10" Font="Arial" FontSize="14" Color="0x55D9FF"
    BackgroundColor="Black" Adjust="Right" VerticalAdjust="Center">
    <String>%((L:FUELGAL,gallons) (A:FUEL TOTAL QUANTITY,gallons) - )%!5.1f! GAL</String>
    </Text>
    </Element>


    <Element>
    <Visible>(G:Var1, bool)</Visible>
    <Position X="53" Y="88"/>
    <Text X="83" Y="16" Bright="No" Length="11" Font="Arial" FontSize="14" Color="0x55D9FF"
    BackgroundColor="Black" Adjust="Right" VerticalAdjust="Center">
    <String>%((L:FUELGAL,gallons) (A:FUEL TOTAL QUANTITY,gallons) - 6 * )%!6.1f! LBS</String>
    </Text>
    </Element>

    <Mouse>
    <Cursor Type="Hand"/>
    <Tooltip>Click to change Fuel Units %((G:Var1, bool) !
    )%{if}to Pounds%{else}to Gallons%{end}</Tooltip>
    <Click>(G:Var1, bool) ! (>G:Var1, bool)</Click>
    </Mouse>

  2. Default

    Does (G:var1) change correctly?
    Way To check, After clicking, does the tooltip change? Or does that not work?

  3. Default

    Typo perhaps.
    Element1-- position X=0 Y=0
    Element2-- position X=0 Y=9

    I think you may have meant to type a 0 instead of a 9 there.

    (With a 9, the lbs reading would appear in a different spot. That spot may not be visible in your gauge. (Hidden behind a bitmap image for example.))
    Last edited by il88pp; 07-28-2018 at 09:52 AM.

  4. #4

    Default

    Yes Top Gun, position X=0 Y=9 should have been Y=0, but it still does not show and would have anyway. And yes, the G:Var1 does work. It changes the toolltip and changes the other fuel values (flow, remaining etc), which I have not shown here as they work OK.

  5. #5
    Join Date
    Oct 2009
    Location
    lost between how it is and how it ought to be
    Posts
    6,947

    Default

    Starting at the top...

    (A:GENERAL ENG COMBUSTION:1,bool) == if{

    == is a comparison operator, you are not comparing anything so get rid of it. If there is combustion A:GENERAL ENG COMBUSTION will return a 1, no combustion = 0. That will satisfy your if{ } query.

    So, if there is combustion then you read (A:FUEL TOTAL QUANTITY,gallons) and load that value into (>L:FUELGAL,gallons). Why not just use (A:FUEL TOTAL QUANTITY,gallons)?

    <String>%((L:FUELGAL,gallons) (A:FUEL TOTAL QUANTITY,gallons) - )%!5.1f! GAL</String>

    In plain English this equation would be...

    L:FUELGAL - A:FUEL TOTAL QUANTITY

    I do not think this is what you want, subtracting total capacity from currently available?

    The same with...

    <String>%((L:FUELGAL,gallons) (A:FUEL TOTAL QUANTITY,gallons) - 6 * )%!6.1f! LBS</String>

    ...or just use...

    <String>%(A:FUEL TOTAL QUANTITY WEIGHT,pounds) %!6.1f! LBS</String>

    peace,
    the Bean

    NB. I have not done any XML coding in a while, I am pretty sure I got this correct.
    WWOD---What Would Opa Do? Farewell, my freind (sp)

    Never argue with idiots.
    They drag you down to their level and beat you with experience

  6. Default

    It's way too hot here and my head's a bit fuzzy, but doesn't the last element calculate fuel remaining?
    Is that one working?(showing lbs when mode changed?)

    I was assuming that that element worked, and that I only needed to check your element 2.

    Please explain.

  7. Default

    Sorry, silly of me, I see now that it calculates fuel used. Never mind.
    il.
    Last edited by il88pp; 07-28-2018 at 07:53 PM.

  8. #8

    Default

    I am trying to capture the fuel load (which will be a fixed amount), when the engine starts (both gallons and pounds) them retain that fuel load. I also want to use that fuel load, less the current fuel quantity, to give me the total fuel used, as a constantly updated amount.

    As explained, the fuel used and fuel remaining are working OK. the fuel remaining is, of course, just the current quantity (Gals or Lbs) and the fuel used is the fuel at engine start (L:FUELGAL,gallons) minus the current quantity (A:FUEL TOTAL QUANTITY,gallons). Both the REMAINING and USED show correctly in gallons or pounds (using G:Var1) but NOT the initial fuel load at startup.

    The basic idea of course, is to select whatever fuel you determine you need for the flight then start engine(s), and the gauge will show what you originally selected, what you have now and what you have remaining.

    All amounts EXCEPT original fuel and fuel used are just standard A:variables, but original fuel and fuel used require the value from L:FUELGAL,gallons. Why does fuel used show OK (when switched to show gallons or lbs) BUT original fuel will only show gallons but not lbs?

    The whole process works fine if I create two (2) separate gauges one showing only gallons and the other showing only lbs.

  9. #9
    Join Date
    Oct 2009
    Location
    lost between how it is and how it ought to be
    Posts
    6,947

    Default

    My bad, I got QUANTITY and CAPACITY mixed up. As I said, it's been a while.

    In this picture, is there a return in the red circle? Why is the string not all on one line?
    Name:  Capture.JPG
Views: 214
Size:  25.3 KB

    In the future, when you post code, put it in a code box.

    Using square brackets instead of curllies...

    {CODE} your code here {/CODE}

    ...will retain your code format, such as...

    Code:
    <Element>
    <Visible>(G:Var1, bool)</Visible>
    <Position X="0" Y="9"/>
    <Text X="83" Y="8" Bright="No" Length="10"
    Font="Arial" FontSize="8" Color="0x55D9FF"
    BackgroundColor="Black" Adjust="Right"
    VerticalAdjust="Center">
    <String>%((L:FUELGAL,gallons) 6 * )%!6.1f!
    LBS</String>
    </Text>
    </Element>
    How do you stop your L:Var from being constantly updated as long as the engine is running?

    peace,
    the Bean
    WWOD---What Would Opa Do? Farewell, my freind (sp)

    Never argue with idiots.
    They drag you down to their level and beat you with experience

  10. #10

    Default

    There is no return, I just had Notepad reduced in width so the text was wrapped onto the next line.

    The L:Var is not constantly updated, because the value is stored in the L:Var while the engine is not running. when the engine is running the value is fixed.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. FS9 XML Gauge L:Vars Scope
    By flyer8 in forum Panel & Gauge Design
    Replies: 7
    Last Post: 06-25-2016, 05:27 AM
  2. L:Vars for aircraft while running in FSX?
    By okbob in forum Panel & Gauge Design
    Replies: 10
    Last Post: 12-02-2015, 03:11 PM
  3. Replies: 0
    Last Post: 01-22-2011, 06:42 PM
  4. Replies: 0
    Last Post: 10-14-2007, 10:32 PM
  5. Fuel fuel fuel fuel...sigh...
    By GreenMachine in forum MSFS Screen Shot Forum
    Replies: 8
    Last Post: 04-24-2002, 04:36 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
  •