Skip to content
Snippets Groups Projects
Commit 1e77157f authored by Alexandre MALFREYT's avatar Alexandre MALFREYT
Browse files

cleanup: fix typos, formatting and improve comments in SingleShotAO and SingleShotAOManager

parent a6daeef3
No related branches found
No related tags found
2 merge requests!4develop -> main,!2[CTRLRFC-1594] Apply memorized dynamic attributes at init
......@@ -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
......@@ -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,12 +279,12 @@ 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)
{
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",
......@@ -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",
......@@ -441,5 +441,5 @@ void SingleShotAOManager::abort()
}
}
}
} // namespace SingleShotAO_ns
} // namespace SingleShotAO_ns
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment