From a770389c90452658d22cfa9e7a8c5f14b1c91dad Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Wed, 23 Sep 2015 11:50:02 +0200 Subject: [PATCH] including subframe index from receiver to client and also sending this to gui --- .../multiSlsDetector/multiSlsDetector.cpp | 4 ++-- slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h | 3 ++- slsDetectorSoftware/slsDetector/slsDetector.cpp | 4 +++- slsDetectorSoftware/slsDetector/slsDetector.h | 3 ++- slsDetectorSoftware/slsDetector/slsDetectorBase.h | 3 ++- slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp | 2 +- slsDetectorSoftware/slsDetector/slsDetectorUsers.h | 4 ++-- slsDetectorSoftware/slsDetector/slsDetectorUtils.h | 3 ++- .../slsDetectorAnalysis/postProcessing.cpp | 9 +++++---- slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h | 4 ++-- 10 files changed, 23 insertions(+), 16 deletions(-) diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 5574da290..e7845b09f 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -4584,7 +4584,7 @@ int multiSlsDetector::resetFramesCaught() { -int* multiSlsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex){ +int* multiSlsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex){ int nel=(thisMultiDetector->dataBytes)/sizeof(int); if(nel <= 0){ cout << "Multislsdetector databytes not valid :" << thisMultiDetector->dataBytes << endl; @@ -4610,7 +4610,7 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex for (int id=0; idnumberOfDetectors; id++) { if (detectors[id]) { n=detectors[id]->getDataBytes(); - retdet=detectors[id]->readFrameFromReceiver(fName, acquisitionIndex, frameIndex); + retdet=detectors[id]->readFrameFromReceiver(fName, acquisitionIndex, frameIndex, subFrameIndex); if(detectors[id]->getErrorMask()) setErrorMask(getErrorMask()|(1<dataBytes/sizeof(int); int* retval=new int[nel]; @@ -6732,6 +6732,8 @@ int* slsDetector::readFrameFromReceiver(char* fName, int &acquisitionIndex, int n=dataSocket->ReceiveDataOnly(fName,MAX_STR_LENGTH); n=dataSocket->ReceiveDataOnly(&acquisitionIndex,sizeof(acquisitionIndex)); n=dataSocket->ReceiveDataOnly(&frameIndex,sizeof(frameIndex)); + if(thisDetector->myDetectorType == EIGER) + n=dataSocket->ReceiveDataOnly(&subFrameIndex,sizeof(subFrameIndex)); n=dataSocket->ReceiveDataOnly(retval,thisDetector->dataBytes); #ifdef VERBOSE diff --git a/slsDetectorSoftware/slsDetector/slsDetector.h b/slsDetectorSoftware/slsDetector/slsDetector.h index 85112f551..fbe6c2f5d 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.h +++ b/slsDetectorSoftware/slsDetector/slsDetector.h @@ -1554,9 +1554,10 @@ class slsDetector : public slsDetectorUtils, public energyConversion { * @param fName file name of current frame() * @param acquisitionIndex current acquisition index * @param frameIndex current frame index (for each scan) + * @param subFrameIndex current sub frame index (for 32 bit mode for eiger) /returns a frame read from recever */ - int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex); + int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex); /** Locks/Unlocks the connection to the receiver /param lock sets (1), usets (0), gets (-1) the lock diff --git a/slsDetectorSoftware/slsDetector/slsDetectorBase.h b/slsDetectorSoftware/slsDetector/slsDetectorBase.h index 98529bcaa..6cf0a203a 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorBase.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorBase.h @@ -499,9 +499,10 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef * @param fName file name of current frame() * @param acquisitionIndex current acquisition index * @param frameIndex current frame index (for each scan) + * @param subFrameIndex current sub frame index (for 32 bit mode for eiger) /returns a frame read from recever */ - virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex)=0; + virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex)=0; /** Sets the read receiver frequency diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp index bcc9b021b..9cd9e9936 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp @@ -268,7 +268,7 @@ int64_t slsDetectorUsers::getThisSoftwareVersion(){ -void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, void*), void *pArg){ +void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg){ myDetector->registerDataCallback(userCallback,pArg); } diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUsers.h b/slsDetectorSoftware/slsDetector/slsDetectorUsers.h index e715b193c..24abc2fc4 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUsers.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUsers.h @@ -408,10 +408,10 @@ class slsDetectorUsers /** @short register calbback for accessing detector final data - \param userCallback function for plotting/analyzing the data. Its arguments are the data structure d and the frame number f. + \param userCallback function for plotting/analyzing the data. Its arguments are the data structure d and the frame number f, s is for subframe number for eiger for 32 bit mode */ - void registerDataCallback(int( *userCallback)(detectorData* d, int f, void*), void *pArg); + void registerDataCallback(int( *userCallback)(detectorData* d, int f, int s, void*), void *pArg); /** @short register callback for accessing raw data - if the rawDataCallback is registered, no filewriting/postprocessing will be carried on automatically by the software - the raw data are deleted by the software diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h index e1bdea683..bd663af23 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h @@ -641,9 +641,10 @@ virtual int resetFramesCaught()=0; * @param fName file name of current frame() * @param acquisitionIndex current acquisition index * @param frameIndex current frame index (for each scan) + * @param subFrameIndex current sub frame index (for 32 bit mode for eiger) /returns a frame read from recever */ -virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex)=0; +virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex)=0; /** diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp index f0465f195..91b57757f 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp @@ -138,7 +138,7 @@ void postProcessing::processFrame(int *myData, int delflag, int jctb) { // cout << "callback arg "<< getCurrentProgress()<< " " << (fname+string(".raw")).c_str() << " " << getTotalNumberOfChannels() << endl; // cout << "DATAREADY 1" <