Vitus
Resource contributor
- Messages
- 1,480
- Country
Hello again,
I am currently working on the part of my dll file that will set the engine parameters for my aircraft. I set up a structure to hold all relevant engine variables that have the "settable" tag. E.g. "RECIP ENG MANIFOLD PRESSURE:1", "GENERAL ENG OIL PRESSURE:1", etc. etc. In my simConnect module, I do the usual SimConnect_AddToDataDefinition for all those variables in the structure. To test the functionality I implemented this:
which is supposed to set the manifold pressure to around 30 psi whenever the engine is turned on. However, this doesn't work, the manifold pressure will still be sim-controlled.
Debugging the code I can confirm that both, the "AddToDataDefinition" as well as the "SetDataOnSimObject" functions return S_OK. In the update function that calls the code above, I initialize the rest of the variables of the engine's data structure with the sim's variables.
Does any one have had any experiences modifying the engine parameters directly? Any ideas why my code doesn't perform?
I am currently working on the part of my dll file that will set the engine parameters for my aircraft. I set up a structure to hold all relevant engine variables that have the "settable" tag. E.g. "RECIP ENG MANIFOLD PRESSURE:1", "GENERAL ENG OIL PRESSURE:1", etc. etc. In my simConnect module, I do the usual SimConnect_AddToDataDefinition for all those variables in the structure. To test the functionality I implemented this:
Code:
if (general_eng_combustion == true) {
map = 206842.0;
hr = SimConnect_SetDataOnSimObject(mySimConnect, DEFINITION_ENGINE, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(set_engine), &set_engine);
}
Debugging the code I can confirm that both, the "AddToDataDefinition" as well as the "SetDataOnSimObject" functions return S_OK. In the update function that calls the code above, I initialize the rest of the variables of the engine's data structure with the sim's variables.
Does any one have had any experiences modifying the engine parameters directly? Any ideas why my code doesn't perform?