mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
changes including warnings and zmq
This commit is contained in:
parent
066550d38c
commit
0722ef3125
@ -5185,17 +5185,13 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy){
|
|||||||
int multiSlsDetector::getData(const int isocket, const bool masking, int* image, const int size,
|
int multiSlsDetector::getData(const int isocket, const bool masking, int* image, const int size,
|
||||||
uint64_t &acqIndex, uint64_t &frameIndex, uint32_t &subframeIndex, string &filename) {
|
uint64_t &acqIndex, uint64_t &frameIndex, uint32_t &subframeIndex, string &filename) {
|
||||||
|
|
||||||
bool dummy = false;
|
//fail is on parse error or end of acquisition
|
||||||
if (!zmqSocket[isocket]->ReceiveHeader(isocket, acqIndex, frameIndex, subframeIndex, filename, dummy))
|
if (!zmqSocket[isocket]->ReceiveHeader(isocket, acqIndex, frameIndex, subframeIndex, filename))
|
||||||
return FAIL;
|
|
||||||
|
|
||||||
//end of acquisition
|
|
||||||
if(dummy)
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
|
||||||
|
//receiving incorrect size is replaced by 0xFF
|
||||||
zmqSocket[isocket]->ReceiveData(isocket, image, size);
|
zmqSocket[isocket]->ReceiveData(isocket, image, size);
|
||||||
|
|
||||||
|
|
||||||
//jungfrau masking adcval
|
//jungfrau masking adcval
|
||||||
if(masking){
|
if(masking){
|
||||||
unsigned int snel = size/sizeof(int);
|
unsigned int snel = size/sizeof(int);
|
||||||
|
@ -888,20 +888,21 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
|||||||
pthread_mutex_unlock(&ms);
|
pthread_mutex_unlock(&ms);
|
||||||
setFileFormat(BINARY);
|
setFileFormat(BINARY);
|
||||||
}else if (thisDetector->myDetectorType==EIGER){
|
}else if (thisDetector->myDetectorType==EIGER){
|
||||||
fileIO:: setFramesPerFile(EIGER_MAX_FRAMES_PER_FILE);
|
fileIO::setFramesPerFile(EIGER_MAX_FRAMES_PER_FILE);
|
||||||
pthread_mutex_unlock(&ms);
|
pthread_mutex_unlock(&ms);
|
||||||
setFileFormat(BINARY);
|
setFileFormat(BINARY);
|
||||||
}else if (thisDetector->myDetectorType==MOENCH){
|
}else if (thisDetector->myDetectorType==MOENCH){
|
||||||
fileIO:: setFramesPerFile(MOENCH_MAX_FRAMES_PER_FILE);
|
fileIO::setFramesPerFile(MOENCH_MAX_FRAMES_PER_FILE);
|
||||||
pthread_mutex_unlock(&ms);
|
pthread_mutex_unlock(&ms);
|
||||||
setFileFormat(BINARY);
|
setFileFormat(BINARY);
|
||||||
}else if (thisDetector->myDetectorType==JUNGFRAU){
|
}else if (thisDetector->myDetectorType==JUNGFRAU){
|
||||||
fileIO:: setFramesPerFile(JFRAU_MAX_FRAMES_PER_FILE);
|
fileIO::setFramesPerFile(JFRAU_MAX_FRAMES_PER_FILE);
|
||||||
pthread_mutex_unlock(&ms);
|
pthread_mutex_unlock(&ms);
|
||||||
setFileFormat(BINARY);
|
setFileFormat(BINARY);
|
||||||
}else if (thisDetector->myDetectorType==JUNGFRAUCTB){
|
}else if (thisDetector->myDetectorType==JUNGFRAUCTB){
|
||||||
setFramesPerFile(JFCTB_MAX_FRAMES_PER_FILE);
|
setFramesPerFile(JFCTB_MAX_FRAMES_PER_FILE);
|
||||||
fileIO:: pthread_mutex_unlock(&ms);
|
fileIO::setFramesPerFile(JFRAU_MAX_FRAMES_PER_FILE);
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
setFileFormat(BINARY);
|
setFileFormat(BINARY);
|
||||||
}else
|
}else
|
||||||
pthread_mutex_unlock(&ms);
|
pthread_mutex_unlock(&ms);
|
||||||
@ -1003,61 +1004,61 @@ slsDetectorDefs::sls_detector_module* slsDetector::createModule(detectorType t)
|
|||||||
switch(t) {
|
switch(t) {
|
||||||
case MYTHEN:
|
case MYTHEN:
|
||||||
nch=128; // complete mythen system
|
nch=128; // complete mythen system
|
||||||
// nm=24;
|
// nm=24;
|
||||||
nc=10;
|
nc=10;
|
||||||
nd=6; // dacs
|
nd=6; // dacs
|
||||||
break;
|
break;
|
||||||
case PICASSO:
|
case PICASSO:
|
||||||
nch=128; // complete mythen system
|
nch=128; // complete mythen system
|
||||||
// nm=24;
|
// nm=24;
|
||||||
nc=12;
|
nc=12;
|
||||||
nd=6; // dacs+adcs
|
nd=6; // dacs+adcs
|
||||||
break;
|
break;
|
||||||
case GOTTHARD:
|
case GOTTHARD:
|
||||||
nch=128;
|
nch=128;
|
||||||
nm=1;
|
// nm=1;
|
||||||
nc=10;
|
nc=10;
|
||||||
nd=8; // dacs+adcs
|
nd=8; // dacs+adcs
|
||||||
na=5;
|
na=5;
|
||||||
break;
|
break;
|
||||||
case PROPIX:
|
case PROPIX:
|
||||||
nch=22*22;
|
nch=22*22;
|
||||||
nm=1;
|
// nm=1;
|
||||||
nc=1;
|
nc=1;
|
||||||
nd=8; // dacs+adcs
|
nd=8; // dacs+adcs
|
||||||
na=5;
|
na=5;
|
||||||
break;
|
break;
|
||||||
case EIGER:
|
case EIGER:
|
||||||
nch=256*256; // one EIGER half module
|
nch=256*256; // one EIGER half module
|
||||||
// nm=1; //modules/detector
|
// nm=1; //modules/detector
|
||||||
nc=4*1; //chips
|
nc=4*1; //chips
|
||||||
nd=16; //dacs
|
nd=16; //dacs
|
||||||
na=0;
|
na=0;
|
||||||
break;
|
break;
|
||||||
case MOENCH:
|
case MOENCH:
|
||||||
nch=160*160;
|
nch=160*160;
|
||||||
nm=1; //modules/detector
|
// nm=1; //modules/detector
|
||||||
nc=1; //chips
|
nc=1; //chips
|
||||||
nd=8; //dacs
|
nd=8; //dacs
|
||||||
na=1;
|
na=1;
|
||||||
break;
|
break;
|
||||||
case JUNGFRAU:
|
case JUNGFRAU:
|
||||||
nch=256*256;//32;
|
nch=256*256;//32;
|
||||||
// nm=1;
|
// nm=1;
|
||||||
nc=4*2;
|
nc=4*2;
|
||||||
nd=16; // dacs+adcs
|
nd=16; // dacs+adcs
|
||||||
na=0;
|
na=0;
|
||||||
break;
|
break;
|
||||||
case JUNGFRAUCTB:
|
case JUNGFRAUCTB:
|
||||||
nch=36;
|
nch=36;
|
||||||
// nm=1;
|
// nm=1;
|
||||||
nc=1;
|
nc=1;
|
||||||
nd=8; // dacs+adcs
|
nd=8; // dacs+adcs
|
||||||
na=1;
|
na=1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
nch=0; // dum!
|
nch=0; // dum!
|
||||||
// nm=0; //modules/detector
|
// nm=0; //modules/detector
|
||||||
nc=0; //chips
|
nc=0; //chips
|
||||||
nd=0; //dacs+adcs
|
nd=0; //dacs+adcs
|
||||||
na=0;
|
na=0;
|
||||||
@ -1722,13 +1723,15 @@ int slsDetector::getTotalNumberOfChannels() {
|
|||||||
}
|
}
|
||||||
thisDetector->nChans=thisDetector->nChan[X];
|
thisDetector->nChans=thisDetector->nChan[X];
|
||||||
thisDetector->dataBytes=thisDetector->nChans*thisDetector->nChips*thisDetector->nMods*2*thisDetector->timerValue[SAMPLES_JCTB];
|
thisDetector->dataBytes=thisDetector->nChans*thisDetector->nChips*thisDetector->nMods*2*thisDetector->timerValue[SAMPLES_JCTB];
|
||||||
} else
|
} else {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "det type is "<< thisDetector->myDetectorType << endl;
|
cout << "det type is "<< thisDetector->myDetectorType << endl;
|
||||||
cout << "Total number of channels is "<< thisDetector->nChans*thisDetector->nChips*thisDetector->nMods << " data bytes is " << thisDetector->dataBytes << endl;
|
cout << "Total number of channels is "<< thisDetector->nChans*thisDetector->nChips*thisDetector->nMods << " data bytes is " << thisDetector->dataBytes << endl;
|
||||||
#endif
|
#endif
|
||||||
|
;
|
||||||
|
}
|
||||||
return thisDetector->nChans*thisDetector->nChips*thisDetector->nMods;
|
return thisDetector->nChans*thisDetector->nChips*thisDetector->nMods;
|
||||||
};
|
}
|
||||||
|
|
||||||
int slsDetector::getTotalNumberOfChannels(dimension d) {
|
int slsDetector::getTotalNumberOfChannels(dimension d) {
|
||||||
getTotalNumberOfChannels();
|
getTotalNumberOfChannels();
|
||||||
@ -1743,7 +1746,10 @@ int slsDetector::getMaxNumberOfChannels(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
int slsDetector::getMaxNumberOfChannels(dimension d){
|
int slsDetector::getMaxNumberOfChannels(dimension d){
|
||||||
if(thisDetector->myDetectorType==JUNGFRAUCTB) if (d==X) return 36*thisDetector->nChip[d]*thisDetector->nModMax[d]; else return 1*thisDetector->nChip[d]*thisDetector->nModMax[d];
|
if(thisDetector->myDetectorType==JUNGFRAUCTB) {
|
||||||
|
if (d==X) return 36*thisDetector->nChip[d]*thisDetector->nModMax[d];
|
||||||
|
else return 1*thisDetector->nChip[d]*thisDetector->nModMax[d];
|
||||||
|
}
|
||||||
return thisDetector->nChan[d]*thisDetector->nChip[d]*thisDetector->nModMax[d];
|
return thisDetector->nChan[d]*thisDetector->nChip[d]*thisDetector->nModMax[d];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2443,7 +2449,7 @@ dacs_t slsDetector::setDAC(dacs_t val, dacIndex index, int mV, int imod){
|
|||||||
int arg[3];
|
int arg[3];
|
||||||
|
|
||||||
|
|
||||||
if ( (thisDetector->myDetectorType == GOTTHARD) || (thisDetector->myDetectorType == PROPIX) && index==HV_NEW)
|
if ( (index==HV_NEW) &&((thisDetector->myDetectorType == GOTTHARD) || (thisDetector->myDetectorType == PROPIX)))
|
||||||
index=HV_POT;
|
index=HV_POT;
|
||||||
|
|
||||||
arg[0]=index;
|
arg[0]=index;
|
||||||
@ -5251,7 +5257,7 @@ double* slsDetector::decodeData(int *datain, int &nn, double *fdata) {
|
|||||||
|
|
||||||
// printf("allocating fdata!\n");
|
// printf("allocating fdata!\n");
|
||||||
}
|
}
|
||||||
const int bytesize=8;
|
// const int bytesize=8;
|
||||||
|
|
||||||
int ival=0;
|
int ival=0;
|
||||||
char *ptr=(char*)datain;
|
char *ptr=(char*)datain;
|
||||||
|
@ -3476,7 +3476,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", (long long unsigned int)retval);
|
sprintf(answer,"%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3490,7 +3490,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", (long long unsigned int)retval);
|
sprintf(answer,"%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
} else
|
} else
|
||||||
return string("undefined module number");
|
return string("undefined module number");
|
||||||
@ -3500,7 +3500,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", (long long unsigned int)retval);
|
sprintf(answer,"%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
if (cmd.find("modulenumber")!=string::npos) {
|
if (cmd.find("modulenumber")!=string::npos) {
|
||||||
@ -3510,7 +3510,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", (long long unsigned int)retval);
|
sprintf(answer,"%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
} else
|
} else
|
||||||
return string("undefined module number");
|
return string("undefined module number");
|
||||||
@ -3521,7 +3521,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", (long long unsigned int)retval);
|
sprintf(answer,"%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3530,7 +3530,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", (long long unsigned int)retval);
|
sprintf(answer,"%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3540,7 +3540,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
sprintf(answer, "%d", -1);
|
sprintf(answer, "%d", -1);
|
||||||
else
|
else
|
||||||
sprintf(answer,"%lx", (long long unsigned int)retval);
|
sprintf(answer,"%lx", retval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
return string("unknown id mode ")+cmd;
|
return string("unknown id mode ")+cmd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user