diff --git a/include/CSAdapterEqFct.h b/include/CSAdapterEqFct.h index 74343d761eb06cc5fe79c415ca1c9c5f57bc0a8c..ddd8902a8d5c872c8e696f6767ca530305a9efb8 100644 --- a/include/CSAdapterEqFct.h +++ b/include/CSAdapterEqFct.h @@ -3,7 +3,6 @@ #include <eq_fct.h> #include <ChimeraTK/ControlSystemAdapter/ProcessVariable.h> -#include <ChimeraTK/ControlSystemAdapter/ControlSystemSynchronizationUtility.h> #include <ChimeraTK/ControlSystemAdapter/ControlSystemPVManager.h> #include "DoocsUpdater.h" @@ -15,10 +14,8 @@ namespace ChimeraTK{ class CSAdapterEqFct : public EqFct , boost::noncopyable { protected: boost::shared_ptr<ControlSystemPVManager> controlSystemPVManager_; - boost::shared_ptr< ControlSystemSynchronizationUtility > syncUtility_; int fctCode_; std::vector< boost::shared_ptr<D_fct> > doocsProperties_; - std::vector< boost::shared_ptr<ChimeraTK::ProcessVariable> > chimeraTKReceivers_; void registerProcessVariablesInDoocs(); std::vector < ChimeraTK::ProcessVariable::SharedPtr > getProcessVariablesInThisLocation(); diff --git a/include/DoocsPVFactory.h b/include/DoocsPVFactory.h index 3c94790cb94f1e25d6b742f6ce63cc412bdfbdb6..43416190ea826275889bd499b6a819dd6f440ebe 100644 --- a/include/DoocsPVFactory.h +++ b/include/DoocsPVFactory.h @@ -2,8 +2,8 @@ #define CHIMERATK_DOOCS_PV_FACTORY_H #include <eq_fct.h> -#include <ChimeraTK/ControlSystemAdapter/ControlSystemSynchronizationUtility.h> #include <ChimeraTK/ControlSystemAdapter/ProcessVariable.h> +#include <ChimeraTK/ControlSystemAdapter/ControlSystemPVManager.h> #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> #include "VariableMapper.h" @@ -20,7 +20,7 @@ namespace ChimeraTK { * The constructor needs a pointer to the EqFct. It is designed to be used inside the EqFct, so * the 'this' pointer will be given. As it is not copyable this is ok. */ - DoocsPVFactory(EqFct * const eqFct, DoocsUpdater & updater,boost::shared_ptr<ControlSystemSynchronizationUtility> const & syncUtility, boost::shared_ptr<ControlSystemPVManager> const & csPVManager); + DoocsPVFactory(EqFct * const eqFct, DoocsUpdater & updater, boost::shared_ptr<ControlSystemPVManager> const & csPVManager); boost::shared_ptr<D_fct> create( ProcessVariable::SharedPtr & processVariable ); @@ -30,7 +30,6 @@ namespace ChimeraTK { protected: EqFct * _eqFct; //< The EqFct which is holding the factory. Needed in the constructor of the doocs properties. DoocsUpdater & _updater; - boost::shared_ptr<ControlSystemSynchronizationUtility> _syncUtility; //< The syncUtility is needed to register listeners boost::shared_ptr<ControlSystemPVManager> _controlSystemPVManager; //< The pv manager, needed to get the instances // create the DOOCS property. Note: DOOCS_T is only used for scalar properties, not for arrays! diff --git a/src/CSAdapterEqFct.cc b/src/CSAdapterEqFct.cc index 51f5d61119a5c2c9c8daed84b88b418035be7ce3..c5418ffa122d44719a8c53e8b48d86e17ff0627f 100644 --- a/src/CSAdapterEqFct.cc +++ b/src/CSAdapterEqFct.cc @@ -19,7 +19,6 @@ namespace ChimeraTK{ controlSystemPVManager_(controlSystemPVManager), fctCode_(fctCode){ - syncUtility_.reset (new ChimeraTK::ControlSystemSynchronizationUtility(controlSystemPVManager_)); registerProcessVariablesInDoocs(); } @@ -42,7 +41,7 @@ namespace ChimeraTK{ void CSAdapterEqFct::registerProcessVariablesInDoocs(){ // We only need the factory inside this function - DoocsPVFactory factory(this, updater_, syncUtility_, controlSystemPVManager_); + DoocsPVFactory factory(this, updater_, controlSystemPVManager_); auto mappingForThisLocation = VariableMapper::getInstance().getPropertiesInLocation(fct_name()); doocsProperties_.reserve( mappingForThisLocation.size() ); @@ -55,17 +54,6 @@ namespace ChimeraTK{ auto chimeraTkVariable = controlSystemPVManager_->getProcessVariable(pvName); doocsProperties_.push_back( factory.create( chimeraTkVariable ) ); - //FIXME: Hack to keep spectra from being added to the list for the sync util. They - //are already switched to the new updater scheme. Remove everything below if we got rid of - //the syncutil - if (boost::dynamic_pointer_cast<D_spectrum>(doocsProperties_.back())){ - continue; - } - - // we also have to remember which chimeraTK variables we have to receive - if ( chimeraTkVariable->isReadable() ){ - chimeraTKReceivers_.push_back(chimeraTkVariable); - } } } diff --git a/src/DoocsPVFactory.cc b/src/DoocsPVFactory.cc index c68387898dbaaee638529b46f0a204d1741f381d..156921fb596491e1c55144ddd90e8002ead55807 100644 --- a/src/DoocsPVFactory.cc +++ b/src/DoocsPVFactory.cc @@ -14,8 +14,8 @@ namespace ChimeraTK { DoocsPVFactory::DoocsPVFactory(EqFct * const eqFct, DoocsUpdater & updater, - boost::shared_ptr<ControlSystemSynchronizationUtility> const & syncUtility, boost::shared_ptr<ControlSystemPVManager> const & csPVManager) - : _eqFct(eqFct), _updater(updater), _syncUtility(syncUtility), _controlSystemPVManager(csPVManager) { + boost::shared_ptr<ControlSystemPVManager> const & csPVManager) + : _eqFct(eqFct), _updater(updater), _controlSystemPVManager(csPVManager) { assert(eqFct != nullptr); } diff --git a/tests/src/testDoocsPVFactory.cpp b/tests/src/testDoocsPVFactory.cpp index ccd9a6ffce686706298cfc341f5400cea8241c98..ae4e12e26c151bedcce3cf62f73f0a5f1b911f92 100644 --- a/tests/src/testDoocsPVFactory.cpp +++ b/tests/src/testDoocsPVFactory.cpp @@ -37,9 +37,8 @@ class TestableDoocsPVFactory: public DoocsPVFactory{ public: TestableDoocsPVFactory(EqFct * const eqFct, DoocsUpdater & updater, - boost::shared_ptr<ControlSystemSynchronizationUtility> const & syncUtility, boost::shared_ptr<ControlSystemPVManager> const & csPVManager) - : DoocsPVFactory(eqFct, updater, syncUtility, csPVManager){ + : DoocsPVFactory(eqFct, updater, csPVManager){ } template<class T, class DOOCS_T> @@ -76,7 +75,6 @@ BOOST_AUTO_TEST_CASE( testCreateScalars ) { shared_ptr<ControlSystemPVManager> csManager = pvManagers.first; shared_ptr<DevicePVManager> devManager = pvManagers.second; - // create all process variables before creating the sync util devManager->createProcessArray<int32_t>(controlSystemToDevice,"/I/int32",1); devManager->createProcessArray<uint32_t>(controlSystemToDevice,"/U/uint32",1); devManager->createProcessArray<int16_t>(controlSystemToDevice,"/I/int16",1); @@ -86,15 +84,12 @@ BOOST_AUTO_TEST_CASE( testCreateScalars ) { devManager->createProcessArray<float>(controlSystemToDevice,"/FP/float",1); devManager->createProcessArray<double>(controlSystemToDevice,"/FP/double",1); - shared_ptr<ControlSystemSynchronizationUtility> syncUtil( - new ControlSystemSynchronizationUtility(csManager)); - // populate the variable mapper VariableMapper::getInstance().directImport( getAllVariableNames(csManager ) ); DoocsUpdater updater; - DoocsPVFactory factory(&myEqFct, updater, syncUtil, csManager); + DoocsPVFactory factory(&myEqFct, updater, csManager); // We insert check points with integers so we know where the algorithm kicks out in case of an error. // These checkpoints are always true. @@ -144,10 +139,8 @@ BOOST_AUTO_TEST_CASE( testCreateScalars ) { // // populate the variable mapper before creating the DoocsPVFactory // VariableMapper::getInstance().directImport( getAllVariableNames(csManager ) ); // -// shared_ptr<ControlSystemSynchronizationUtility> syncUtil( -// new ControlSystemSynchronizationUtility(csManager)); // -// DoocsPVFactory factory(&myEqFct, syncUtil); +// DoocsPVFactory factory(&myEqFct); // // // have the variable created and check that it is the right type // ProcessVariable::SharedPtr processVariable = @@ -179,11 +172,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testCreateSpectrum, T, simple_test_types ){ // populate the variable mapper before creating the DoocsPVFactory, with array becoming D_spectrum VariableMapper::getInstance().prepareOutput("variableTreeXml/testSpectrum.xml",pvNames); - shared_ptr<ControlSystemSynchronizationUtility> syncUtil( - new ControlSystemSynchronizationUtility(csManager)); DoocsUpdater updater; - DoocsPVFactory factory(&myEqFct, updater, syncUtil, csManager); + DoocsPVFactory factory(&myEqFct, updater, csManager); // have the variable created and check that it is the right type for (auto const & pvName : pvNames){ @@ -216,11 +207,9 @@ BOOST_AUTO_TEST_CASE( testErrorHandling ){ // populate the variable mapper before creating the DoocsPVFactory VariableMapper::getInstance().directImport( getAllVariableNames(csManager ) ); - shared_ptr<ControlSystemSynchronizationUtility> syncUtil( - new ControlSystemSynchronizationUtility(csManager)); DoocsUpdater updater; - TestableDoocsPVFactory testableFactory(&myEqFct, updater, syncUtil, csManager); + TestableDoocsPVFactory testableFactory(&myEqFct, updater, csManager); ProcessVariable::SharedPtr processScalar = csManager->getProcessArray<int64_t>("I/toDeviceInt");