Skip to content
Snippets Groups Projects

develop -> main

4 files
+ 60
4
Compare changes
  • Side-by-side
  • Inline

Files

+ 46
4
@@ -348,6 +348,28 @@ void SingleShotAO::init_device()
@@ -348,6 +348,28 @@ void SingleShotAO::init_device()
}
}
 
// Make sure running processes are aborted properly
 
//--------------------------------------------
 
try
 
{
 
_abort();
 
}
 
catch (Tango::DevFailed &df)
 
{
 
ERROR_STREAM << df << endl;
 
RETHROW_DEVFAILED(df,
 
"DRIVER_FAILURE",
 
"could not abort [caught Tango::DevFailed]",
 
"SingleShotAO::init");
 
}
 
catch (...)
 
{
 
ERROR_STREAM << "SingleShotAO::init::unknown exception caught" << std::endl;
 
THROW_DEVFAILED("DRIVER_FAILURE",
 
"could not abort [unknown error]",
 
"SingleShotAO::init");
 
}
 
// Create dynamic attributes
// Create dynamic attributes
//--------------------------------------------
//--------------------------------------------
@@ -990,11 +1012,9 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData &
@@ -990,11 +1012,9 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData &
void SingleShotAO::abort()
void SingleShotAO::abort()
{
{
DEBUG_STREAM << "SingleShotAO::abort(): entering... !" << endl;
DEBUG_STREAM << "SingleShotAO::abort(): entering... !" << endl;
CHECK_MANAGER();
try
try
{
{
m_manager->abort();
_abort();
}
}
catch(Tango::DevFailed& df)
catch(Tango::DevFailed& df)
{
{
@@ -1006,11 +1026,33 @@ void SingleShotAO::abort()
@@ -1006,11 +1026,33 @@ void SingleShotAO::abort()
}
}
catch(...)
catch(...)
{
{
ERROR_STREAM << "SingleShotAOManager::abort::unknown exception caught"<<std::endl;
ERROR_STREAM << "SingleShotAO::abort::unknown exception caught"<< std::endl;
THROW_DEVFAILED("DRIVER_FAILURE",
THROW_DEVFAILED("DRIVER_FAILURE",
"could not abort [unknown error]",
"could not abort [unknown error]",
"SingleShotAO::abort");
"SingleShotAO::abort");
}
}
}
}
 
void SingleShotAO::_abort()
 
{
 
CHECK_MANAGER();
 
 
// memorize the current initial_values and value of channels
 
for (unsigned int l_cpt = 0; l_cpt < m_nb_chan; l_cpt++)
 
{
 
if (m_manager->is_running(l_cpt)) {
 
DEBUG_STREAM << "Channel " << l_cpt << " is running. Memorizing values..." << std::endl;
 
 
double l_val_channel = m_manager->get_channel(l_cpt);
 
yat4tango::PropertyHelper::set_memorized_attribute(this, kCHANNEL + std::to_string(l_cpt), l_val_channel);
 
DEBUG_STREAM << "Memorizing channel " << l_cpt << " to " << l_val_channel << std::endl;
 
 
double l_val_initial = m_manager->get_initial(l_cpt);
 
yat4tango::PropertyHelper::set_memorized_attribute(this, kINITIAL + std::to_string(l_cpt), l_val_initial);
 
DEBUG_STREAM << "Memorizing initial " << l_cpt << " to " << l_val_initial << std::endl;
 
}
 
}
 
m_manager->abort();
 
}
 
} // namespace
} // namespace
Loading