diff --git a/include/ApplicationCore.h b/include/ApplicationCore.h index 4eaa1ef94c1340c462e328404f5fdf0c39b0fbec..a0a420ddde5f1e4ddd6b0a36452137e95c0e3df0 100644 --- a/include/ApplicationCore.h +++ b/include/ApplicationCore.h @@ -27,12 +27,16 @@ #include <ControlSystemAdapter-DoocsAdapter/DoocsAdapter.h> BEGIN_DOOCS_SERVER("Control System Adapter", 10) - // set the DOOCS server name to the application name - object_name = ChimeraTK::Application::getInstance().getName().c_str(); - // Create static instances for all applications cores. They must not have overlapping - // process variable names ("location/protery" must be unique). - ChimeraTK::Application::getInstance().setPVManager(doocsAdapter.getDevicePVManager()); - ChimeraTK::Application::getInstance().run(); + static bool isInitialised = false; + if(!isInitialised) { + // set the DOOCS server name to the application name + object_name = ChimeraTK::Application::getInstance().getName().c_str(); + // Create static instances for all applications cores. They must not have overlapping + // process variable names ("location/protery" must be unique). + ChimeraTK::Application::getInstance().setPVManager(doocsAdapter.getDevicePVManager()); + ChimeraTK::Application::getInstance().run(); + isInitialised = true; + } END_DOOCS_SERVER() #else