Commit 0720d5f1 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Laurent Claustre
Browse files

Add flip support to Frelon16, including Espia SG inv. for Dual-SPB8

parent 238cf1bb
......@@ -301,7 +301,7 @@ class FlipCtrlObj : public HwFlipCtrlObj
DEB_CLASS_NAMESPC(DebModCamera, "FlipCtrlObj", "Frelon");
public:
FlipCtrlObj(Camera& cam);
FlipCtrlObj(Espia::Acq& acq, Camera& cam);
virtual ~FlipCtrlObj();
virtual void setFlip(const Flip& flip);
......@@ -309,6 +309,7 @@ class FlipCtrlObj : public HwFlipCtrlObj
virtual void checkFlip(Flip& flip);
private:
Espia::Acq& m_acq;
Camera& m_cam;
};
......
......@@ -140,6 +140,7 @@ class Model
ChipType getChipType();
SPBConType getSPBConType();
GeomType getGeomType();
bool isFrelon16Dual();
bool has(Feature feature);
double getPixelSize();
......
......@@ -241,7 +241,7 @@ class FlipCtrlObj : HwFlipCtrlObj
%End
public:
FlipCtrlObj(Frelon::Camera& cam);
FlipCtrlObj(Espia::Acq& acq, Frelon::Camera& cam);
virtual ~FlipCtrlObj();
virtual void setFlip(const Flip& flip);
......
......@@ -90,6 +90,7 @@ class Model
Frelon::ChipType getChipType();
Frelon::SPBConType getSPBConType();
Frelon::GeomType getGeomType();
bool isFrelon16Dual();
bool has(Model::Feature feature);
double getPixelSize();
......
......@@ -355,12 +355,7 @@ void Geometry::checkFlip(Flip& flip)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(flip);
if (isFrelon16()) {
DEB_TRACE() << "No flip is supported";
flip = Flip(false);
} else {
DEB_TRACE() << "All standard flip modes are supported";
}
DEB_RETURN() << DEB_VAR1(flip);
}
......
......@@ -446,10 +446,8 @@ void BinCtrlObj::setBin(const Bin& bin)
FrameDim det_frame_dim;
m_cam.getFrameDim(det_frame_dim);
Size new_size = det_frame_dim.getSize() / bin;
if (new_size != prev_size) {
m_acq.bufferFree();
if (new_size != prev_size)
m_acq.setSGImgConfig(img_config, new_size);
}
if (m_bin_chg_cb) {
DEB_TRACE() << "Firing change callback";
......@@ -640,8 +638,8 @@ void RoiCtrlObj::unregisterRoiChangedCallback(RoiChangedCallback& roi_chg_cb)
* \brief FlipCtrlObj constructor
*******************************************************************/
FlipCtrlObj::FlipCtrlObj(Camera& cam)
: m_cam(cam)
FlipCtrlObj::FlipCtrlObj(Espia::Acq& acq, Camera& cam)
: m_acq(acq), m_cam(cam)
{
DEB_CONSTRUCTOR();
}
......@@ -654,7 +652,19 @@ FlipCtrlObj::~FlipCtrlObj()
void FlipCtrlObj::setFlip(const Flip& flip)
{
DEB_MEMBER_FUNCT();
m_cam.setFlip(flip);
if (!m_cam.getModel().isFrelon16Dual())
return;
Espia::SGImgConfig img_config = (flip.y ? Espia::SGImgConcatVertInv2 :
Espia::SGImgConcatVert2);
FrameDim det_frame_dim;
m_cam.getFrameDim(det_frame_dim);
Bin bin;
m_cam.getBin(bin);
det_frame_dim /= bin;
m_acq.setSGImgConfig(img_config, det_frame_dim.getSize());
}
void FlipCtrlObj::getFlip(Flip& flip)
......@@ -817,12 +827,12 @@ Interface::Interface(Espia::Acq& acq, BufferCtrlMgr& buffer_mgr,
Camera& cam)
: m_acq(acq), m_buffer_mgr(buffer_mgr), m_cam(cam),
m_det_info(cam), m_buffer(buffer_mgr), m_sync(acq, cam),
m_bin(acq, cam), m_roi(acq, cam), m_flip(cam), m_shutter(cam),
m_bin(acq, cam), m_roi(acq, cam), m_flip(acq, cam), m_shutter(cam),
m_acq_end_cb(cam), m_event_cb(m_event)
{
DEB_CONSTRUCTOR();
bool f16_dual = (m_cam.getModel().getGeomType() == SPB8_F16_Dual);
bool f16_dual = m_cam.getModel().isFrelon16Dual();
if (f16_dual != m_acq.getDev().isMeta())
THROW_HW_ERROR(Error) << "Frelon16 2xSPB8 / Espia mismatch";
Espia::SGImgConfig img_config = (f16_dual ? Espia::SGImgConcatVert2 :
......
......@@ -403,6 +403,14 @@ GeomType Model::getGeomType()
return geom_type;
}
bool Model::isFrelon16Dual()
{
DEB_MEMBER_FUNCT();
bool is_dual = (getGeomType() == SPB8_F16_Dual);
DEB_RETURN() << DEB_VAR1(is_dual);
return is_dual;
}
double Model::getPixelSize()
{
DEB_MEMBER_FUNCT();
......
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