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

FSXA Fuel gauge quantity from left and right tanks switch code

Messages
1,018
Country
us-northcarolina
I have the Ayres Turbo Thrush port-over for fsx. It is a fun airplane to fly. I was able yesterday to figure out how to display the gauges in the vc and change them in the panel.cfg. The aircraft panel is fed from the Cessna208B.gau they say float version which I believe is FS2004. So in order to make it display in the VC I had to use the default Cessna C208B_XML from my FSX aircraft, no problem. There is a switch for displaying left and right tanks on the fuel quantity gauge but I figured out it is nothing but artwork on the [VCockpit00] panel . On that panel is a cumulative fuel gauge in the C208B XML FSX I would like to be able to check tanks individually if possible. Can anyone help by writing a simple switch xml code to do this. I can fill in the names of the bmp's for left/right switch bmps. Thanks for your help teaching me a little more about xml gauges.
 
Last edited:
It depends on the assignments of the left and right tanks. Are they Mains?
 
Yes, wet tanks in the wings left and right.

[fuel]
LeftMain = -12.000, -4.800, -0.850, 114.000, 3.600
RightMain = -12.000, 4.800, -0.850, 114.000, 3.600
fuel_type = 2 //Fuel type: 1 = Avgas, 2 = JetA
number_of_tank_selectors = 1
electric_pump=1
 
Let's say the mouse code changes the Fuel_Tank_Switch variable between 0 (left main) and 1 (right main) when the switch is clicked.

Then the code for the fuel gauge needle would use:

<Value> (L:Fuel_Tank_Switch, enum) 0 == if{ (A:FUEL TANK LEFT MAIN QUANTITY, gallons) } els{ (A:FUEL TANK RIGHT MAIN QUANTITY, gallons) } </Value>

You could also use the LEVEL variables if you wanted the needle to move as a percentage of the capacity of the tank (more flexible if used with other aircraft types). Ex. (A:FUEL TANK LEFT MAIN LEVEL, percent)
 
Let's say the mouse code changes the Fuel_Tank_Switch variable between 0 (left main) and 1 (right main) when the switch is clicked.

Then the code for the fuel gauge needle would use:

<Value> (L:Fuel_Tank_Switch, enum) 0 == if{ (A:FUEL TANK LEFT MAIN QUANTITY, gallons) } els{ (A:FUEL TANK RIGHT MAIN QUANTITY, gallons) } </Value>

You could also use the LEVEL variables if you wanted the needle to move as a percentage of the capacity of the tank (more flexible if used with other aircraft types). Ex. (A:FUEL TANK LEFT MAIN LEVEL, percent)
Thank you. I will create this and give it a try.
 
Here is the gauge I created with bmp's. It keeps telling me no bmp's. Can you please look at what obviously I have done wrong and correct it? I feel like I know just enough xml to get myself in trouble all the time and need help.
 

Attachments

Here is the gauge I created with bmp's. It keeps telling me no bmp's. Can you please look at what obviously I have done wrong and correct it? I feel like I know just enough xml to get myself in trouble all the time and need help.
I found that the background image didn;t jave a .bmp at the end and now it works. I will have to resize it and reposition the switch which is far left but it works as far as FS Panel Studio. I will have to try and click it in the aircraft. Thank you.
 
Awright, now it gets weird...I can get the gauge to add to the panel in FSPanel Studio no problem. I added it to the 2D panel because I yet have gotten to figure out his VC coordinates. Just wanted to see if it worked. Saved the panel. Open it up in FSX and it not there. OK, opened up the Panel.cfg and it is THERE but written like this :
Gauge!fuel_quantity_switch, 185,329,78,24 when I changed that to gauge19=fuel_quantity_switch and it said no gauge bmp. So I added it to the default Cessna172 panel and it shows the same. Tried another gauge just to see if it would add it properly and it does as you can see.
gauge46=Aft Cargo Fire!Aft Cargo Fire, 264,344,37,40

HELP!!!!!
 
Last edited:
I don't just wait around lost...I discovered that my folder was not labeled correctly as the gauge name in the xml doc so I changed it and it DOES properly show up in the panel cfg for the default Cessna 172:
gauge45=fuel quantity switch!fuel_quantity_switch, 185,339,65,19 but it is still NOT on the 2D panel in FSX. I am still at a loss.
 
First you talk about a VC and then the 2D panel. Where is it not showing up? Note that in a VC you can usually only display gauges where the author has gauges already (i.e. a gauge swap) - adding gauges is often very tricky.
 
First you talk about a VC and then the 2D panel. Where is it not showing up? Note that in a VC you can usually only display gauges where the author has gauges already (i.e. a gauge swap) - adding gauges is often very tricky.
I wanted this to work and tested it on the 2D panels because I know about the VC and its gauges. After being frustrated all day yesterday that it wouldn't even show on the Cessna172 default panel though it is in the panel.cfg 00 window I just decided to quit trying. Thank you for all your help and time. You taught me how to do the gauge and that makes it a learning experience. I have moved on from this and removed the aircraft from my FSX hanger. I was intrigued with it but don't need it. You have been a good helper in the past and I thank you for taking your time here. See you later.
 
Back
Top