Commit 28406b63 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

Check CamStatus at startup and initialize if not idle or ready

parent e05c9f56
Pipeline #21546 failed with stages
in 1 minute and 15 seconds
......@@ -120,6 +120,11 @@ Camera::Camera(const std::string& detector_ip, ///< [in] Ip address of the dete
DEB_PARAM() << DEB_VAR1(detector_ip);
// Init EigerAPI
try {
std::string status = getCamStatus();
DEB_TRACE() << DEB_VAR1(status);
if ((status != "idle") && (status != "ready"))
THROW_HW_ERROR(Error) << "Camera is not idle/ready. "
<< "Forcing initialization";
_synchronize();
} catch(Exception& e) {
DEB_ALWAYS() << "Could not get configuration parameters, try to initialize";
......@@ -599,6 +604,7 @@ std::string Camera::getCamStatus()
DEB_MEMBER_FUNCT();
std::string status;
getParam(Requests::DETECTOR_STATUS,status);
DEB_RETURN() << DEB_VAR1(status);
return status;
}
//-----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment