mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-03 11:48:39 +01:00
Rxclassmembers (#503)
* gui message doesnt show if it has a '>' symbol in error msg * minor refactoring for readability (size_t calc fifo size) * refactoring listening udp socket code: activated and datastream dont create udp sockets anyway, rc<=- should be discarded in any case * wip * refactoring memory structure access * wip: bugfix write header + data to binary * wip * wip * wip * wip * wip * wip * wip * wip * wip * portRoi no roi effecto on progress * fail at receiver progress, wip * segfaults for char pointer in struct * reference to header to get header and data * refactoring * use const defined for size of header of fifo * updated release notes * remove pointer in callback for sls_receiver_header pointer * rx same name arguments in constructors * rx: same name arguments in constructor * rx: removing the '_' suffix in class data members * merge fix * merge fix * review fix refactoring
This commit is contained in:
@@ -21,92 +21,34 @@ namespace sls {
|
||||
class Fifo : private virtual slsDetectorDefs {
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
* Calls CreateFifos that creates fifos and allocates memory
|
||||
* @param ind self index
|
||||
* @param fifoItemSize size of each fifo item
|
||||
* @param depth fifo depth
|
||||
*/
|
||||
Fifo(int ind, size_t fifoItemSize, uint32_t depth);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
Fifo(int index, size_t fifoItemSize, uint32_t fifoDepth);
|
||||
~Fifo();
|
||||
|
||||
/**
|
||||
* Frees the bound address by pushing into fifoFree
|
||||
*/
|
||||
|
||||
void FreeAddress(char *&address);
|
||||
|
||||
/**
|
||||
* Pops free address from fifoFree
|
||||
*/
|
||||
void GetNewAddress(char *&address);
|
||||
|
||||
/**
|
||||
* Pushes bound address into fifoBound
|
||||
*/
|
||||
/** to process data */
|
||||
void PushAddress(char *&address);
|
||||
|
||||
/**
|
||||
* Pops bound address from fifoBound to process data
|
||||
*/
|
||||
void PopAddress(char *&address);
|
||||
|
||||
/**
|
||||
* Pushes bound address into fifoStream
|
||||
*/
|
||||
void PushAddressToStream(char *&address);
|
||||
|
||||
/**
|
||||
* Pops bound address from fifoStream to stream data
|
||||
*/
|
||||
void PopAddressToStream(char *&address);
|
||||
|
||||
/**
|
||||
* Get Maximum Level filled in Fifo Bound
|
||||
* and reset this value for next intake
|
||||
*/
|
||||
int GetMaxLevelForFifoBound();
|
||||
|
||||
/**
|
||||
* Get Minimum Level filled in Fifo Free
|
||||
* and reset this value to max for next intake
|
||||
*/
|
||||
int GetMinLevelForFifoFree();
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
* Create Fifos, allocate memory & push addresses into fifo
|
||||
* @param fifoItemSize size of each fifo item
|
||||
*/
|
||||
/** also allocate memory & push addresses into free fifo */
|
||||
void CreateFifos(size_t fifoItemSize);
|
||||
|
||||
/**
|
||||
* Destroy Fifos and deallocate memory
|
||||
*/
|
||||
/** also deallocate memory */
|
||||
void DestroyFifos();
|
||||
|
||||
/** Self Index */
|
||||
int index;
|
||||
|
||||
/** Memory allocated, whose addresses are pushed into the fifos */
|
||||
char *memory;
|
||||
|
||||
/** Circular Fifo pointing to addresses of bound data in memory */
|
||||
CircularFifo<char> *fifoBound;
|
||||
|
||||
/** Circular Fifo pointing to addresses of freed data in memory */
|
||||
CircularFifo<char> *fifoFree;
|
||||
|
||||
/** Circular Fifo pointing to addresses of to be streamed data in memory */
|
||||
CircularFifo<char> *fifoStream;
|
||||
|
||||
/** Fifo depth set */
|
||||
int fifoDepth;
|
||||
|
||||
volatile int status_fifoBound;
|
||||
volatile int status_fifoFree;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user