From 6063c712f734a93a08a1e90765e187de2e0690ec Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Tue, 10 Mar 2015 15:04:50 +0100 Subject: [PATCH 1/2] copy first frame to latest data no matter what and also copy only if more than packets per frame --- .../src/UDPBaseImplementation.cpp | 2 +- .../src/UDPStandardImplementation.cpp | 75 +++++++++++-------- .../src/slsReceiverTCPIPInterface.cpp | 4 +- 3 files changed, 45 insertions(+), 36 deletions(-) diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index f12890aa2..8b2cdb598 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -688,7 +688,7 @@ void UDPBaseImplementation::copyFrameToGui(char* startbuf[], uint32_t fnum, char pthread_mutex_unlock(&dataReadyMutex); } - //random read or nth frame read, gui needs data now + //random read or nth frame read, gui needs data now or it is the first frame else{ /* //nth frame read, block current process if the guireader hasnt read it yet diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 6f454ab57..55e8775f7 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -874,7 +874,7 @@ void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, ui if (guiData == NULL){ guiData = latestData; #ifdef VERY_VERY_DEBUG - cout <<"gui data not null anymore" << endl; + cout << "gui data not null anymore" << endl; #endif } @@ -886,14 +886,14 @@ void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, ui //could not get gui data if(!guiDataReady){ #ifdef VERY_VERY_DEBUG - cout<<"gui data not ready"<= packetsPerFrame){//min 1 frame, but neednt be + //if(numpackets == packetsPerFrame * numJobsPerThread){ //only full frames copyFrameToGui(NULL,-1,wbuf[0]+HEADER_SIZE_NUM_TOT_PACKETS); #ifdef VERYVERBOSE cout << ithread << " finished copying" << endl; @@ -2108,8 +2117,16 @@ int i; exit(-1); } + //free buffer + if(rc <= 0){ + cout << ithread << "Discarding empty frame" << endl; + fifoFree[ithread]->push(buffer[ithread]); +#ifdef FIFO_DEBUG + cprintf(BLUE,"%d listener empty buffer pushed into fifofree %x\n", ithread, (void*)(buffer[ithread])); +#endif + } //push the last buffer into fifo - if(rc > 0){ + else{ //eiger (incomplete frames) - throw away if((myDetectorType == EIGER) && (rc < (bufferSize * numJobsPerThread)) ){ if(rc == 266240) @@ -2135,14 +2152,6 @@ int i; #endif } } - //free buffer - else{ - cout << ithread << "Discarding empty frame" << endl; - fifoFree[ithread]->push(buffer[ithread]); -#ifdef FIFO_DEBUG - cprintf(BLUE,"%d listener empty buffer pushed into fifofree %x\n", ithread, (void*)(buffer[ithread])); -#endif - } diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 8b0d52195..8c3815c19 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -1252,10 +1252,10 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){ } #ifdef VERBOSE - if(arg!=-1){ + //if(arg!=-1){ cout << "fName:" << fName << endl; cout << "findex:" << arg << endl; - } + //} #endif From 89ad2112c6b397a340635b5573e2ef645321aa0b Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 12 Mar 2015 12:25:23 +0100 Subject: [PATCH 2/2] difference between acquisition index and frame index --- .../include/UDPBaseImplementation.h | 18 ++- slsReceiverSoftware/include/UDPInterface.h | 10 +- .../include/UDPRESTImplementation.h | 9 +- .../include/UDPStandardImplementation.h | 10 +- .../src/UDPBaseImplementation.cpp | 59 +++++---- .../src/UDPRESTImplementation.cpp | 19 +-- .../src/UDPStandardImplementation.cpp | 36 ++++-- .../src/slsReceiverTCPIPInterface.cpp | 117 +++++++++++++----- 8 files changed, 190 insertions(+), 88 deletions(-) diff --git a/slsReceiverSoftware/include/UDPBaseImplementation.h b/slsReceiverSoftware/include/UDPBaseImplementation.h index 90aaf52b9..6450f85f0 100644 --- a/slsReceiverSoftware/include/UDPBaseImplementation.h +++ b/slsReceiverSoftware/include/UDPBaseImplementation.h @@ -67,6 +67,11 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter //Frame indices and numbers caught + /** + * Returns the frame index at start of entire acquisition (including all scans) + */ + uint32_t getStartAcquisitionIndex(); + /** * Returns current Frame Index Caught for an entire acquisition (including all scans) */ @@ -288,9 +293,11 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter * @param c pointer to current file name * @param raw address of pointer, pointing to current frame to send to gui * @param fnum frame number for eiger as it is not in the packet - * @param fstartind is the start index of the acquisition + * @param startAcquisitionIndex is the start index of the acquisition + * @param startFrameIndex is the start index of the scan */ - void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind); + void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex); + /** * Closes all files * @param ithr thread index @@ -479,6 +486,13 @@ protected: unsigned char fnum[4]; unsigned char header_after[24]; } eiger_image_header; + /** structure of an eiger image header*/ + typedef struct + { + unsigned char header_before[35]; + unsigned char fnum[4]; + unsigned char header_after[9]; + } eiger_image_header32; /** structure of an eiger image header*/ diff --git a/slsReceiverSoftware/include/UDPInterface.h b/slsReceiverSoftware/include/UDPInterface.h index 831b9bb62..8f3ce3f41 100644 --- a/slsReceiverSoftware/include/UDPInterface.h +++ b/slsReceiverSoftware/include/UDPInterface.h @@ -240,6 +240,11 @@ class UDPInterface { */ virtual int getFramesCaught() = 0; + /** + * Returns the frame index at start of entire acquisition (including all scans) + */ + virtual uint32_t getStartAcquisitionIndex()=0; + /** * Returns current Frame Index Caught for an entire acquisition (including all scans) */ @@ -328,9 +333,10 @@ class UDPInterface { * @param c pointer to current file name * @param raw address of pointer, pointing to current frame to send to gui * @param fnum frame number for eiger as it is not in the packet - * @param fstartind is the start index of the acquisition + * @param startAcquisitionIndex is the start index of the acquisition + * @param startFrameIndex is the start index of the scan */ - virtual void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind ) = 0; + virtual void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex)=0; /** set status to transmitting and * when fifo is empty later, sets status to run_finished diff --git a/slsReceiverSoftware/include/UDPRESTImplementation.h b/slsReceiverSoftware/include/UDPRESTImplementation.h index 6f59c30c2..f335ba9d2 100644 --- a/slsReceiverSoftware/include/UDPRESTImplementation.h +++ b/slsReceiverSoftware/include/UDPRESTImplementation.h @@ -89,6 +89,11 @@ class UDPRESTImplementation : protected virtual slsReceiverDefs, public UDPBaseI //Frame indices and numbers caught + /** + * Returns the frame index at start of entire acquisition (including all scans) + */ + uint32_t getStartAcquisitionIndex(); + /** * Returns current Frame Index Caught for an entire acquisition (including all scans) */ @@ -300,8 +305,10 @@ class UDPRESTImplementation : protected virtual slsReceiverDefs, public UDPBaseI * @param c pointer to current file name * @param raw address of pointer, pointing to current frame to send to gui * @param fnum frame number for eiger as it is not in the packet + * @param startAcquisitionIndex is the start index of the acquisition + * @param startFrameIndex is the start index of the scan */ - void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind); + void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex); /** * Closes all files diff --git a/slsReceiverSoftware/include/UDPStandardImplementation.h b/slsReceiverSoftware/include/UDPStandardImplementation.h index dca52e6a4..bad7f7a2e 100644 --- a/slsReceiverSoftware/include/UDPStandardImplementation.h +++ b/slsReceiverSoftware/include/UDPStandardImplementation.h @@ -68,6 +68,11 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase //Frame indices and numbers caught + /** + * Returns the frame index at start of entire acquisition (including all scans) + */ + //uint32_t getStartAcquisitionIndex(); + /** * Returns current Frame Index Caught for an entire acquisition (including all scans) */ @@ -290,8 +295,11 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase * @param c pointer to current file name * @param raw address of pointer, pointing to current frame to send to gui * @param fnum frame number for eiger as it is not in the packet + * @param startAcquisitionIndex is the start index of the acquisition + * @param startFrameIndex is the start index of the scan */ - void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind); + void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex); + /** * Closes all files * @param ithr thread index diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index 8b2cdb598..c70be5b7d 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -155,6 +155,8 @@ int UDPBaseImplementation::getFramesCaught(){ FILE_LOG(logDEBUG) << __AT__ << " int UDPBaseImplementation::getTotalFramesCaught(){ FILE_LOG(logDEBUG) << __AT__ << " starting";return (totalPacketsCaught/packetsPerFrame);} +uint32_t UDPBaseImplementation::getStartAcquisitionIndex(){ FILE_LOG(logDEBUG) << __AT__ << " starting";return startAcquisitionIndex;} + uint32_t UDPBaseImplementation::getStartFrameIndex(){ FILE_LOG(logDEBUG) << __AT__ << " starting";return startFrameIndex;} uint32_t UDPBaseImplementation::getFrameIndex(){ FILE_LOG(logDEBUG) << __AT__ << " starting"; @@ -642,36 +644,33 @@ void UDPBaseImplementation::setupFifoStructure(){ FILE_LOG(logDEBUG) << __AT__ < /** acquisition functions */ -void UDPBaseImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t& fstartind){ - FILE_LOG(logDEBUG) << __AT__ << " starting"; - - //point to gui data - if (guiData == NULL) - guiData = latestData; - - //copy data and filename - strcpy(c,guiFileName); - fnum = guiFrameNumber; - fstartind = getStartFrameIndex(); - - //could not get gui data - if(!guiDataReady){ - *raw = NULL; - } - //data ready, set guidata to receive new data - else{ - *raw = guiData; - guiData = NULL; - - pthread_mutex_lock(&dataReadyMutex); - guiDataReady = 0; - pthread_mutex_unlock(&dataReadyMutex); - if((nFrameToGui) && (writerthreads_mask)){ - /*if(nFrameToGui){*/ - //release after getting data - sem_post(&smp); - } - } +void UDPBaseImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex){ + FILE_LOG(logDEBUG) << __AT__ << " called"; + //point to gui data + if (guiData == NULL){ + guiData = latestData; + } + + //copy data and filename + strcpy(c,guiFileName); + fnum = guiFrameNumber; + startAcquisitionIndex = getStartAcquisitionIndex(); + startFrameIndex = getStartFrameIndex(); + + + //could not get gui data + if(!guiDataReady){ + *raw = NULL; + } + //data ready, set guidata to receive new data + else{ + *raw = guiData; + guiData = NULL; + if((nFrameToGui) && (writerthreads_mask)){ + //release after getting data + sem_post(&smp); + } + } } diff --git a/slsReceiverSoftware/src/UDPRESTImplementation.cpp b/slsReceiverSoftware/src/UDPRESTImplementation.cpp index be929dd0d..b03f92a18 100644 --- a/slsReceiverSoftware/src/UDPRESTImplementation.cpp +++ b/slsReceiverSoftware/src/UDPRESTImplementation.cpp @@ -187,6 +187,11 @@ int UDPRESTImplementation::getTotalFramesCaught(){ return (totalPacketsCaught/packetsPerFrame); } +uint32_t UDPRESTImplementation::getStartAcquisitionIndex(){ + FILE_LOG(logDEBUG) << __AT__ << " called"; + return startAcquisitionIndex; +} + uint32_t UDPRESTImplementation::getStartFrameIndex(){ FILE_LOG(logDEBUG) << __AT__ << " called"; return startFrameIndex; @@ -577,16 +582,19 @@ void UDPRESTImplementation::setupFifoStructure(){ /** acquisition functions */ -void UDPRESTImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind){ +void UDPRESTImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex){ FILE_LOG(logDEBUG) << __AT__ << " called"; //point to gui data - if (guiData == NULL) + if (guiData == NULL){ guiData = latestData; + } //copy data and filename strcpy(c,guiFileName); fnum = guiFrameNumber; - fstartind = getStartFrameIndex(); + startAcquisitionIndex = getStartAcquisitionIndex(); + startFrameIndex = getStartFrameIndex(); + //could not get gui data if(!guiDataReady){ @@ -596,12 +604,7 @@ void UDPRESTImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32 else{ *raw = guiData; guiData = NULL; - - pthread_mutex_lock(&dataReadyMutex); - guiDataReady = 0; - pthread_mutex_unlock(&dataReadyMutex); if((nFrameToGui) && (writerthreads_mask)){ - /*if(nFrameToGui){*/ //release after getting data sem_post(&smp); } diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 55e8775f7..f44ed6017 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -352,6 +352,8 @@ int UDPStandardImplementation::setDetectorType(detectorType det){ FILE_LOG(logD //int UDPStandardImplementation::getTotalFramesCaught(){return (totalPacketsCaught/packetsPerFrame);} +//uint32_t UDPStandardImplementation::getStartAcquisitionIndex(){return startAcquisitionIndex;} + //uint32_t UDPStandardImplementation::getStartFrameIndex(){return startFrameIndex;} /* @@ -868,7 +870,7 @@ void UDPStandardImplementation::setupFifoStructure(){ /** acquisition functions */ -void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind){ +void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex){ FILE_LOG(logDEBUG) << __AT__ << " called"; //point to gui data if (guiData == NULL){ @@ -881,7 +883,9 @@ void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, ui //copy data and filename strcpy(c,guiFileName); fnum = guiFrameNumber; - fstartind = getStartFrameIndex(); + startAcquisitionIndex = getStartAcquisitionIndex(); + startFrameIndex = getStartFrameIndex(); + //could not get gui data if(!guiDataReady){ @@ -975,9 +979,13 @@ cout << "copyframe" << endl; #endif //nth frame read, block current process if the guireader hasnt read it yet if(nFrameToGui){ - //cout<<"waiting after copying"<fnum); if(dynamicRange != 32) tempframenum += (startFrameIndex-1); //eiger frame numbers start at 1, so need to -1 - else + else{ + cout << " 32 bit eiger could be "<< dec << htonl(*(unsigned int*)((eiger_image_header *)((char*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum) << endl; + cout << " 32 bit eiger32 could be "<< dec << htonl(*(unsigned int*)((eiger_image_header32 *)((char*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum) << endl; tempframenum = ((tempframenum / EIGER_32BIT_INITIAL_CONSTANT) + startFrameIndex)-1;//eiger 32 bit mode is a multiple of 17c. +startframeindex for scans + } }else if ((myDetectorType == GOTTHARD) && (shortFrame == -1)) tempframenum = (((((uint32_t)(*((uint32_t*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))))+1)& (frameIndexMask)) >> frameIndexOffset); else @@ -1936,10 +1947,10 @@ int UDPStandardImplementation::startWriting(){ currframenum = tempframenum; pthread_mutex_unlock(&progress_mutex); } -//#ifdef VERYDEBUG +#ifdef VERYDEBUG if(myDetectorType == EIGER) cout << endl <push(buffer[ithread]); #ifdef FIFO_DEBUG @@ -2261,8 +2272,13 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer[]){ //report cprintf(GREEN, "Status: Run Finished\n"); - cprintf(GREEN, "Total Packets Caught:%d\n", totalPacketsCaught); - cprintf(GREEN, "Total Frames Caught:%d\n",(totalPacketsCaught/packetsPerFrame)); + if(!totalPacketsCaught){ + cprintf(RED, "Total Packets Caught:%d\n", totalPacketsCaught); + cprintf(RED, "Total Frames Caught:%d\n",(totalPacketsCaught/packetsPerFrame)); + }else{ + cprintf(GREEN, "Total Packets Caught:%d\n", totalPacketsCaught); + cprintf(GREEN, "Total Frames Caught:%d\n",(totalPacketsCaught/packetsPerFrame)); + } //acquisition end if (acquisitionFinishedCallBack) acquisitionFinishedCallBack((totalPacketsCaught/packetsPerFrame), pAcquisitionFinished); diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 8c3815c19..23d1d0147 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -977,7 +977,9 @@ int slsReceiverTCPIPInterface::read_frame(){ int slsReceiverTCPIPInterface::moench_read_frame(){ ret=OK; char fName[MAX_STR_LENGTH]=""; - int arg = -1,i; + int acquisitionIndex = -1; + int frameIndex= -1; + int i; int bufferSize = MOENCH_BUFFER_SIZE; @@ -990,7 +992,8 @@ int slsReceiverTCPIPInterface::moench_read_frame(){ char* raw = new char[bufferSize]; - uint32_t startIndex=0; + uint32_t startAcquisitionIndex=0; + uint32_t startFrameIndex=0; uint32_t index = 0,bindex = 0, offset=0; strcpy(mess,"Could not read frame\n"); @@ -1001,18 +1004,18 @@ int slsReceiverTCPIPInterface::moench_read_frame(){ /**send garbage with -1 index to try again*/ if(!receiverBase->getFramesCaught()){ - arg = -1; + startAcquisitionIndex = -1; cout<<"haven't caught any frame yet"<getStartFrameIndex();*/ - receiverBase->readFrame(fName,&raw,index,startIndex); + receiverBase->readFrame(fName,&raw,index,startAcquisitionIndex,startFrameIndex); /**send garbage with -1 index to try again*/ if (raw == NULL){ - arg = -1; + startAcquisitionIndex = -1; #ifdef VERBOSE cout<<"data not ready for gui yet"<SendDataOnly(fName,MAX_STR_LENGTH); - socket->SendDataOnly(&arg,sizeof(arg)); + socket->SendDataOnly(&acquisitionIndex,sizeof(acquisitionIndex)); + socket->SendDataOnly(&frameIndex,sizeof(frameIndex)); socket->SendDataOnly(retval,MOENCH_DATA_BYTES); } //return ok/fail @@ -1135,7 +1151,9 @@ int slsReceiverTCPIPInterface::moench_read_frame(){ int slsReceiverTCPIPInterface::gotthard_read_frame(){ ret=OK; char fName[MAX_STR_LENGTH]=""; - int arg = -1,i; + int acquisitionIndex = -1; + int frameIndex= -1; + int i; //retval is a full frame @@ -1161,7 +1179,8 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){ uint32_t index=0,index2=0; uint32_t pindex=0,pindex2=0; uint32_t bindex=0,bindex2=0; - uint32_t startIndex=0; + uint32_t startAcquisitionIndex=0; + uint32_t startFrameIndex=0; strcpy(mess,"Could not read frame\n"); @@ -1173,16 +1192,16 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){ /**send garbage with -1 index to try again*/ if(!receiverBase->getFramesCaught()){ - arg=-1; + startAcquisitionIndex=-1; cout<<"haven't caught any frame yet"<getStartFrameIndex();*/ - receiverBase->readFrame(fName,&raw,index,startIndex); + receiverBase->readFrame(fName,&raw,index,startAcquisitionIndex,startFrameIndex); /**send garbage with -1 index to try again*/ if (raw == NULL){ - arg = -1; + startAcquisitionIndex = -1; #ifdef VERBOSE cout<<"data not ready for gui yet"<SendDataOnly(fName,MAX_STR_LENGTH); - socket->SendDataOnly(&arg,sizeof(arg)); + socket->SendDataOnly(&acquisitionIndex,sizeof(acquisitionIndex)); + socket->SendDataOnly(&frameIndex,sizeof(frameIndex)); socket->SendDataOnly(retval,GOTTHARD_DATA_BYTES); } @@ -1297,7 +1332,9 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){ int slsReceiverTCPIPInterface::eiger_read_frame(){ ret=OK; char fName[MAX_STR_LENGTH]=""; - int arg = -1,i; + int acquisitionIndex = -1; + int frameIndex= -1; + int i; uint32_t index=0; int frameSize = EIGER_ONE_GIGA_ONE_PACKET_SIZE * packetsPerFrame; @@ -1309,7 +1346,8 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){ char* raw = new char[frameSize]; char* origVal = new char[frameSize]; char* retval = new char[dataSize]; - uint32_t startIndex=0; + uint32_t startAcquisitionIndex=0; + uint32_t startFrameIndex=0; strcpy(mess,"Could not read frame\n"); @@ -1320,7 +1358,7 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){ /**send garbage with -1 index to try again*/ if(!receiverBase->getFramesCaught()){ - arg=-1; + startAcquisitionIndex=-1; #ifdef VERBOSE cout<<"haven't caught any frame yet"<readFrame(fName,&raw,index,startIndex); + receiverBase->readFrame(fName,&raw,index,startAcquisitionIndex,startFrameIndex); #ifdef VERBOSE cout << "index:" << dec << index << endl; #endif /**send garbage with -1 index to try again*/ if (raw == NULL){ - arg = -1; + startAcquisitionIndex = -1; #ifdef VERBOSE cout<<"data not ready for gui yet"<SendDataOnly(fName,MAX_STR_LENGTH); - socket->SendDataOnly(&arg,sizeof(arg)); + socket->SendDataOnly(&acquisitionIndex,sizeof(acquisitionIndex)); + socket->SendDataOnly(&frameIndex,sizeof(frameIndex)); socket->SendDataOnly(retval,dataSize); }