Commit 8a095dd4 authored by Laurent Claustre's avatar Laurent Claustre
Browse files

Merge branch '7-pilatus-s-series-do-not-support-hw-roi' into 'master'

Resolve "Pilatus S series do not support hw ROI"

Closes #7

See merge request !13
parents 6778e602 d03de439
Pipeline #48200 passed with stages
in 13 minutes and 31 seconds
...@@ -80,10 +80,12 @@ public: ...@@ -80,10 +80,12 @@ public:
double getMinLatTime() const; double getMinLatTime() const;
bool isPilatus2() const {return m_is_pilatus2;} bool isPilatus2() const {return m_is_pilatus2;}
bool isPilatus3() const {return m_is_pilatus3;} bool isPilatus3() const {return m_is_pilatus3;}
bool isSSerie() const {return m_is_s_serie;}
private: private:
Info m_info; Info m_info;
bool m_is_pilatus2; bool m_is_pilatus2;
bool m_is_pilatus3; bool m_is_pilatus3;
bool m_is_s_serie;
Camera& m_cam; Camera& m_cam;
}; };
......
...@@ -37,6 +37,8 @@ using namespace lima::Pilatus; ...@@ -37,6 +37,8 @@ using namespace lima::Pilatus;
static const char CAMERA_NAME_TOKEN[] = "camera_name"; static const char CAMERA_NAME_TOKEN[] = "camera_name";
static const char CAMERA_WIDE_TOKEN[] = "camera_wide"; static const char CAMERA_WIDE_TOKEN[] = "camera_wide";
static const char CAMERA_HIGH_TOKEN[] = "camera_high"; static const char CAMERA_HIGH_TOKEN[] = "camera_high";
static const char CAMERA_S_SERIE_TOKEN[] = "camera_s_serie";
static const char CAMERA_PILATUS3_TOKEN[] = "PILATUS3"; static const char CAMERA_PILATUS3_TOKEN[] = "PILATUS3";
static const char FILE_PATTERN[] = "tmp_img_%.7d.edf"; static const char FILE_PATTERN[] = "tmp_img_%.7d.edf";
...@@ -53,7 +55,8 @@ static const float P3_6M_MAX_FREQUENCY[3] = {100, 200, 500}; //full, c18, c2 ...@@ -53,7 +55,8 @@ static const float P3_6M_MAX_FREQUENCY[3] = {100, 200, 500}; //full, c18, c2
* \param info if info is NULL look for ~det/p2_det/config/cam_data/camera.def file * \param info if info is NULL look for ~det/p2_det/config/cam_data/camera.def file
*******************************************************************/ *******************************************************************/
DetInfoCtrlObj::DetInfoCtrlObj(Camera& cam,const DetInfoCtrlObj::Info* info): DetInfoCtrlObj::DetInfoCtrlObj(Camera& cam,const DetInfoCtrlObj::Info* info):
m_cam(cam) m_cam(cam),
m_is_s_serie(false)
{ {
DEB_CONSTRUCTOR(); DEB_CONSTRUCTOR();
if(info) if(info)
...@@ -103,6 +106,12 @@ DetInfoCtrlObj::DetInfoCtrlObj(Camera& cam,const DetInfoCtrlObj::Info* info): ...@@ -103,6 +106,12 @@ DetInfoCtrlObj::DetInfoCtrlObj(Camera& cam,const DetInfoCtrlObj::Info* info):
while(*aPt && (*aPt < '1' || *aPt > '9')) ++aPt; while(*aPt && (*aPt < '1' || *aPt > '9')) ++aPt;
aWidth = atoi(aPt); aWidth = atoi(aPt);
} }
else if(!strncmp(aReadBuffer,
CAMERA_S_SERIE_TOKEN,sizeof(CAMERA_S_SERIE_TOKEN) - 1))
{
m_is_s_serie = true;
}
} }
if(aWidth <= 0 || aHeight <= 0) if(aWidth <= 0 || aHeight <= 0)
{ {
...@@ -110,6 +119,11 @@ DetInfoCtrlObj::DetInfoCtrlObj(Camera& cam,const DetInfoCtrlObj::Info* info): ...@@ -110,6 +119,11 @@ DetInfoCtrlObj::DetInfoCtrlObj(Camera& cam,const DetInfoCtrlObj::Info* info):
THROW_HW_ERROR(Error) << "Can't get detector info"; THROW_HW_ERROR(Error) << "Can't get detector info";
} }
m_info.m_det_size = Size(aWidth,aHeight); m_info.m_det_size = Size(aWidth,aHeight);
if (m_is_s_serie )
m_info.m_det_model += ", S serie";
else
m_info.m_det_model += ", X serie";
fclose(aConfFile); fclose(aConfFile);
} }
} }
...@@ -413,7 +427,13 @@ RoiCtrlObj::RoiCtrlObj(Camera& cam,DetInfoCtrlObj& det) : ...@@ -413,7 +427,13 @@ RoiCtrlObj::RoiCtrlObj(Camera& cam,DetInfoCtrlObj& det) :
int c18_max_frequency = -1; int c18_max_frequency = -1;
int c2_max_frequency = -1; int c2_max_frequency = -1;
if(detImageSize == Size(2463,2527)) // Pilatus 6M // S (versus X) series do not have hardware ROI capability
// need the camera.conf file patched with keyword "camera_s_serie"
if (det.isSSerie())
{
m_has_hardware_roi = false;
}
else if(detImageSize == Size(2463,2527)) // Pilatus 6M
{ {
if(det.isPilatus2()) if(det.isPilatus2())
{ {
...@@ -502,9 +522,7 @@ RoiCtrlObj::RoiCtrlObj(Camera& cam,DetInfoCtrlObj& det) : ...@@ -502,9 +522,7 @@ RoiCtrlObj::RoiCtrlObj(Camera& cam,DetInfoCtrlObj& det) :
3 * MODULE_HEIGHT + 2 * MODULE_HEIGHT_SPACE); 3 * MODULE_HEIGHT + 2 * MODULE_HEIGHT_SPACE);
m_possible_rois.push_back(PATTERN2ROI(Pattern("L3",500),l3)); m_possible_rois.push_back(PATTERN2ROI(Pattern("L3",500),l3));
} }
else
m_has_hardware_roi = false;
if(!m_has_hardware_roi) if(!m_has_hardware_roi)
DEB_WARNING() << "Hardware Roi not managed for this detector"; DEB_WARNING() << "Hardware Roi not managed for this detector";
...@@ -725,8 +743,8 @@ private: ...@@ -725,8 +743,8 @@ private:
Interface::Interface(Camera& cam,const DetInfoCtrlObj::Info* info) Interface::Interface(Camera& cam,const DetInfoCtrlObj::Info* info)
: m_cam(cam), : m_cam(cam),
m_det_info(cam, info), m_det_info(cam, info),
m_buffer_cbk(new Interface::_BufferCallback(*this)),
m_roi(cam, m_det_info), m_roi(cam, m_det_info),
m_buffer_cbk(new Interface::_BufferCallback(*this)),
m_sync(cam,m_det_info, m_roi), m_sync(cam,m_det_info, m_roi),
m_saving(cam), m_saving(cam),
m_buffer(cam.tmpFsPath(), FILE_PATTERN, *m_buffer_cbk) m_buffer(cam.tmpFsPath(), FILE_PATTERN, *m_buffer_cbk)
...@@ -745,9 +763,14 @@ Interface::Interface(Camera& cam,const DetInfoCtrlObj::Info* info) ...@@ -745,9 +763,14 @@ Interface::Interface(Camera& cam,const DetInfoCtrlObj::Info* info)
HwSavingCtrlObj *saving = &m_saving; HwSavingCtrlObj *saving = &m_saving;
m_cap_list.push_back(HwCap(saving)); m_cap_list.push_back(HwCap(saving));
HwRoiCtrlObj *roi = &m_roi; // S (versus X) series do not have hardware ROI capability
m_cap_list.push_back(HwCap(roi)); // need the camera.conf file patched with keyword "camera_s_serie"
if (!m_det_info.isSSerie())
{
HwRoiCtrlObj *roi = &m_roi;
m_cap_list.push_back(HwCap(roi));
}
m_buffer.getDirectoryEvent().watch_moved_to(); m_buffer.getDirectoryEvent().watch_moved_to();
//Activate new pilatus3 threshold method //Activate new pilatus3 threshold method
......
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