1.1.26+ FS24 adjustments
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
#define MODULE_EXPORT __attribute__((visibility("default")))
|
||||
#define MODULE_WASM_MODNAME(mod) __attribute__((import_module(mod)))
|
||||
#else
|
||||
#define MODULE_EXPORT
|
||||
#define MODULE_WASM_MODNAME(mod)
|
||||
#define __attribute__(x)
|
||||
#define __restrict__
|
||||
#endif
|
||||
|
||||
/********************************* Headers *********************************/
|
||||
// MSFS headers
|
||||
#include <MSFS/MSFS_WindowsTypes.h>
|
||||
#include <SimConnect.h>
|
||||
// C headers
|
||||
#include <math.h>
|
||||
// C++ headers
|
||||
#include <algorithm>
|
||||
// Own headers
|
||||
#include "fuel.h"
|
||||
#include "log.h"
|
||||
#include "shared.h"
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
// PMC pallet due to 104in door
|
||||
#define MAX_UPPER_CARGO(IS_IMPERIAL) ((IS_IMPERIAL) ? (6.5 * 15000.0) : (6.5 * 6804.0))
|
||||
// Max ZFW
|
||||
#define MAX_F_ZFW(IS_IMPERIAL) ((IS_IMPERIAL) ? (451300) : (204706))
|
||||
// Arms
|
||||
#define ARM_F_UPPER1_LEFT 660
|
||||
#define ARM_F_UPPER1_RIGHT 660
|
||||
#define ARM_F_UPPER2_LEFT 240
|
||||
#define ARM_F_UPPER2_RIGHT 240
|
||||
#define ARM_F_UPPER3_LEFT -240
|
||||
#define ARM_F_UPPER3_RIGHT -240
|
||||
#define ARM_F_UPPER4_LEFT -600
|
||||
#define ARM_F_UPPER4_RIGHT -600
|
||||
|
||||
/***************************** Data structures *****************************/
|
||||
typedef struct {
|
||||
// SimConnect mapped
|
||||
double pilot;
|
||||
double firstOfficer;
|
||||
double engineer;
|
||||
double upper1Left;
|
||||
double upper1Right;
|
||||
double upper2Left;
|
||||
double upper2Right;
|
||||
double upper3Left;
|
||||
double upper3Right;
|
||||
double upper4Left;
|
||||
double upper4Right;
|
||||
double lowerForward;
|
||||
double lowerRear;
|
||||
double leftAux;
|
||||
double rightAux;
|
||||
double _ZFWCG; // DO NOT USE
|
||||
|
||||
// Additional properties
|
||||
double empty;
|
||||
double total;
|
||||
double CGTarget;
|
||||
double ZFWCG;
|
||||
double TOCG;
|
||||
struct stations {
|
||||
unsigned int upper1;
|
||||
unsigned int upper2;
|
||||
unsigned int upper3;
|
||||
unsigned int upper4;
|
||||
unsigned int total;
|
||||
} stations;
|
||||
struct sbPlanned {
|
||||
double ZFW;
|
||||
double GW;
|
||||
double fuel;
|
||||
unsigned int cargo;
|
||||
} sbPlanned;
|
||||
} fPayloadData_t;
|
||||
|
||||
typedef struct {
|
||||
// SimConnect mapped
|
||||
double pilot;
|
||||
double firstOfficer;
|
||||
double engineer;
|
||||
double upper1Left;
|
||||
double upper1Right;
|
||||
double upper2Left;
|
||||
double upper2Right;
|
||||
double upper3Left;
|
||||
double upper3Right;
|
||||
double upper4Left;
|
||||
double upper4Right;
|
||||
double lowerForward;
|
||||
double lowerRear;
|
||||
double leftAux;
|
||||
double rightAux;
|
||||
double ZFWCG;
|
||||
} fPayloadDataSet_t;
|
||||
|
||||
/******************************** Functions ********************************/
|
||||
// ZFW Entry
|
||||
void distribute(fPayloadData_t *const targetPayload, const FuelData_t *const fuel, const double ZFWTarget,
|
||||
const UserData_t *const userData);
|
||||
// SimBrief Entry
|
||||
void distribute(fPayloadData_t *const targetPayload, const FuelData_t *const fuel, unsigned int cargo,
|
||||
const UserData_t *const userData);
|
||||
// Updates pax stations with their respective weights
|
||||
// Used internally and used for Station Entry (pax only, cargo is ste directly)
|
||||
// STATION WEIGHTS ARE NOT NORMALISED TO POUNDS
|
||||
void generatePayload(fPayloadData_t *const targetPayload);
|
||||
// Normalise to Pounds
|
||||
// For Station Entry: CALL AFTER `generatePayload`
|
||||
void normalisePayload(fPayloadData_t *const targetPayload, const bool isImperial);
|
||||
void calculateCGs(fPayloadData_t *const targetPayload, const FuelData_t *const fuel, const bool isImperial);
|
||||
void load(const fPayloadData_t *const targetPayload, const FuelData_t *const fuel, const HANDLE simConnect,
|
||||
const bool isImperial);
|
||||
void unloadF(const HANDLE simConnect, const FuelData_t *const fuel, const double empty, const bool isER);
|
||||
@@ -0,0 +1,94 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
#define MODULE_EXPORT __attribute__((visibility("default")))
|
||||
#define MODULE_WASM_MODNAME(mod) __attribute__((import_module(mod)))
|
||||
#else
|
||||
#define MODULE_EXPORT
|
||||
#define MODULE_WASM_MODNAME(mod)
|
||||
#define __attribute__(x)
|
||||
#define __restrict__
|
||||
#endif
|
||||
|
||||
/********************************* Headers *********************************/
|
||||
// MSFS headers
|
||||
#include <MSFS/MSFS_WindowsTypes.h>
|
||||
#include <SimConnect.h>
|
||||
// C headers
|
||||
#include <math.h>
|
||||
// C++ headers
|
||||
#include <algorithm>
|
||||
// Own headers
|
||||
#include "shared.h"
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
|
||||
// Pounds to gallons conversion
|
||||
#define LBS_PER_GAL 6.699999809
|
||||
// Fueling rate
|
||||
#define FUELING_RATE ((LBS_PER_GAL * 1000) / 60)
|
||||
// Max tank capacity gallons
|
||||
#define MAX_TANK_1_3_MAIN_GAL 5167.907
|
||||
#define MAX_TANK_1_3_TIP_GAL 874.5
|
||||
#define MAX_TANK_1_3_GAL (5167.907 + 874.5)
|
||||
#define MAX_TANK_2_GAL 9556.95
|
||||
#define MAX_UPR_AUX_GAL 12998.58
|
||||
#define MAX_LWR_AUX_GAL 1641.82
|
||||
#define MAX_TAIL_GAL 1957.779
|
||||
#define MAX_FWD_AUX_GAL 1970.8
|
||||
// Max tank capacity pounds
|
||||
#define MAX_TANK_1_3_MAIN_LBS (LBS_PER_GAL * MAX_TANK_1_3_MAIN_GAL)
|
||||
#define MAX_TANK_1_3_TIP_LBS (LBS_PER_GAL * MAX_TANK_1_3_TIP_GAL)
|
||||
#define MAX_TANK_1_3_LBS (LBS_PER_GAL * MAX_TANK_1_3_GAL)
|
||||
#define MAX_TANK_2_LBS (LBS_PER_GAL * MAX_TANK_2_GAL)
|
||||
#define MAX_UPR_AUX_LBS (LBS_PER_GAL * MAX_UPR_AUX_GAL)
|
||||
#define MAX_LWR_AUX_LBS (LBS_PER_GAL * MAX_LWR_AUX_GAL)
|
||||
#define MAX_TAIL_LBS (LBS_PER_GAL * MAX_TAIL_GAL)
|
||||
#define MAX_FWD_AUX_LBS (LBS_PER_GAL * MAX_FWD_AUX_GAL)
|
||||
// Max Fuel
|
||||
#define MAX_FUEL(IS_IMPERIAL) ((IS_IMPERIAL) ? (256207) : (116213))
|
||||
#define MAX_FUEL_ER(IS_IMPERIAL) ((IS_IMPERIAL) ? (282619) : (128193))
|
||||
// Arms Fuel
|
||||
#define ARM_MAIN1 -240.0
|
||||
#define ARM_MAIN3 -240.0
|
||||
#define ARM_MAIN2 120.0
|
||||
#define ARM_UPPER_AUX 0.0
|
||||
#define ARM_LOWER_AUX 0.0
|
||||
#define ARM_MAIN1_TIP -468.0
|
||||
#define ARM_MAIN3_TIP -468.0
|
||||
#define ARM_TAIL -840.0
|
||||
#define ARM_FORWARD_AUX1 60.0
|
||||
#define ARM_FORWARD_AUX2 60.0
|
||||
|
||||
/***************************** Data structures *****************************/
|
||||
typedef struct {
|
||||
// SimConnect mapped
|
||||
double main1;
|
||||
double main3;
|
||||
double main2;
|
||||
double upperAux;
|
||||
double lowerAux;
|
||||
double main1Tip;
|
||||
double main3Tip;
|
||||
double tail;
|
||||
double forwardAux1;
|
||||
double forwardAux2;
|
||||
// Additional properties
|
||||
double total;
|
||||
} FuelData_t;
|
||||
|
||||
typedef struct {
|
||||
double main1;
|
||||
double main3;
|
||||
double main2;
|
||||
double upperAux;
|
||||
double lowerAux;
|
||||
double tail;
|
||||
double forwardAux1;
|
||||
double forwardAux2;
|
||||
} FuelDataSet_t;
|
||||
|
||||
/******************************** Functions ********************************/
|
||||
void distribute(FuelData_t *const targetFuel, const double fuelTarget, const bool isImperial, const bool isER);
|
||||
void distribute(FuelData_t *const targetFuel, const double fuelTarget, const UserData_t *const userData);
|
||||
void fuel(const FuelData_t *const targetFuel, const HANDLE simConnect);
|
||||
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
#define MODULE_EXPORT __attribute__((visibility("default")))
|
||||
#define MODULE_WASM_MODNAME(mod) __attribute__((import_module(mod)))
|
||||
#else
|
||||
#define MODULE_EXPORT
|
||||
#define MODULE_WASM_MODNAME(mod)
|
||||
#define __attribute__(x)
|
||||
#define __restrict__
|
||||
#endif
|
||||
|
||||
/********************************* Headers *********************************/
|
||||
// MSFS headers
|
||||
#include "rapidjson/filewritestream.h"
|
||||
#include <MSFS/MSFS.h>
|
||||
#include <MSFS/MSFS_CommBus.h>
|
||||
#include <MSFS/MSFS_Core.h>
|
||||
#include <MSFS/MSFS_GaugeContext.h>
|
||||
#include <MSFS/MSFS_WindowsTypes.h>
|
||||
#include <SimConnect.h>
|
||||
#include <rapidjson/document.h>
|
||||
#include <rapidjson/filereadstream.h>
|
||||
#include <rapidjson/writer.h>
|
||||
|
||||
// Own headers
|
||||
#include "freighter.h"
|
||||
#include "fuel.h"
|
||||
#include "log.h"
|
||||
#include "pax.h"
|
||||
#include "shared.h"
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
// Module identification
|
||||
// COMM BUS
|
||||
#define COMM_BUS_LIVE_DATA_EVENT "khofmann_tfdi_md-11_load_manager_live_data"
|
||||
#define COMM_BUS_UPDATE_TARGET_EVENT "khofmann_tfdi_md-11_load_manager_update_target"
|
||||
|
||||
/******************************** Functions ********************************/
|
||||
void commBusUpdateTargetCallback(const char *args, unsigned int size, void *ctx);
|
||||
int receiveData(const char *buf);
|
||||
void sendData();
|
||||
void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContext);
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
#define MODULE_EXPORT __attribute__((visibility("default")))
|
||||
#define MODULE_WASM_MODNAME(mod) __attribute__((import_module(mod)))
|
||||
#else
|
||||
#define MODULE_EXPORT
|
||||
#define MODULE_WASM_MODNAME(mod)
|
||||
#define __attribute__(x)
|
||||
#define __restrict__
|
||||
#endif
|
||||
|
||||
// C headers
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
// C++ headers
|
||||
#include <ctime>
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
// Module identification
|
||||
#define MODULE_NAME "[KHOFMANN TFDi MD-11 Load Manager] "
|
||||
#define VERSION_STRING "2.40"
|
||||
|
||||
void toLog(FILE *file, const char *format, double *optional = nullptr);
|
||||
@@ -0,0 +1,156 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
#define MODULE_EXPORT __attribute__((visibility("default")))
|
||||
#define MODULE_WASM_MODNAME(mod) __attribute__((import_module(mod)))
|
||||
#else
|
||||
#define MODULE_EXPORT
|
||||
#define MODULE_WASM_MODNAME(mod)
|
||||
#define __attribute__(x)
|
||||
#define __restrict__
|
||||
#endif
|
||||
|
||||
/********************************* Headers *********************************/
|
||||
// MSFS headers
|
||||
#include <MSFS/MSFS_WindowsTypes.h>
|
||||
#include <SimConnect.h>
|
||||
// C headers
|
||||
#include <math.h>
|
||||
// C++ headers
|
||||
#include <algorithm>
|
||||
// Own headers
|
||||
#include "fuel.h"
|
||||
#include "log.h"
|
||||
#include "shared.h"
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
// 2x 190lbs default
|
||||
#define FRONT_CREW_WEIGHT(IS_IMPERIAL) ((IS_IMPERIAL) ? (760.0) : (344.0))
|
||||
// 2x 190lbs default
|
||||
#define REAR_CREW_WEIGHT(IS_IMPERIAL) ((IS_IMPERIAL) ? (760.0) : (344.0))
|
||||
// All actual Business seats
|
||||
#define MAX_BUSINESS_1 18
|
||||
// First 5 rows of economy
|
||||
#define MAX_BUSINESS_2 45
|
||||
// Next 10 rows
|
||||
#define MAX_ECONOMY_1 86
|
||||
// Remaining rows
|
||||
// 12 x 9
|
||||
// 6 x 8
|
||||
// 4 x 2
|
||||
#define MAX_ECONOMY_2 164
|
||||
// Total
|
||||
#define MAX_PAX 313
|
||||
// Max ZFW
|
||||
#define MAX_PAX_ZFW(IS_IMPERIAL) ((IS_IMPERIAL) ? (400000) : (181437))
|
||||
// Arms
|
||||
#define ARM_PAX_CABIN_CREW_FRONT 792.0
|
||||
#define ARM_PAX_BUSINESS1_LEFT 540.0
|
||||
#define ARM_PAX_BUSINESS1_CENTER 540.0
|
||||
#define ARM_PAX_BUSINESS1_RIGHT 540.0
|
||||
#define ARM_PAX_BUSINESS2_LEFT 300.0
|
||||
#define ARM_PAX_BUSINESS2_CENTER 300.0
|
||||
#define ARM_PAX_BUSINESS2_RIGHT 300.0
|
||||
#define ARM_PAX_ECONOMY1_LEFT -240.0
|
||||
#define ARM_PAX_ECONOMY1_CENTER -240.0
|
||||
#define ARM_PAX_ECONOMY1_RIGHT -240.0
|
||||
#define ARM_PAX_ECONOMY2_LEFT -600.0
|
||||
#define ARM_PAX_ECONOMY2_CENTER -600.0
|
||||
#define ARM_PAX_ECONOMY2_RIGHT -600.0
|
||||
#define ARM_PAX_CABIN_CREW_REAR -660.0
|
||||
|
||||
/***************************** Data structures *****************************/
|
||||
typedef struct {
|
||||
// SimConnect mapped
|
||||
double pilot;
|
||||
double firstOfficer;
|
||||
double engineer;
|
||||
double cabinCrewFront;
|
||||
double business1Left;
|
||||
double business1Center;
|
||||
double business1Right;
|
||||
double business2Left;
|
||||
double business2Center;
|
||||
double business2Right;
|
||||
double economy1Left;
|
||||
double economy1Center;
|
||||
double economy1Right;
|
||||
double economy2Left;
|
||||
double economy2Center;
|
||||
double economy2Right;
|
||||
double cabinCrewRear;
|
||||
double forwardCargo;
|
||||
double rearCargo;
|
||||
double leftAux;
|
||||
double rightAux;
|
||||
double _ZFWCG; // DO NOT USE
|
||||
|
||||
// Additional properties
|
||||
double empty;
|
||||
double total;
|
||||
double CGTarget;
|
||||
double ZFWCG;
|
||||
double TOCG;
|
||||
struct paxCount {
|
||||
unsigned char business1;
|
||||
unsigned char business2;
|
||||
unsigned char economy1;
|
||||
unsigned char economy2;
|
||||
unsigned short total;
|
||||
} paxCount;
|
||||
struct sbPlanned {
|
||||
double ZFW;
|
||||
double GW;
|
||||
double fuel;
|
||||
unsigned short pax;
|
||||
unsigned int cargo;
|
||||
} sbPlanned;
|
||||
} paxPayloadData_t;
|
||||
|
||||
typedef struct {
|
||||
double pilot;
|
||||
double firstOfficer;
|
||||
double engineer;
|
||||
double cabinCrewFront;
|
||||
double business1Left;
|
||||
double business1Center;
|
||||
double business1Right;
|
||||
double business2Left;
|
||||
double business2Center;
|
||||
double business2Right;
|
||||
double economy1Left;
|
||||
double economy1Center;
|
||||
double economy1Right;
|
||||
double economy2Left;
|
||||
double economy2Center;
|
||||
double economy2Right;
|
||||
double cabinCrewRear;
|
||||
double forwardCargo;
|
||||
double rearCargo;
|
||||
double leftAux;
|
||||
double rightAux;
|
||||
double ZFWCG;
|
||||
} paxPayloadDataSet_t;
|
||||
|
||||
/******************************** Functions ********************************/
|
||||
// ZFW Entry, fill pax first (pax+bag), rest is cargo
|
||||
void distribute(paxPayloadData_t *const targetPayload, const FuelData_t *const fuel, const double ZFWTarget,
|
||||
const UserData_t *const userData, const UserOptions_t *const userOptions);
|
||||
// SimBrief Entry, SB pax count and total cargo
|
||||
void distribute(paxPayloadData_t *const targetPayload, const FuelData_t *const fuel, unsigned short numPax, unsigned int cargo,
|
||||
const UserData_t *const userData, const UserOptions_t *const userOptions);
|
||||
// Updates pax stations with their respective weights
|
||||
// Used internally and used for Station Entry (pax only, cargo is ste directly)
|
||||
// STATION WEIGHTS ARE NOT NORMALISED TO POUNDS
|
||||
void generatePayload(paxPayloadData_t *const targetPayload, const bool isImperial, const UserOptions_t *const userOptions);
|
||||
// Normalise to Pounds
|
||||
// For Station Entry: CALL AFTER `generatePayload`
|
||||
void normalisePayload(paxPayloadData_t *const targetPayload, const bool isImperial);
|
||||
void calculateCGs(paxPayloadData_t *const targetPayload, const FuelData_t *const fuel, const bool isImperial);
|
||||
void load(const paxPayloadData_t *const targetPayload, const FuelData_t *const fuel, const HANDLE simConnect,
|
||||
const bool isImperial);
|
||||
void unload(const HANDLE simConnect, const FuelData_t *const fuel, const double empty, const bool isER);
|
||||
// Based on ICAO/LH findings
|
||||
double PAX_WEIGHT(const bool isImperial, const UserOptions_t *const options);
|
||||
// Based on ICAO/LH findings
|
||||
double BAG_WEIGHT(const bool isImperial, const UserOptions_t *const options);
|
||||
@@ -0,0 +1,131 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
#define MODULE_EXPORT __attribute__((visibility("default")))
|
||||
#define MODULE_WASM_MODNAME(mod) __attribute__((import_module(mod)))
|
||||
#else
|
||||
#define MODULE_EXPORT
|
||||
#define MODULE_WASM_MODNAME(mod)
|
||||
#define __attribute__(x)
|
||||
#define __restrict__
|
||||
#endif
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
// 190lbs default
|
||||
#define PILOT_WEIGHT(IS_IMPERIAL) ((IS_IMPERIAL) ? (190.0) : (86.0))
|
||||
// 200lbs per tank (one LD3)
|
||||
#define AUX_WEIGHT(IS_IMPERIAL) ((IS_IMPERIAL) ? (200.0) : (91.0))
|
||||
// PMC pallet due to 104in door
|
||||
#define MAX_FRONT_CARGO(IS_IMPERIAL) ((IS_IMPERIAL) ? (6.0 * 15000.0) : (6.0 * 6804.0))
|
||||
// LD3s due to 70in door, ER option takes up two slots
|
||||
#define MAX_REAR_CARGO(IS_IMPERIAL, IS_ER) ((IS_IMPERIAL) ? ((IS_ER ? 12.0 : 14.0) * 3500.0) : ((IS_ER ? 12.0 : 14.0) * 1588.0))
|
||||
// Max TOW
|
||||
#define MAX_TOW(IS_IMPERIAL) ((IS_IMPERIAL) ? (625500) : (283722))
|
||||
#define MAX_TOW_ER(IS_IMPERIAL) ((IS_IMPERIAL) ? (630500) : (285990))
|
||||
// Arms Shared
|
||||
#define ARM_EMPTY -120.0
|
||||
#define ARM_PILOT 984.0
|
||||
#define ARM_FIRST_OFFICER 984.0
|
||||
#define ARM_ENGINEER 960.0
|
||||
#define ARM_FORWARD_CARGO 360.0
|
||||
#define ARM_REAR_CARGO -360.0
|
||||
#define ARM_LEFT_AUX 60.0
|
||||
#define ARM_RIGHT_AUX 60.0
|
||||
// MAC
|
||||
#define ROOT_CHORD 34.68
|
||||
#define WING_SPAN 170.5
|
||||
#define WING_AREA 3648.0
|
||||
#define QUARTER_MAC -165.0 // aero_center
|
||||
#define TIP_CHORD ((2.0 * WING_AREA) / WING_SPAN - ROOT_CHORD)
|
||||
#define TAPER_RATIO (TIP_CHORD / ROOT_CHORD)
|
||||
#define MAC ((2.0 / 3.0) * ROOT_CHORD * ((1.0 + TAPER_RATIO + (TAPER_RATIO * TAPER_RATIO)) / (1.0 + TAPER_RATIO)) * 12.0)
|
||||
#define LEMAC (QUARTER_MAC + (1.0 / 4.0) * MAC)
|
||||
// CG Limits
|
||||
#define MIN_CG 12.0
|
||||
#define MAX_CG 34.0
|
||||
#define CG_TOLERANCE 0.05
|
||||
// GSX States
|
||||
#define GSX_SERVICE_IDLE 1
|
||||
#define GSX_SERVICE_CALLED 4
|
||||
#define GSX_SERVICE_ACTIVE 5
|
||||
#define GSX_SERVICE_FINISHED 6
|
||||
|
||||
/********************************* Macros **********************************/
|
||||
// Conversions
|
||||
#define TO_POUNDS(IS_IMPERIAL, VALUE) ((IS_IMPERIAL) ? (VALUE) : (VALUE)*2.20462262185)
|
||||
#define FROM_POUNDS(IS_IMPERIAL, VALUE) ((IS_IMPERIAL) ? (VALUE) : (VALUE) * (1.0 / 2.20462262185))
|
||||
// MAC
|
||||
#define TO_PERCENT_MAC(POS) ((((POS)-LEMAC) / MAC) * -100.0)
|
||||
|
||||
/********************************** ENUMS **********************************/
|
||||
enum DATA_DEFINITIONS {
|
||||
DATA_DEFINITION_EMPTY_WEIGHT,
|
||||
DATA_DEFINITION_PAYLOAD_PAX,
|
||||
DATA_DEFINITION_PAYLOAD_F,
|
||||
DATA_DEFINITION_FUEL,
|
||||
DATA_DEFINITION_FUEL_SET,
|
||||
DATA_DEFINITION_GSX,
|
||||
DATA_DEFINITION_USER_DATA,
|
||||
};
|
||||
|
||||
enum DATA_REQUESTS {
|
||||
DATA_REQUEST_EMPTY_WEIGHT,
|
||||
DATA_REQUEST_PAYLOAD_PAX,
|
||||
DATA_REQUEST_PAYLOAD_F,
|
||||
DATA_REQUEST_FUEL,
|
||||
DATA_REQUEST_FUEL_SET,
|
||||
DATA_REQUEST_GSX,
|
||||
DATA_REQUEST_USER_DATA,
|
||||
};
|
||||
|
||||
enum LOADING_STATES {
|
||||
LOADING_STATE_IDLE,
|
||||
LOADING_STATE_BOARDING,
|
||||
LOADING_STATE_BOARDED,
|
||||
LOADING_STATE_DEBOARDING,
|
||||
LOADING_STATE_DEBOARDED,
|
||||
};
|
||||
|
||||
enum FUELING_STATES { FUELING_STATE_IDLE, FUELING_STATE_CALLED, FUELING_STATE_FUELING, FUELING_STATE_FUELED };
|
||||
|
||||
enum CALL_MODES {
|
||||
CALL_MODE_SB_SET,
|
||||
CALL_MODE_ZFW_SET,
|
||||
CALL_MODE_STATION_SET,
|
||||
CALL_MODE_LOAD_SET,
|
||||
CALL_MODE_UNLOAD_SET,
|
||||
CALL_MODE_OPTIONS_SET,
|
||||
CALL_MODE_GSX_RESET,
|
||||
};
|
||||
|
||||
/***************************** Data structures *****************************/
|
||||
typedef struct {
|
||||
double isCargo;
|
||||
double isER;
|
||||
double isImperial;
|
||||
} UserData_t;
|
||||
|
||||
typedef struct {
|
||||
// SimConnect mapped
|
||||
double couatlStarted; // boolean
|
||||
double boardingState; // See manual, 5 => active
|
||||
double deboardingState; // See manual, 5 => active
|
||||
double refuelingState; // See manual, 5 => active
|
||||
double passengersBoarded; // Num pax
|
||||
double passengersDeboarded; // Num pax
|
||||
double cargoBoarded; // In percent
|
||||
double cargoDeboarded; // In percent
|
||||
double fuelConnected; // boolean
|
||||
|
||||
// Additional properties
|
||||
enum LOADING_STATES loadingState;
|
||||
enum FUELING_STATES fuelingState;
|
||||
} GSXData_t;
|
||||
|
||||
typedef struct {
|
||||
bool GSXSync;
|
||||
double paxWeightKG;
|
||||
double bagWeightKG;
|
||||
double paxWeightLBS;
|
||||
double bagWeightLBS;
|
||||
} UserOptions_t;
|
||||
Reference in New Issue
Block a user