diff --git a/src/SingleShotAO.cpp b/src/SingleShotAO.cpp index 80911971616622960f56ed9669f9cec2cbcc01f1..21f3c407deae2ba3c9d491c49d7d9b01ffb6ce28 100755 --- a/src/SingleShotAO.cpp +++ b/src/SingleShotAO.cpp @@ -505,9 +505,7 @@ void SingleShotAO::init_device() std::string attr_name = kINITIAL + oss.str(); std::string name = "__" + attr_name; - // To be activated with Tango 8 - //double l_val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this,name); - double l_val = get_memorized_attribute<double>(name); + double l_val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this,name); m_manager->set_initial(l_cpt, l_val); } catch (...) @@ -896,10 +894,7 @@ void SingleShotAO::write_speed(yat4tango::DynamicAttributeWriteCallbackData & cb "could not write initial [unknown error]", "SingleShotAO::write_initial"); } - // To be activated with Tango 8 - //yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val); - std::string name = "__" + l_attr_name; - store_value_as_property(l_val, name); + yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val); } @@ -969,10 +964,7 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData & "could not write initial [unknown error]", "SingleShotAO::write_initial"); } - // To be activated with Tango 8 - //yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val); - std::string name = "__" + l_attr_name; - store_value_as_property(l_val, name); + yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val); } diff --git a/src/SingleShotAO.h b/src/SingleShotAO.h index 61f5f60f7bf8ed1a287dead8d17a84f5219e134c..41ed3617534915d8456cfb8defab141e7a61e4d5 100755 --- a/src/SingleShotAO.h +++ b/src/SingleShotAO.h @@ -279,76 +279,6 @@ protected : //- channel number unsigned short m_nb_chan; - // To be deleted with Tango 8 - //- Template class to store a current value in a Device property. - //- \param value Value to store. - //- \param property_name Name to use. - template <class T> - void store_value_as_property(T value, std::string property_name) - { - Tango::DbDatum current_value(property_name); - current_value << value; - Tango::DbData db_data; - db_data.push_back(current_value); - - try - { - get_db_device()->put_property(db_data); - } - catch(Tango::DevFailed &df) - { - ERROR_STREAM << df << endl; - RETHROW_DEVFAILED(df, - "SOFTWARE_FAILURE", - "Error while storing properties in database", - "SingleShotAO::store_value_as_property"); - } - } - - // To be deleted with Tango 8 - //- Template class to get a memorized attribute stored as a Device property. - //- \param property_name Name od the property to read. - template <class T> - T get_memorized_attribute(const std::string& property_name) - { - T value; - if (!Tango::Util::instance()->_UseDb) - { - //- throw exception - THROW_DEVFAILED("DEVICE_ERROR", - "No DATA BASE!", - "SingleShotAO::get_memorized_attribute"); - } - - Tango::DbData dev_prop; - dev_prop.push_back(Tango::DbDatum(property_name)); - - try - { - get_db_device()->get_property(dev_prop); - } - catch (Tango::DevFailed &df) - { - //- rethrow exception - RETHROW_DEVFAILED(df, - "DEVICE_ERROR", - "could not get Device properties! [caught Tango::DevFailed]", - "SingleShotAO::get_memorized_attribute"); - } - - if (dev_prop[0].is_empty()==false) - { - dev_prop[0] >> value; - } - else - { - //- throw exception - THROW_DEVFAILED("DATA_ERROR", - "No property stored in database!", - "SingleShotAO::get_memorized_attribute"); - } - return value; - } }; } // namespace_ns