Skip to content
Snippets Groups Projects

develop -> main

3 files
+ 41
26
Compare changes
  • Side-by-side
  • Inline

Files

+ 20
25
@@ -489,32 +489,25 @@ void SingleShotAO::init_device()
@@ -489,32 +489,25 @@ void SingleShotAO::init_device()
yat::OSStream oss;
yat::OSStream oss;
oss << l_cpt;
oss << l_cpt;
// speed value
// Helper function to get and set memorized attributes
try
auto applyMemorizedAttr = [&](const std::string& attrPrefix,
{
void (SingleShotAOManager::*setter)(yat::uint16, double))
std::string attr_name = kSPEED + oss.str();
std::string name = "__" + attr_name;
double l_val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this, name);
m_manager->set_speed(l_cpt, l_val);
}
catch (...) {
// nothing to do
}
// initial value
try
{
{
std::string attr_name = kINITIAL + oss.str();
try {
std::string name = "__" + attr_name;
std::string attrName = attrPrefix + oss.str();
double val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this, attrName);
double l_val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this,name);
(m_manager->*setter)(l_cpt, val);
m_manager->set_initial(l_cpt, l_val);
}
}
catch (...) {
catch (...)
// nothing to do
{
}
//nothing to do
};
}
 
// Get and set memorized values for speed, initial and channel
 
applyMemorizedAttr(kSPEED, &SingleShotAOManager::set_speed);
 
applyMemorizedAttr(kINITIAL, &SingleShotAOManager::set_initial);
 
applyMemorizedAttr(kCHANNEL, &SingleShotAOManager::set_channel);
 
// TODO: add a property to call write_channel instead of set_channel (false by default)
}
}
//- GO for task
//- GO for task
@@ -850,6 +843,8 @@ void SingleShotAO::write_channel(yat4tango::DynamicAttributeWriteCallbackData &
@@ -850,6 +843,8 @@ void SingleShotAO::write_channel(yat4tango::DynamicAttributeWriteCallbackData &
"could not write channel [unknown error]",
"could not write channel [unknown error]",
"SingleShotAO::write_channel");
"SingleShotAO::write_channel");
}
}
 
 
yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val);
}
}
Loading