Skip to content
Snippets Groups Projects
Commit 7a0c0347 authored by BAHJI's avatar BAHJI
Browse files

[ICATHALES-416] check the AxisDefinition value

parent 48dfeee7
Branches
No related tags found
1 merge request!3[PIController] Add PIAxis commands and attributes
......@@ -162,7 +162,8 @@ void PIAxis::init_device()
m_is_device_initialized = false;
m_status_message.str("Initialization in progress...");
try
{
/*----- PROTECTED REGION END -----*/ // PIAxis::init_device_before
......@@ -170,6 +171,20 @@ void PIAxis::init_device()
get_device_property();
/*----- PROTECTED REGION ID(PIAxis::init_device) ENABLED START -----*/
}
catch (Tango::DevFailed & df)
{
m_status_message << "initialization Failed [<get_device_property> error]: " << string(df.errors[0].desc) << std::endl;;
ERROR_STREAM << m_status_message << std::endl;
return;
}
catch (...)
{
m_status_message << "initialization Failed [unknown <get_device_property> error]" << std::endl;
ERROR_STREAM << "initialization Failed - unknown <get_device_property> error" << std::endl;
return;
}
try
{
m_axis_controller.reset(new AxisController(this, axisDefinition), yat4tango::DeviceTaskExiter());
......@@ -249,6 +264,16 @@ void PIAxis::get_device_property()
// Check device property data members init
yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, "0", "AxisDefinition");
//check the AxisDefinition value
std::stringstream axis_id_str("");
axis_id_str << axisDefinition;
if (!(yat::StringUtil::to_num<int>(axis_id_str.str()) > 0))
{
ERROR_STREAM << "The AxisDefinition property must be filled with at value greater than 0" << std::endl;
THROW_DEVFAILED("CONFIGURATION_ERROR",
"The AxisDefinition property must be filled with at value greater than 0",
"PIAxis::get_device_property ");
}
/*----- PROTECTED REGION END -----*/ // PIAxis::get_device_property_after
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment