diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 8ca9548e5..051d7e8eb 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -5766,10 +5766,11 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy){ int multiSlsDetector::getData(const int isocket, char* 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, uint64_t &fileIndex) { //fail is on parse error or end of acquisition - if (!zmqSocket[isocket]->ReceiveHeader(isocket, acqIndex, frameIndex, subframeIndex, filename)) + if (!zmqSocket[isocket]->ReceiveHeader(isocket, acqIndex, frameIndex, subframeIndex, filename, fileIndex)) return FAIL; //receiving incorrect size is replaced by 0xFF @@ -5808,6 +5809,7 @@ void multiSlsDetector::readFrameFromReceiver(){ uint64_t currentAcquisitionIndex = -1; uint64_t currentFrameIndex = -1; uint32_t currentSubFrameIndex = -1; + uint64_t currentFileIndex = -1; string currentFileName = ""; //getting sls values @@ -5903,7 +5905,7 @@ void multiSlsDetector::readFrameFromReceiver(){ //if running if (runningList[isocket]) { //get individual images - if(FAIL == getData(isocket, image, expectedslssize, currentAcquisitionIndex,currentFrameIndex,currentSubFrameIndex,currentFileName)){ + if(FAIL == getData(isocket, image, expectedslssize, currentAcquisitionIndex,currentFrameIndex,currentSubFrameIndex,currentFileName, currentFileIndex)){ runningList[isocket] = false; --numRunning; continue; @@ -5961,10 +5963,10 @@ void multiSlsDetector::readFrameFromReceiver(){ int nx = thisMultiDetector->numberOfChannelInclGapPixels[X]; int ny = thisMultiDetector->numberOfChannelInclGapPixels[Y]; int n = processImageWithGapPixels(multiframe, multigappixels); - thisData = new detectorData(NULL,NULL,NULL,getCurrentProgress(),currentFileName.c_str(), nx, ny,multigappixels, n, dr); + thisData = new detectorData(NULL,NULL,NULL,getCurrentProgress(),currentFileName.c_str(), nx, ny,multigappixels, n, dr, currentFileIndex); } else { - thisData = new detectorData(NULL,NULL,NULL,getCurrentProgress(),currentFileName.c_str(),maxX,maxY,multiframe, multidatabytes, dr); + thisData = new detectorData(NULL,NULL,NULL,getCurrentProgress(),currentFileName.c_str(),maxX,maxY,multiframe, multidatabytes, dr, currentFileIndex); } dataReady(thisData, currentFrameIndex, currentSubFrameIndex, pCallbackArg); delete thisData; diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h index bf776825a..77b04c493 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h @@ -1518,8 +1518,11 @@ private: * @param frameIndex address of frame index * @param subframeIndex address of subframe index * @param filename address of file name + * @param fileindex address of file index */ - int getData(const int isocket, char* image, const int size, uint64_t &acqIndex, uint64_t &frameIndex, uint32_t &subframeIndex, string &filename); + int getData(const int isocket, char* image, const int size, + uint64_t &acqIndex, uint64_t &frameIndex, uint32_t &subframeIndex, + string &filename, uint64_t &fileIndex); /** diff --git a/slsDetectorSoftware/slsDetectorAnalysis/detectorData.h b/slsDetectorSoftware/slsDetectorAnalysis/detectorData.h index 9f5313bef..3abf9f19d 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/detectorData.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/detectorData.h @@ -19,8 +19,9 @@ class detectorData { \param cval pointer to data in char* format (valid only for non MYTHEN detectors) \param dbytes number of bytes of image pointed to by cval pointer (valid only for non MYTHEN detectors) \param dr dynamic range or bits per pixel (valid only for non MYTHEN detectors) + \param file_ind file index */ - detectorData(double *val=NULL, double *err=NULL, double *ang=NULL, double f_ind=-1, const char *fname="", int np=-1, int ny=1, char *cval=NULL, int dbytes=0, int dr=0) : values(val), errors(err), angles(ang), progressIndex(f_ind), npoints(np), npy(ny), cvalues(cval), databytes(dbytes), dynamicRange(dr), dgainvalues(NULL) { + detectorData(double *val=NULL, double *err=NULL, double *ang=NULL, double f_ind=-1, const char *fname="", int np=-1, int ny=1, char *cval=NULL, int dbytes=0, int dr=0, long long int file_ind=-1) : values(val), errors(err), angles(ang), progressIndex(f_ind), npoints(np), npy(ny), cvalues(cval), databytes(dbytes), dynamicRange(dr), dgainvalues(NULL), fileIndex(file_ind) { strcpy(fileName,fname); }; @@ -42,6 +43,7 @@ class detectorData { int databytes; /**< @short number of bytes of data. Used with cvalues */ int dynamicRange; /**< @short dynamic range */ double* dgainvalues; /**< @short pointer to gain data as double array */ + long long int fileIndex; /**< @short file index */ };