diff --git a/src/SingleShotAO.cpp b/src/SingleShotAO.cpp index 2c26d31c3fa9e5281e22473b6689de8e4f6f1dd5..65643b0841fb2f5c04b6853aa18f5b275538deea 100755 --- a/src/SingleShotAO.cpp +++ b/src/SingleShotAO.cpp @@ -326,7 +326,6 @@ void SingleShotAO::init_device() DEBUG_STREAM << "Failed to get frequency value. Maybe there is no value yet." << std::endl; } - // initialize the AO manager //-------------------------------------------- try @@ -348,6 +347,10 @@ void SingleShotAO::init_device() return; } + + // Create dynamic attributes + //-------------------------------------------- + // create dynamic attribute manager try { @@ -495,8 +498,7 @@ void SingleShotAO::init_device() double l_val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this, name); m_manager->set_speed(l_cpt, l_val); } - catch (...) - { + catch (...) { // nothing to do } @@ -903,16 +905,17 @@ void SingleShotAO::write_speed(yat4tango::DynamicAttributeWriteCallbackData & cb ERROR_STREAM << df<< endl; RETHROW_DEVFAILED(df, "DRIVER_FAILURE", - "could not write initial [caught Tango::DevFailed]", - "SingleShotAO::write_initial"); + "could not write speed [caught Tango::DevFailed]", + "SingleShotAO::write_speed"); } catch(...) { - ERROR_STREAM << "SingleShotAO::write_initial::unknown exception caught"<<std::endl; + ERROR_STREAM << "SingleShotAO::write_speed::unknown exception caught" << std::endl; THROW_DEVFAILED("DRIVER_FAILURE", - "could not write initial [unknown error]", - "SingleShotAO::write_initial"); + "could not write speed [unknown error]", + "SingleShotAO::write_speed"); } + yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val); } @@ -975,6 +978,7 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData & "could not write initial [unknown error]", "SingleShotAO::write_initial"); } + yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val); } @@ -986,14 +990,12 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData & * description: method to execute "Abort" * Aborts ramps in progress. * - * */ //+------------------------------------------------------------------ void SingleShotAO::abort() { DEBUG_STREAM << "SingleShotAO::abort(): entering... !" << endl; - // Add your own code to control device here CHECK_MANAGER(); try { @@ -1014,7 +1016,6 @@ void SingleShotAO::abort() "could not abort [unknown error]", "SingleShotAO::abort"); } - } } // namespace diff --git a/src/SingleShotAOManager.cpp b/src/SingleShotAOManager.cpp index 7e708181d89dcdf4301471c371e5190653ee0d5f..e78806d397222a4a9c5757559e1eec7813dd60a8 100755 --- a/src/SingleShotAOManager.cpp +++ b/src/SingleShotAOManager.cpp @@ -270,7 +270,7 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val) { DEBUG_STREAM << "write_channel " << p_chIdx << " : " << p_val << endl; - // if the speed is 0, write the value directly + // if the speed is 0, write the value directly and skip ramp if (m_speeds[p_chIdx] == 0.0) { try @@ -279,21 +279,21 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val) m_ssao->write_scaled_channel((adl::ChanId)p_chIdx, p_val); m_channels[p_chIdx] = p_val; m_initials[p_chIdx] = p_val; - DEBUG_STREAM << "Speed is 0, writing directly the value" << endl; + DEBUG_STREAM << "Speed is 0, writing directly the value" << std::endl; } - catch(const asl::DAQException& de) + catch (const asl::DAQException &de) { Tango::DevFailed df = daq_to_tango_exception(de); - ERROR_STREAM << df << endl; + ERROR_STREAM << df << std::endl; m_state = Tango::FAULT; RETHROW_DEVFAILED(df, "DRIVER_FAILURE", "could not write channel [caught asl::DAQException]", "SingleShotAOManager::write_channel"); } - catch(...) + catch (...) { - ERROR_STREAM << "SingleShotAOManager::write_channel::unknown exception caught"<<std::endl; + ERROR_STREAM << "SingleShotAOManager::write_channel::unknown exception caught" << std::endl; m_state = Tango::FAULT; THROW_DEVFAILED("DRIVER_FAILURE", "could not write channel [unknown error]", @@ -302,7 +302,7 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val) return; } - // if a ramp is not running, error + // if a ramp is running, error if (m_isRunning[p_chIdx]) { THROW_DEVFAILED("DEVICE_FAILURE", @@ -428,8 +428,8 @@ void SingleShotAOManager::set_speed(ChannelId_t p_chIdx, Intial_t p_speed) // ============================================================================ void SingleShotAOManager::abort() { - //test all channels and abort current ramps - for (unsigned int l_cpt = 0;l_cpt < m_nb_chan;l_cpt++) + // test all channels and abort current ramps + for (unsigned int l_cpt = 0; l_cpt < m_nb_chan; l_cpt++) { if (m_isRunning[l_cpt]) { @@ -441,5 +441,5 @@ void SingleShotAOManager::abort() } } } -} // namespace SingleShotAO_ns +} // namespace SingleShotAO_ns diff --git a/src/SingleShotAOManager.h b/src/SingleShotAOManager.h index 27e73ced03b88b1dbe5300aeaa4272ff12a586b8..05be89df61acb708344d4fbf6ad61af5c22989c8 100755 --- a/src/SingleShotAOManager.h +++ b/src/SingleShotAOManager.h @@ -59,10 +59,10 @@ public: //- change period void write_frequency(double p_frequency); - //- get inital + //- get initial Intial_t get_initial(ChannelId_t p_chIdx); - //- set inital + //- set initial void set_initial(ChannelId_t p_chIdx, Intial_t p_initial); //- get speed