using file index from zmq

This commit is contained in:
Dhanya Maliakal 2017-11-28 14:45:29 +01:00
parent 57fc89a6bb
commit 6a41b5ce3a
3 changed files with 14 additions and 7 deletions

View File

@ -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;

View File

@ -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);
/**

View File

@ -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 */
};