Commit d12d208d authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Eiger: add fixed_clock_div

parent 5a3bf212
......@@ -85,6 +85,8 @@ class Eiger : public Model
void setParallelMode(ParallelMode mode);
void getParallelMode(ParallelMode& mode);
void setFixedClockDiv(bool fixed_clock_div);
void getFixedClockDiv(bool& fixed_clock_div);
void setClockDiv(ClockDiv clock_div);
void getClockDiv(ClockDiv& clock_div);
......@@ -361,6 +363,8 @@ class Eiger : public Model
FrameDim m_recv_frame_dim;
CorrList m_corr_list;
PortGeometryList m_port_geom_list;
bool m_fixed_clock_div;
ClockDiv m_clock_div;
};
std::ostream& operator <<(std::ostream& os, Eiger::ParallelMode mode);
......
......@@ -69,6 +69,8 @@ class Eiger : public SlsDetector::Model
void setParallelMode(SlsDetector::Eiger::ParallelMode mode);
void getParallelMode(SlsDetector::Eiger::ParallelMode& mode);
void setFixedClockDiv(bool fixed_clock_div);
void getFixedClockDiv(bool& fixed_clock_div);
void setClockDiv(SlsDetector::Defs::ClockDiv clock_div);
void getClockDiv(SlsDetector::Defs::ClockDiv& clock_div /Out/);
......
......@@ -300,7 +300,7 @@ void Eiger::RecvPortGeometry::expandPixelDepth4(FrameType frame, char *ptr)
}
Eiger::Eiger(Camera *cam)
: Model(cam, EigerDet)
: Model(cam, EigerDet), m_fixed_clock_div(false)
{
DEB_CONSTRUCTOR();
......@@ -315,6 +315,8 @@ Eiger::Eiger(Camera *cam)
}
updateCameraModel();
getClockDiv(m_clock_div);
}
Eiger::~Eiger()
......@@ -545,6 +547,24 @@ void Eiger::updateImageSize()
if (getNbEigerModules() > 1)
createInterModGapCorr();
if (m_fixed_clock_div) {
ClockDiv curr_clock_div;
getClockDiv(curr_clock_div);
if (curr_clock_div != m_clock_div) {
try {
DEB_ALWAYS() << "Restoring "
<< DEB_VAR1(m_clock_div);
setClockDiv(m_clock_div);
} catch (...) {
DEB_WARNING() << "Could not set "
<< DEB_VAR1(m_clock_div) << " "
<< "keeping "
<< DEB_VAR1(curr_clock_div);
m_clock_div = curr_clock_div;
}
}
}
}
bool Eiger::checkSettings(Settings settings)
......@@ -578,11 +598,26 @@ void Eiger::getParallelMode(ParallelMode& mode)
DEB_RETURN() << DEB_VAR1(mode);
}
void Eiger::setFixedClockDiv(bool fixed_clock_div)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(fixed_clock_div);
m_fixed_clock_div = fixed_clock_div;
}
void Eiger::getFixedClockDiv(bool& fixed_clock_div)
{
DEB_MEMBER_FUNCT();
fixed_clock_div = m_fixed_clock_div;
DEB_RETURN() << DEB_VAR1(fixed_clock_div);
}
void Eiger::setClockDiv(ClockDiv clock_div)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(clock_div);
m_det->setClockDivider(clock_div);
m_clock_div = clock_div;
updateTimeRanges();
}
......
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