Poker a écrit :Après quelques recherches, je pense que les données du Flightdata2 sont dans le fichier flightdata.h et non dans un autre fichier.
Ils auraient rajouter une extension flightdata2 (une sorte de sous menu) après le flighdata original certainement afin de pas toucher les données originales
Après je ne sais pas trop comment programmer de tel sorte que nous allions chercher ces infos dans le sous menu flightdata2 enfin pour un newbie comme moi en programmation...
J’essaie d'apprendre le langage C++ mais bien sûre ça ne se fera pas en 5 min compliqué quand c'est la première fois.
En tout cas je ne lâche pas
A+
Oui c'est ça, il s'agit d'un flightdata2
/ *** "FalconSharedMemoryArea2" ***
class FlightData2
{
public:
// TACAN
enum TacanSources
{
UFC = 0,
AUX = 1,
NUMBER_OF_SOURCES = 2,
};
enum TacanBits
{
band = 0x01, // true in this bit position if band is X
mode = 0x02, // true in this bit position if domain is air to air
};
// ALTIMETER
enum AltBits
{
CalType = 0x01, // true if calibration in inches of Mercury (Hg), false if in hectoPascal (hPa)
PneuFlag = 0x02, // true if PNEU flag is visible
};
// POWER
enum PowerBits
{
BusPowerBattery = 0x01, // true if at least the battery bus is powered
BusPowerEmergency = 0x02, // true if at least the emergency bus is powered
BusPowerEssential = 0x04, // true if at least the essential bus is powered
BusPowerNonEssential = 0x08, // true if at least the non-essential bus is powered
MainGenerator = 0x10, // true if the main generator is online
StandbyGenerator = 0x20, // true if the standby generator is online
JetFuelStarter = 0x40, // true if JFS is running, can be used for magswitch
};
// BLINKING LIGHTS - only indicating *IF* a lamp is blinking, not implementing the actual on/off/blinking pattern logic!
enum BlinkBits
{
// currently working
OuterMarker = 0x01, // defined in HsiBits - slow flashing for outer marker
MiddleMarker = 0x02, // defined in HsiBits - fast flashing for middle marker
PROBEHEAT = 0x04, // defined in LightBits2 - probeheat system is tested
AuxSrch = 0x08, // defined in LightBits2 - search function in NOT activated and a search radar is painting ownship
Launch = 0x10, // defined in LightBits2 - missile is fired at ownship
PriMode = 0x20, // defined in LightBits2 - priority mode is enabled but more than 5 threat emitters are detected
Unk = 0x40, // defined in LightBits2 - unknown is not active but EWS detects unknown radar
// not working yet, defined for future use
Elec_Fault = 0x80, // defined in LightBits3 - non-resetting fault
OXY_BROW = 0x100, // defined in LightBits - monitor fault during Obogs
EPUOn = 0x200, // defined in LightBits3 - abnormal EPU operation
JFSOn_Slow = 0x400, // defined in LightBits3 - slow blinking: non-critical failure
JFSOn_Fast = 0x800, // defined in LightBits3 - fast blinking: critical failure
};
// CMDS mode state
enum CmdsModes
{
CmdsOFF = 0,
CmdsSTBY = 1,
CmdsMAN = 2,
CmdsSEMI = 3,
CmdsAUTO = 4,
CmdsBYP = 5,
};
// HSI/eHSI mode state
enum NavModes
{
ILS_TACAN = 0,
TACAN = 1,
NAV = 2,
ILS_NAV = 3,
};
// human pilot state
enum FlyStates
{
IN_UI = 0, // UI - in the UI
LOADING = 1, // UI>3D - loading the sim data
WAITING = 2, // UI>3D - waiting for other players
FLYING = 3, // 3D - flying
DEAD = 4, // 3D>Dead - dead, waiting to respawn
UNKNOWN = 5, // ???
};
// VERSION 1
float nozzlePos2; // Ownship engine nozzle2 percent open (0-100)
float rpm2; // Ownship engine rpm2 (Percent 0-103)
float ftit2; // Ownship Forward Turbine Inlet Temp2 (Degrees C)
float oilPressure2; // Ownship Oil Pressure2 (Percent 0-100)
unsigned char navMode; // current mode selected for HSI/eHSI, see NavModes enum for details
float AAUZ; // Ownship barometric altitude given by AAU (depends on calibration)
char tacanInfo[NUMBER_OF_SOURCES]; // Tacan band/mode settings for UFC and AUX COMM
// VERSION 2 / 7
int AltCalReading; // barometric altitude calibration (depends on CalType)
unsigned int altBits; // various altimeter bits, see AltBits enum for details
unsigned int powerBits; // Ownship power bus / generator states, see PowerBits enum for details
unsigned int blinkBits; // Cockpit indicator lights blink status, see BlinkBits enum for details
// NOTE: these bits indicate only *if* a lamp is blinking, in addition to the
// existing on/off bits. It's up to the external program to implement the
// *actual* blinking.
int cmdsMode; // Ownship CMDS mode state, see CmdsModes enum for details
int BupUhfPreset; // BUP UHF channel preset
// VERSION 3
int BupUhfFreq; // BUP UHF channel frequency
float cabinAlt; // Ownship cabin altitude
float hydPressureA; // Ownship Hydraulic Pressure A
float hydPressureB; // Ownship Hydraulic Pressure B
int currentTime; // Current time in seconds (max 60 * 60 * 24)
short vehicleACD; // Ownship ACD index number, i.e. which aircraft type are we flying.
int VersionNum; // Version of FlightData2 mem area
// VERSION 4
float fuelFlow2; // Ownship fuel flow2 (Lbs/Hour)
// VERSION 5 / 8
char RwrInfo[RWRINFO_SIZE]; // New RWR Info
float lefPos; // Ownship LEF position
float tefPos; // Ownship TEF position
// VERSION 6
float vtolPos; // Ownship VTOL exhaust angle
// VERSION 9
char pilotsOnline; // Number of pilots in an MP session
char pilotsCallsign[MAX_CALLSIGNS][CALLSIGN_LEN]; // List of pilots callsign connected to an MP session
char pilotsStatus[MAX_CALLSIGNS]; // Status of the MP pilots, see enum FlyStates
// TACAN
// setters for internal use only
void SetUfcTacanToAA(bool t) { if (t) { tacanInfo[UFC] |= mode; } else { tacanInfo[UFC] &= ~mode; } }
void SetAuxTacanToAA(bool t) { if (t) { tacanInfo[AUX] |= mode; } else { tacanInfo[AUX] &= ~mode; } }
void SetUfcTacanToX(bool t) { if (t) { tacanInfo[UFC] |= band; } else { tacanInfo[UFC] &= ~band; } }
void SetAuxTacanToX(bool t) { if (t) { tacanInfo[AUX] |= band; } else { tacanInfo[AUX] &= ~band; } }
// getters for external reader programs
bool UfcTacanIsAA(void) {return ((tacanInfo[UFC] & mode) ? true : false); }
bool AuxTacanIsAA(void) {return ((tacanInfo[AUX] & mode) ? true : false); }
bool UfcTacanIsX(void) {return ((tacanInfo[UFC] & band) ? true : false); }
bool AuxTacanIsX(void) {return ((tacanInfo[AUX] & band) ? true : false); }
// ALTIMETER
void SetAltBit(unsigned int newBit) { altBits |= newBit; };
void ClearAltBit(unsigned int newBit) { altBits &= ~newBit; };
bool IsSetAlt(unsigned int newBit) { return ((altBits & newBit) ? true : false); };
// POWER
void SetPowerBit(unsigned int newBit) { powerBits |= newBit; };
void ClearPowerBit(unsigned int newBit) { powerBits &= ~newBit; };
bool IsSetPower(unsigned int newBit) { return ((powerBits & newBit) ? true : false); };
// BLINKING LIGHTS
void SetBlinkBit(unsigned int newBit) { blinkBits |= newBit; };
void ClearBlinkBit(unsigned int newBit) { blinkBits &= ~newBit; };
bool IsSetBlink(unsigned int newBit) { return ((blinkBits & newBit) ? true : false); };
// CMDS mode state
void SetCmdsMode(int newMode) {cmdsMode = newMode;};
int GetCmdsMode(void) {return cmdsMode;};
// HSI/eHSI mode state
void SetNavMode(int newMode) {navMode = newMode;};
int GetNavMode(void) {return navMode;};
};
Elle s'ouvre comme la flightdata sauf que là tu déclare ici la flightdata2 après la première, un deuxième record... et tu te sert des déclarations ci-dessus pour récupérer les valeurs... Rien de compliqué si tu sais déjà lire la première flightdata...