mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
slsReciever, slsDetector: configurable number of images per file, removed all the receiver threads from using generalData->maxframesperfile, yet to do: infinite images, bug fix, virtual hdf5 has -1 for all pixels in last image
This commit is contained in:
@ -21,7 +21,7 @@ class BinaryFile : private virtual slsReceiverDefs, public File, public BinaryFi
|
||||
* Constructor
|
||||
* creates the File Writer
|
||||
* @param ind self index
|
||||
* @param maxf max frames per file
|
||||
* @param maxf pointer to max frames per file
|
||||
* @param nd pointer to number of detectors in each dimension
|
||||
* @param fname pointer to file name prefix
|
||||
* @param fpath pointer to file path
|
||||
@ -34,7 +34,7 @@ class BinaryFile : private virtual slsReceiverDefs, public File, public BinaryFi
|
||||
* @param portno pointer to udp port number for logging
|
||||
* @param smode pointer to silent mode
|
||||
*/
|
||||
BinaryFile(int ind, uint32_t maxf,
|
||||
BinaryFile(int ind, uint32_t* maxf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
bool* smode);
|
||||
|
@ -34,6 +34,7 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
* @param freq pointer to streaming frequency
|
||||
* @param timer pointer to timer if streaming frequency is random
|
||||
* @param dataReadycb pointer to data ready call back function
|
||||
* @param dataModifyReadycb pointer to data ready call back function with modified
|
||||
* @param pDataReadycb pointer to arguments of data ready call back function. To write/stream a smaller size of processed data, change this value (only smaller value is allowed).
|
||||
*/
|
||||
DataProcessor(int ind, Fifo*& f, fileFormat* ftype, bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
|
||||
@ -154,6 +155,7 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
* Set up file writer object and call backs
|
||||
* @param fwe file write enable
|
||||
* @param nd pointer to number of detectors in each dimension
|
||||
* @param maxf pointer to max frames per file
|
||||
* @param fname pointer to file name prefix
|
||||
* @param fpath pointer to file path
|
||||
* @param findex pointer to file index
|
||||
@ -165,8 +167,10 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
* @param portno pointer to udp port number
|
||||
* @param g address of GeneralData (Detector Data) pointer
|
||||
*/
|
||||
void SetupFileWriter(bool fwe, int* nd, char* fname, char* fpath, uint64_t* findex,
|
||||
bool* owenable, int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno, GeneralData* g = 0);
|
||||
void SetupFileWriter(bool fwe, int* nd, uint32_t* maxf, char* fname,
|
||||
char* fpath, uint64_t* findex,
|
||||
bool* owenable, int* dindex, int* nunits, uint64_t* nf, uint32_t* dr,
|
||||
uint32_t* portno, GeneralData* g = 0);
|
||||
|
||||
/**
|
||||
* Create New File
|
||||
@ -326,7 +330,6 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
|
||||
|
||||
|
||||
|
||||
//acquisition start
|
||||
/** Aquisition Started flag */
|
||||
bool acquisitionStartedFlag;
|
||||
|
@ -21,7 +21,7 @@ class File : private virtual slsReceiverDefs {
|
||||
* Constructor
|
||||
* creates the File Writer
|
||||
* @param ind self index
|
||||
* @param maxf max frames per file
|
||||
* @param maxf pointer to max frames per file
|
||||
* @param nd pointer to number of detectors in each dimension
|
||||
* @param fname pointer to file name prefix
|
||||
* @param fpath pointer to file path
|
||||
@ -34,7 +34,7 @@ class File : private virtual slsReceiverDefs {
|
||||
* @param portno pointer to udp port number for logging
|
||||
* @param smode pointer to silent mode
|
||||
*/
|
||||
File(int ind, uint32_t maxf,
|
||||
File(int ind, uint32_t* maxf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
bool* smode);
|
||||
@ -64,6 +64,7 @@ class File : private virtual slsReceiverDefs {
|
||||
/**
|
||||
* Get Member Pointer Values before the object is destroyed
|
||||
* @param nd pointer to number of detectors in each dimension
|
||||
* @param maxf pointer to max frames per file
|
||||
* @param fname pointer to file name prefix
|
||||
* @param fpath pointer to file path
|
||||
* @param findex pointer to file index
|
||||
@ -74,15 +75,10 @@ class File : private virtual slsReceiverDefs {
|
||||
* @param dr pointer to dynamic range
|
||||
* @param portno pointer to dynamic range
|
||||
*/
|
||||
void GetMemberPointerValues(int* nd, char*& fname, char*& fpath, uint64_t*& findex, bool*& owenable,
|
||||
void GetMemberPointerValues(int* nd, uint32_t*& maxf, char*& fname, char*& fpath,
|
||||
uint64_t*& findex, bool*& owenable,
|
||||
int*& dindex, int*& nunits, uint64_t*& nf, uint32_t*& dr, uint32_t*& portno);
|
||||
|
||||
/**
|
||||
* Set Max frames per file
|
||||
* @param maxf maximum frames per file
|
||||
*/
|
||||
void SetMaxFramesPerFile(uint32_t maxf);
|
||||
|
||||
/**
|
||||
* Create file
|
||||
* @param fnum current frame index to include in file name
|
||||
@ -172,7 +168,7 @@ class File : private virtual slsReceiverDefs {
|
||||
int index;
|
||||
|
||||
/** Maximum frames per file */
|
||||
uint32_t maxFramesPerFile;
|
||||
uint32_t* maxFramesPerFile;
|
||||
|
||||
/** Master File Name */
|
||||
std::string masterFileName;
|
||||
|
@ -27,7 +27,7 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
|
||||
* Constructor
|
||||
* creates the File Writer
|
||||
* @param ind self index
|
||||
* @param maxf max frames per file
|
||||
* @param maxf pointer to max frames per file
|
||||
* @param nd pointer to number of detectors in each dimension
|
||||
* @param fname pointer to file name prefix
|
||||
* @param fpath pointer to file path
|
||||
@ -42,7 +42,7 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
|
||||
* @param ny number of pixels in y direction
|
||||
* @param smode pointer to silent mode
|
||||
*/
|
||||
HDF5File(int ind, uint32_t maxf,
|
||||
HDF5File(int ind, uint32_t* maxf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
uint32_t nx, uint32_t ny,
|
||||
|
@ -32,10 +32,11 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
||||
* @param dr pointer to dynamic range
|
||||
* @param us pointer to udp socket buffer size
|
||||
* @param as pointer to actual udp socket buffer size
|
||||
* @param fpf pointer to frames per file
|
||||
*/
|
||||
Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
|
||||
uint32_t* portno, char* e, int* act, uint64_t* nf, uint32_t* dr,
|
||||
uint32_t* us, uint32_t* as);
|
||||
uint32_t* us, uint32_t* as, uint32_t* fpf);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
@ -237,6 +238,9 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
||||
/** actual UDP Socket Buffer Size (double due to kernel bookkeeping) */
|
||||
uint32_t* actualUDPSocketBufferSize;
|
||||
|
||||
/** frames per file */
|
||||
uint32_t* framesPerFile;
|
||||
|
||||
|
||||
// acquisition start
|
||||
/** Aquisition Started flag */
|
||||
|
@ -97,6 +97,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
||||
*/
|
||||
uint64_t getFileIndex() const;
|
||||
|
||||
/**
|
||||
* Get Frames per File
|
||||
* @return Frames per File
|
||||
*/
|
||||
uint32_t getFramesPerFile() const;
|
||||
|
||||
/**
|
||||
* Get Scan Tag
|
||||
* @return scan tag //FIXME: needed? (unsigned integer?)
|
||||
@ -356,6 +362,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
||||
*/
|
||||
void setFileIndex(const uint64_t i);
|
||||
|
||||
/**
|
||||
* Set Frames per File
|
||||
* @param i Frames per File
|
||||
*/
|
||||
void setFramesPerFile(const uint32_t i);
|
||||
|
||||
/**
|
||||
* Set Scan Tag
|
||||
* @param i scan tag //FIXME: needed? (unsigned integer?)
|
||||
@ -739,6 +751,8 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
||||
char filePath[MAX_STR_LENGTH];
|
||||
/** File Index */
|
||||
uint64_t fileIndex;
|
||||
/** Frames per file */
|
||||
uint32_t framesPerFile;
|
||||
/** Scan Tag */
|
||||
int scanTag;
|
||||
/** File Write enable */
|
||||
|
@ -181,10 +181,16 @@ class UDPInterface {
|
||||
|
||||
/**
|
||||
* Get File Index
|
||||
* @return NULL or file index of acquisition
|
||||
* @return file index of acquisition
|
||||
*/
|
||||
virtual uint64_t getFileIndex() const = 0;
|
||||
|
||||
/**
|
||||
* Get Frames per File
|
||||
* @return Frames per File
|
||||
*/
|
||||
virtual uint32_t getFramesPerFile() const = 0;
|
||||
|
||||
/**
|
||||
* Get Scan Tag
|
||||
* @return scan tag //FIXME: needed? (unsigned integer?)
|
||||
@ -443,6 +449,12 @@ class UDPInterface {
|
||||
*/
|
||||
virtual void setFileIndex(const uint64_t i) = 0;
|
||||
|
||||
/**
|
||||
* Set Frames per File
|
||||
* @param i Frames per File
|
||||
*/
|
||||
virtual void setFramesPerFile(const uint32_t i) = 0;
|
||||
|
||||
/**
|
||||
* Set Scan Tag
|
||||
* @param i scan tag //FIXME: needed? (unsigned integer?)
|
||||
|
@ -35,6 +35,7 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
||||
|
||||
|
||||
//*** Overloaded Functions called by TCP Interface ***
|
||||
|
||||
/**
|
||||
* Get Total Frames Caught for an entire acquisition (including all scans)
|
||||
* @return total number of frames caught for entire acquisition
|
||||
|
@ -306,7 +306,8 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
|
||||
/** get real udp socket buffer size */
|
||||
int get_real_udp_socket_buffer_size();
|
||||
|
||||
|
||||
/** set frames per file */
|
||||
int set_frames_per_file();
|
||||
|
||||
/** detector type */
|
||||
detectorType myDetectorType;
|
||||
|
@ -66,6 +66,7 @@ enum recFuncs{
|
||||
F_ADDITIONAL_JSON_HEADER, /** < additional json header */
|
||||
F_RECEIVER_UDP_SOCK_BUF_SIZE, /** < UDP socket buffer size */
|
||||
F_RECEIVER_REAL_UDP_SOCK_BUF_SIZE, /** < real UDP socket buffer size */
|
||||
F_SET_RECEIVER_FRAMES_PER_FILE, /** < receiver frames per file */
|
||||
|
||||
/* Always append functions hereafter!!! */
|
||||
|
||||
|
Reference in New Issue
Block a user