Skip to content
Snippets Groups Projects
Commit ee6b5e81 authored by Martin Killenberg's avatar Martin Killenberg
Browse files

got rid of the syn utility completely

parent d60343c7
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
......@@ -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!
......
......@@ -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);
}
}
}
......
......@@ -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);
}
......
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment