Jump to content

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

#### Share this 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.

#### Share this 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

##### 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

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

#### Share this 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

#### Share this 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

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• Tom Allensworth,
Founder of AVSIM Online

• ### Hot Spots

• 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.
• ### Donation Goals

AVSIM's 2019 Fundraising Goal

Donate to our annual general fund. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.

68%
\$24,820.00 of \$36,000.00 Donate Now
×
×
• Create New...