Skip to content
Snippets Groups Projects
Commit bc2fc5df authored by Sonia Minolli's avatar Sonia Minolli
Browse files

Add try/catch for memorized values at init

parent d48da588
Branches
Tags
No related merge requests found
......@@ -9,7 +9,7 @@
<groupId>fr.soleil.device</groupId>
<artifactId>XPSV2-${aol}-${mode}</artifactId>
<version>1.4.9-SNAPSHOT</version>
<version>1.4.9</version>
<packaging>nar</packaging>
......
......@@ -233,6 +233,8 @@ namespace XPSAxis_ns
// - velocity
// - accuracy
try
{
//restore offset TANGODEVIC-1065
double loffset = yat4tango::PropertyHelper::get_memorized_attribute<double>(this, "offset", yat::IEEE_NAN);
if (! yat::is_nan (loffset))
......@@ -253,7 +255,21 @@ namespace XPSAxis_ns
double laccu = yat4tango::PropertyHelper::get_memorized_attribute<double>(this, "accuracy", yat::IEEE_NAN);
if (! yat::is_nan (laccu))
positioner->set_accuracy (laccu);
}
catch(Tango::DevFailed &e)
{
FATAL_STREAM << "XPSAxis::init_device() : caught DevFailed <" << e.errors[0].desc << "> unable to set memorized values [check XPS controller network connection]" << endl;
FATAL_STREAM << e << endl;
status_str = "caught (...) <" + std::string (e.errors [0].desc) + "> unable to set memorized values [check XPS controller network connection]";
return;
}
catch(...)
{
FATAL_STREAM << "XPSAxis::init_device() : caught (...) unable to set memorized values [check XPS controller network connection]" << endl;
set_state(Tango::FAULT);
set_status("caught (...) unable to set memorized values [check XPS controller network connection]");
return;
}
// get current position from hw
double current_pos = positioner->get_position ();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment