Jump to content
Sign in to follow this  
rcbarend

XML - Kg output for Fuel

Recommended Posts

Hi Guys,I am trying to get a simple XML gauge running which will display fuel quantity in Kilograms. I have the following so far;%((A:Fuel Tank Left Main Quantity,kilogram))%!4.1f!but it seems to be producing a figure of Litres/1000. So it looks like it is saying 2.7 when I have 2700litres.Is there a place I can find the list of operators that can be attend to convert results??? Or the correct string for Kg output.


Sean (Brisbane, Australia)

Processor Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz, 2904 Mhz, 8 Core(s), 16 Logical Processor(s) OPSYS Windows 11 Homex64 Application Lockheed Martin P3Dv4

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Start by reading the SDK, and the XML FAQ above, which while a bit dated will give you the basics.There is no substitute for reading the SDK. Also, you will then want to look at a couple of similar XML gauges that came with FS to get the idea.

Share this post


Link to post
Share on other sites

Although reading the SDK, as suggested, usually is a good idea :-), that doesn't solve your problem in this case.As far as I can remember, the impliciet conversion from the Quantity variables (volume) to weight units doesn't work properly (at least in FS9).As you found out.What does work:(A:Fuel Tank Left Main Quantity,gallon) (* Quant. in Gallon *)(A:Fuel Weight Per Gallon,pound per gallon) * (* Quant. in Pounds *)2.198 / (* Quant. in Kg *)(A:Fuel Weight Per Gallon,pound per gallon) depends on the defined fuel type; ( == 6.7 for jet fuel if I remember correctly).And there are 2.198 Pounds in a Kg.Rob

Share this post


Link to post
Share on other sites

Volume parameters:Gallons or liters must be multiplied by density of fuel to obtain the weight:pounds or kilograms.If you start from US gallons you have to convert it to liters:1US gallon = 3.78 litersthen: liters multiplied by density = kilogramsThe density of jet fuel normally is from 0.70 to 0.85cheers

Share this post


Link to post
Share on other sites

>Start by reading the SDK, and the XML FAQ above, which while>a bit dated will give you the basics.>>There is no substitute for reading the SDK. Also, you will>then want to look at a couple of similar XML gauges that came>with FS to get the idea.>I have downloaded and read over the MS SDK for Panel and Gauges, and a few other online documents, however I couldn't locate anything that specifically mentions this type of operation. Thanks to Rob for the suggestion.


Sean (Brisbane, Australia)

Processor Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz, 2904 Mhz, 8 Core(s), 16 Logical Processor(s) OPSYS Windows 11 Homex64 Application Lockheed Martin P3Dv4

Share this post


Link to post
Share on other sites

Thanks Rob and G.Franco,So do i put that in one line or do i place multiple lines as Rob did??I've worked out I need to multiply the result in Gallons by 3.028 to get Kilograms.(A:Fuel Tank Left Main Quantity,gallon)%!4.1f! X 3.028How do I write that into the code???Cheers


Sean (Brisbane, Australia)

Processor Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz, 2904 Mhz, 8 Core(s), 16 Logical Processor(s) OPSYS Windows 11 Homex64 Application Lockheed Martin P3Dv4

Share this post


Link to post
Share on other sites

%((A:Fuel Tank Left Main Quantity,gallon) (A:Fuel Weight Per Gallon,pound per gallon) * 2.198 /)%!4.1f!I do suggest that you use the FS variable FuelWeightPerGallon instead of a fixed factor.Makes the gauge more versitile, because it takes into account the fuel type for that aircraft; moreover, this also ensures that is never a discrepancy with the Fuel menu in FS, since FS uses this variable internally as well.Rob

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...