mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
updated users class: get/set detector size sets one roi /get roi if roi enabled. mythen is not supported anymore, hence
This commit is contained in:
parent
a774c62cd4
commit
c611523352
@ -4533,7 +4533,9 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
|
||||
myDet->setReceiverOnline(ONLINE_FLAG);
|
||||
ret=myDet->setDynamicRange(val);
|
||||
} else if (cmd=="roi") {
|
||||
myDet->getROI(ret);
|
||||
ROI* r = myDet->getROI(ret);
|
||||
if (r != NULL)
|
||||
delete [] r;
|
||||
} else if (cmd=="detsizechan") {
|
||||
sprintf(ans,"%d %d",myDet->getMaxNumberOfChannelsPerDetector(X),myDet->getMaxNumberOfChannelsPerDetector(Y));
|
||||
return string(ans);
|
||||
@ -6995,6 +6997,8 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
|
||||
}
|
||||
}
|
||||
os << hex << reg << dec;
|
||||
if (aa != NULL)
|
||||
delete [] aa;
|
||||
|
||||
|
||||
//os <<" "<< hex << myDet->readRegister(120) << dec;
|
||||
|
@ -115,18 +115,37 @@ int slsDetectorUsers::getPositions(double *pos){
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setDetectorSize(int x0, int y0, int nx, int ny){
|
||||
if(myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y)>1)
|
||||
return 1;
|
||||
int nmod=nx/(myDetector->getChansPerMod(0));
|
||||
cout << myDetector->getChansPerMod(0) << " " << nx << " " << nmod << endl;
|
||||
return myDetector->setNumberOfModules(nmod)*myDetector->getChansPerMod(0);}
|
||||
// only one roi
|
||||
slsDetectorDefs::ROI roi[1];
|
||||
roi[0].xmin = x0;
|
||||
roi[0].ymin = y0;
|
||||
roi[0].xmax = x0 + nx;
|
||||
roi[0].ymax = y0 + ny;
|
||||
return myDetector->setROI(1, roi);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::getDetectorSize(int &x0, int &y0, int &nx, int &ny){
|
||||
y0=0;
|
||||
x0=0;
|
||||
nx=myDetector->getTotalNumberOfChannels(slsDetectorDefs::X);
|
||||
ny=myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y);
|
||||
return nx*ny;
|
||||
// default (no roi)
|
||||
y0=0;
|
||||
x0=0;
|
||||
nx=myDetector->getTotalNumberOfChannels(slsDetectorDefs::X);
|
||||
ny=myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y);
|
||||
|
||||
int n = 0;
|
||||
slsDetectorDefs::ROI* roi = myDetector->getROI(n);
|
||||
|
||||
// roi
|
||||
if (roi != NULL && n > 0) {
|
||||
x0 = roi[0].xmin;
|
||||
y0 = roi[0].ymin;
|
||||
nx = roi[0].xmax - roi[0].xmin;
|
||||
ny = roi[0].ymax - roi[0].ymin;
|
||||
}
|
||||
|
||||
if (roi != NULL)
|
||||
delete [] roi;
|
||||
|
||||
return nx*ny;
|
||||
}
|
||||
|
||||
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
||||
|
@ -247,7 +247,7 @@ class slsDetectorUsers
|
||||
int getPositions(double *pos=NULL);
|
||||
|
||||
/**
|
||||
@short sets the detector size
|
||||
@short sets the detector size (only 1 ROI)
|
||||
\param x0 horizontal position origin in channel number (-1 unchanged)
|
||||
\param y0 vertical position origin in channel number (-1 unchanged)
|
||||
\param nx number of channels in horiziontal (-1 unchanged)
|
||||
@ -263,7 +263,7 @@ class slsDetectorUsers
|
||||
\param y0 vertical position origin in channel number
|
||||
\param nx number of channels in horiziontal
|
||||
\param ny number of channels in vertical
|
||||
\returns OK/FAIL
|
||||
\returns total number of channels
|
||||
*/
|
||||
int getDetectorSize(int &x0, int &y0, int &nx, int &ny);
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user