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.

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.

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

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

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.

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

Sign in to follow this  

×
×
  • Create New...