<!--
Fuel figures
===============
Dump Rate 500 pounds per minute from wing tanks
Transfer Rate 300 pounds per minute from center tank to both wing tanks
Tank Qtys are updated every second, the same rate FS updates tanks AVars.
-->
(L:DumpElapsed,seconds) 0 == if{ (P:Absolute time,seconds) (>L:DumpElapsed,seconds) }
(L:TransferElapsed,seconds) 0 == if{ (P:Absolute time,seconds) (>L:TransferElapsed,seconds) }
(L:DumpEnabled,bool)
if{
(P:Absolute time,seconds) (L:DumpElapsed,seconds) - 1.00 >
if{
500 (P:Absolute time,minutes) (L:DumpElapsed,minutes) - * (A:FUEL WEIGHT PER GALLON, pounds) / (>L:FuelDumpQty,Gallons)
(A:FUEL TANK LEFT MAIN QUANTITY,Gallons) (L:FuelDumpQty,Gallons) 2 / - (>C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons)
(A:FUEL TANK RIGHT MAIN QUANTITY,Gallons) (L:FuelDumpQty,Gallons) 2 / - (>C:SIMVARS:FUEL TANK RIGHT MAIN QUANTITY,Gallons)
(P:Absolute time,seconds) (>L:DumpElapsed,seconds)
}
els{
(A:FUEL TANK LEFT MAIN QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons)
(A:FUEL TANK RIGHT MAIN QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK RIGHT MAIN QUANTITY,Gallons)
}
}
els{
(A:FUEL TANK LEFT MAIN QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons)
(A:FUEL TANK RIGHT MAIN QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK RIGHT MAIN QUANTITY,Gallons)
(P:Absolute time,seconds) (>L:DumpElapsed,seconds)
}
(L:TransferEnabled,bool)
if{
(P:Absolute time,seconds) (L:TransferElapsed,seconds) - 1.00 >
if{
300 (P:Absolute time,minutes) (L:TransferElapsed,minutes) - * (A:FUEL WEIGHT PER GALLON, pounds) / (>L:FuelTransferQty,Gallons)
(A:FUEL TANK CENTER QUANTITY,Gallons) (L:FuelTransferQty,Gallons) - (>C:SIMVARS:FUEL TANK CENTER QUANTITY,Gallons)
(A:FUEL TANK LEFT MAIN QUANTITY,Gallons) (L:FuelTransferQty,Gallons) 2 / + (>C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons)
(A:FUEL TANK RIGHT MAIN QUANTITY,Gallons) (L:FuelTransferQty,Gallons) 2 / + (>C:SIMVARS:FUEL TANK RIGHT MAIN QUANTITY,Gallons)
(P:Absolute time,seconds) (>L:TransferElapsed,seconds)
}
els{
(A:FUEL TANK CENTER QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK CENTER QUANTITY,Gallons)
(A:FUEL TANK LEFT MAIN QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons)
(A:FUEL TANK RIGHT MAIN QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK RIGHT MAIN QUANTITY,Gallons)
}
}
els{
(A:FUEL TANK CENTER QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK CENTER QUANTITY,Gallons)
(A:FUEL TANK LEFT MAIN QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons)
(A:FUEL TANK RIGHT MAIN QUANTITY,Gallons) (>C:SIMVARS:FUEL TANK RIGHT MAIN QUANTITY,Gallons)
(P:Absolute time,seconds) (>L:TransferElapsed,seconds)
}
<!--
Fuel Qty Readings
==================
For 2D gauges, it is possible to read the SIMVARS directly to avoid flickering.
Example:
<String>%((C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons))%!6d!<String>
For 3D gauges (in modeldef), LVars must be used instead.
Then in the code above, write at the bottom
(C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons) (>L:FUEL TANK LEFT MAIN QUANTITY,Gallons)
(C:SIMVARS:FUEL TANK RIGHT MAIN QUANTITY,Gallons) (>L:FUEL TANK RIGHT MAIN QUANTITY,Gallons)
(C:SIMVARS:FUEL TANK CENTER QUANTITY,Gallons) (>L:FUEL TANK CENTER QUANTITY,Gallons)
And use these Lvars in the Modeldef file
Also convert to pounds if necessary.
Example:
(C:SIMVARS:FUEL TANK LEFT MAIN QUANTITY,Gallons) (A:FUEL WEIGHT PER GALLON, pounds) (>L:FUEL TANK LEFT MAIN QUANTITY,Pounds)
-->