• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Help Needed With Fuel Panel

Messages
292
Country
unitedkingdom
I am currently in the process of coding a fuel panel that includes a "fuel Used" counter which also has a reset button.

Fuel Panel.jpeg


The problem I have encountered is when I load the aircraft, the fuel used indicator displays "minus total fuel quantity" & with engines running begins to count down fuel used, when I hit the reset button it does zero & starts counting fuel used as it should.

Code:
        <Element id="Fuel Used Display">
            <FloatPosition>436.000,103.000</FloatPosition>
            <GaugeText id="GaugeText">
                <Bright>True</Bright>
                <FontColor>white</FontColor>
                <FontFace>ariel</FontFace>
                <FontHeight>50</FontHeight>
                <GaugeString>%((L:Clear, enum) (A:FUEL TOTAL QUANTITY, gallon) - 6.7 *)%!04d!</GaugeString>
                <HorizontalAlign>CENTER</HorizontalAlign>
                <Size>100,60</Size>
                <Transparent>True</Transparent>
            </GaugeText>

            </MouseArea>
            <MouseArea id="MouseArea">
                <FloatPosition>379.000,155.000</FloatPosition>
                <Size>60,60</Size>
                <CursorType>Hand</CursorType>
                <MouseClick id="MouseClick">
                    <Script> (A:FUEL TOTAL QUANTITY, gallon) (&gt;L:clear,enum)</Script>
                </MouseClick>
            </MouseArea>
        </MouseArea>

I would appreciate any help given.
 
When you first load the aircraft, your (L:clear,enum) is initialized to ZERO, hence the negative fuel used reading... try adding this to your script:
Code:
<Update>
   (L:FuelInit,bool) 0 ==
       if{
           (A:FUEL TOTAL QUANTITY, gallon) (>L:clear,enum)
           1 (>L:FuelInit,bool)
         }
</Update>
This is simply a quick initialization routine. Since all L:variables are initialized to a ZERO value, the "if{" condition will set your (L:clear,enum) to equal the total fuel qty, then set the (L:FuelInit,bool) flag to equal 1 ending the "if{" routine.
 
Last edited:
Thank's Bill, that did the job, however I did find a typo in the code, (A:FUEL TOTAL QUANTITY, gallon) >L:clear,enum)
missing a ( before ">L:clear,enum)"
Again I thank you.
 
Last edited:
The following is what I use to get 'Fuel used' , it lists for each of 2 engines and has a total .
Note the Variables used .
Code:
       <Element>
          <Position X="75" Y="354"/>
            <FormattedText X="310" Y="50" Font="Tahoma" FontSize="16" LineSpacing="18" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,1L,90L,205L">
              <String>\t%Fuel Burn%\t%ENG #1 %((A:GENERAL ENG FUEL USED SINCE START:01, pounds))%!5d!%\t%ENG #2 %((A:GENERAL ENG FUEL USED SINCE START:02, pounds))%!5d!%
                      \n\t% -lbs-%\t    %TOTAL%  %((A:GENERAL ENG FUEL USED SINCE START:01, pounds) (A:GENERAL ENG FUEL USED SINCE START:02, pounds) +)%!5d!%  %lbs%
              </String>                   
          </FormattedText> 
       </Element>

Cheers
Karol
 
Thank's Bill, that did the job, however I did find a typo in the code, (A:FUEL TOTAL QUANTITY, gallon) >L:clear,enum)
missing a ( before ">L:clear,enum)"
Again I thank you.
Oops! That's what happens when I type of the cuff without using my Visual Studio where such an omission would have been flagged. In any event I'm happy you found/fixed my typo.

I've also edited my post to add the missing opening "("... :coffee:
 
Back
Top