• 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.

FS2004 Fuel Totalizer

Messages
210
Country
us-michigan
A have modified an exisiting (working) code for a fuel totalizer that counts up the total fuel used in lbs. It also has a reset.
Like I said, this worked fine with any 2 engine aircraft, but I needed it to work for a 4 engine airplane now. I just added the ENG3 and ENG4 entries to the end of the code, but now it does not work properly. It actually counts down and it is not close to the correct value. Wondering if that 3600 value is the culprit, but I am not sure what it for.


Code:
<Gauge Name="Totalizador" Version="1.0">
   <Image Name="total_back.bmp" ImageSizes="43,15"/>
   <Element>
      <Select>
         <Value>(P:Local time,seconds) flr 2 % (L:TimeFlag,bool) != if{ (L:Totalizer,number) (A:Turb Eng1 fuel flow PPH,pounds per hour) (A:Turb Eng2 fuel flow PPH,pounds per hour) (A:Turb Eng3 fuel flow PPH,pounds per hour) (A:Turb Eng4 fuel flow PPH,pounds per hour) + 3600 / + (&gt;L:Totalizer,number) (L:TimeFlag,bool) ! (&gt;L:TimeFlag,bool) }</Value>
      </Select>
   </Element>
   <Element>
      <Position X="0" Y="0"/>
      <Text X="120" Y="15" Luminous="Yes" Length="12" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Fixed="Yes">
         <String>%((L:Totalizer,number) 9999 min 0 max)%!04d!</String>
      </Text>
   </Element>
   <Mouse>
      <Cursor Type="Hand"/>
      <Click>0 (&gt;L:Totalizer,number)</Click>
   </Mouse>
</Gauge>

Thanks for any help,

Greg
 
You're missing an operator or two in the Value statement. + 3600 / + ( 3 operators) isn't enough for a stack with 5 items:

Code:
(P:Local time,seconds) flr 2 % (L:TimeFlag,bool) !=
    if{
        (L:Totalizer,number)
        (A:Turb Eng1 fuel flow PPH,pounds per hour)
        (A:Turb Eng2 fuel flow PPH,pounds per hour)
        (A:Turb Eng3 fuel flow PPH,pounds per hour)
        (A:Turb Eng4 fuel flow PPH,pounds per hour)
        + 3600 / +
        (&gt;L:Totalizer,number)
        (L:TimeFlag,bool) ! (&gt;L:TimeFlag,bool)
    }

And, not sure purpose of 3600 off hand. For me, it's easier to keep track if the operators are placed after the variable names rather than all grouped at the end.

Is this what you need??

Code:
(P:Local time,seconds) flr 2 % (L:TimeFlag,bool) !=
    if{
        (L:Totalizer,number)
        (A:Turb Eng1 fuel flow PPH,pounds per hour)
        (A:Turb Eng2 fuel flow PPH,pounds per hour) +
        (A:Turb Eng3 fuel flow PPH,pounds per hour) +
        (A:Turb Eng4 fuel flow PPH,pounds per hour) +
        3600 / +
        (&gt;L:Totalizer,number)
        (L:TimeFlag,bool) ! (&gt;L:TimeFlag,bool)
    }

This sums all 4 engine pph's, divides the sum by 3600, adds that to the previous Totalizer and stores the result as the new Totalizer. Just a wild guess...

Bob
 
Last edited:
The "3600" is simply the number of seconds in one hour, so it is necessary to convert the totalizer's value to a "per hour" form.
 
Thank you Bob! I used the second variation and works fine now.

Thank you Bill also for the 3600 explanation. Makes sense now.

Greg
 
Back
Top