mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 11:20:04 +02:00
users: added setroi and getroi, modified multi to allow imod for setroi on sls level, modified detectorsize to set a single roi or give roi if only one roi
This commit is contained in:
parent
c611523352
commit
2cebec90ee
@ -3261,7 +3261,10 @@ void multiSlsDetector::verifyMinMaxROI(int n, ROI r[]) {
|
||||
}
|
||||
}
|
||||
|
||||
int multiSlsDetector::setROI(int n, ROI roiLimits[]) {
|
||||
int multiSlsDetector::setROI(int n, ROI roiLimits[], int imod) {
|
||||
if (imod > 0 && imod < (int)detectors.size()) {
|
||||
return detectors[imod]->setROI(n, roiLimits, imod);
|
||||
}
|
||||
int ret1 = -100, ret;
|
||||
int i, xmin, xmax, ymin, ymax, channelX, channelY, idet, lastChannelX,
|
||||
lastChannelY, index, offsetX, offsetY;
|
||||
@ -3393,8 +3396,10 @@ int multiSlsDetector::setROI(int n, ROI roiLimits[]) {
|
||||
}
|
||||
|
||||
|
||||
slsDetectorDefs::ROI* multiSlsDetector::getROI(int& n) {
|
||||
|
||||
slsDetectorDefs::ROI* multiSlsDetector::getROI(int& n, int imod) {
|
||||
if (imod > 0 && imod < (int)detectors.size()) {
|
||||
return detectors[imod]->getROI(n, imod);
|
||||
}
|
||||
n = 0;
|
||||
int num = 0, i, j;
|
||||
int ndet = detectors.size();
|
||||
|
@ -1222,16 +1222,18 @@ public:
|
||||
* At the moment only one set allowed
|
||||
* @param n number of rois
|
||||
* @param roiLimits array of roi
|
||||
* @param imod module number (-1 for all)
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int setROI(int n=-1,ROI roiLimits[]=NULL);
|
||||
int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1);
|
||||
|
||||
/**
|
||||
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
||||
* @param n number of rois
|
||||
* @returns OK or FAIL
|
||||
* @param imod module number (-1 for all)
|
||||
* @returns pointer to array of ROI structure
|
||||
*/
|
||||
ROI* getROI(int &n);
|
||||
ROI* getROI(int &n, int imod = -1);
|
||||
|
||||
/**
|
||||
* Write to ADC register (Gotthard, Jungfrau, ChipTestBoard). For expert users
|
||||
|
@ -6017,7 +6017,7 @@ int slsDetector::setCounterBit(int i) {
|
||||
|
||||
|
||||
|
||||
int slsDetector::setROI(int n,ROI roiLimits[]) {
|
||||
int slsDetector::setROI(int n,ROI roiLimits[], int imod) {
|
||||
int ret = FAIL;
|
||||
//sort ascending order
|
||||
int temp;
|
||||
@ -6053,7 +6053,7 @@ int slsDetector::setROI(int n,ROI roiLimits[]) {
|
||||
}
|
||||
|
||||
|
||||
slsDetectorDefs::ROI* slsDetector::getROI(int &n) {
|
||||
slsDetectorDefs::ROI* slsDetector::getROI(int &n, int imod) {
|
||||
sendROI(-1,NULL);
|
||||
n=thisDetector->nROI;
|
||||
if(thisDetector->myDetectorType==JUNGFRAUCTB) getTotalNumberOfChannels();
|
||||
|
@ -1500,16 +1500,18 @@ public:
|
||||
* At the moment only one set allowed
|
||||
* @param n number of rois
|
||||
* @param roiLimits array of roi
|
||||
* @param imod module number (ignored)
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int setROI(int n=-1,ROI roiLimits[]=NULL);
|
||||
int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1);
|
||||
|
||||
/**
|
||||
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
||||
* @param n number of rois
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
slsDetectorDefs::ROI* getROI(int &n);
|
||||
/**
|
||||
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
||||
* @param n number of rois
|
||||
* @param imod module number (ignored)
|
||||
* @returns pointer to array of ROI structure
|
||||
*/
|
||||
ROI* getROI(int &n, int imod = -1);
|
||||
|
||||
/**
|
||||
* Returns number of rois
|
||||
|
@ -4534,7 +4534,7 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
|
||||
ret=myDet->setDynamicRange(val);
|
||||
} else if (cmd=="roi") {
|
||||
ROI* r = myDet->getROI(ret);
|
||||
if (r != NULL)
|
||||
if (myDet->isMultiSlsDetectorClass() && r != NULL)
|
||||
delete [] r;
|
||||
} else if (cmd=="detsizechan") {
|
||||
sprintf(ans,"%d %d",myDet->getMaxNumberOfChannelsPerDetector(X),myDet->getMaxNumberOfChannelsPerDetector(Y));
|
||||
@ -6997,7 +6997,7 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
|
||||
}
|
||||
}
|
||||
os << hex << reg << dec;
|
||||
if (aa != NULL)
|
||||
if (myDet->isMultiSlsDetectorClass() && aa != NULL)
|
||||
delete [] aa;
|
||||
|
||||
|
||||
|
@ -135,7 +135,7 @@ int slsDetectorUsers::getDetectorSize(int &x0, int &y0, int &nx, int &ny){
|
||||
slsDetectorDefs::ROI* roi = myDetector->getROI(n);
|
||||
|
||||
// roi
|
||||
if (roi != NULL && n > 0) {
|
||||
if (roi != NULL && n == 1) {
|
||||
x0 = roi[0].xmin;
|
||||
y0 = roi[0].ymin;
|
||||
nx = roi[0].xmax - roi[0].xmin;
|
||||
@ -513,3 +513,11 @@ int64_t slsDetectorUsers::setNumberOfStorageCells(int64_t t, int imod) {
|
||||
int slsDetectorUsers::setStoragecellStart(int pos) {
|
||||
return myDetector->setStoragecellStart(pos);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setROI(int n, slsDetectorDefs::ROI roiLimits[], int imod) {
|
||||
return myDetector->setROI(n, roiLimits, imod);
|
||||
}
|
||||
|
||||
slsDetectorDefs::ROI* slsDetectorUsers::getROI(int &n, int imod) {
|
||||
return myDetector->getROI(n, imod);
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ class detectorData;
|
||||
class multiSlsDetector;
|
||||
class multiSlsDetectorCommand;
|
||||
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
@ -256,9 +258,8 @@ class slsDetectorUsers
|
||||
*/
|
||||
int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1);
|
||||
|
||||
|
||||
/**
|
||||
@short gets detector size
|
||||
@short gets detector size (roi size if only one roi)
|
||||
\param x0 horizontal position origin in channel number
|
||||
\param y0 vertical position origin in channel number
|
||||
\param nx number of channels in horiziontal
|
||||
@ -818,6 +819,25 @@ class slsDetectorUsers
|
||||
*/
|
||||
int setStoragecellStart(int pos=-1);
|
||||
|
||||
/**
|
||||
* Set ROI (Gotthard) (>= 1 roi, but max 1 roi per module)
|
||||
* At the moment only one set allowed
|
||||
* @param n number of rois
|
||||
* @param roiLimits array of roi
|
||||
* @param imod module number (-1 for all)
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int setROI(int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL, int imod = -1);
|
||||
|
||||
/**
|
||||
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
||||
* >= 1 roi, but max 1 roi per module
|
||||
* @param n number of rois
|
||||
* @param imod module number (ignored)
|
||||
* @returns pointer to array of ROI structure
|
||||
*/
|
||||
slsDetectorDefs::ROI* getROI(int &n, int imod = -1);
|
||||
|
||||
/************************************************************************
|
||||
|
||||
STATIC FUNCTIONS
|
||||
|
@ -869,16 +869,18 @@ virtual int calibratePedestal(int frames = 0)=0;
|
||||
set roi
|
||||
\param n number of rois
|
||||
\param roiLimits array of roi
|
||||
\param imod module number (-1 for all)
|
||||
\returns success or failure
|
||||
*/
|
||||
virtual int setROI(int n=-1,ROI roiLimits[]=NULL)=0;
|
||||
virtual int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1)=0;
|
||||
|
||||
/**
|
||||
get roi from each detector and convert it to the multi detector scale
|
||||
\param n number of rois
|
||||
\returns an array of multidetector's rois
|
||||
\param imod module number (-1 for all)
|
||||
\returns pointer to array of ROI structure
|
||||
*/
|
||||
virtual ROI* getROI(int &n)=0;
|
||||
virtual ROI* getROI(int &n, int imod = -1)=0;
|
||||
|
||||
/** Sets the read receiver frequency
|
||||
if data required from receiver randomly readRxrFrequency=0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user