FSUIPC Client DLL
.NET interface for FSUIPC
PayloadServices Class Reference

A class that provides information about the Fuel and Payload of the current aircraft. More...

Public Member Functions

FsFuelTank GetFuelTank (FSFuelTanks Tank)
 DEPRECATED: Use the accessor on the FuelTanks collection instead. e.g. FsFuelTank leftTank = PayloadServices.FuelTanks[FsFuelTanks.Left_Main];.
 
void RefreshData ()
 Updates all the payload data from FSUIPC.
 
void WriteChanges ()
 Writes the changes to fuel tank levels and payload weights.
 
double LoadFuelUSGallons (double FuelQuantity, bool SetAbsoluteQuantity)
 Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.
 
double LoadFuelLitres (double FuelQuantity, bool SetAbsoluteQuantity)
 Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.
 
double LoadFuelLbs (double FuelQuantity, bool SetAbsoluteQuantity)
 Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.
 
double LoadFuelKgs (double FuelQuantity, bool SetAbsoluteQuantity)
 Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.
 
double LoadFuelNewtons (double FuelQuantity, bool SetAbsoluteQuantity)
 Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.
 
double LoadFuelSlugs (double FuelQuantity, bool SetAbsoluteQuantity)
 Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.
 

Properties

bool TooManyPayloadStations [get]
 This will be true if the loaded aircraft has more than 61 payload stations. FSUIPC can only handle the first 61 and therefore the PayloadStations list will never have more than that. Becuase of this limitation, stations above 61 that will not be accessible to your application.
 
List< FsPayloadStationPayloadStations [get]
 A strongly-typed list of FsPayloadStation objects. One for each payload station on this aircraft.
 
FsFuelTanksCollection FuelTanks [get]
 A strongly-typed list of FsFuelTank objects. One for each know possible fuel tank. Check which tanks are present with the IsPresent property.
 
double PayloadWeightLbs [get]
 The total current weight of all payload stations in Pounds.
 
double PayloadWeightKgs [get]
 The current weight of all payload stations in Kilograms.
 
double PayloadWeightSlugs [get]
 The current weight of all payload stations in Slugs.
 
double PayloadWeightNewtons [get]
 The current weight of all payload stations in Newtons.
 
double GrossWeightLbs [get]
 The total current weight of the aircraft in Pounds.
 
double GrossWeightKgs [get]
 The total current weight of the aircraft in Kilograms.
 
double GrossWeightSlugs [get]
 The total current weight of the aircraft in Slugs.
 
double GrossWeightNewtons [get]
 The total current weight of the aircraft in Newtons.
 
double MaxGrossWeightLbs [get]
 The maxmimum allowed weight (including payload and fuel) of the aircraft in Pounds.
 
double MaxGrossWeightKgs [get]
 The maxmimum allowed weight (including payload and fuel) of the aircraft in Kilograms.
 
double MaxGrossWeightSlugs [get]
 The maxmimum allowed weight (including payload and fuel) of the aircraft in Slugs.
 
double MaxGrossWeightNewtons [get]
 The maxmimum allowed weight (including payload and fuel) of the aircraft in Newtons.
 
double EmptyWeightLbs [get]
 The total current weight of the aircraft not including fuel or payload, in Pounds.
 
double EmptyWeightKgs [get]
 The total current weight of the aircraft not including fuel or payload, in Kilograms.
 
double EmptyWeightSlugs [get]
 The total current weight of the aircraft not including fuel or payload, in Slugs.
 
double EmptyWeightNewtons [get]
 The total current weight of the aircraft not including fuel or payload, in Newtons.
 
double FuelWeightLbs [get]
 The total current weight of all the fuel in Pounds.
 
double FuelWeightKgs [get]
 The total current weight of all the fuel in Kilograms.
 
double FuelWeightSlugs [get]
 The total current weight of all the fuel in Slugs.
 
double FuelWeightNewtons [get]
 The total current weight of all the fuel in Newtons.
 
double FuelCapacityUSGallons [get]
 The total capacity of all fuel tanks in US Gallons.
 
double FuelCapacityLitres [get]
 The total capacity of all fuel tanks in Litres.
 
double FuelCapacityLbs [get]
 The total current weight of all the fuel in Pounds.
 
double FuelCapacityKgs [get]
 The total capacity of all fuel tanks in Kilograms.
 
double FuelCapacitySlugs [get]
 The total capacity of all fuel tanks in Slugs.
 
double FuelCapacityNewtons [get]
 The total capacity of all fuel tanks in Newtons.
 
double FuelLevelUSGallons [get]
 The total level of all fuel tanks in US Gallons.
 
double FuelLevelLitres [get]
 The total level of all fuel tanks in Litres.
 
double FuelPercentage [get]
 The total percentage fuel level accross all tanks.
 
FSFuelTanks[][] FuelDistributionPlan [get, set]
 Gets or Sets the FuelTank distribution plan for the fuel loading algorithm used by the LoadFuel() methods.
 

Detailed Description

A class that provides information about the Fuel and Payload of the current aircraft.

Member Function Documentation

◆ GetFuelTank()

FsFuelTank GetFuelTank ( FSFuelTanks Tank)
inline

