PLUGIN_API int XPluginEnable(void) { // Load the setup file on enable. This allows the user to modify the file without exit of XPlane SetupFile Setup; Setup.LoadSetupFile(ControlSurfaces, CommPortString, CommPortSpeed, OverString); // Open the setup file and parse it into the control surface list OpenComms(); SetupDefaultServoZeros(); // Setup the servo defaults. drOverRide = XPLMFindDataRef(OverString.data()); // Get the latest overide reference XPLMSetDatai(drOverRide, 1); // Overide from the setup file XPLMSetDatai(drThrOverRide, 1); memset(&CamPath, 0, sizeof(float) * 3 * CamPathLength); return 1; }
PLUGIN_API int XPluginEnable(void) { PortNum = 0; pendingElapsedTime = 0; // Load the setup file on enable. This allows the user to modify the file without exit of XPlane SetupFile Setup; // Open the setup file and parse it into the control surface list Setup.LoadSetupFile(ControlSurfaces, CommPortString, CommPortSpeed, PortNum, OverString); // Don't attempt a conection until we're done starting up // AttemptConnection(); SetupDefaultServoZeros(); // Setup the servo defaults. drOverRide = XPLMFindDataRef(OverString.data()); // Get the latest overide reference XPLMSetDatai(drOverRide, 1); // Overide from the setup file XPLMSetDatai(drThrOverRide, 1); XPLMSetDatai(drBrakeOverRide, 1); memset(&CamPath, 0, sizeof(float) * 3 * CamPathLength); return 1; }