From 53be854efdc328ef30f6ece3482abdf8b2488aa4 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Mon, 13 Mar 2017 11:33:06 +0100 Subject: [PATCH 01/13] including subframe number --- .../include/UDPBaseImplementation.h | 32 +++++++------ slsReceiverSoftware/include/UDPInterface.h | 12 +++-- slsReceiverSoftware/include/receiver_defs.h | 6 ++- slsReceiverSoftware/include/slsReceiver.h | 41 ++++++++++------ .../include/slsReceiverTCPIPInterface.h | 32 +++++++------ .../include/slsReceiverUsers.h | 16 ++----- .../src/UDPBaseImplementation.cpp | 6 +-- .../src/UDPStandardImplementation.cpp | 48 ++++++++++++++----- slsReceiverSoftware/src/slsReceiver.cpp | 6 +-- .../src/slsReceiverTCPIPInterface.cpp | 6 +-- slsReceiverSoftware/src/slsReceiverUsers.cpp | 6 +-- 11 files changed, 126 insertions(+), 85 deletions(-) diff --git a/slsReceiverSoftware/include/UDPBaseImplementation.h b/slsReceiverSoftware/include/UDPBaseImplementation.h index ce8a3ddb7..728f39d6c 100644 --- a/slsReceiverSoftware/include/UDPBaseImplementation.h +++ b/slsReceiverSoftware/include/UDPBaseImplementation.h @@ -486,30 +486,32 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter * fileindex * datasize * - * return value is the action which decides what the user and default responsibilities to save data are + * return value is * 0 callback takes care of open,close,wrie file * 1 callback writes file, we have to open, close it * 2 we open, close, write file, callback does not do anything */ - void registerCallBackStartAcquisition(int (*func)(char*, char*,int, int, void*),void *arg); + void registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg); /** * Call back for acquisition finished * callback argument is * total frames caught */ - void registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg); + void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg); /** * Call back for raw data * args to raw data ready callback are - * framenum + * index + * frame number + * timestamp/ bunch id + * exposure length/ sub frame number * datapointer * datasize in bytes * file descriptor - * guidatapointer (NULL, no data required) */ - void registerCallBackRawDataReady(void (*func)(int, char*, int, FILE*, char*, void*),void *arg); + void registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg); @@ -599,7 +601,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter //***callback parameters*** /** - * function being called back for start acquisition + * Call back for start acquisition * callback arguments are * filepath * filename @@ -611,28 +613,30 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter * 1 callback writes file, we have to open, close it * 2 we open, close, write file, callback does not do anything */ - int (*startAcquisitionCallBack)(char*, char*,int, int, void*); + int (*startAcquisitionCallBack)(char*, char*, uint64_t, uint32_t, void*); void *pStartAcquisition; /** - * function being called back for acquisition finished + * Call back for acquisition finished * callback argument is * total frames caught */ - void (*acquisitionFinishedCallBack)(int, void*); + void (*acquisitionFinishedCallBack)(uint64_t, void*); void *pAcquisitionFinished; /** - * function being called back for raw data + * Call back for raw data * args to raw data ready callback are - * framenum + * index + * frame number + * timestamp/ bunch id + * exposure length/ sub frame number * datapointer * datasize in bytes * file descriptor - * guidatapointer (NULL, no data required) */ - void (*rawDataReadyCallBack)(int, char*, int, FILE*, char*, void*); + void (*rawDataReadyCallBack)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*); void *pRawDataReady; diff --git a/slsReceiverSoftware/include/UDPInterface.h b/slsReceiverSoftware/include/UDPInterface.h index 8bdc1a87e..3c42dbfd1 100644 --- a/slsReceiverSoftware/include/UDPInterface.h +++ b/slsReceiverSoftware/include/UDPInterface.h @@ -548,25 +548,27 @@ class UDPInterface { * 1 callback writes file, we have to open, close it * 2 we open, close, write file, callback does not do anything */ - virtual void registerCallBackStartAcquisition(int (*func)(char*, char*,int, int, void*),void *arg) = 0; + virtual void registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg) = 0; /** * Call back for acquisition finished * callback argument is * total frames caught */ - virtual void registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg) = 0; + virtual void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg) = 0; /** * Call back for raw data * args to raw data ready callback are - * framenum + * index + * frame number + * timestamp/ bunch id + * exposure length/ sub frame number * datapointer * datasize in bytes * file descriptor - * guidatapointer (NULL, no data required) */ - virtual void registerCallBackRawDataReady(void (*func)(int, char*, int, FILE*, char*, void*),void *arg) = 0; + virtual void registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg) = 0; protected: diff --git a/slsReceiverSoftware/include/receiver_defs.h b/slsReceiverSoftware/include/receiver_defs.h index ec848bf4f..6f4b8fb83 100755 --- a/slsReceiverSoftware/include/receiver_defs.h +++ b/slsReceiverSoftware/include/receiver_defs.h @@ -58,8 +58,10 @@ typedef struct { #define HEADER_SIZE_NUM_PACKETS 1 #define ALL_MASK_32 0xFFFFFFFF -#define FILE_FRAME_HEADER_LENGTH 16 -#define FILE_HEADER_BUNCHID_OFFSET 8 +#define FILE_FRAME_HEADER_LENGTH (8*3) +#define FILE_HEADER_TIMESTAMP_OFFSET 8 //start of frame/ bunch id +#define FILE_HEADER_EXPLENGTH_OFFSET 16 //exposure length/ sub frame number + //all max frames defined in sls_receiver_defs.h. 20000 gotthard, 100000 for short gotthard, 1000 for moench, eiger 20000 diff --git a/slsReceiverSoftware/include/slsReceiver.h b/slsReceiverSoftware/include/slsReceiver.h index e76ea7d1b..5a2118cab 100644 --- a/slsReceiverSoftware/include/slsReceiver.h +++ b/slsReceiverSoftware/include/slsReceiver.h @@ -58,28 +58,39 @@ class slsReceiver : private virtual slsReceiverDefs { int64_t getReceiverVersion(); /** - @sort register calbback for starting the acquisition - @param func callback to be called when starting the acquisition. Its arguments are filepath filename fileindex data size - \returns 0 callback takes care of open,close,write file; 1 callback writes file, we have to open, close it; 2 we open, close, write file, callback does not do anything + * Call back for start acquisition + * callback arguments are + * filepath + * filename + * fileindex + * datasize + * + * return value is + * 0 callback takes care of open,close,wrie file + * 1 callback writes file, we have to open, close it + * 2 we open, close, write file, callback does not do anything */ - void registerCallBackStartAcquisition(int (*func)(char*, char*,int, int, void*),void *arg); - + void registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg); /** - callback argument is - toatal farmes caught + * Call back for acquisition finished + * callback argument is + * total frames caught */ - void registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg); + void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg); /** - args to raw data ready callback are - framenum - datapointer - datasize in bytes - file descriptor - guidatapointer (NULL, no data required) + * Call back for raw data + * args to raw data ready callback are + * index + * frame number + * timestamp/ bunch id + * exposure length/ sub frame number + * datapointer + * datasize in bytes + * file descriptor */ - void registerCallBackRawDataReady(void (*func)(int, char*, int, FILE*, char*, void*),void *arg); + void registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg); private: diff --git a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h index f0bf66f03..c967d4335 100644 --- a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h +++ b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h @@ -65,30 +65,32 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs { * fileindex * datasize * - * return value is the action which decides what the user and default responsibilities to save data are + * return value is * 0 callback takes care of open,close,wrie file * 1 callback writes file, we have to open, close it * 2 we open, close, write file, callback does not do anything */ - void registerCallBackStartAcquisition(int (*func)(char*, char*,int, int, void*),void *arg); + void registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg); /** * Call back for acquisition finished * callback argument is * total frames caught */ - void registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg); + void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg); /** * Call back for raw data * args to raw data ready callback are - * framenum + * index + * frame number + * timestamp/ bunch id + * exposure length/ sub frame number * datapointer * datasize in bytes * file descriptor - * guidatapointer (NULL, no data required) */ - void registerCallBackRawDataReady(void (*func)(int, char*, int, FILE*, char*, void*),void *arg); + void registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg); private: @@ -292,7 +294,7 @@ private: //***callback parameters*** /** - * function being called back for start acquisition + * Call back for start acquisition * callback arguments are * filepath * filename @@ -304,28 +306,30 @@ private: * 1 callback writes file, we have to open, close it * 2 we open, close, write file, callback does not do anything */ - int (*startAcquisitionCallBack)(char*, char*,int, int, void*); + int (*startAcquisitionCallBack)(char*, char*, uint64_t, uint32_t, void*); void *pStartAcquisition; /** - * function being called back for acquisition finished + * Call back for acquisition finished * callback argument is * total frames caught */ - void (*acquisitionFinishedCallBack)(int, void*); + void (*acquisitionFinishedCallBack)(uint64_t, void*); void *pAcquisitionFinished; /** - * function being called back for raw data + * Call back for raw data * args to raw data ready callback are - * framenum + * index + * frame number + * timestamp/ bunch id + * exposure length/ sub frame number * datapointer * datasize in bytes * file descriptor - * guidatapointer (NULL, no data required) */ - void (*rawDataReadyCallBack)(int, char*, int, FILE*, char*, void*); + void (*rawDataReadyCallBack)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*); void *pRawDataReady; diff --git a/slsReceiverSoftware/include/slsReceiverUsers.h b/slsReceiverSoftware/include/slsReceiverUsers.h index eea403560..45e6d62e0 100644 --- a/slsReceiverSoftware/include/slsReceiverUsers.h +++ b/slsReceiverSoftware/include/slsReceiverUsers.h @@ -55,13 +55,10 @@ public: /** @sort register calbback for starting the acquisition - \param func callback to be called when starting the acquisition. Its arguments are filepath filename fileindex data size - + \param func callback to be called when starting the acquisition. Its arguments are filepath, filename, fileindex, datasize \returns 0 callback takes care of open,close,write file; 1 callback writes file, we have to open, close it; 2 we open, close, write file, callback does not do anything - */ - - void registerCallBackStartAcquisition(int (*func)(char* filepath, char* filename,int fileindex, int datasize, void*),void *arg); + void registerCallBackStartAcquisition(int (*func)(char* filepath, char* filename, uint64_t fileindex, uint32_t datasize, void*),void *arg); /** @@ -69,20 +66,17 @@ public: \param func end of acquisition callback. Argument nf is total frames caught \returns nothing */ - - - void registerCallBackAcquisitionFinished(void (*func)(int nf, void*),void *arg); + void registerCallBackAcquisitionFinished(void (*func)(uint64_t nf, void*),void *arg); /** @sort register callback to be called when data are available (to process and/or save the data). - \param func raw data ready callback. arguments are framenum datapointer datasize file descriptor guidatapointer (NULL, no data required) + \param func raw data ready callback. arguments are index, frame number, timestamp/ bunch id, exposure length/ sub frame number, datapointer, datasize in bytes, file descriptor \returns nothing */ + void registerCallBackRawDataReady(void (*func)(int index, uint64_t framenumber, uint64_t timestamp, uint64_t explength, char* datapointer, uint32_t datasize, FILE* filedescriptor, void*),void *arg); - void registerCallBackRawDataReady(void (*func)(int framenumber, char* datapointer, int datasize, FILE* filedescriptor, char* guidatapointer, void*),void *arg); - //receiver object slsReceiver* receiver; }; diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index e0bf65f6d..b2a5f69b0 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -507,17 +507,17 @@ int UDPBaseImplementation::setActivate(int enable){ } /***callback functions***/ -void UDPBaseImplementation::registerCallBackStartAcquisition(int (*func)(char*, char*,int, int, void*),void *arg){ +void UDPBaseImplementation::registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg){ startAcquisitionCallBack=func; pStartAcquisition=arg; } -void UDPBaseImplementation::registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg){ +void UDPBaseImplementation::registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg){ acquisitionFinishedCallBack=func; pAcquisitionFinished=arg; } -void UDPBaseImplementation::registerCallBackRawDataReady(void (*func)(int, char*, int, FILE*, char*, void*),void *arg){ +void UDPBaseImplementation::registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg){ rawDataReadyCallBack=func; pRawDataReady=arg; } diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 79d8e0520..2672a3fbd 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -1527,7 +1527,7 @@ int UDPStandardImplementation::setupWriter(){ //acquisition start call back returns enable write cbAction = DO_EVERYTHING; if (startAcquisitionCallBack) - cbAction=startAcquisitionCallBack(filePath,fileNamePerThread[0],(int)fileIndex,bufferSize,pStartAcquisition); + cbAction=startAcquisitionCallBack(filePath,fileNamePerThread[0],fileIndex, (uint32_t)bufferSize,pStartAcquisition); if(cbAction < DO_EVERYTHING){ @@ -2175,6 +2175,7 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread) uint32_t pnum = 0; uint64_t fnum = 0; uint64_t bnum = 0; + uint64_t snum = 0; int rc = 0; //from getframeandpacketnumber() uint32_t pi = 0; @@ -2193,7 +2194,8 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread) } else fnum = fi; //fnum of first packet - bnum = bi; //bnum of first packet + bnum = bi; //bnum of first packet + snum = si; //snum of first packet totalListeningPacketCount[ithread]++; #ifdef VERBOSE if(!ithread) cout << "1 pnum:" << pnum << endl; @@ -2283,6 +2285,7 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread) if(fi!=ALL_MASK_32) fnum = fi; //fnum of first packet bnum = bi; //bnum of first packet + snum = si; //snum of first packet } } //------------------------------------------------------ got a complete frame -------------------------------------------------------- @@ -2292,8 +2295,21 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread) #ifdef VERBOSE if(!ithread) cout << "fnum:" << (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))) << endl; #endif - if(myDetectorType == JUNGFRAU) - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_BUNCHID_OFFSET))) = bnum; + switch (myDetectorType) { + case JUNGFRAU: + (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))) = bnum; + (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = 0; + break; + case EIGER: + (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))) = 0; + (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = snum; + break; + default: + (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))) = 0; + (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = 0; + break; + } + //write packet count to buffer *((uint32_t*)(buffer[ithread])) = packetsPerFrame; return bufferSize; @@ -2802,7 +2818,7 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){ cprintf(RED,"Note: Deactivated Receiver\n"); //acquisition end if (acquisitionFinishedCallBack) - acquisitionFinishedCallBack((int)totalPacketsCaught, pAcquisitionFinished); + acquisitionFinishedCallBack(totalPacketsCaught, pAcquisitionFinished); } } @@ -2827,8 +2843,12 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* //callback to write data if (cbAction < DO_EVERYTHING) - rawDataReadyCallBack((int)tempframenumber, wbuffer + fifoBufferHeaderSize, npackets * onePacketSize, - sfilefd[ithread], latestData[ithread],pRawDataReady);//know which thread from sfilefd + rawDataReadyCallBack(detID*numberofListeningThreads+ithread, tempframenumber, + 0,0, + wbuffer + fifoBufferHeaderSize, + bufferSize * numberofJobsPerBuffer + fifoBufferHeaderSize, + sfilefd[ithread], pRawDataReady);//know which thread from sfilefd + //write to file if enabled and update write parameters @@ -2870,14 +2890,17 @@ void UDPStandardImplementation::handleCompleteFramesOnly(int ithread, char* wbuf FILE_LOG(logDEBUG) << __AT__ << " called"; //get current frame number - uint64_t tempframenumber; - tempframenumber = (*((uint64_t*)(wbuffer+HEADER_SIZE_NUM_TOT_PACKETS))); - tempframenumber -= startFrameIndex; + uint64_t tempframenumber = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS))); + uint64_t bnum = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))); + uint64_t snum = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))); if (cbAction < DO_EVERYTHING) - rawDataReadyCallBack((int)tempframenumber, wbuffer + HEADER_SIZE_NUM_TOT_PACKETS, bufferSize + FILE_FRAME_HEADER_LENGTH, - sfilefd[ithread], latestData[ithread],pRawDataReady); + rawDataReadyCallBack(detID*numberofListeningThreads+ithread, tempframenumber, + bnum, snum, + wbuffer + fifoBufferHeaderSize, + bufferSize * numberofJobsPerBuffer + fifoBufferHeaderSize, + sfilefd[ithread], pRawDataReady); //write to file if enabled and update write parameters @@ -2887,6 +2910,7 @@ void UDPStandardImplementation::handleCompleteFramesOnly(int ithread, char* wbuf fwrite(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS, 1, (bufferSize + FILE_FRAME_HEADER_LENGTH), sfilefd[ithread]); } + tempframenumber -= startFrameIndex; //progress if(tempframenumber && (tempframenumber%(maxFramesPerFile/progressFrequency)) == 0){ diff --git a/slsReceiverSoftware/src/slsReceiver.cpp b/slsReceiverSoftware/src/slsReceiver.cpp index 04bc29563..85750c517 100644 --- a/slsReceiverSoftware/src/slsReceiver.cpp +++ b/slsReceiverSoftware/src/slsReceiver.cpp @@ -160,7 +160,7 @@ int64_t slsReceiver::getReceiverVersion(){ } -void slsReceiver::registerCallBackStartAcquisition(int (*func)(char*, char*,int, int, void*),void *arg){ +void slsReceiver::registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg){ //tcpipInterface if(udp_interface) udp_interface->registerCallBackStartAcquisition(func,arg); @@ -170,7 +170,7 @@ void slsReceiver::registerCallBackStartAcquisition(int (*func)(char*, char*,int, -void slsReceiver::registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg){ +void slsReceiver::registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg){ //tcpipInterface if(udp_interface) udp_interface->registerCallBackAcquisitionFinished(func,arg); @@ -179,7 +179,7 @@ void slsReceiver::registerCallBackAcquisitionFinished(void (*func)(int, void*),v } -void slsReceiver::registerCallBackRawDataReady(void (*func)(int, char*, int, FILE*, char*, void*),void *arg){ +void slsReceiver::registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg){ //tcpipInterface if(udp_interface) udp_interface->registerCallBackRawDataReady(func,arg); diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index e477c6655..304476e56 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -3393,17 +3393,17 @@ int slsReceiverTCPIPInterface::exec_command() { /***callback functions***/ -void slsReceiverTCPIPInterface::registerCallBackStartAcquisition(int (*func)(char*, char*,int, int, void*),void *arg){ +void slsReceiverTCPIPInterface::registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg){ startAcquisitionCallBack=func; pStartAcquisition=arg; } -void slsReceiverTCPIPInterface::registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg){ +void slsReceiverTCPIPInterface::registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg){ acquisitionFinishedCallBack=func; pAcquisitionFinished=arg; } -void slsReceiverTCPIPInterface::registerCallBackRawDataReady(void (*func)(int, char*, int, FILE*, char*, void*),void *arg){ +void slsReceiverTCPIPInterface::registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg){ rawDataReadyCallBack=func; pRawDataReady=arg; } diff --git a/slsReceiverSoftware/src/slsReceiverUsers.cpp b/slsReceiverSoftware/src/slsReceiverUsers.cpp index 8a1d17f43..384ce86ea 100644 --- a/slsReceiverSoftware/src/slsReceiverUsers.cpp +++ b/slsReceiverSoftware/src/slsReceiverUsers.cpp @@ -27,18 +27,18 @@ int64_t slsReceiverUsers::getReceiverVersion(){ } -void slsReceiverUsers::registerCallBackStartAcquisition(int (*func)(char*, char*,int, int, void*),void *arg){ +void slsReceiverUsers::registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg){ receiver->registerCallBackStartAcquisition(func,arg); } -void slsReceiverUsers::registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg){ +void slsReceiverUsers::registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg){ receiver->registerCallBackAcquisitionFinished(func,arg); } -void slsReceiverUsers::registerCallBackRawDataReady(void (*func)(int, char*, int, FILE*, char*, void*),void *arg){ +void slsReceiverUsers::registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*), void *arg){ receiver->registerCallBackRawDataReady(func,arg); } From 36e92c194de0b6f6a75e44c2423222462b7adb2f Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Tue, 14 Mar 2017 08:23:47 +0100 Subject: [PATCH 02/13] changes for callback to work --- .../src/UDPStandardImplementation.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 2672a3fbd..09b86ac2e 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -1526,9 +1526,15 @@ int UDPStandardImplementation::setupWriter(){ //acquisition start call back returns enable write cbAction = DO_EVERYTHING; - if (startAcquisitionCallBack) - cbAction=startAcquisitionCallBack(filePath,fileNamePerThread[0],fileIndex, (uint32_t)bufferSize,pStartAcquisition); - + if (startAcquisitionCallBack) { + //remove detector index in the file name + int deti = -1; + string tempname(fileName); + size_t uscore=tempname.rfind("_"); + if ((uscore!=string::npos) && (sscanf(tempname.substr(uscore+1,tempname.size()-uscore-1).c_str(),"d%d",&deti))) + tempname=tempname.substr(0,uscore); + cbAction=startAcquisitionCallBack(filePath, (char*)tempname.c_str(),fileIndex, (uint32_t)bufferSize,pStartAcquisition); + } if(cbAction < DO_EVERYTHING){ FILE_LOG(logINFO) << "Call back activated. Data saving must be taken care of by user in call back."; @@ -2302,7 +2308,10 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread) break; case EIGER: (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))) = 0; - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = snum; + if (dynamicRange == 32) + (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = snum; + else + (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = 0; break; default: (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))) = 0; @@ -2818,7 +2827,7 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){ cprintf(RED,"Note: Deactivated Receiver\n"); //acquisition end if (acquisitionFinishedCallBack) - acquisitionFinishedCallBack(totalPacketsCaught, pAcquisitionFinished); + acquisitionFinishedCallBack((totalPacketsCaught/(packetsPerFrame*numberofListeningThreads)), pAcquisitionFinished); } } From 9f68fc6f3b26be3b4bad659b40b9d4453291de7c Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Wed, 15 Mar 2017 15:00:25 +0100 Subject: [PATCH 03/13] fixed call backs with new standard header --- .../include/UDPBaseImplementation.h | 53 +++++++---- slsReceiverSoftware/include/UDPInterface.h | 26 ++++-- slsReceiverSoftware/include/receiver_defs.h | 7 +- slsReceiverSoftware/include/slsReceiver.h | 27 ++++-- .../include/slsReceiverTCPIPInterface.h | 52 +++++++---- .../include/slsReceiverUsers.h | 10 +- .../include/sls_receiver_defs.h | 34 +++++++ .../src/UDPBaseImplementation.cpp | 3 +- .../src/UDPStandardImplementation.cpp | 93 +++++++++++-------- slsReceiverSoftware/src/slsReceiver.cpp | 3 +- .../src/slsReceiverTCPIPInterface.cpp | 3 +- slsReceiverSoftware/src/slsReceiverUsers.cpp | 9 +- 12 files changed, 219 insertions(+), 101 deletions(-) diff --git a/slsReceiverSoftware/include/UDPBaseImplementation.h b/slsReceiverSoftware/include/UDPBaseImplementation.h index 728f39d6c..0519d1a56 100644 --- a/slsReceiverSoftware/include/UDPBaseImplementation.h +++ b/slsReceiverSoftware/include/UDPBaseImplementation.h @@ -503,15 +503,25 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter /** * Call back for raw data * args to raw data ready callback are - * index - * frame number - * timestamp/ bunch id - * exposure length/ sub frame number - * datapointer - * datasize in bytes - * file descriptor + * frameNumber is the frame number + * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) + * packetNumber is the packet number + * bunchId is the bunch id from beamline + * timestamp is the time stamp with 10 MHz clock + * modId is the unique module id (unique even for left, right, top, bottom) + * xCoord is the x coordinate in the complete detector system + * yCoord is the y coordinate in the complete detector system + * zCoord is the z coordinate in the complete detector system + * debug is for debugging purposes + * roundRNumber is the round robin set number + * detType is the detector type see :: detectorType + * version is the version number of this structure format + * dataPointer is the pointer to the data + * dataSize in bytes is the size of the data in bytes + * fileDescriptor is the file descriptor */ - void registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg); + void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*),void *arg); @@ -628,18 +638,29 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter /** * Call back for raw data * args to raw data ready callback are - * index - * frame number - * timestamp/ bunch id - * exposure length/ sub frame number - * datapointer - * datasize in bytes - * file descriptor + * frameNumber is the frame number + * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) + * packetNumber is the packet number + * bunchId is the bunch id from beamline + * timestamp is the time stamp with 10 MHz clock + * modId is the unique module id (unique even for left, right, top, bottom) + * xCoord is the x coordinate in the complete detector system + * yCoord is the y coordinate in the complete detector system + * zCoord is the z coordinate in the complete detector system + * debug is for debugging purposes + * roundRNumber is the round robin set number + * detType is the detector type see :: detectorType + * version is the version number of this structure format + * dataPointer is the pointer to the data + * dataSize in bytes is the size of the data in bytes + * fileDescriptor is the file descriptor */ - void (*rawDataReadyCallBack)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*); + void (*rawDataReadyCallBack)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*); void *pRawDataReady; + private: }; diff --git a/slsReceiverSoftware/include/UDPInterface.h b/slsReceiverSoftware/include/UDPInterface.h index 3c42dbfd1..de497a0b6 100644 --- a/slsReceiverSoftware/include/UDPInterface.h +++ b/slsReceiverSoftware/include/UDPInterface.h @@ -560,15 +560,25 @@ class UDPInterface { /** * Call back for raw data * args to raw data ready callback are - * index - * frame number - * timestamp/ bunch id - * exposure length/ sub frame number - * datapointer - * datasize in bytes - * file descriptor + * frameNumber is the frame number + * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) + * packetNumber is the packet number + * bunchId is the bunch id from beamline + * timestamp is the time stamp with 10 MHz clock + * modId is the unique module id (unique even for left, right, top, bottom) + * xCoord is the x coordinate in the complete detector system + * yCoord is the y coordinate in the complete detector system + * zCoord is the z coordinate in the complete detector system + * debug is for debugging purposes + * roundRNumber is the round robin set number + * detType is the detector type see :: detectorType + * version is the version number of this structure format + * dataPointer is the pointer to the data + * dataSize in bytes is the size of the data in bytes + * fileDescriptor is the file descriptor */ - virtual void registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg) = 0; + virtual void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*),void *arg) = 0; protected: diff --git a/slsReceiverSoftware/include/receiver_defs.h b/slsReceiverSoftware/include/receiver_defs.h index 6f4b8fb83..6301f879a 100755 --- a/slsReceiverSoftware/include/receiver_defs.h +++ b/slsReceiverSoftware/include/receiver_defs.h @@ -58,9 +58,10 @@ typedef struct { #define HEADER_SIZE_NUM_PACKETS 1 #define ALL_MASK_32 0xFFFFFFFF -#define FILE_FRAME_HEADER_LENGTH (8*3) -#define FILE_HEADER_TIMESTAMP_OFFSET 8 //start of frame/ bunch id -#define FILE_HEADER_EXPLENGTH_OFFSET 16 //exposure length/ sub frame number +#define SLS_DETECTOR_HEADER_VERSION 0x1 +//#define FILE_FRAME_HEADER_LENGTH (8*3) +//#define FILE_HEADER_TIMESTAMP_OFFSET 8 //start of frame/ bunch id +//#define FILE_HEADER_EXPLENGTH_OFFSET 16 //exposure length/ sub frame number diff --git a/slsReceiverSoftware/include/slsReceiver.h b/slsReceiverSoftware/include/slsReceiver.h index 5a2118cab..35feec9f4 100644 --- a/slsReceiverSoftware/include/slsReceiver.h +++ b/slsReceiverSoftware/include/slsReceiver.h @@ -82,15 +82,26 @@ class slsReceiver : private virtual slsReceiverDefs { /** * Call back for raw data * args to raw data ready callback are - * index - * frame number - * timestamp/ bunch id - * exposure length/ sub frame number - * datapointer - * datasize in bytes - * file descriptor + * frameNumber is the frame number + * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) + * packetNumber is the packet number + * bunchId is the bunch id from beamline + * timestamp is the time stamp with 10 MHz clock + * modId is the unique module id (unique even for left, right, top, bottom) + * xCoord is the x coordinate in the complete detector system + * yCoord is the y coordinate in the complete detector system + * zCoord is the z coordinate in the complete detector system + * debug is for debugging purposes + * roundRNumber is the round robin set number + * detType is the detector type see :: detectorType + * version is the version number of this structure format + * dataPointer is the pointer to the data + * dataSize in bytes is the size of the data in bytes + * fileDescriptor is the file descriptor */ - void registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg); + void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*),void *arg); + private: diff --git a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h index c967d4335..bed74d936 100644 --- a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h +++ b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h @@ -82,15 +82,25 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs { /** * Call back for raw data * args to raw data ready callback are - * index - * frame number - * timestamp/ bunch id - * exposure length/ sub frame number - * datapointer - * datasize in bytes - * file descriptor + * frameNumber is the frame number + * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) + * packetNumber is the packet number + * bunchId is the bunch id from beamline + * timestamp is the time stamp with 10 MHz clock + * modId is the unique module id (unique even for left, right, top, bottom) + * xCoord is the x coordinate in the complete detector system + * yCoord is the y coordinate in the complete detector system + * zCoord is the z coordinate in the complete detector system + * debug is for debugging purposes + * roundRNumber is the round robin set number + * detType is the detector type see :: detectorType + * version is the version number of this structure format + * dataPointer is the pointer to the data + * dataSize in bytes is the size of the data in bytes + * fileDescriptor is the file descriptor */ - void registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg); + void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*),void *arg); private: @@ -321,15 +331,25 @@ private: /** * Call back for raw data * args to raw data ready callback are - * index - * frame number - * timestamp/ bunch id - * exposure length/ sub frame number - * datapointer - * datasize in bytes - * file descriptor + * frameNumber is the frame number + * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) + * packetNumber is the packet number + * bunchId is the bunch id from beamline + * timestamp is the time stamp with 10 MHz clock + * modId is the unique module id (unique even for left, right, top, bottom) + * xCoord is the x coordinate in the complete detector system + * yCoord is the y coordinate in the complete detector system + * zCoord is the z coordinate in the complete detector system + * debug is for debugging purposes + * roundRNumber is the round robin set number + * detType is the detector type see :: detectorType + * version is the version number of this structure format + * dataPointer is the pointer to the data + * dataSize in bytes is the size of the data in bytes + * fileDescriptor is the file descriptor */ - void (*rawDataReadyCallBack)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*); + void (*rawDataReadyCallBack)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*); void *pRawDataReady; diff --git a/slsReceiverSoftware/include/slsReceiverUsers.h b/slsReceiverSoftware/include/slsReceiverUsers.h index 45e6d62e0..c59e4cf13 100644 --- a/slsReceiverSoftware/include/slsReceiverUsers.h +++ b/slsReceiverSoftware/include/slsReceiverUsers.h @@ -72,10 +72,12 @@ public: /** @sort register callback to be called when data are available (to process and/or save the data). - \param func raw data ready callback. arguments are index, frame number, timestamp/ bunch id, exposure length/ sub frame number, datapointer, datasize in bytes, file descriptor - \returns nothing - */ - void registerCallBackRawDataReady(void (*func)(int index, uint64_t framenumber, uint64_t timestamp, uint64_t explength, char* datapointer, uint32_t datasize, FILE* filedescriptor, void*),void *arg); + \param func raw data ready callback. arguments are frameNumber, expLength, packetNumber, bunchId, timestamp, modId, xCoord, yCoord, zCoord, debug, roundRNumber, detType, version, dataPointer, dataSize, fileDescriptor + \returns nothing + */ + void registerCallBackRawDataReady(void (*func)(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp, + uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version, + char* datapointer, uint32_t datasize, FILE* filedescriptor, void*),void *arg); //receiver object slsReceiver* receiver; diff --git a/slsReceiverSoftware/include/sls_receiver_defs.h b/slsReceiverSoftware/include/sls_receiver_defs.h index ce0fad9fa..2dee3ddd1 100755 --- a/slsReceiverSoftware/include/sls_receiver_defs.h +++ b/slsReceiverSoftware/include/sls_receiver_defs.h @@ -116,6 +116,40 @@ public: STOPPED /**< acquisition stopped externally */ }; + + /** + @short structure for a Detector Packet or Image Header + @li frameNumber is the frame number + @li expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) + @li packetNumber is the packet number + @li bunchId is the bunch id from beamline + @li timestamp is the time stamp with 10 MHz clock + @li modId is the unique module id (unique even for left, right, top, bottom) + @li xCoord is the x coordinate in the complete detector system + @li yCoord is the y coordinate in the complete detector system + @li zCoord is the z coordinate in the complete detector system + @li debug is for debugging purposes + @li roundRNumber is the round robin set number + @li detType is the detector type see :: detectorType + @li version is the version number of this structure format + */ + typedef struct { + uint64_t frameNumber; /**< is the frame number */ + uint32_t expLength; /**< is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) */ + uint32_t packetNumber; /**< is the packet number */ + uint64_t bunchId; /**< is the bunch id from beamline */ + uint64_t timestamp; /**< is the time stamp with 10 MHz clock */ + uint16_t modId; /**< is the unique module id (unique even for left, right, top, bottom) */ + uint16_t xCoord; /**< is the x coordinate in the complete detector system */ + uint16_t yCoord; /**< is the y coordinate in the complete detector system */ + uint16_t zCoord; /**< is the z coordinate in the complete detector system */ + uint32_t debug; /**< is for debugging purposes */ + uint16_t roundRNumber; /**< is the round robin set number */ + uint8_t detType; /**< is the detector type see :: detectorType */ + uint8_t version; /**< is the version number of this structure format */ + } sls_detector_header; + + #ifdef __cplusplus /** returns string from enabled/disabled \param b true or false diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index b2a5f69b0..8d184ed82 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -517,7 +517,8 @@ void UDPBaseImplementation::registerCallBackAcquisitionFinished(void (*func)(uin pAcquisitionFinished=arg; } -void UDPBaseImplementation::registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg){ +void UDPBaseImplementation::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*),void *arg){ rawDataReadyCallBack=func; pRawDataReady=arg; } diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 09b86ac2e..216dfabb9 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -650,7 +650,7 @@ int UDPStandardImplementation::setDynamicRange(const uint32_t i){ if(latestData[i]){delete[] latestData[i];latestData[i] = 0;} } for(int i=0;iframeNumber = (uint64_t) (fnum + startAcquisitionIndex); + if (myDetectorType == EIGER && dynamicRange == 32) + header->expLength = (uint32_t) snum; + header->packetNumber = (uint32_t) packetsPerFrame; + if (myDetectorType == JUNGFRAU) + header->bunchId = (uint64_t) bnum; + header->xCoord = (uint16_t) detID * numberofListeningThreads + ithread; + header->detType = (uint8_t) myDetectorType; + header->version = (uint8_t) SLS_DETECTOR_HEADER_VERSION; + #ifdef VERBOSE - if(!ithread) cout << "fnum:" << (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))) << endl; + if(!ithread) + cprintf(BLUE, + "framenumber:%llu\tsubfnum:%u\tpnum:%u\tbunchid:%llu\txcoord:%u\tdettype:%u\tversion:%u\n", + header->frameNumber, header->expLength, header->packetNumber, + header->bunchId, header->xCoord, header->detType, header->version); #endif - switch (myDetectorType) { - case JUNGFRAU: - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))) = bnum; - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = 0; - break; - case EIGER: - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))) = 0; - if (dynamicRange == 32) - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = snum; - else - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = 0; - break; - default: - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))) = 0; - (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))) = 0; - break; - } //write packet count to buffer *((uint32_t*)(buffer[ithread])) = packetsPerFrame; @@ -2852,8 +2849,20 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* //callback to write data if (cbAction < DO_EVERYTHING) - rawDataReadyCallBack(detID*numberofListeningThreads+ithread, tempframenumber, - 0,0, + rawDataReadyCallBack( + tempframenumber,//frameNumber + 0,//expLength + 0,//packetNumber + 0,//bunchId + 0,//timestamp + 0,//modId + detID*numberofListeningThreads+ithread,//xCoord + 0,//yCoord + 0,//zCoord + 0,//debug + 0,//roundRNumber + (uint8_t)myDetectorType,//detType + SLS_DETECTOR_HEADER_VERSION,//version wbuffer + fifoBufferHeaderSize, bufferSize * numberofJobsPerBuffer + fifoBufferHeaderSize, sfilefd[ithread], pRawDataReady);//know which thread from sfilefd @@ -2898,15 +2907,25 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* void UDPStandardImplementation::handleCompleteFramesOnly(int ithread, char* wbuffer){ FILE_LOG(logDEBUG) << __AT__ << " called"; - //get current frame number - uint64_t tempframenumber = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS))); - uint64_t bnum = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET))); - uint64_t snum = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET))); - + //get header + sls_detector_header* header = (sls_detector_header*) (wbuffer + HEADER_SIZE_NUM_TOT_PACKETS); + uint64_t tempframenumber = header->frameNumber; if (cbAction < DO_EVERYTHING) - rawDataReadyCallBack(detID*numberofListeningThreads+ithread, tempframenumber, - bnum, snum, + rawDataReadyCallBack( + header->frameNumber, + header->expLength, + header->packetNumber, + header->bunchId, + header->timestamp, + header->modId, + header->xCoord, + header->yCoord, + header->zCoord, + header->debug, + header->roundRNumber, + header->detType, + header->version, wbuffer + fifoBufferHeaderSize, bufferSize * numberofJobsPerBuffer + fifoBufferHeaderSize, sfilefd[ithread], pRawDataReady); @@ -2916,7 +2935,7 @@ void UDPStandardImplementation::handleCompleteFramesOnly(int ithread, char* wbuf if((fileWriteEnable) && (sfilefd[ithread])){ if(tempframenumber && (tempframenumber%maxFramesPerFile) == 0) createNewFile(ithread); - fwrite(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS, 1, (bufferSize + FILE_FRAME_HEADER_LENGTH), sfilefd[ithread]); + fwrite(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS, 1, (bufferSize + sizeof(sls_detector_header)), sfilefd[ithread]); } tempframenumber -= startFrameIndex; @@ -3179,7 +3198,7 @@ void UDPStandardImplementation::copyFrameToGui(int ithread, char* buffer, uint32 strcpy(guiFileName[ithread],completeFileName[ithread]); if(excludeMissingPackets) //copy also the header - memcpy(latestData[ithread],buffer+HEADER_SIZE_NUM_TOT_PACKETS, bufferSize + FILE_FRAME_HEADER_LENGTH); + memcpy(latestData[ithread],buffer+ HEADER_SIZE_NUM_TOT_PACKETS, bufferSize + sizeof(sls_detector_header)); else //copy only the data memcpy(latestData[ithread],buffer+ fifoBufferHeaderSize , numpackets*onePacketSize); //let it know its got data diff --git a/slsReceiverSoftware/src/slsReceiver.cpp b/slsReceiverSoftware/src/slsReceiver.cpp index 85750c517..0db3dc793 100644 --- a/slsReceiverSoftware/src/slsReceiver.cpp +++ b/slsReceiverSoftware/src/slsReceiver.cpp @@ -179,7 +179,8 @@ void slsReceiver::registerCallBackAcquisitionFinished(void (*func)(uint64_t, voi } -void slsReceiver::registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg){ +void slsReceiver::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*),void *arg){ //tcpipInterface if(udp_interface) udp_interface->registerCallBackRawDataReady(func,arg); diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 304476e56..a21bc8ca8 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -3403,7 +3403,8 @@ void slsReceiverTCPIPInterface::registerCallBackAcquisitionFinished(void (*func) pAcquisitionFinished=arg; } -void slsReceiverTCPIPInterface::registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*),void *arg){ +void slsReceiverTCPIPInterface::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, + char*, uint32_t, FILE*, void*),void *arg){ rawDataReadyCallBack=func; pRawDataReady=arg; } diff --git a/slsReceiverSoftware/src/slsReceiverUsers.cpp b/slsReceiverSoftware/src/slsReceiverUsers.cpp index 384ce86ea..512e838ac 100644 --- a/slsReceiverSoftware/src/slsReceiverUsers.cpp +++ b/slsReceiverSoftware/src/slsReceiverUsers.cpp @@ -17,7 +17,6 @@ void slsReceiverUsers::stop() { receiver->stop(); } - void slsReceiverUsers::closeFile(int p) { receiver->closeFile(p); } @@ -26,19 +25,17 @@ int64_t slsReceiverUsers::getReceiverVersion(){ return receiver->getReceiverVersion(); } - void slsReceiverUsers::registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg){ receiver->registerCallBackStartAcquisition(func,arg); } - - void slsReceiverUsers::registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg){ receiver->registerCallBackAcquisitionFinished(func,arg); } - -void slsReceiverUsers::registerCallBackRawDataReady(void (*func)(int, uint64_t, uint64_t, uint64_t, char*, uint32_t, FILE*, void*), void *arg){ +void slsReceiverUsers::registerCallBackRawDataReady(void (*func)(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp, + uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version, + char* datapointer, uint32_t datasize, FILE* filedescriptor, void*), void *arg){ receiver->registerCallBackRawDataReady(func,arg); } From 141324461746d6d3ad22738ad88150ee2b4d8890 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Wed, 15 Mar 2017 15:02:28 +0100 Subject: [PATCH 04/13] update rev --- slsReceiverSoftware/gitInfo.txt | 8 ++++---- slsReceiverSoftware/include/gitInfoReceiver.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index d82f2848d..87759958f 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git -Repsitory UUID: 398e8b241fe37a2102709553b8b0fa3650f97966 -Revision: 499 +Repsitory UUID: 5edf56eead747efd9f52c5b29d3e23a235a74479 +Revision: 503 Branch: 2.3-rc Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 499 -Last Changed Date: 2016-12-15 14:32:34 +0100 +Last Changed Rev: 503 +Last Changed Date: 2017-03-15 15:00:25 +0100 diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index 421bf31c3..39383e175 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "398e8b241fe37a2102709553b8b0fa3650f97966" -//#define SVNREV 0x499 +#define SVNREPUUID "5edf56eead747efd9f52c5b29d3e23a235a74479" +//#define SVNREV 0x503 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x499 -#define SVNDATE 0x20161215 +#define SVNREV 0x503 +#define SVNDATE 0x20170315 // From 575c9617c721ee76df67d5db5b12d72de08b2e5f Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Mon, 20 Mar 2017 09:28:15 +0100 Subject: [PATCH 05/13] fixed gui for new header --- slsReceiverSoftware/gitInfo.txt | 8 +- slsReceiverSoftware/include/gitInfoReceiver.h | 6 +- slsReceiverSoftware/include/receiver_defs.h | 3 +- .../src/UDPStandardImplementation.cpp | 79 ++++++++++++++----- 4 files changed, 70 insertions(+), 26 deletions(-) diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index 87759958f..b25cc0fe8 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git -Repsitory UUID: 5edf56eead747efd9f52c5b29d3e23a235a74479 -Revision: 503 +Repsitory UUID: 37c93c568669422f853cc8eb3f22d3b4afc257ba +Revision: 504 Branch: 2.3-rc Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 503 -Last Changed Date: 2017-03-15 15:00:25 +0100 +Last Changed Rev: 504 +Last Changed Date: 2017-03-15 15:02:28 +0100 diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index 39383e175..91121b015 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "5edf56eead747efd9f52c5b29d3e23a235a74479" -//#define SVNREV 0x503 +#define SVNREPUUID "37c93c568669422f853cc8eb3f22d3b4afc257ba" +//#define SVNREV 0x504 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x503 +#define SVNREV 0x504 #define SVNDATE 0x20170315 // diff --git a/slsReceiverSoftware/include/receiver_defs.h b/slsReceiverSoftware/include/receiver_defs.h index 6301f879a..795557dee 100755 --- a/slsReceiverSoftware/include/receiver_defs.h +++ b/slsReceiverSoftware/include/receiver_defs.h @@ -58,7 +58,8 @@ typedef struct { #define HEADER_SIZE_NUM_PACKETS 1 #define ALL_MASK_32 0xFFFFFFFF -#define SLS_DETECTOR_HEADER_VERSION 0x1 +#define SLS_DETECTOR_HEADER_VERSION 0x1 +#define SLS_DETECTOR_JSON_HEADER_VERSION 0x2 //#define FILE_FRAME_HEADER_LENGTH (8*3) //#define FILE_HEADER_TIMESTAMP_OFFSET 8 //start of frame/ bunch id //#define FILE_HEADER_EXPLENGTH_OFFSET 16 //exposure length/ sub frame number diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 216dfabb9..1f43355ce 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -1785,13 +1785,38 @@ void UDPStandardImplementation::startDataCallback(){ //header details - const char *type = "float64"; - const char *shape= "[1024, 512]"; - const char *jsonFmt ="{\"htype\":[\"chunk-1.0\"], \"type\":\"%s\", \"shape\":%s, \"acqIndex\":%d, \"fIndex\":%d, \"subfnum\":%d, \"fname\":\"%s\"}"; + const char *jsonFmt ="{" + "\"jsonversion\":%u, " + "\"acqIndex\":%llu, " + "\"fIndex\":%llu, " + "\"bitmode\":%d, " + "\"shape\":[%d, %d], " + "\"fname\":\"%s\", " + + "\"frameNumber\":%llu, " + "\"expLength\":%u, " + "\"packetNumber\":%u, " + "\"bunchId\":%llu, " + "\"timestamp\":%llu, " + "\"modId\":%u, " + "\"xCoord\":%u, " + "\"yCoord\":%u, " + "\"zCoord\":%u, " + "\"debug\":%u, " + "\"roundRNumber\":%u, " + "\"detType\":%u, " + "\"version\":%u" + "}"; + int npixelsx=0, npixelsy=0; + switch(myDetectorType) { + case JUNGFRAU: npixelsx = JFRAU_PIXELS_IN_ONE_ROW; npixelsy = JFRAU_PIXELS_IN_ONE_COL; break; + case EIGER: npixelsx = EIGER_PIXELS_IN_ONE_ROW; npixelsy = EIGER_PIXELS_IN_ONE_COL; break; + default:break; /* will not work for other detectors*/ + } char buf[1000]; - int acquisitionIndex = -1; - int frameIndex = -1; - int subframeIndex = -1; + uint64_t acquisitionIndex = -1; + uint64_t frameIndex = -1; + uint32_t subframeIndex = -1; #ifdef DEBUG int oldpnum = -1; #endif @@ -1816,7 +1841,9 @@ void UDPStandardImplementation::startDataCallback(){ frameIndex = fnum; acquisitionIndex = fnum - startAcquisitionIndex; if(dynamicRange == 32) subframeIndex = snum; - int len = sprintf(buf,jsonFmt,type,shape, acquisitionIndex, frameIndex, subframeIndex,completeFileName[ithread]); + int len = sprintf(buf,jsonFmt, + SLS_DETECTOR_JSON_HEADER_VERSION, acquisitionIndex, frameIndex, dynamicRange, npixelsx, npixelsy,completeFileName[ithread], + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );/* will not work for other detectors*/ zmq_send(zmqsocket, buf,len, ZMQ_SNDMORE); //send data zmq_send(zmqsocket, buffer, oneframesize, 0); @@ -1828,12 +1855,15 @@ void UDPStandardImplementation::startDataCallback(){ //send final header //update frame details #ifdef DEBUG - cout << "sending dummy" << endl; + cprintf(BLUE,"%d sending dummy\n"); #endif - frameIndex = -9; - acquisitionIndex = -9; - subframeIndex = -9; - int len = sprintf(buf,jsonFmt,type,shape, acquisitionIndex, frameIndex, subframeIndex,completeFileName[ithread]); + + frameIndex = -1; + acquisitionIndex = -1; + int len = sprintf(buf,jsonFmt, + SLS_DETECTOR_JSON_HEADER_VERSION, acquisitionIndex, frameIndex, dynamicRange, npixelsx, npixelsy,completeFileName[ithread], + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + zmq_send(zmqsocket, buf,len, ZMQ_SNDMORE); //send final data zmq_send (zmqsocket, "end", 3, 0); @@ -1863,12 +1893,21 @@ void UDPStandardImplementation::startDataCallback(){ } if(excludeMissingPackets){ +#ifdef DEBUG + cprintf(BLUE,"%d sending image\n", ithread); +#endif //send header //update frame details - frameIndex = (*((uint64_t*)(latestData[ithread]))) - startFrameIndex; - acquisitionIndex = (*((uint64_t*)(latestData[ithread]))) - startAcquisitionIndex; - subframeIndex = -1; - int len = sprintf(buf,jsonFmt,type,shape, acquisitionIndex, frameIndex, subframeIndex,completeFileName[ithread]); + sls_detector_header* header = (sls_detector_header*) (latestData[ithread]); + uint64_t fnum = header->frameNumber; + frameIndex = fnum - startFrameIndex; + acquisitionIndex = fnum - startAcquisitionIndex; + + int len = sprintf(buf,jsonFmt, + SLS_DETECTOR_JSON_HEADER_VERSION, acquisitionIndex, frameIndex, dynamicRange, npixelsx, npixelsy,completeFileName[ithread], + header->frameNumber, header->expLength, header->packetNumber, header->bunchId, header->timestamp, + header->modId, header->xCoord, header->yCoord, header->zCoord, header->debug, header->roundRNumber, header->detType, header->version); + zmq_send(zmqsocket, buf,len, ZMQ_SNDMORE); //send data zmq_send(zmqsocket, (latestData[ithread]+sizeof(sls_detector_header)), bufferSize, 0); @@ -1922,7 +1961,9 @@ void UDPStandardImplementation::startDataCallback(){ frameIndex = fnum; acquisitionIndex = fnum - startAcquisitionIndex; if(dynamicRange == 32) subframeIndex = snum; - int len = sprintf(buf,jsonFmt,type,shape, acquisitionIndex, frameIndex, subframeIndex,completeFileName[ithread]); + int len = sprintf(buf,jsonFmt, + SLS_DETECTOR_JSON_HEADER_VERSION, acquisitionIndex, frameIndex, dynamicRange, npixelsx, npixelsy,completeFileName[ithread], + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );/* will not work for other detectors*/ zmq_send(zmqsocket, buf,len, ZMQ_SNDMORE); //send data zmq_send(zmqsocket, buffer, oneframesize, 0); @@ -1958,7 +1999,9 @@ void UDPStandardImplementation::startDataCallback(){ frameIndex = fnum; acquisitionIndex = fnum - startAcquisitionIndex; if(dynamicRange == 32) subframeIndex = snum; - int len = sprintf(buf,jsonFmt,type,shape, acquisitionIndex, frameIndex, subframeIndex,completeFileName[ithread]); + int len = sprintf(buf,jsonFmt, + SLS_DETECTOR_JSON_HEADER_VERSION, acquisitionIndex, frameIndex, dynamicRange, npixelsx, npixelsy,completeFileName[ithread], + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );/* will not work for other detectors*/ zmq_send(zmqsocket, buf,len, ZMQ_SNDMORE); //send data zmq_send(zmqsocket, buffer, oneframesize, 0); From 78958c76999a1581e454a5e967cead717ef04ea5 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Mon, 20 Mar 2017 09:30:15 +0100 Subject: [PATCH 06/13] updaterev --- slsReceiverSoftware/gitInfo.txt | 8 ++++---- slsReceiverSoftware/include/gitInfoReceiver.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index b25cc0fe8..2bad189e9 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git -Repsitory UUID: 37c93c568669422f853cc8eb3f22d3b4afc257ba -Revision: 504 +Repsitory UUID: 41fa05e555865e703acd55c143ca0d3cc6dc1022 +Revision: 505 Branch: 2.3-rc Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 504 -Last Changed Date: 2017-03-15 15:02:28 +0100 +Last Changed Rev: 505 +Last Changed Date: 2017-03-20 09:28:15 +0100 diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index 91121b015..45fabf65e 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "37c93c568669422f853cc8eb3f22d3b4afc257ba" -//#define SVNREV 0x504 +#define SVNREPUUID "41fa05e555865e703acd55c143ca0d3cc6dc1022" +//#define SVNREV 0x505 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x504 -#define SVNDATE 0x20170315 +#define SVNREV 0x505 +#define SVNDATE 0x20170320 // From 6f34dddb5afadcdc45b43c63346666dec85431a3 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 23 Mar 2017 13:41:37 +0100 Subject: [PATCH 07/13] changed the file header size t0 1kb and changed its description in the header --- .../include/UDPStandardImplementation.h | 2 +- .../src/UDPStandardImplementation.cpp | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/slsReceiverSoftware/include/UDPStandardImplementation.h b/slsReceiverSoftware/include/UDPStandardImplementation.h index ad455e791..a1542e000 100644 --- a/slsReceiverSoftware/include/UDPStandardImplementation.h +++ b/slsReceiverSoftware/include/UDPStandardImplementation.h @@ -630,7 +630,7 @@ private: bool fileCreateSuccess; /** File header */ - const static unsigned int FILE_HEADER_SIZE = 500; + const static unsigned int FILE_HEADER_SIZE = 1000; char fileHeader[MAX_NUMBER_OF_WRITER_THREADS][FILE_HEADER_SIZE]; /** File Descriptor */ diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 1f43355ce..46548b3dd 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -3196,8 +3196,20 @@ void UDPStandardImplementation::updateFileHeader(int ithread){ "Timestamp\t: %s\n\n" "#Frame Header\n" - "Frame Number\t: 8 bytes\n" - "Bunch ID\t: 8 bytes\n", + "Frame Number : 8 bytes\n" + "Exposure Length : 4 bytes\n" + "Packet Number : 4 bytes\n" + "Bunch ID : 8 bytes\n" + "Timestamp : 8 bytes\n" + "Module Id : 2 bytes\n" + "X Coordinate : 2 bytes\n" + "Y Coordinate : 2 bytes\n" + "Z Coordinate : 2 bytes\n" + "Debug : 4 bytes\n" + "Round Robin Number : 2 bytes\n" + "Detector Type : 1 byte\n" + "Header Version : 1 byte\n" + , FILE_HEADER_SIZE, (flippedData[0]?0:1), (ithread?0:1), From 0814f6369d126f34b01c1271dc057c5ef5ba09d7 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 23 Mar 2017 13:46:16 +0100 Subject: [PATCH 08/13] udpaterev --- slsReceiverSoftware/gitInfo.txt | 10 +++++----- slsReceiverSoftware/include/gitInfoReceiver.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index 2bad189e9..2cea640e9 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git -Repsitory UUID: 41fa05e555865e703acd55c143ca0d3cc6dc1022 -Revision: 505 -Branch: 2.3-rc +Repsitory UUID: 09606556f452f6051706557b8201e6221fa44ed6 +Revision: 507 +Branch: 2.3 Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 505 -Last Changed Date: 2017-03-20 09:28:15 +0100 +Last Changed Rev: 507 +Last Changed Date: 2017-03-23 13:41:37 +0100 diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index 45fabf65e..999cfdb8d 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "41fa05e555865e703acd55c143ca0d3cc6dc1022" -//#define SVNREV 0x505 +#define SVNREPUUID "09606556f452f6051706557b8201e6221fa44ed6" +//#define SVNREV 0x507 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x505 -#define SVNDATE 0x20170320 +#define SVNREV 0x507 +#define SVNDATE 0x20170323 // From 54371bc6beeec22166f4644da3d9cc035361d123 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 23 Mar 2017 13:48:18 +0100 Subject: [PATCH 09/13] updaterev --- slsReceiverSoftware/gitInfo.txt | 8 ++++---- slsReceiverSoftware/include/gitInfoReceiver.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index 2cea640e9..ff5aae18b 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git -Repsitory UUID: 09606556f452f6051706557b8201e6221fa44ed6 -Revision: 507 +Repsitory UUID: 08da5f3560f705d87317ab91e3e0dd75351847e0 +Revision: 508 Branch: 2.3 Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 507 -Last Changed Date: 2017-03-23 13:41:37 +0100 +Last Changed Rev: 508 +Last Changed Date: 2017-03-23 13:46:16 +0100 diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index 999cfdb8d..8edf062cf 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "09606556f452f6051706557b8201e6221fa44ed6" -//#define SVNREV 0x507 +#define SVNREPUUID "08da5f3560f705d87317ab91e3e0dd75351847e0" +//#define SVNREV 0x508 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x507 +#define SVNREV 0x508 #define SVNDATE 0x20170323 // From 404be013a2ffa046dfb33a46a05c1b9f78d10c56 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 23 Mar 2017 14:08:43 +0100 Subject: [PATCH 10/13] changes to new callback arguments without filepointer --- .../include/UDPBaseImplementation.h | 12 ++++-------- slsReceiverSoftware/include/UDPInterface.h | 8 +++----- slsReceiverSoftware/include/receiver_defs.h | 3 +-- slsReceiverSoftware/include/slsReceiver.h | 6 ++---- .../include/slsReceiverTCPIPInterface.h | 13 ++++--------- slsReceiverSoftware/include/slsReceiverUsers.h | 6 +++--- .../src/UDPBaseImplementation.cpp | 2 +- .../src/UDPStandardImplementation.cpp | 16 ++++++++-------- slsReceiverSoftware/src/slsReceiver.cpp | 2 +- .../src/slsReceiverTCPIPInterface.cpp | 2 +- slsReceiverSoftware/src/slsReceiverUsers.cpp | 2 +- 11 files changed, 29 insertions(+), 43 deletions(-) diff --git a/slsReceiverSoftware/include/UDPBaseImplementation.h b/slsReceiverSoftware/include/UDPBaseImplementation.h index 0519d1a56..6c7a1b500 100644 --- a/slsReceiverSoftware/include/UDPBaseImplementation.h +++ b/slsReceiverSoftware/include/UDPBaseImplementation.h @@ -488,8 +488,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter * * return value is * 0 callback takes care of open,close,wrie file - * 1 callback writes file, we have to open, close it - * 2 we open, close, write file, callback does not do anything + * 1 we open, close, write file, callback does not do anything */ void registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg); @@ -518,10 +517,9 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter * version is the version number of this structure format * dataPointer is the pointer to the data * dataSize in bytes is the size of the data in bytes - * fileDescriptor is the file descriptor */ void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*),void *arg); + char*, uint32_t, void*),void *arg); @@ -620,8 +618,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter * * return value is * 0 callback takes care of open,close,wrie file - * 1 callback writes file, we have to open, close it - * 2 we open, close, write file, callback does not do anything + * 1 we open, close, write file, callback does not do anything */ int (*startAcquisitionCallBack)(char*, char*, uint64_t, uint32_t, void*); void *pStartAcquisition; @@ -653,10 +650,9 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter * version is the version number of this structure format * dataPointer is the pointer to the data * dataSize in bytes is the size of the data in bytes - * fileDescriptor is the file descriptor */ void (*rawDataReadyCallBack)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*); + char*, uint32_t, void*); void *pRawDataReady; diff --git a/slsReceiverSoftware/include/UDPInterface.h b/slsReceiverSoftware/include/UDPInterface.h index de497a0b6..5aa47b58e 100644 --- a/slsReceiverSoftware/include/UDPInterface.h +++ b/slsReceiverSoftware/include/UDPInterface.h @@ -544,9 +544,8 @@ class UDPInterface { * datasize * * return value is - * 0 callback takes care of open,close,wrie file - * 1 callback writes file, we have to open, close it - * 2 we open, close, write file, callback does not do anything + * 0 callback takes care of open,close,write file + * 1 we open, close, write file, callback does not do anything */ virtual void registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg) = 0; @@ -575,10 +574,9 @@ class UDPInterface { * version is the version number of this structure format * dataPointer is the pointer to the data * dataSize in bytes is the size of the data in bytes - * fileDescriptor is the file descriptor */ virtual void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*),void *arg) = 0; + char*, uint32_t, void*),void *arg) = 0; protected: diff --git a/slsReceiverSoftware/include/receiver_defs.h b/slsReceiverSoftware/include/receiver_defs.h index 795557dee..fe142ddea 100755 --- a/slsReceiverSoftware/include/receiver_defs.h +++ b/slsReceiverSoftware/include/receiver_defs.h @@ -47,8 +47,7 @@ typedef struct { #define GOODBYE -200 #define DO_NOTHING 0 -#define CREATE_FILES 1 -#define DO_EVERYTHING 2 +#define DO_EVERYTHING 1 #define BUF_SIZE (16*1024*1024) //16mb #define SAMPLE_TIME_IN_NS 100000000//100ms diff --git a/slsReceiverSoftware/include/slsReceiver.h b/slsReceiverSoftware/include/slsReceiver.h index 35feec9f4..7617f43f7 100644 --- a/slsReceiverSoftware/include/slsReceiver.h +++ b/slsReceiverSoftware/include/slsReceiver.h @@ -67,8 +67,7 @@ class slsReceiver : private virtual slsReceiverDefs { * * return value is * 0 callback takes care of open,close,wrie file - * 1 callback writes file, we have to open, close it - * 2 we open, close, write file, callback does not do anything + * 1 we open, close, write file, callback does not do anything */ void registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg); @@ -97,10 +96,9 @@ class slsReceiver : private virtual slsReceiverDefs { * version is the version number of this structure format * dataPointer is the pointer to the data * dataSize in bytes is the size of the data in bytes - * fileDescriptor is the file descriptor */ void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*),void *arg); + char*, uint32_t, void*),void *arg); diff --git a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h index bed74d936..d497f8fb8 100644 --- a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h +++ b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h @@ -67,8 +67,7 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs { * * return value is * 0 callback takes care of open,close,wrie file - * 1 callback writes file, we have to open, close it - * 2 we open, close, write file, callback does not do anything + * 1 we open, close, write file, callback does not do anything */ void registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg); @@ -97,11 +96,9 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs { * version is the version number of this structure format * dataPointer is the pointer to the data * dataSize in bytes is the size of the data in bytes - * fileDescriptor is the file descriptor */ void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*),void *arg); - + char*, uint32_t, void*),void *arg); private: /** @@ -313,8 +310,7 @@ private: * * return value is * 0 callback takes care of open,close,wrie file - * 1 callback writes file, we have to open, close it - * 2 we open, close, write file, callback does not do anything + * 1 we open, close, write file, callback does not do anything */ int (*startAcquisitionCallBack)(char*, char*, uint64_t, uint32_t, void*); void *pStartAcquisition; @@ -346,10 +342,9 @@ private: * version is the version number of this structure format * dataPointer is the pointer to the data * dataSize in bytes is the size of the data in bytes - * fileDescriptor is the file descriptor */ void (*rawDataReadyCallBack)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*); + char*, uint32_t, void*); void *pRawDataReady; diff --git a/slsReceiverSoftware/include/slsReceiverUsers.h b/slsReceiverSoftware/include/slsReceiverUsers.h index c59e4cf13..ee60ed2cd 100644 --- a/slsReceiverSoftware/include/slsReceiverUsers.h +++ b/slsReceiverSoftware/include/slsReceiverUsers.h @@ -56,7 +56,7 @@ public: @sort register calbback for starting the acquisition \param func callback to be called when starting the acquisition. Its arguments are filepath, filename, fileindex, datasize - \returns 0 callback takes care of open,close,write file; 1 callback writes file, we have to open, close it; 2 we open, close, write file, callback does not do anything + \returns 0 callback takes care of open,close,write file; 1 we open, close, write file, callback does not do anything */ void registerCallBackStartAcquisition(int (*func)(char* filepath, char* filename, uint64_t fileindex, uint32_t datasize, void*),void *arg); @@ -72,12 +72,12 @@ public: /** @sort register callback to be called when data are available (to process and/or save the data). - \param func raw data ready callback. arguments are frameNumber, expLength, packetNumber, bunchId, timestamp, modId, xCoord, yCoord, zCoord, debug, roundRNumber, detType, version, dataPointer, dataSize, fileDescriptor + \param func raw data ready callback. arguments are frameNumber, expLength, packetNumber, bunchId, timestamp, modId, xCoord, yCoord, zCoord, debug, roundRNumber, detType, version, dataPointer, dataSize \returns nothing */ void registerCallBackRawDataReady(void (*func)(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp, uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version, - char* datapointer, uint32_t datasize, FILE* filedescriptor, void*),void *arg); + char* datapointer, uint32_t datasize, void*),void *arg); //receiver object slsReceiver* receiver; diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index 8d184ed82..5539b4d95 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -518,7 +518,7 @@ void UDPBaseImplementation::registerCallBackAcquisitionFinished(void (*func)(uin } void UDPBaseImplementation::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*),void *arg){ + char*, uint32_t, void*),void *arg){ rawDataReadyCallBack=func; pRawDataReady=arg; } diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 46548b3dd..0c2a6d063 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -1536,7 +1536,7 @@ int UDPStandardImplementation::setupWriter(){ cbAction=startAcquisitionCallBack(filePath, (char*)tempname.c_str(),fileIndex, (uint32_t)bufferSize,pStartAcquisition); } - if(cbAction < DO_EVERYTHING){ + if(cbAction == DO_NOTHING){ FILE_LOG(logINFO) << "Call back activated. Data saving must be taken care of by user in call back."; if (rawDataReadyCallBack){ FILE_LOG(logINFO) << "Data Write has been defined externally"; @@ -1587,12 +1587,12 @@ int UDPStandardImplementation::createNewFile(int ithread){ #endif //filewrite enable & we allowed to create/close files - if(fileWriteEnable && cbAction > DO_NOTHING){ + if(fileWriteEnable && cbAction == DO_EVERYTHING){ //close file pointers if(sfilefd[ithread]){ //all threads need to close file, reset mask and exit loop - if(myDetectorType == EIGER && fileWriteEnable && (cbAction > DO_NOTHING)){ + if(myDetectorType == EIGER && fileWriteEnable && (cbAction == DO_EVERYTHING)){ updateFileHeader(ithread); fseek(sfilefd[ithread],0,0); fwrite((void*)fileHeader[ithread], 1, FILE_HEADER_SIZE, sfilefd[ithread]); @@ -2732,7 +2732,7 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){ //all threads need to close file, reset mask and exit loop - if(myDetectorType == EIGER && fileWriteEnable && (cbAction > DO_NOTHING)){ + if(myDetectorType == EIGER && fileWriteEnable && (cbAction == DO_EVERYTHING)){ updateFileHeader(ithread); fseek(sfilefd[ithread],0,0); fwrite((void*)fileHeader[ithread], 1, FILE_HEADER_SIZE, sfilefd[ithread]); @@ -2891,7 +2891,7 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* //callback to write data - if (cbAction < DO_EVERYTHING) + if (cbAction == DO_NOTHING) rawDataReadyCallBack( tempframenumber,//frameNumber 0,//expLength @@ -2908,7 +2908,7 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* SLS_DETECTOR_HEADER_VERSION,//version wbuffer + fifoBufferHeaderSize, bufferSize * numberofJobsPerBuffer + fifoBufferHeaderSize, - sfilefd[ithread], pRawDataReady);//know which thread from sfilefd + pRawDataReady);//know which thread from sfilefd @@ -2954,7 +2954,7 @@ void UDPStandardImplementation::handleCompleteFramesOnly(int ithread, char* wbuf sls_detector_header* header = (sls_detector_header*) (wbuffer + HEADER_SIZE_NUM_TOT_PACKETS); uint64_t tempframenumber = header->frameNumber; - if (cbAction < DO_EVERYTHING) + if (cbAction == DO_NOTHING) rawDataReadyCallBack( header->frameNumber, header->expLength, @@ -2971,7 +2971,7 @@ void UDPStandardImplementation::handleCompleteFramesOnly(int ithread, char* wbuf header->version, wbuffer + fifoBufferHeaderSize, bufferSize * numberofJobsPerBuffer + fifoBufferHeaderSize, - sfilefd[ithread], pRawDataReady); + pRawDataReady); //write to file if enabled and update write parameters diff --git a/slsReceiverSoftware/src/slsReceiver.cpp b/slsReceiverSoftware/src/slsReceiver.cpp index 0db3dc793..4a28ab8e1 100644 --- a/slsReceiverSoftware/src/slsReceiver.cpp +++ b/slsReceiverSoftware/src/slsReceiver.cpp @@ -180,7 +180,7 @@ void slsReceiver::registerCallBackAcquisitionFinished(void (*func)(uint64_t, voi void slsReceiver::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*),void *arg){ + char*, uint32_t, void*),void *arg){ //tcpipInterface if(udp_interface) udp_interface->registerCallBackRawDataReady(func,arg); diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index a21bc8ca8..8f4fd537a 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -3404,7 +3404,7 @@ void slsReceiverTCPIPInterface::registerCallBackAcquisitionFinished(void (*func) } void slsReceiverTCPIPInterface::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, - char*, uint32_t, FILE*, void*),void *arg){ + char*, uint32_t, void*),void *arg){ rawDataReadyCallBack=func; pRawDataReady=arg; } diff --git a/slsReceiverSoftware/src/slsReceiverUsers.cpp b/slsReceiverSoftware/src/slsReceiverUsers.cpp index 512e838ac..a0126764d 100644 --- a/slsReceiverSoftware/src/slsReceiverUsers.cpp +++ b/slsReceiverSoftware/src/slsReceiverUsers.cpp @@ -35,7 +35,7 @@ void slsReceiverUsers::registerCallBackAcquisitionFinished(void (*func)(uint64_t void slsReceiverUsers::registerCallBackRawDataReady(void (*func)(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp, uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version, - char* datapointer, uint32_t datasize, FILE* filedescriptor, void*), void *arg){ + char* datapointer, uint32_t datasize, void*), void *arg){ receiver->registerCallBackRawDataReady(func,arg); } From da8d535dae95e9621cff09ac07b7e3bdeda59ba6 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 23 Mar 2017 14:09:01 +0100 Subject: [PATCH 11/13] updaterev --- slsReceiverSoftware/gitInfo.txt | 8 ++++---- slsReceiverSoftware/include/gitInfoReceiver.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index ff5aae18b..e43d9a0d2 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git -Repsitory UUID: 08da5f3560f705d87317ab91e3e0dd75351847e0 -Revision: 508 +Repsitory UUID: b4698af6a1ed52ff9a03881f14c93097f249588c +Revision: 510 Branch: 2.3 Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 508 -Last Changed Date: 2017-03-23 13:46:16 +0100 +Last Changed Rev: 510 +Last Changed Date: 2017-03-23 14:08:43 +0100 diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index 8edf062cf..b4579fe95 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "08da5f3560f705d87317ab91e3e0dd75351847e0" -//#define SVNREV 0x508 +#define SVNREPUUID "b4698af6a1ed52ff9a03881f14c93097f249588c" +//#define SVNREV 0x510 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x508 +#define SVNREV 0x510 #define SVNDATE 0x20170323 // From 70a7217353199cfbccc7f3448285e52c30884f0f Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 23 Mar 2017 15:17:21 +0100 Subject: [PATCH 12/13] changed the header size to a better number --- slsReceiverSoftware/include/UDPStandardImplementation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slsReceiverSoftware/include/UDPStandardImplementation.h b/slsReceiverSoftware/include/UDPStandardImplementation.h index a1542e000..b52c53b30 100644 --- a/slsReceiverSoftware/include/UDPStandardImplementation.h +++ b/slsReceiverSoftware/include/UDPStandardImplementation.h @@ -630,7 +630,7 @@ private: bool fileCreateSuccess; /** File header */ - const static unsigned int FILE_HEADER_SIZE = 1000; + const static unsigned int FILE_HEADER_SIZE = 1024; char fileHeader[MAX_NUMBER_OF_WRITER_THREADS][FILE_HEADER_SIZE]; /** File Descriptor */ From e450f5ec6a5fba5b1e03448a0e636a3f8d20acf3 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 23 Mar 2017 15:17:34 +0100 Subject: [PATCH 13/13] updaterev --- slsReceiverSoftware/gitInfo.txt | 8 ++++---- slsReceiverSoftware/include/gitInfoReceiver.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index e43d9a0d2..09ad992a7 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git -Repsitory UUID: b4698af6a1ed52ff9a03881f14c93097f249588c -Revision: 510 +Repsitory UUID: 9f0ea629975864abb9bb3fd9f59c1d9188e0f3d1 +Revision: 512 Branch: 2.3 Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 510 -Last Changed Date: 2017-03-23 14:08:43 +0100 +Last Changed Rev: 512 +Last Changed Date: 2017-03-23 15:17:21 +0100 diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index b4579fe95..aab086be3 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "b4698af6a1ed52ff9a03881f14c93097f249588c" -//#define SVNREV 0x510 +#define SVNREPUUID "9f0ea629975864abb9bb3fd9f59c1d9188e0f3d1" +//#define SVNREV 0x512 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x510 +#define SVNREV 0x512 #define SVNDATE 0x20170323 //