Commit 5abfcea0 authored by Sebastien Petitdemange's avatar Sebastien Petitdemange
Browse files

Workaround for the buggy setthreshold command

parent b581909c
......@@ -143,6 +143,7 @@ private:
void _resync();
void _reinit();
void _pilatus3model(); ///< set pilatus3 threshold extention
void _work_around_threshold_bug();
std::map<std::string,Gain> GAIN_SERVER_RESPONSE;
std::map<Gain,std::string> GAIN_VALUE2SERVER;
......
......@@ -305,6 +305,18 @@ void Camera::_pilatus3model()
m_pilatus3_threshold_mode = true;
}
//-----------------------------------------------------
// This method will reset threshold if it's a pilatus3
// and bugged version
//-----------------------------------------------------
void Camera::_work_around_threshold_bug()
{
if(m_pilatus3_threshold_mode &&
m_major_version <= 7 &&
m_minor_version <= 4 &&
m_patch_version <= 3)
send("setthreshold 0");
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void Camera::send(const std::string& message)
......@@ -721,6 +733,8 @@ void Camera::setEnergy(double val)
"Could not set energy, server is not idle");
if(m_has_cmd_setenergy)
{
_work_around_threshold_bug();
m_state = Camera::SETTING_ENERGY;
std::stringstream msg;
msg << "setenergy " << val*1000;
......@@ -807,6 +821,8 @@ void Camera::setThreshold(int threshold,int energy)
RECONNECT_WAIT_UNTIL(Camera::STANDBY,
"Could not set threshold,server is not idle");
_work_around_threshold_bug();
m_state = Camera::SETTING_THRESHOLD;
if(energy < 0)
{
......
Supports Markdown
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