DEPRECATED: Use the accessor on the FuelTanks collection instead. e.g. FsFuelTank leftTank = PayloadServices.FuelTanks[FsFuelTanks.Left_Main];.

Parameters
TankDEPRECATED
Returns
DEPRECATED

◆ LoadFuelKgs()

double LoadFuelKgs ( double FuelQuantity,
bool SetAbsoluteQuantity )
inline

Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.

The priority for filling tanks is set out in the FuelDistributionPlan. The default plan fills tip and aux tanks first, followed by the main tanks, then centre, and finally external.

Parameters
FuelQuantityThe quantity of fuel in Kg
SetAbsoluteQuantitySet to true to set the fuel load to the specified quantity. Set to false to add the specified quantity to the fuel already in the tanks.
Returns
The quantity of fuel that could not be placed in the tanks

◆ LoadFuelLbs()

double LoadFuelLbs ( double FuelQuantity,
bool SetAbsoluteQuantity )
inline

Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.

The priority for filling tanks is set out in the FuelDistributionPlan. The default plan fills tip and aux tanks first, followed by the main tanks, then centre, and finally external.

Parameters
FuelQuantityThe quantity of fuel in Pounds (Lbs)
SetAbsoluteQuantitySet to true to set the fuel load to the specified quantity. Set to false to add the specified quantity to the fuel already in the tanks.
Returns
The quantity of fuel that could not be placed in the tanks

◆ LoadFuelLitres()

double LoadFuelLitres ( double FuelQuantity,
bool SetAbsoluteQuantity )
inline

Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.

The priority for filling tanks is set out in the FuelDistributionPlan. The default plan fills tip and aux tanks first, followed by the main tanks, then centre, and finally external.

Parameters
FuelQuantityThe quantity of fuel in Litres
SetAbsoluteQuantitySet to true to set the fuel load to the specified quantity. Set to false to add the specified quantity to the fuel already in the tanks.
Returns
The quantity of fuel that could not be placed in the tanks

◆ LoadFuelNewtons()

double LoadFuelNewtons ( double FuelQuantity,
bool SetAbsoluteQuantity )
inline

Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.

The priority for filling tanks is set out in the FuelDistributionPlan. The default plan fills tip and aux tanks first, followed by the main tanks, then centre, and finally external.

Parameters
FuelQuantityThe quantity of fuel in Newtons
SetAbsoluteQuantitySet to true to set the fuel load to the specified quantity. Set to false to add the specified quantity to the fuel already in the tanks.
Returns
The quantity of fuel that could not be placed in the tanks

◆ LoadFuelSlugs()

double LoadFuelSlugs ( double FuelQuantity,
bool SetAbsoluteQuantity )
inline

Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.

The priority for filling tanks is set out in the FuelDistributionPlan. The default plan fills tip and aux tanks first, followed by the main tanks, then centre, and finally external.

Parameters
FuelQuantityThe quantity of fuel in Slugs
SetAbsoluteQuantitySet to true to set the fuel load to the specified quantity. Set to false to add the specified quantity to the fuel already in the tanks.
Returns
The quantity of fuel that could not be placed in the tanks

◆ LoadFuelUSGallons()

double LoadFuelUSGallons ( double FuelQuantity,
bool SetAbsoluteQuantity )
inline

Sets the fuel in the aircraft to the specified quantity, or adds the specified quantity. The fuel will be distributed automatically between the fuel tanks present on the aircraft. If adding fuel the algorithm will try to correct any imbalance between the tanks.

The priority for filling tanks is set out in the FuelDistributionPlan. The default plan fills tip and aux tanks first, followed by the main tanks, then centre, and finally external.

Parameters
FuelQuantityThe quantity of fuel in US Gallons
SetAbsoluteQuantitySet to true to set the fuel load to the specified quantity. Set to false to add the specified quantity to the fuel already in the tanks.
Returns
The quantity of fuel that could not be placed in the tanks

Property Documentation

◆ FuelDistributionPlan

FSFuelTanks [][] FuelDistributionPlan
getset
Initial value:
= {
new FSFuelTanks[] { FSFuelTanks.Left_Tip, FSFuelTanks.Right_Tip, FSFuelTanks.Left_Aux, FSFuelTanks.Right_Aux },
new FSFuelTanks[] { FSFuelTanks.Centre_Main, FSFuelTanks.Centre_2, FSFuelTanks.Centre_3 },
new FSFuelTanks[] { FSFuelTanks.External_2, FSFuelTanks.External_1 }
}
FSFuelTanks
One of the known possible fuel tanks in Flight Sim.
Definition enums.cs:330
@ Right_Main
The Right Main tank.
Definition enums.cs:342
@ Centre_3
The Third Centre tank (FS2000 and later only)
Definition enums.cs:366
@ Right_Aux
The Right Auxiliary tank.
Definition enums.cs:350

Gets or Sets the FuelTank distribution plan for the fuel loading algorithm used by the LoadFuel() methods.

The plan is an array of FSFuelTanks[] arrays. Each sub-array is a group of tanks which get filled equally.

The fuel is placed in the first group of tanks. If they become full the remaining fuel is placed in the next group and so on.

Tanks which are not present on the aircraft being used are ignored. All tanks should be therefore included in the plan.