Skip to content
Snippets Groups Projects
Commit a2ad9a5a authored by DESGRANGES's avatar DESGRANGES
Browse files

Throw execptions for read/write operations on acceleration and deceleration attributes if E-754

parent 5b9b6f38
Branches
Tags
1 merge request!3[PIController] Add PIAxis commands and attributes
...@@ -482,6 +482,14 @@ void PIAxis::read_acceleration(Tango::Attribute &attr) ...@@ -482,6 +482,14 @@ void PIAxis::read_acceleration(Tango::Attribute &attr)
*attr_acceleration_read = m_axis_controller->read_acceleration(); *attr_acceleration_read = m_axis_controller->read_acceleration();
attr.set_value(attr_acceleration_read); attr.set_value(attr_acceleration_read);
} }
else
{
std::stringstream ss;
ss << "aCceleration is not handled by this PI Controller" << std::endl;
Tango::Except::throw_exception("TANGO_DEVICE_ERROR",
(ss.str()).c_str(),
"PIAxis::read_acceleration()");
}
/*----- PROTECTED REGION END -----*/ // PIAxis::read_acceleration /*----- PROTECTED REGION END -----*/ // PIAxis::read_acceleration
} }
...@@ -505,6 +513,14 @@ void PIAxis::write_acceleration(Tango::WAttribute &attr) ...@@ -505,6 +513,14 @@ void PIAxis::write_acceleration(Tango::WAttribute &attr)
{ {
m_axis_controller->write_acceleration(w_val); m_axis_controller->write_acceleration(w_val);
} }
else
{
std::stringstream ss;
ss << "acceleration is not handled by this PI Controller" << std::endl;
Tango::Except::throw_exception("TANGO_DEVICE_ERROR",
(ss.str()).c_str(),
"PIAxis::write_acceleration()");
}
/*----- PROTECTED REGION END -----*/ // PIAxis::write_acceleration /*----- PROTECTED REGION END -----*/ // PIAxis::write_acceleration
} }
...@@ -528,7 +544,14 @@ void PIAxis::read_deceleration(Tango::Attribute &attr) ...@@ -528,7 +544,14 @@ void PIAxis::read_deceleration(Tango::Attribute &attr)
*attr_deceleration_read = m_axis_controller->read_deceleration(); *attr_deceleration_read = m_axis_controller->read_deceleration();
attr.set_value(attr_deceleration_read); attr.set_value(attr_deceleration_read);
} }
else
{
std::stringstream ss;
ss << "deceleration is not handled by this PI Controller" << std::endl;
Tango::Except::throw_exception("TANGO_DEVICE_ERROR",
(ss.str()).c_str(),
"PIAxis::read_deceleration()");
}
/*----- PROTECTED REGION END -----*/ // PIAxis::read_deceleration /*----- PROTECTED REGION END -----*/ // PIAxis::read_deceleration
} }
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -551,7 +574,14 @@ void PIAxis::write_deceleration(Tango::WAttribute &attr) ...@@ -551,7 +574,14 @@ void PIAxis::write_deceleration(Tango::WAttribute &attr)
{ {
m_axis_controller->write_deceleration(w_val); m_axis_controller->write_deceleration(w_val);
} }
else
{
std::stringstream ss;
ss << "deceleration is not handled by this PI Controller" << std::endl;
Tango::Except::throw_exception("TANGO_DEVICE_ERROR",
(ss.str()).c_str(),
"PIAxis::write_deceleration()");
}
/*----- PROTECTED REGION END -----*/ // PIAxis::write_deceleration /*----- PROTECTED REGION END -----*/ // PIAxis::write_deceleration
} }
//-------------------------------------------------------- //--------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment