removed the allocating of memory for eiger and jungfrau to receive data via tcp from detector as this will not happen

This commit is contained in:
Dhanya Maliakal
2016-12-02 12:47:01 +01:00
parent dd9387ef29
commit a67f9d50de
2 changed files with 38 additions and 30 deletions

View File

@ -1420,40 +1420,45 @@ int multiSlsDetector::startReadOut(){
int* multiSlsDetector::getDataFromDetector() {
int nel=thisMultiDetector->dataBytes/sizeof(int);
int n;
int* retval=new int[nel];
int n = 0;
int* retval= NULL;
int *retdet, *p=retval;
int nodata=1, nodatadet=-1;;
int nodata=1, nodatadet=-1;
int nodatadetectortype = false;
detectorType types = getDetectorsType();
if(types == EIGER || types == JUNGFRAU){
nodatadetectortype = true;
}
if(!nodatadetectortype)
retval=new int[nel];
for (int id=0; id<thisMultiDetector->numberOfDetectors; id++) {
if (detectors[id]) {
retdet=detectors[id]->getDataFromDetector(p);
n=detectors[id]->getDataBytes();
if(detectors[id]->getErrorMask())
setErrorMask(getErrorMask()|(1<<id));
if (retdet) {
nodata=0;
if(!nodatadetectortype){
n=detectors[id]->getDataBytes();
if (retdet) {
nodata=0;
#ifdef VERBOSE
cout << "Detector " << id << " returned " << n << " bytes " << endl;
cout << "Detector " << id << " returned " << n << " bytes " << endl;
#endif
} else {
nodatadet=id;
} else {
nodatadet=id;
#ifdef VERBOSE
cout << "Detector " << id << " does not have data left " << endl;
cout << "Detector " << id << " does not have data left " << endl;
#endif
/*if((detectors[id]->getDetectorsType() != EIGER)||(detectors[id]->getDetectorsType() != JUNGFRAU))
break;*/
}
p+=n/sizeof(int);
}
p+=n/sizeof(int);
}
}
//eiger returns only null
detectorType types = getDetectorsType();
if(types == EIGER || types == JUNGFRAU){
delete [] retval;
if(nodatadetectortype){
return NULL;
}