October 24, 200718 yr 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
October 24, 200718 yr 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.
October 24, 200718 yr 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
October 24, 200718 yr 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
October 24, 200718 yr >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
October 24, 200718 yr 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
October 24, 200718 yr 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