fixed compilation problem with rectangular pixels for zmq process

This commit is contained in:
2020-02-18 11:23:54 +01:00
parent 940c8f05cd
commit fcd4821b8d
5 changed files with 24 additions and 21 deletions

View File

@ -199,7 +199,7 @@ template <class dataType> class analogDetector {
\param nns reference to number of subpixels for interpolating detector, will always be 1 in this case \param nns reference to number of subpixels for interpolating detector, will always be 1 in this case
\returns number of pixels of the detector image \returns number of pixels of the detector image
*/ */
virtual int getImageSize(int &nnx, int &nny, int &nns){nnx=nx; nny=ny; nns=1; return nx*ny;}; virtual int getImageSize(int &nnx, int &nny, int &nnsx, int &nnsy){nnx=nx; nny=ny; nnsx=1; nnsy=1; return nx*ny;};
/** /**
Returns data size of the detector image matrix Returns data size of the detector image matrix
\param nnx reference to pixel size in x \param nnx reference to pixel size in x

View File

@ -107,11 +107,11 @@ class interpolatingDetector : public singlePhotonDetector {
singlePhotonDetector::clearImage(); singlePhotonDetector::clearImage();
}; };
int getImageSize(int &nnx, int &nny, int &ns) { int getImageSize(int &nnx, int &nny, int &nsx, int &nsy) {
if (interp) if (interp)
return interp->getImageSize(nnx, nny, ns); return interp->getImageSize(nnx, nny, nsx, nsy);
else else
return analogDetector<uint16_t>::getImageSize(nnx, nny, ns); return analogDetector<uint16_t>::getImageSize(nnx, nny, nsx, nsy);
}; };
@ -251,6 +251,7 @@ int addFrame(char *data, int *ph=NULL, int ff=0) {
} }
virtual int getNSubPixels(){ if (interp) return interp->getNSubPixels(); else return 1;} virtual int getNSubPixels(){ if (interp) return interp->getNSubPixels(); else return 1;}
virtual int setNSubPixels(int ns) { virtual int setNSubPixels(int ns) {
if (interp) { if (interp) {
pthread_mutex_lock(fi); pthread_mutex_lock(fi);

View File

@ -288,7 +288,7 @@ int main(int argc, char *argv[]) {
char fname[10000]; char fname[10000];
// int length; // int length;
int *detimage=NULL; int *detimage=NULL;
int nnx, nny,nns; int nnx, nny,nnsx, nnsy;
//uint32_t imageSize = 0, nPixelsX = 0, nPixelsY = 0, //uint32_t imageSize = 0, nPixelsX = 0, nPixelsY = 0,
//uint32_t dynamicRange = 0; //uint32_t dynamicRange = 0;
// infinite loop // infinite loop
@ -326,7 +326,7 @@ int main(int argc, char *argv[]) {
frameMode fMode=eFrame; frameMode fMode=eFrame;
double *ped; double *ped;
filter->getImageSize(nnx, nny,nns); filter->getImageSize(nnx, nny,nnsx, nnsy);
@ -424,11 +424,13 @@ int main(int argc, char *argv[]) {
if (fMode==ePedestal) { if (fMode==ePedestal) {
cprintf(MAGENTA,"Get pedestal!\n"); cprintf(MAGENTA,"Get pedestal!\n");
nns=1; nnsx=1;
nnsy=1;
nnx=npx; nnx=npx;
nny=npy; nny=npy;
//dout= new int16_t[nnx*nny*nns*nns]; //dout= new int16_t[nnx*nny*nns*nns];
dout= new int32_t[nnx*nny*nns*nns]; dout= new int32_t[nnx*nny*nnsx*nnsy];
// cout << "get pedestal " << endl; // cout << "get pedestal " << endl;
ped=mt->getPedestal(); ped=mt->getPedestal();
// cout << "got pedestal " << endl; // cout << "got pedestal " << endl;
@ -454,9 +456,9 @@ int main(int argc, char *argv[]) {
} }
#endif #endif
else { else {
detimage=mt->getImage(nnx,nny,nns); detimage=mt->getImage(nnx,nny,nnsx, nnsy);
cprintf(MAGENTA,"Get image!\n"); cprintf(MAGENTA,"Get image!\n");
cout << nnx << " " << nny << " " << nns << endl; cout << nnx << " " << nny << " " << nnsx << " " << nnsy << endl;
// nns=1; // nns=1;
// nnx=npx; // nnx=npx;
// nny=npy; // nny=npy;
@ -821,7 +823,7 @@ int main(int argc, char *argv[]) {
if (subframes>0 && insubframe>=subframes && fMode==eFrame) { if (subframes>0 && insubframe>=subframes && fMode==eFrame) {
while (mt->isBusy()) {;}//wait until all data are processed from the queues while (mt->isBusy()) {;}//wait until all data are processed from the queues
detimage=mt->getImage(nnx,nny,nns); detimage=mt->getImage(nnx,nny,nnsx, nnsy);
cprintf(MAGENTA,"Get image!\n"); cprintf(MAGENTA,"Get image!\n");
dout= new int32_t[nnx*nny]; dout= new int32_t[nnx*nny];
doutf= new float[nnx*nny]; doutf= new float[nnx*nny];

View File

@ -95,7 +95,7 @@ public:
virtual int *getImage() { virtual int *getImage() {
return det->getImage(); return det->getImage();
} }
virtual int getImageSize(int &nnx, int &nny, int &ns) {return det->getImageSize(nnx, nny, ns);}; virtual int getImageSize(int &nnx, int &nny, int &nsx,int &nsy) {return det->getImageSize(nnx, nny, nsx, nsy);};
virtual int getDetectorSize(int &nnx, int &nny) {return det->getDetectorSize(nnx, nny);}; virtual int getDetectorSize(int &nnx, int &nny) {return det->getDetectorSize(nnx, nny);};
virtual ~threadedAnalogDetector() {StopThread(); delete fifoFree; delete fifoData;} virtual ~threadedAnalogDetector() {StopThread(); delete fifoFree; delete fifoData;}
@ -320,11 +320,11 @@ public:
virtual void newDataSet(){for (int i=0; i<nThreads; i++) dets[i]->newDataSet();}; virtual void newDataSet(){for (int i=0; i<nThreads; i++) dets[i]->newDataSet();};
virtual int *getImage(int &nnx, int &nny, int &ns) { virtual int *getImage(int &nnx, int &nny, int &ns, int &nsy) {
int *img; int *img;
// int nnx, nny, ns; // int nnx, nny, ns;
// int nnx, nny, ns; // int nnx, nny, ns;
int nn=dets[0]->getImageSize(nnx, nny,ns); int nn=dets[0]->getImageSize(nnx, nny,ns, nsy);
if (image) { if (image) {
delete image; delete image;
image=NULL; image=NULL;
@ -369,10 +369,10 @@ public:
/* dets[ii]->writeImage(tit); */ /* dets[ii]->writeImage(tit); */
/* } */ /* } */
/* #endif */ /* #endif */
int nnx, nny, ns; int nnx, nny, ns, nsy;
getImage(nnx, nny, ns); getImage(nnx, nny, ns, nsy);
//int nnx, nny, ns; //int nnx, nny, ns;
int nn=dets[0]->getImageSize(nnx, nny, ns); int nn=dets[0]->getImageSize(nnx, nny, ns, nsy);
float *gm=new float[nn]; float *gm=new float[nn];
if (gm) { if (gm) {
for (int ix=0; ix<nn; ix++) { for (int ix=0; ix<nn; ix++) {

View File

@ -46,7 +46,7 @@ public:
}; };
virtual int setNSubPixels(int ns) { return (dets[0])->setNSubPixels(ns);}; /* virtual int setNSubPixels(int ns) { return (dets[0])->setNSubPixels(ns);}; */
virtual void resetFlatField() {(dets[0])->resetFlatField();}; virtual void resetFlatField() {(dets[0])->resetFlatField();};
@ -69,13 +69,13 @@ public:
virtual int *getImage(int &nnx, int &nny, int &ns) { virtual int *getImage(int &nnx, int &nny, int &nsx, int &nsy) {
if (getInterpolation()==NULL) return multiThreadedAnalogDetector::getImage(nnx,nny,ns); if (getInterpolation()==NULL) return multiThreadedAnalogDetector::getImage(nnx,nny,nsx, nsy);
//if one interpolates, the whole image is stored in detector 0; //if one interpolates, the whole image is stored in detector 0;
int *img; int *img;
// int nnx, nny, ns; // int nnx, nny, ns;
// int nnx, nny, ns; // int nnx, nny, ns;
int nn=dets[0]->getImageSize(nnx, nny,ns); int nn=dets[0]->getImageSize(nnx, nny,nsx, nsy);
if (image) { if (image) {
delete image; delete image;
image=NULL; image=NULL;