Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML - Kg output for Fuel

Featured Replies

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

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.

  • Author

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

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

>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

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

  • Author

%((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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.