Hi everyone!
The file PMDG_NGX_SKD.h, situated in C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\PMDG\PMDG 737 NGX\SDK, suggests that there are some new variables added sometimes. Those are:
I am using C# to speak with PMDG. I have a struct of PMDG variables, however, those "new ones" appear to be missing. When I add a few of those to that struct:
When the struct is returned, those are zeros, not populated. Any idea how to fix that? This is a piece of my code:
My SDK is the same as this one:
https://github.com/maciekish/SimInterface/blob/master/Windows/SimInterface/PmdgSDK.cs
However, I've added the three variables from above at the end of the public struct PMDG_NGX_Data.
The file PMDG_NGX_SKD.h, situated in C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\PMDG\PMDG 737 NGX\SDK, suggests that there are some new variables added sometimes. Those are:
C++:
// New variables for SP2
unsigned int COMM_ReceiverSwitches[3]; // Bit flags for selector receivers (see ACP_SEL_RECV_VHF1 etc): [0]=Capt, [1]=FO, [2]=Overhead
bool MAIN_annunAP_Amber[2]; // Amber color
bool MAIN_annunAT_Amber[2]; // Amber color
int ICE_WindowHeatTestSw; // 0: OVHT 1: Neutral 2: PWR TEST
bool DOOR_annunFWD_ENTRY;
bool DOOR_annunFWD_SERVICE;
bool DOOR_annunAIRSTAIR;
bool DOOR_annunLEFT_FWD_OVERWING;
bool DOOR_annunRIGHT_FWD_OVERWING;
bool DOOR_annunFWD_CARGO;
bool DOOR_annunEQUIP;
bool DOOR_annunLEFT_AFT_OVERWING;
bool DOOR_annunRIGHT_AFT_OVERWING;
bool DOOR_annunAFT_CARGO;
bool DOOR_annunAFT_ENTRY;
bool DOOR_annunAFT_SERVICE;
bool AIR_annunAUTO_FAIL;
bool AIR_annunOFFSCHED_DESCENT;
bool AIR_annunALTN;
bool AIR_annunMANUAL;
float AIR_CabinAltNeedle; // Value - ft
float AIR_CabinDPNeedle; // Value - PSI
float AIR_CabinVSNeedle; // Value - ft/min
float AIR_CabinValveNeedle; // Value - 0 (closed) .. 1 (open)
float AIR_TemperatureNeedle; // Value - degrees C
float AIR_DuctPressNeedle[2]; // Value - degrees C
char ELEC_MeterDisplayTop[13]; // Top line of the display: 3 groups of 4 digits (or symbols) + terminating zero
char ELEC_MeterDisplayBottom[13]; // Bottom line of the display
char IRS_DisplayLeft[7]; // Left display string, zero terminated
char IRS_DisplayRight[8]; // Right display string, zero terminated
bool IRS_DisplayShowsDots; // True if the degrees and decimal dot symbols are shown on the IRS display
I am using C# to speak with PMDG. I have a struct of PMDG variables, however, those "new ones" appear to be missing. When I add a few of those to that struct:
C#:
public float AIR_CabinAltNeedle; // Value
public float AIR_CabinDPNeedle; // Value
public float AIR_CabinVSNeedle; // Value
C#:
_simConnect.MapClientDataNameToID(PMDG.PMDG_NGX_DATA_NAME, PMDG.PMDGIds.PMDG_NGX_DATA_ID);
// Define the data area structure - this is a required step
_simConnect.AddToClientDataDefinition(PMDG.PMDGIds.PMDG_NGX_DATA_DEFINITION, 0, (uint)Marshal.SizeOf(typeof(PMDG.PMDG_NGX_Data)), 0.0f, SimConnect.SIMCONNECT_UNUSED);
_simConnect.RegisterStruct<SIMCONNECT_RECV_CLIENT_DATA, PMDG.PMDG_NGX_Data>(PMDG.PMDGIds.PMDG_NGX_DATA_DEFINITION);
_simConnect.RequestClientData(PMDG.PMDGIds.PMDG_NGX_DATA_ID, DATA_REQUEST_ID.DATA_REQUEST, PMDG.PMDGIds.PMDG_NGX_DATA_DEFINITION, SIMCONNECT_CLIENT_DATA_PERIOD.ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG.CHANGED, 0, 0, 0);
_simConnect.OnRecvClientData += new SimConnect.RecvClientDataEventHandler(simconnect_PMDGVarsHandler);
C#:
void simconnect_PMDGVarsHandler(SimConnect sender, SIMCONNECT_RECV_CLIENT_DATA data)
{
switch ((DATA_REQUEST_ID)data.dwRequestID)
{
case DATA_REQUEST_ID.DATA_REQUEST:
PMDG.PMDG_NGX_Data ngxVars = (PMDG.PMDG_NGX_Data)data.dwData[0];
//code here,
break;
}
}
My SDK is the same as this one:
https://github.com/maciekish/SimInterface/blob/master/Windows/SimInterface/PmdgSDK.cs
However, I've added the three variables from above at the end of the public struct PMDG_NGX_Data.