diff --git a/slsDetectorSoftware/eigerDetectorServer/FebControl.c b/slsDetectorSoftware/eigerDetectorServer/FebControl.c index 099e64079..434cf69d1 100644 --- a/slsDetectorSoftware/eigerDetectorServer/FebControl.c +++ b/slsDetectorSoftware/eigerDetectorServer/FebControl.c @@ -1027,7 +1027,7 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){ for(i=0;i<8;i++){ // column loop i //printf("i:%d\t\t",i); - if(Module_TopAddressIsValid(&modules[0])){ + if(Module_TopAddressIsValid(&modules[1])){ trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_l+i])<<((7-i)*4);//low trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_l+i])>>3)<<((7-i)*4);//upper trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_r+i])<<((7-i)*4);//low @@ -1043,7 +1043,7 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){ } //end supercolumn loop sc } //end row loop - if(Module_TopAddressIsValid(&modules[0])){ + if(Module_TopAddressIsValid(&modules[1])){ if(!Feb_Interface_WriteMemoryInLoops(Module_GetTopLeftAddress(&modules[Feb_Control_current_index]),0,0,1024,trimbits_to_load_r)|| !Feb_Interface_WriteMemoryInLoops(Module_GetTopRightAddress(&modules[Feb_Control_current_index]),0,0,1024,trimbits_to_load_l)|| //if(!Feb_Interface_WriteMemory(Module_GetTopLeftAddress(&modules[0]),0,0,1023,trimbits_to_load_r)|| diff --git a/slsDetectorSoftware/eigerDetectorServer/Makefile b/slsDetectorSoftware/eigerDetectorServer/Makefile index 046fd22eb..26b190032 100755 --- a/slsDetectorSoftware/eigerDetectorServer/Makefile +++ b/slsDetectorSoftware/eigerDetectorServer/Makefile @@ -1,6 +1,6 @@ CC = powerpc-4xx-softfloat-gcc CCX = powerpc-4xx-softfloat-g++ -CFLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT -DSTOP_SERVER #-DVERBOSE #-DVIRTUAL -DPCCOMPILE +CFLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT #-DSTOP_SERVER #-DVERBOSE #-DVIRTUAL -DPCCOMPILE LDLIBS += -lm -lstdc++ PROGS = eigerDetectorServer diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer index bb5c40f33..6911f0645 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer differ diff --git a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c index 5fa6b7bab..15de3e24f 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -143,10 +143,10 @@ int initDetector(){ Feb_Control_CheckSetup(); //top or bottom - bottom = Feb_Control_IsBottomModule(); - // if(getDetectorNumber()==0xbeb016) -// bottom = 0; - //else bottom = 1; + //bottom = Feb_Control_IsBottomModule(); + if(getDetectorNumber()==0xbeb031) + bottom = 0; + else bottom = 1; if(bottom) printf("BOTTOM ***************\n"); diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 527fa82d9..179215f7f 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -376,32 +376,33 @@ void multiSlsDetector::updateOffsets(){ for (int i=1; inumberOfDetectors; i++) { if (detectors[i]) { - //incrementing in x direction - if ((maxChanX == -1) || ((maxChanX > 0) && ((offsetX + numX) < maxChanX))){ - offsetX += detectors[i]->getMaxNumberOfChannels(X); - maxX += detectors[i]->getMaxNumberOfChannels(X); - numX += detectors[i]->getTotalNumberOfChannels(X); + //incrementing in y direction + if ((maxChanY == -1) || ((maxChanY > 0) && ((offsetY + numY) < maxChanY))){ + offsetY += detectors[i]->getMaxNumberOfChannels(Y); + maxY += detectors[i]->getMaxNumberOfChannels(Y); + numY += detectors[i]->getTotalNumberOfChannels(Y); } //incrementing in y direction else{ - offsetX = 0; - numX = 0; - maxX = 0; - thisMultiDetector->maxNumberOfChannel[X] = 0; - offsetY += detectors[i]->getMaxNumberOfChannels(Y); - if ((maxChanY == -1) || ((maxChanY > 0) && (offsetY <= maxChanY))){ - numY += detectors[i]->getTotalNumberOfChannels(Y); - maxY += detectors[i]->getMaxNumberOfChannels(Y); + offsetY = 0; + numY = 0; + maxY = 0; + thisMultiDetector->maxNumberOfChannel[Y] = 0; + if ((maxChanX == -1) || ((maxChanX > 0) && (offsetX <= maxChanX))){ + offsetX += detectors[i]->getMaxNumberOfChannels(X); + numX += detectors[i]->getTotalNumberOfChannels(X); + maxX += detectors[i]->getMaxNumberOfChannels(X); }else{ - cout<<"Detector at position " << i << "exceeds maximum channels allowed for complete detector set in y dimension also!" << endl; - numY += detectors[i]->getTotalNumberOfChannels(Y); - maxY += detectors[i]->getMaxNumberOfChannels(Y); + offsetX += detectors[i]->getMaxNumberOfChannels(X); + numX += detectors[i]->getTotalNumberOfChannels(X); + maxX += detectors[i]->getMaxNumberOfChannels(X); + cout<<"Detector at position " << i << "exceeds maximum channels allowed for complete detector set in X dimension also!" << endl; } } thisMultiDetector->offsetX[i] = offsetX; thisMultiDetector->offsetY[i] = offsetY; - cout << "Detector at position: " << i << " x offset:" << thisMultiDetector->offsetX[i] << " y offset:" << thisMultiDetector->offsetY[i] << endl; + cout << "Detector at position" << i << ": x offset:" << thisMultiDetector->offsetX[i] << " y offset:" << thisMultiDetector->offsetY[i] << endl; if(numX > thisMultiDetector->numberOfChannel[X]) thisMultiDetector->numberOfChannel[X] = numX; if(numY > thisMultiDetector->numberOfChannel[Y]) @@ -4539,11 +4540,17 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ } int n; + int i,k,offsetX, offsetY, maxX, maxY;; int* retval=new int[nel]; int *retdet, *p=retval; string fullFName=""; string ext=""; + if(getDetectorsType() == EIGER){ + maxX = thisMultiDetector->numberOfChannel[X]; + maxY = thisMultiDetector->numberOfChannel[Y]; + } + for (int id=0; idnumberOfDetectors; id++) { if (detectors[id]) { @@ -4552,9 +4559,20 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ setErrorMask(getErrorMask()|(1<getDataBytes(); - memcpy(p,retdet,n); + + if(getDetectorsType() == EIGER){ + k=detectors[id]->getMaxNumberOfChannels(X)*2;/**bit mode*/ + offsetY = ((maxY - (thisMultiDetector->offsetY[id] + detectors[id]->getMaxNumberOfChannels(Y))) * maxX)*2;/**bit mode*/ + offsetX = thisMultiDetector->offsetX[id]*2; + for(i=0; i< 256;i++){ + memcpy((((char*)p) + offsetY + offsetX + (i*maxX*2)/**bit mode*/) ,(((char*)retdet) + (i*k)),k); + } + } + else{ + memcpy(p,retdet,n); + p+=n/sizeof(int); + } delete [] retdet; - p+=n/sizeof(int); //concatenate filenames if(!fullFName.length()){ fullFName.assign(fileIO::getFileName()); diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp index ffb943c04..cf947247a 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp @@ -472,7 +472,7 @@ void* postProcessing::processData(int delflag) { //if nth frame if(nthframe){ - newData = true; + /*newData = true;//unnecessary to read every data, 09.12.2014**/ //and no gui if(!dataReady){ std::cout << "Error: receiver read freq is set to " << nthframe << " but should be > 0 only when using gui." << std::endl; @@ -543,7 +543,7 @@ void* postProcessing::processData(int delflag) { delete thisData; fdata = NULL; progress = currentfIndex; - if(!nthframe) + /*if(!nthframe) //unnecessary to read every data, 09.12.2014**/ newData = false; } }