mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 15:00:02 +02:00
including subframe number
This commit is contained in:
parent
a1f00518b8
commit
53be854efd
@ -486,30 +486,32 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
|||||||
* fileindex
|
* fileindex
|
||||||
* datasize
|
* 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
|
* 0 callback takes care of open,close,wrie file
|
||||||
* 1 callback writes file, we have to open, close it
|
* 1 callback writes file, we have to open, close it
|
||||||
* 2 we open, close, write file, callback does not do anything
|
* 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
|
* Call back for acquisition finished
|
||||||
* callback argument is
|
* callback argument is
|
||||||
* total frames caught
|
* 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
|
* Call back for raw data
|
||||||
* args to raw data ready callback are
|
* args to raw data ready callback are
|
||||||
* framenum
|
* index
|
||||||
|
* frame number
|
||||||
|
* timestamp/ bunch id
|
||||||
|
* exposure length/ sub frame number
|
||||||
* datapointer
|
* datapointer
|
||||||
* datasize in bytes
|
* datasize in bytes
|
||||||
* file descriptor
|
* 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***
|
//***callback parameters***
|
||||||
/**
|
/**
|
||||||
* function being called back for start acquisition
|
* Call back for start acquisition
|
||||||
* callback arguments are
|
* callback arguments are
|
||||||
* filepath
|
* filepath
|
||||||
* filename
|
* filename
|
||||||
@ -611,28 +613,30 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
|||||||
* 1 callback writes file, we have to open, close it
|
* 1 callback writes file, we have to open, close it
|
||||||
* 2 we open, close, write file, callback does not do anything
|
* 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;
|
void *pStartAcquisition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function being called back for acquisition finished
|
* Call back for acquisition finished
|
||||||
* callback argument is
|
* callback argument is
|
||||||
* total frames caught
|
* total frames caught
|
||||||
*/
|
*/
|
||||||
void (*acquisitionFinishedCallBack)(int, void*);
|
void (*acquisitionFinishedCallBack)(uint64_t, void*);
|
||||||
void *pAcquisitionFinished;
|
void *pAcquisitionFinished;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function being called back for raw data
|
* Call back for raw data
|
||||||
* args to raw data ready callback are
|
* args to raw data ready callback are
|
||||||
* framenum
|
* index
|
||||||
|
* frame number
|
||||||
|
* timestamp/ bunch id
|
||||||
|
* exposure length/ sub frame number
|
||||||
* datapointer
|
* datapointer
|
||||||
* datasize in bytes
|
* datasize in bytes
|
||||||
* file descriptor
|
* 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;
|
void *pRawDataReady;
|
||||||
|
|
||||||
|
|
||||||
|
@ -548,25 +548,27 @@ class UDPInterface {
|
|||||||
* 1 callback writes file, we have to open, close it
|
* 1 callback writes file, we have to open, close it
|
||||||
* 2 we open, close, write file, callback does not do anything
|
* 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
|
* Call back for acquisition finished
|
||||||
* callback argument is
|
* callback argument is
|
||||||
* total frames caught
|
* 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
|
* Call back for raw data
|
||||||
* args to raw data ready callback are
|
* args to raw data ready callback are
|
||||||
* framenum
|
* index
|
||||||
|
* frame number
|
||||||
|
* timestamp/ bunch id
|
||||||
|
* exposure length/ sub frame number
|
||||||
* datapointer
|
* datapointer
|
||||||
* datasize in bytes
|
* datasize in bytes
|
||||||
* file descriptor
|
* 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:
|
protected:
|
||||||
|
@ -58,8 +58,10 @@ typedef struct {
|
|||||||
#define HEADER_SIZE_NUM_PACKETS 1
|
#define HEADER_SIZE_NUM_PACKETS 1
|
||||||
#define ALL_MASK_32 0xFFFFFFFF
|
#define ALL_MASK_32 0xFFFFFFFF
|
||||||
|
|
||||||
#define FILE_FRAME_HEADER_LENGTH 16
|
#define FILE_FRAME_HEADER_LENGTH (8*3)
|
||||||
#define FILE_HEADER_BUNCHID_OFFSET 8
|
#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
|
//all max frames defined in sls_receiver_defs.h. 20000 gotthard, 100000 for short gotthard, 1000 for moench, eiger 20000
|
||||||
|
@ -58,28 +58,39 @@ class slsReceiver : private virtual slsReceiverDefs {
|
|||||||
int64_t getReceiverVersion();
|
int64_t getReceiverVersion();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@sort register calbback for starting the acquisition
|
* Call back for start acquisition
|
||||||
@param func callback to be called when starting the acquisition. Its arguments are filepath filename fileindex data size
|
* callback arguments are
|
||||||
\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
|
* 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
|
* Call back for acquisition finished
|
||||||
toatal farmes caught
|
* 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
|
* Call back for raw data
|
||||||
framenum
|
* args to raw data ready callback are
|
||||||
datapointer
|
* index
|
||||||
datasize in bytes
|
* frame number
|
||||||
file descriptor
|
* timestamp/ bunch id
|
||||||
guidatapointer (NULL, no data required)
|
* 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:
|
private:
|
||||||
|
@ -65,30 +65,32 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
|
|||||||
* fileindex
|
* fileindex
|
||||||
* datasize
|
* 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
|
* 0 callback takes care of open,close,wrie file
|
||||||
* 1 callback writes file, we have to open, close it
|
* 1 callback writes file, we have to open, close it
|
||||||
* 2 we open, close, write file, callback does not do anything
|
* 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
|
* Call back for acquisition finished
|
||||||
* callback argument is
|
* callback argument is
|
||||||
* total frames caught
|
* 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
|
* Call back for raw data
|
||||||
* args to raw data ready callback are
|
* args to raw data ready callback are
|
||||||
* framenum
|
* index
|
||||||
|
* frame number
|
||||||
|
* timestamp/ bunch id
|
||||||
|
* exposure length/ sub frame number
|
||||||
* datapointer
|
* datapointer
|
||||||
* datasize in bytes
|
* datasize in bytes
|
||||||
* file descriptor
|
* 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:
|
private:
|
||||||
|
|
||||||
@ -292,7 +294,7 @@ private:
|
|||||||
|
|
||||||
//***callback parameters***
|
//***callback parameters***
|
||||||
/**
|
/**
|
||||||
* function being called back for start acquisition
|
* Call back for start acquisition
|
||||||
* callback arguments are
|
* callback arguments are
|
||||||
* filepath
|
* filepath
|
||||||
* filename
|
* filename
|
||||||
@ -304,28 +306,30 @@ private:
|
|||||||
* 1 callback writes file, we have to open, close it
|
* 1 callback writes file, we have to open, close it
|
||||||
* 2 we open, close, write file, callback does not do anything
|
* 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;
|
void *pStartAcquisition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function being called back for acquisition finished
|
* Call back for acquisition finished
|
||||||
* callback argument is
|
* callback argument is
|
||||||
* total frames caught
|
* total frames caught
|
||||||
*/
|
*/
|
||||||
void (*acquisitionFinishedCallBack)(int, void*);
|
void (*acquisitionFinishedCallBack)(uint64_t, void*);
|
||||||
void *pAcquisitionFinished;
|
void *pAcquisitionFinished;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function being called back for raw data
|
* Call back for raw data
|
||||||
* args to raw data ready callback are
|
* args to raw data ready callback are
|
||||||
* framenum
|
* index
|
||||||
|
* frame number
|
||||||
|
* timestamp/ bunch id
|
||||||
|
* exposure length/ sub frame number
|
||||||
* datapointer
|
* datapointer
|
||||||
* datasize in bytes
|
* datasize in bytes
|
||||||
* file descriptor
|
* 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;
|
void *pRawDataReady;
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,13 +55,10 @@ public:
|
|||||||
/**
|
/**
|
||||||
|
|
||||||
@sort register calbback for starting the acquisition
|
@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
|
\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, uint64_t fileindex, uint32_t datasize, void*),void *arg);
|
||||||
void registerCallBackStartAcquisition(int (*func)(char* filepath, char* filename,int fileindex, int datasize, void*),void *arg);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,19 +66,16 @@ public:
|
|||||||
\param func end of acquisition callback. Argument nf is total frames caught
|
\param func end of acquisition callback. Argument nf is total frames caught
|
||||||
\returns nothing
|
\returns nothing
|
||||||
*/
|
*/
|
||||||
|
void registerCallBackAcquisitionFinished(void (*func)(uint64_t nf, void*),void *arg);
|
||||||
|
|
||||||
void registerCallBackAcquisitionFinished(void (*func)(int nf, void*),void *arg);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@sort register callback to be called when data are available (to process and/or save the data).
|
@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
|
\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
|
//receiver object
|
||||||
slsReceiver* receiver;
|
slsReceiver* receiver;
|
||||||
|
@ -507,17 +507,17 @@ int UDPBaseImplementation::setActivate(int enable){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/***callback functions***/
|
/***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;
|
startAcquisitionCallBack=func;
|
||||||
pStartAcquisition=arg;
|
pStartAcquisition=arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UDPBaseImplementation::registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg){
|
void UDPBaseImplementation::registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg){
|
||||||
acquisitionFinishedCallBack=func;
|
acquisitionFinishedCallBack=func;
|
||||||
pAcquisitionFinished=arg;
|
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;
|
rawDataReadyCallBack=func;
|
||||||
pRawDataReady=arg;
|
pRawDataReady=arg;
|
||||||
}
|
}
|
||||||
|
@ -1527,7 +1527,7 @@ int UDPStandardImplementation::setupWriter(){
|
|||||||
//acquisition start call back returns enable write
|
//acquisition start call back returns enable write
|
||||||
cbAction = DO_EVERYTHING;
|
cbAction = DO_EVERYTHING;
|
||||||
if (startAcquisitionCallBack)
|
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){
|
if(cbAction < DO_EVERYTHING){
|
||||||
@ -2175,6 +2175,7 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread)
|
|||||||
uint32_t pnum = 0;
|
uint32_t pnum = 0;
|
||||||
uint64_t fnum = 0;
|
uint64_t fnum = 0;
|
||||||
uint64_t bnum = 0;
|
uint64_t bnum = 0;
|
||||||
|
uint64_t snum = 0;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
//from getframeandpacketnumber()
|
//from getframeandpacketnumber()
|
||||||
uint32_t pi = 0;
|
uint32_t pi = 0;
|
||||||
@ -2193,7 +2194,8 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
fnum = fi; //fnum of first packet
|
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]++;
|
totalListeningPacketCount[ithread]++;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
if(!ithread) cout << "1 pnum:" << pnum << endl;
|
if(!ithread) cout << "1 pnum:" << pnum << endl;
|
||||||
@ -2283,6 +2285,7 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread)
|
|||||||
if(fi!=ALL_MASK_32)
|
if(fi!=ALL_MASK_32)
|
||||||
fnum = fi; //fnum of first packet
|
fnum = fi; //fnum of first packet
|
||||||
bnum = bi; //bnum of first packet
|
bnum = bi; //bnum of first packet
|
||||||
|
snum = si; //snum of first packet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//------------------------------------------------------ got a complete frame --------------------------------------------------------
|
//------------------------------------------------------ got a complete frame --------------------------------------------------------
|
||||||
@ -2292,8 +2295,21 @@ int UDPStandardImplementation::prepareAndListenBufferCompleteFrames(int ithread)
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
if(!ithread) cout << "fnum:" << (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))) << endl;
|
if(!ithread) cout << "fnum:" << (*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))) << endl;
|
||||||
#endif
|
#endif
|
||||||
if(myDetectorType == JUNGFRAU)
|
switch (myDetectorType) {
|
||||||
(*((uint64_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_BUNCHID_OFFSET))) = bnum;
|
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
|
//write packet count to buffer
|
||||||
*((uint32_t*)(buffer[ithread])) = packetsPerFrame;
|
*((uint32_t*)(buffer[ithread])) = packetsPerFrame;
|
||||||
return bufferSize;
|
return bufferSize;
|
||||||
@ -2802,7 +2818,7 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){
|
|||||||
cprintf(RED,"Note: Deactivated Receiver\n");
|
cprintf(RED,"Note: Deactivated Receiver\n");
|
||||||
//acquisition end
|
//acquisition end
|
||||||
if (acquisitionFinishedCallBack)
|
if (acquisitionFinishedCallBack)
|
||||||
acquisitionFinishedCallBack((int)totalPacketsCaught, pAcquisitionFinished);
|
acquisitionFinishedCallBack(totalPacketsCaught, pAcquisitionFinished);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2827,8 +2843,12 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char*
|
|||||||
|
|
||||||
//callback to write data
|
//callback to write data
|
||||||
if (cbAction < DO_EVERYTHING)
|
if (cbAction < DO_EVERYTHING)
|
||||||
rawDataReadyCallBack((int)tempframenumber, wbuffer + fifoBufferHeaderSize, npackets * onePacketSize,
|
rawDataReadyCallBack(detID*numberofListeningThreads+ithread, tempframenumber,
|
||||||
sfilefd[ithread], latestData[ithread],pRawDataReady);//know which thread from sfilefd
|
0,0,
|
||||||
|
wbuffer + fifoBufferHeaderSize,
|
||||||
|
bufferSize * numberofJobsPerBuffer + fifoBufferHeaderSize,
|
||||||
|
sfilefd[ithread], pRawDataReady);//know which thread from sfilefd
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//write to file if enabled and update write parameters
|
//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";
|
FILE_LOG(logDEBUG) << __AT__ << " called";
|
||||||
|
|
||||||
//get current frame number
|
//get current frame number
|
||||||
uint64_t tempframenumber;
|
uint64_t tempframenumber = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS)));
|
||||||
tempframenumber = (*((uint64_t*)(wbuffer+HEADER_SIZE_NUM_TOT_PACKETS)));
|
uint64_t bnum = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_TIMESTAMP_OFFSET)));
|
||||||
tempframenumber -= startFrameIndex;
|
uint64_t snum = (*((uint64_t*)(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS + FILE_HEADER_EXPLENGTH_OFFSET)));
|
||||||
|
|
||||||
|
|
||||||
if (cbAction < DO_EVERYTHING)
|
if (cbAction < DO_EVERYTHING)
|
||||||
rawDataReadyCallBack((int)tempframenumber, wbuffer + HEADER_SIZE_NUM_TOT_PACKETS, bufferSize + FILE_FRAME_HEADER_LENGTH,
|
rawDataReadyCallBack(detID*numberofListeningThreads+ithread, tempframenumber,
|
||||||
sfilefd[ithread], latestData[ithread],pRawDataReady);
|
bnum, snum,
|
||||||
|
wbuffer + fifoBufferHeaderSize,
|
||||||
|
bufferSize * numberofJobsPerBuffer + fifoBufferHeaderSize,
|
||||||
|
sfilefd[ithread], pRawDataReady);
|
||||||
|
|
||||||
|
|
||||||
//write to file if enabled and update write parameters
|
//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]);
|
fwrite(wbuffer + HEADER_SIZE_NUM_TOT_PACKETS, 1, (bufferSize + FILE_FRAME_HEADER_LENGTH), sfilefd[ithread]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tempframenumber -= startFrameIndex;
|
||||||
|
|
||||||
//progress
|
//progress
|
||||||
if(tempframenumber && (tempframenumber%(maxFramesPerFile/progressFrequency)) == 0){
|
if(tempframenumber && (tempframenumber%(maxFramesPerFile/progressFrequency)) == 0){
|
||||||
|
@ -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
|
//tcpipInterface
|
||||||
if(udp_interface)
|
if(udp_interface)
|
||||||
udp_interface->registerCallBackStartAcquisition(func,arg);
|
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
|
//tcpipInterface
|
||||||
if(udp_interface)
|
if(udp_interface)
|
||||||
udp_interface->registerCallBackAcquisitionFinished(func,arg);
|
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
|
//tcpipInterface
|
||||||
if(udp_interface)
|
if(udp_interface)
|
||||||
udp_interface->registerCallBackRawDataReady(func,arg);
|
udp_interface->registerCallBackRawDataReady(func,arg);
|
||||||
|
@ -3393,17 +3393,17 @@ int slsReceiverTCPIPInterface::exec_command() {
|
|||||||
|
|
||||||
|
|
||||||
/***callback functions***/
|
/***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;
|
startAcquisitionCallBack=func;
|
||||||
pStartAcquisition=arg;
|
pStartAcquisition=arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void slsReceiverTCPIPInterface::registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg){
|
void slsReceiverTCPIPInterface::registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg){
|
||||||
acquisitionFinishedCallBack=func;
|
acquisitionFinishedCallBack=func;
|
||||||
pAcquisitionFinished=arg;
|
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;
|
rawDataReadyCallBack=func;
|
||||||
pRawDataReady=arg;
|
pRawDataReady=arg;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
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);
|
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);
|
receiver->registerCallBackRawDataReady(func,arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user