From 69965fcb7e5cb3d65a2b16f37ebd22d301480449 Mon Sep 17 00:00:00 2001 From: bergamaschi Date: Fri, 15 Jun 2012 12:49:28 +0000 Subject: [PATCH] changed detector size from module to channel number, added y dimension to detectorData git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@192 951219d9-93cf-4727-9268-0efd64621fa3 --- slsDetectorSoftware/slsDetector/slsDetectorBase.h | 8 ++++---- slsDetectorSoftware/slsDetectorAnalysis/detectorData.h | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/slsDetectorSoftware/slsDetector/slsDetectorBase.h b/slsDetectorSoftware/slsDetector/slsDetectorBase.h index e80174fac..afa21545e 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorBase.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorBase.h @@ -292,12 +292,12 @@ class slsDetectorBase : public virtual slsDetectorDefs, public slsDetectorUsers */ virtual int setNumberOfModules(int i=-1, dimension d=X)=0; - int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1){return setNumberOfModules(nx,X);}; + int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1){return setNumberOfModules(nx/getChansPerMod(0),X);}; - int getDetectorSize(int &x0, int &y0, int &nx, int &ny){x0=0; nx=setNumberOfModules(-1,X); return nx;}; + int getDetectorSize(int &x0, int &y0, int &nx, int &ny){x0=0; nx=setNumberOfModules(-1,X)*getChansPerMod(0); return nx;}; virtual int getMaxNumberOfModules(dimension d=X)=0; // - int getMaximumDetectorSize(int &nx, int &ny){nx=getMaxNumberOfModules(X); ny=1; return nx;}; + int getMaximumDetectorSize(int &nx, int &ny){nx=getMaxNumberOfModules(X)*getChansPerMod(0); ny=1; return nx;}; /** Locks/Unlocks the connection to the server @@ -339,7 +339,7 @@ class slsDetectorBase : public virtual slsDetectorDefs, public slsDetectorUsers */ virtual int stopAcquisition()=0; int stopMeasurement(){return stopAcquisition();}; - + virtual int getChansPerMod(int imod=0)=0; /** set/get timer value diff --git a/slsDetectorSoftware/slsDetectorAnalysis/detectorData.h b/slsDetectorSoftware/slsDetectorAnalysis/detectorData.h index 2f8681596..32217a907 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/detectorData.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/detectorData.h @@ -16,9 +16,10 @@ class detectorData { \param ang pointer to the angles \param f_ind file index \param fname file name to which the data are saved - \param np number of points defaults to the number of detector channels + \param np number of points in x coordinate defaults to the number of detector channels (1D detector) + \param ny dimension in y (1D detector) */ - detectorData(float *val=NULL, float *err=NULL, float *ang=NULL, float p_ind=-1, const char *fname="", int np=-1) : values(val), errors(err), angles(ang), progressIndex(p_ind), npoints(np){strcpy(fileName,fname);}; + detectorData(float *val=NULL, float *err=NULL, float *ang=NULL, float p_ind=-1, const char *fname="", int np=-1, int ny=1) : values(val), errors(err), angles(ang), progressIndex(p_ind), npoints(np), npy(ny){strcpy(fileName,fname);}; /** the destructor deletes also the arrays pointing to data/errors/angles if not NULL @@ -31,6 +32,7 @@ class detectorData { float progressIndex;/**< file index */ char fileName[1000];/**< file name */ int npoints;/**< number of points */ + int npy;/**< dimensions in y coordinate*/ };