From b1f902638f6d22bb8acd7544ceacef29b39e772c Mon Sep 17 00:00:00 2001 From: Marco De Marco <demarco@oats.inaf.it> Date: Thu, 6 Feb 2014 19:43:07 +0100 Subject: [PATCH] Script path property path added --- src/Configuration.h | 25 +++--- src/PreProcessor.cpp | 180 ++++++++++++++++++++++++++++++++------ src/PreProcessor.h | 34 +++++-- src/PreProcessor.xmi | 30 ++++++- src/PreProcessorClass.cpp | 157 ++++++++++++++++++++++++++------- 5 files changed, 345 insertions(+), 81 deletions(-) diff --git a/src/Configuration.h b/src/Configuration.h index 4c3f608..d2ebeaf 100644 --- a/src/Configuration.h +++ b/src/Configuration.h @@ -21,10 +21,11 @@ private: //------------------------------------------------------------------------------ // [Private] Constructor destructor deleter //------------------------------------------------------------------------------ - Configuration(std::string watchPath, int workerNumber, int sleepTime, int waitTime, - int connectionNumber, uint32_t iNotifyMask): m_watchPath(watchPath), - m_workerNumber(workerNumber), m_sleepTime(sleepTime), m_waitTime(waitTime), - m_connectionNumber(connectionNumber), m_iNotifyMask(iNotifyMask) {} + Configuration(std::string watchPath, std::string destPath, int workerNumber, + int sleepTime, int waitTime, uint32_t iNotifyMask) : m_watchPath(watchPath), + m_destPath(destPath), m_workerNumber(workerNumber), m_sleepTime(sleepTime), + m_waitTime(waitTime), m_iNotifyMask(iNotifyMask) { } + virtual ~Configuration() {} class Deleter; @@ -39,20 +40,20 @@ public: //------------------------------------------------------------------------------ // [Public] User methods //------------------------------------------------------------------------------ - static Configuration::SP create(std::string watchPath, int workerNumber, - int sleepTime, int waitTime, int connectionNumber, uint32_t iNotifyMask) + static Configuration::SP create(std::string watchPath, std::string destPath, + int workerNumber, int sleepTime, int waitTime, uint32_t iNotifyMask) { - Configuration::SP c_sp(new Configuration(watchPath, workerNumber, sleepTime, - waitTime, connectionNumber, iNotifyMask), Configuration::Deleter()); + Configuration::SP c_sp(new Configuration(watchPath, destPath, workerNumber, + sleepTime, waitTime, iNotifyMask), Configuration::Deleter()); return c_sp; } std::string getWatchPath() const { return m_watchPath; } + std::string getDestPath() const { return m_destPath; } unsigned int getWorkerNumber() const { return m_workerNumber; } unsigned int getSleepTime() const { return m_sleepTime; } unsigned int getWaitTime() const { return m_waitTime; } - unsigned int getConnectionNumber() const { return m_connectionNumber; } uint32_t getINotifyMask() const { return m_iNotifyMask; } private: @@ -62,6 +63,9 @@ private: //INotify watch path const std::string m_watchPath; + //File destination path + const std::string m_destPath; + //Worker thread number const unsigned int m_workerNumber; @@ -71,9 +75,6 @@ private: //Worker thread wait time const unsigned int m_waitTime; - //Number of connection per destination - const unsigned int m_connectionNumber; - //INotify mask const uint32_t m_iNotifyMask; }; diff --git a/src/PreProcessor.cpp b/src/PreProcessor.cpp index e66c1a9..60497b5 100644 --- a/src/PreProcessor.cpp +++ b/src/PreProcessor.cpp @@ -12,20 +12,20 @@ // project : PreProcessor // // This file is part of Tango device class. -// +// // Tango is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// +// // Tango is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with Tango. If not, see <http://www.gnu.org/licenses/>. -// +// // $Author: $ // // $Revision: $ @@ -86,7 +86,7 @@ PreProcessor::PreProcessor(Tango::DeviceClass *cl, string &s) { /*----- PROTECTED REGION ID(PreProcessor::constructor_1) ENABLED START -----*/ init_device(); - + /*----- PROTECTED REGION END -----*/ // PreProcessor::constructor_1 } //-------------------------------------------------------- @@ -95,7 +95,7 @@ PreProcessor::PreProcessor(Tango::DeviceClass *cl, const char *s) { /*----- PROTECTED REGION ID(PreProcessor::constructor_2) ENABLED START -----*/ init_device(); - + /*----- PROTECTED REGION END -----*/ // PreProcessor::constructor_2 } //-------------------------------------------------------- @@ -104,7 +104,7 @@ PreProcessor::PreProcessor(Tango::DeviceClass *cl, const char *s, const char *d) { /*----- PROTECTED REGION ID(PreProcessor::constructor_3) ENABLED START -----*/ init_device(); - + /*----- PROTECTED REGION END -----*/ // PreProcessor::constructor_3 } @@ -118,9 +118,9 @@ void PreProcessor::delete_device() { DEBUG_STREAM << "PreProcessor::delete_device() " << device_name << endl; /*----- PROTECTED REGION ID(PreProcessor::delete_device) ENABLED START -----*/ - + // Delete device allocated objects - + /*----- PROTECTED REGION END -----*/ // PreProcessor::delete_device } @@ -134,21 +134,145 @@ void PreProcessor::init_device() { DEBUG_STREAM << "PreProcessor::init_device() create device " << device_name << endl; /*----- PROTECTED REGION ID(PreProcessor::init_device_before) ENABLED START -----*/ - + // Initialization before get_device_property() call - + /*----- PROTECTED REGION END -----*/ // PreProcessor::init_device_before - - // No device property to be read from database - + + + // Get the device properties from database + get_device_property(); + /*----- PROTECTED REGION ID(PreProcessor::init_device) ENABLED START -----*/ - + // Initialize device - + /*----- PROTECTED REGION END -----*/ // PreProcessor::init_device } +//-------------------------------------------------------- +/** + * Method : PreProcessor::get_device_property() + * Description : Read database to initialize property data members. + */ +//-------------------------------------------------------- +void PreProcessor::get_device_property() +{ + /*----- PROTECTED REGION ID(PreProcessor::get_device_property_before) ENABLED START -----*/ + + // Initialize property data members + + /*----- PROTECTED REGION END -----*/ // PreProcessor::get_device_property_before + + + // Read device properties from database. + Tango::DbData dev_prop; + dev_prop.push_back(Tango::DbDatum("WatchPath")); + dev_prop.push_back(Tango::DbDatum("DestPath")); + dev_prop.push_back(Tango::DbDatum("ScriptPath")); + dev_prop.push_back(Tango::DbDatum("EventList")); + dev_prop.push_back(Tango::DbDatum("SleepTime")); + dev_prop.push_back(Tango::DbDatum("WaitTime")); + dev_prop.push_back(Tango::DbDatum("WorkerNumber")); + + // is there at least one property to be read ? + if (dev_prop.size()>0) + { + // Call database and extract values + if (Tango::Util::instance()->_UseDb==true) + get_db_device()->get_property(dev_prop); + + // get instance on PreProcessorClass to get class property + Tango::DbDatum def_prop, cl_prop; + PreProcessorClass *ds_class = + (static_cast<PreProcessorClass *>(get_device_class())); + int i = -1; + + // Try to initialize WatchPath from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> watchPath; + else { + // Try to initialize WatchPath from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> watchPath; + } + // And try to extract WatchPath value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> watchPath; + + // Try to initialize DestPath from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> destPath; + else { + // Try to initialize DestPath from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> destPath; + } + // And try to extract DestPath value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> destPath; + + // Try to initialize ScriptPath from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> scriptPath; + else { + // Try to initialize ScriptPath from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> scriptPath; + } + // And try to extract ScriptPath value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> scriptPath; + + // Try to initialize EventList from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> eventList; + else { + // Try to initialize EventList from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> eventList; + } + // And try to extract EventList value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> eventList; + + // Try to initialize SleepTime from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> sleepTime; + else { + // Try to initialize SleepTime from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> sleepTime; + } + // And try to extract SleepTime value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> sleepTime; + + // Try to initialize WaitTime from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> waitTime; + else { + // Try to initialize WaitTime from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> waitTime; + } + // And try to extract WaitTime value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> waitTime; + + // Try to initialize WorkerNumber from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> workerNumber; + else { + // Try to initialize WorkerNumber from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> workerNumber; + } + // And try to extract WorkerNumber value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> workerNumber; + } + + /*----- PROTECTED REGION ID(PreProcessor::get_device_property_after) ENABLED START -----*/ + + // Check device property data members init + + /*----- PROTECTED REGION END -----*/ // PreProcessor::get_device_property_after +} //-------------------------------------------------------- /** @@ -160,9 +284,9 @@ void PreProcessor::always_executed_hook() { INFO_STREAM << "PreProcessor::always_executed_hook() " << device_name << endl; /*----- PROTECTED REGION ID(PreProcessor::always_executed_hook) ENABLED START -----*/ - + // code always executed before all requests - + /*----- PROTECTED REGION END -----*/ // PreProcessor::always_executed_hook } @@ -176,9 +300,9 @@ void PreProcessor::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list)) { DEBUG_STREAM << "PreProcessor::read_attr_hardware(vector<long> &attr_list) entering... " << endl; /*----- PROTECTED REGION ID(PreProcessor::read_attr_hardware) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessor::read_attr_hardware } @@ -193,16 +317,16 @@ void PreProcessor::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list)) void PreProcessor::add_dynamic_attributes() { /*----- PROTECTED REGION ID(PreProcessor::add_dynamic_attributes) ENABLED START -----*/ - + // Add your own code to create and add dynamic attributes if any - + /*----- PROTECTED REGION END -----*/ // PreProcessor::add_dynamic_attributes } //-------------------------------------------------------- /** * Command On related method - * Description: + * Description: * */ //-------------------------------------------------------- @@ -210,15 +334,15 @@ void PreProcessor::on() { DEBUG_STREAM << "PreProcessor::On() - " << device_name << endl; /*----- PROTECTED REGION ID(PreProcessor::on) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessor::on } //-------------------------------------------------------- /** * Command Off related method - * Description: + * Description: * */ //-------------------------------------------------------- @@ -226,9 +350,9 @@ void PreProcessor::off() { DEBUG_STREAM << "PreProcessor::Off() - " << device_name << endl; /*----- PROTECTED REGION ID(PreProcessor::off) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessor::off } diff --git a/src/PreProcessor.h b/src/PreProcessor.h index bc07568..a8d5336 100644 --- a/src/PreProcessor.h +++ b/src/PreProcessor.h @@ -8,20 +8,20 @@ // project : PreProcessor // // This file is part of Tango device class. -// +// // Tango is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// +// // Tango is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with Tango. If not, see <http://www.gnu.org/licenses/>. -// +// // $Author: $ // // $Revision: $ @@ -65,6 +65,22 @@ class PreProcessor : public TANGO_BASE_CLASS /*----- PROTECTED REGION END -----*/ // PreProcessor::Data Members +// Device property data members +public: + // WatchPath: + string watchPath; + // DestPath: + string destPath; + // ScriptPath: + string scriptPath; + // EventList: + vector<string> eventList; + // SleepTime: + Tango::DevULong sleepTime; + // WaitTime: + Tango::DevUShort waitTime; + // WorkerNumber: + Tango::DevUShort workerNumber; // Constructors and destructors @@ -93,7 +109,7 @@ public: PreProcessor(Tango::DeviceClass *cl,const char *s,const char *d); /** * The device object destructor. - */ + */ ~PreProcessor() {delete_device();}; @@ -107,6 +123,10 @@ public: * Initialize the device */ virtual void init_device(); + /* + * Read the device properties from database + */ + void get_device_property(); /* * Always executed method before execution command method. */ @@ -138,14 +158,14 @@ public: public: /** * Command On related method - * Description: + * Description: * */ virtual void on(); virtual bool is_On_allowed(const CORBA::Any &any); /** * Command Off related method - * Description: + * Description: * */ virtual void off(); diff --git a/src/PreProcessor.xmi b/src/PreProcessor.xmi index ffb31b5..4cf344d 100644 --- a/src/PreProcessor.xmi +++ b/src/PreProcessor.xmi @@ -1,10 +1,38 @@ <?xml version="1.0" encoding="ASCII"?> <pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl"> <classes name="PreProcessor" pogoRevision="8.1"> - <description description="Pre proccesing generic server" title="PreProcessor" sourcePath="/home/mdm/workspace/nadir/pre_precessor/src" language="Cpp" filestogenerate="XMI file,Code files" license="GPL" hasMandatoryProperty="false" hasConcreteProperty="false" hasAbstractCommand="false" hasAbstractAttribute="false"> + <description description="Pre proccesing generic server" title="PreProcessor" sourcePath="/home/mdm/workspace/nadir/pre_precessor/src" language="Cpp" filestogenerate="XMI file,Code files" license="GPL" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> <inheritances classname="Device_Impl" sourcePath=""/> <identification contact="at oats.inaf.it - demarco" author="demarco" emailDomain="oats.inaf.it" classFamily="Acquisition" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="none" reference=""/> </description> + <deviceProperties name="WatchPath" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="DestPath" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="ScriptPath" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="EventList" description=""> + <type xsi:type="pogoDsl:StringVectorType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="SleepTime" description=""> + <type xsi:type="pogoDsl:UIntType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="WaitTime" description=""> + <type xsi:type="pogoDsl:UShortType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="WorkerNumber" description=""> + <type xsi:type="pogoDsl:UShortType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> <commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0"> <argin description="none"> <type xsi:type="pogoDsl:VoidType"/> diff --git a/src/PreProcessorClass.cpp b/src/PreProcessorClass.cpp index 684dee6..50bde92 100644 --- a/src/PreProcessorClass.cpp +++ b/src/PreProcessorClass.cpp @@ -16,20 +16,20 @@ static const char *HttpServer = "http://www.esrf.eu/computing/cs/tango/tango_doc // project : PreProcessor // // This file is part of Tango device class. -// +// // Tango is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// +// // Tango is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with Tango. If not, see <http://www.gnu.org/licenses/>. -// +// // $Author: $ // // $Revision: $ @@ -87,7 +87,7 @@ PreProcessorClass::PreProcessorClass(string &s):Tango::DeviceClass(s) write_class_property(); /*----- PROTECTED REGION ID(PreProcessorClass::constructor) ENABLED START -----*/ - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::constructor cout2 << "Leaving PreProcessorClass constructor" << endl; @@ -102,7 +102,7 @@ PreProcessorClass::PreProcessorClass(string &s):Tango::DeviceClass(s) PreProcessorClass::~PreProcessorClass() { /*----- PROTECTED REGION ID(PreProcessorClass::destructor) ENABLED START -----*/ - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::destructor _instance = NULL; @@ -130,8 +130,8 @@ PreProcessorClass *PreProcessorClass::init(const char *name) catch (bad_alloc &) { throw; - } - } + } + } return _instance; } @@ -262,6 +262,97 @@ void PreProcessorClass::set_default_property() // Set Default Class Properties // Set Default device Properties + prop_name = "WatchPath"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "DestPath"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "ScriptPath"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "EventList"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "SleepTime"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "WaitTime"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "WorkerNumber"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); } //-------------------------------------------------------- @@ -334,7 +425,7 @@ void PreProcessorClass::write_class_property() header = "$HeadURL: "; start = header.length(); string strloc = src_path.substr(start, (end-start)); - + Tango::DbDatum svn_loc("svn_location"); svn_loc << strloc; data.push_back(svn_loc); @@ -343,13 +434,13 @@ void PreProcessorClass::write_class_property() } // Get CVS or SVN revision tag - + // CVS tag string tagname(TagName); header = "$Name: "; start = header.length(); string endstr(" $"); - + end = tagname.find(endstr); if (end!=string::npos && end>start) { @@ -358,17 +449,17 @@ void PreProcessorClass::write_class_property() cvs_tag << strtag; data.push_back(cvs_tag); } - + // SVN tag string svnpath(SvnPath); header = "$HeadURL: "; start = header.length(); - + end = svnpath.find(endstr); if (end!=string::npos && end>start) { string strloc = svnpath.substr(start, end-start); - + string tagstr ("/tags/"); start = strloc.find(tagstr); if ( start!=string::npos ) @@ -376,7 +467,7 @@ void PreProcessorClass::write_class_property() start = start + tagstr.length(); end = strloc.find(filename); string strtag = strloc.substr(start, end-start-1); - + Tango::DbDatum svn_tag("svn_tag"); svn_tag << strtag; data.push_back(svn_tag); @@ -417,16 +508,16 @@ void PreProcessorClass::write_class_property() void PreProcessorClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) { /*----- PROTECTED REGION ID(PreProcessorClass::device_factory_before) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::device_factory_before // Create devices and add it into the device list for (unsigned long i=0 ; i<devlist_ptr->length() ; i++) { cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl; - device_list.push_back(new PreProcessor(this, (*devlist_ptr)[i])); + device_list.push_back(new PreProcessor(this, (*devlist_ptr)[i])); } // Manage dynamic attributes if any @@ -447,9 +538,9 @@ void PreProcessorClass::device_factory(const Tango::DevVarStringArray *devlist_p } /*----- PROTECTED REGION ID(PreProcessorClass::device_factory_after) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::device_factory_after } //-------------------------------------------------------- @@ -462,16 +553,16 @@ void PreProcessorClass::device_factory(const Tango::DevVarStringArray *devlist_p void PreProcessorClass::attribute_factory(vector<Tango::Attr *> &att_list) { /*----- PROTECTED REGION ID(PreProcessorClass::attribute_factory_before) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::attribute_factory_before // Create a list of static attributes create_static_attribute_list(get_class_attr()->get_attr_list()); /*----- PROTECTED REGION ID(PreProcessorClass::attribute_factory_after) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::attribute_factory_after } //-------------------------------------------------------- @@ -484,9 +575,9 @@ void PreProcessorClass::attribute_factory(vector<Tango::Attr *> &att_list) void PreProcessorClass::command_factory() { /*----- PROTECTED REGION ID(PreProcessorClass::command_factory_before) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::command_factory_before @@ -509,9 +600,9 @@ void PreProcessorClass::command_factory() command_list.push_back(pOffCmd); /*----- PROTECTED REGION ID(PreProcessorClass::command_factory_after) ENABLED START -----*/ - + // Add your own code - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::command_factory_after } @@ -524,7 +615,7 @@ void PreProcessorClass::command_factory() * method : PreProcessorClass::create_static_attribute_list * description : Create the a list of static attributes * - * @param att_list the ceated attribute list + * @param att_list the ceated attribute list */ //-------------------------------------------------------- void PreProcessorClass::create_static_attribute_list(vector<Tango::Attr *> &att_list) @@ -539,7 +630,7 @@ void PreProcessorClass::create_static_attribute_list(vector<Tango::Attr *> &att_ cout2 << defaultAttList.size() << " attributes in default list" << endl; /*----- PROTECTED REGION ID(PreProcessorClass::create_static_att_list) ENABLED START -----*/ - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::create_static_att_list } @@ -558,10 +649,10 @@ void PreProcessorClass::erase_dynamic_attributes(const Tango::DevVarStringArray Tango::Util *tg = Tango::Util::instance(); for (unsigned long i=0 ; i<devlist_ptr->length() ; i++) - { + { Tango::DeviceImpl *dev_impl = tg->get_device_by_name(((string)(*devlist_ptr)[i]).c_str()); PreProcessor *dev = static_cast<PreProcessor *> (dev_impl); - + vector<Tango::Attribute *> &dev_att_list = dev->get_device_attr()->get_attribute_list(); vector<Tango::Attribute *>::iterator ite_att; for (ite_att=dev_att_list.begin() ; ite_att != dev_att_list.end() ; ++ite_att) @@ -580,7 +671,7 @@ void PreProcessorClass::erase_dynamic_attributes(const Tango::DevVarStringArray } } /*----- PROTECTED REGION ID(PreProcessorClass::erase_dynamic_attributes) ENABLED START -----*/ - + /*----- PROTECTED REGION END -----*/ // PreProcessorClass::erase_dynamic_attributes } -- GitLab