including subframe number

This commit is contained in:
Dhanya Maliakal
2017-03-13 11:33:06 +01:00
parent a1f00518b8
commit 53be854efd
11 changed files with 126 additions and 85 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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