mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
somewhere in between.. next step include generalData pointer in listerner and dataprocessor calss in constructor and a setter
This commit is contained in:
@ -35,17 +35,9 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
||||
*/
|
||||
virtual ~UDPStandardImplementation();
|
||||
|
||||
//*** initial parameters (behavioral)***
|
||||
/**
|
||||
* Set receiver type (and corresponding detector variables in derived STANDARD class)
|
||||
* It is the first function called by the client when connecting to receiver
|
||||
* @param d detector type
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setDetectorType(const detectorType d);
|
||||
|
||||
|
||||
//*** Getters ***
|
||||
//*** 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
|
||||
@ -58,11 +50,12 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
||||
*/
|
||||
uint64_t getFramesCaught() const;
|
||||
|
||||
/**
|
||||
* Get Current Frame Index for an entire acquisition (including all scans)
|
||||
* @return -1 if no frames have been caught, else current frame index (represents all scans too)
|
||||
*/
|
||||
int64_t getAcquisitionIndex() const;
|
||||
|
||||
|
||||
//*** Setters ***
|
||||
|
||||
//*** file parameters ***
|
||||
/**
|
||||
* Set File Name Prefix (without frame index, file index and extension (_f000000000000_8.raw))
|
||||
* Does not check for file existence since it is created only at startReceiver
|
||||
@ -70,7 +63,6 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
||||
*/
|
||||
void setFileName(const char c[]);
|
||||
|
||||
//*** acquisition parameters ***
|
||||
/**
|
||||
* Set Short Frame Enabled, later will be moved to getROI (so far only for gotthard)
|
||||
* @param i index of adc enabled, else -1 if all enabled
|
||||
@ -99,9 +91,93 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
||||
*/
|
||||
int setAcquisitionPeriod(const uint64_t i);
|
||||
|
||||
//*** Behavioral functions ***
|
||||
/**
|
||||
* Set Acquisition Time
|
||||
* @param i acquisition time
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setAcquisitionTime(const uint64_t i);
|
||||
|
||||
/**
|
||||
* Set Number of Frames expected by receiver from detector
|
||||
* The data receiver status will change from running to idle when it gets this number of frames
|
||||
* @param i number of frames expected
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setNumberOfFrames(const uint64_t i);
|
||||
|
||||
/**
|
||||
* Set Dynamic Range or Number of Bits Per Pixel
|
||||
* @param i dynamic range that is 4, 8, 16 or 32
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setDynamicRange(const uint32_t i);
|
||||
|
||||
/**
|
||||
* Set Ten Giga Enable
|
||||
* @param b true if 10GbE enabled, else false (1G enabled)
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setTenGigaEnable(const bool b);
|
||||
|
||||
/**
|
||||
* Set Fifo Depth
|
||||
* @param i fifo depth value
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setFifoDepth(const uint32_t i);
|
||||
|
||||
/**
|
||||
* Set receiver type (and corresponding detector variables in derived STANDARD class)
|
||||
* It is the first function called by the client when connecting to receiver
|
||||
* @param d detector type
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setDetectorType(const detectorType d);
|
||||
|
||||
/**
|
||||
* Reset acquisition parameters such as total frames caught for an entire acquisition (including all scans)
|
||||
*/
|
||||
void resetAcquisitionCount();
|
||||
|
||||
/**
|
||||
* Start Listening for Packets by activating all configuration settings to receiver
|
||||
* When this function returns, it has status RUNNING(upon SUCCESS) or IDLE (upon failure)
|
||||
* @param c error message if FAIL
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int startReceiver(char *c=NULL);
|
||||
|
||||
/**
|
||||
* Stop Listening for Packets
|
||||
* Calls startReadout(), which stops listening and sets status to Transmitting
|
||||
* When it has read every frame in buffer, the status changes to Run_Finished
|
||||
* When this function returns, receiver has status IDLE
|
||||
* Pre: status is running, semaphores have been instantiated,
|
||||
* Post: udp sockets shut down, status is idle, semaphores destroyed
|
||||
*/
|
||||
void stopReceiver();
|
||||
|
||||
/**
|
||||
* Stop Listening to Packets
|
||||
* and sets status to Transmitting
|
||||
* Next step would be to get all data and stop receiver completely and return with idle state
|
||||
* Pre: status is running, udp sockets have been initialized, stop receiver initiated
|
||||
* Post:udp sockets closed, status is transmitting
|
||||
*/
|
||||
void startReadout();
|
||||
|
||||
/**
|
||||
* Shuts down and deletes UDP Sockets
|
||||
* also called in case of illegal shutdown of receiver
|
||||
*/
|
||||
void shutDownUDPSockets();
|
||||
|
||||
/**
|
||||
* Closes file / all files(data compression involves multiple files)
|
||||
* TCPIPInterface can also call this in case of illegal shutdown of receiver
|
||||
*/
|
||||
void closeFiles();
|
||||
|
||||
private:
|
||||
|
||||
@ -127,6 +203,31 @@ private:
|
||||
*/
|
||||
int SetupFifoStructure();
|
||||
|
||||
/**
|
||||
* Reset parameters for new measurement (eg. for each scan)
|
||||
*/
|
||||
void ResetParametersforNewMeasurement();
|
||||
|
||||
/**
|
||||
* Creates UDP Sockets
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int CreateUDPSockets();
|
||||
|
||||
/**
|
||||
* Creates the first file
|
||||
* also does the startAcquisitionCallBack
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int SetupWriter();
|
||||
|
||||
/**
|
||||
* Start Running
|
||||
* Set running mask and post semaphore of the threads
|
||||
* to start the inner loop in execution thread
|
||||
*/
|
||||
void StartRunning();
|
||||
|
||||
|
||||
//*** Class Members ***
|
||||
|
||||
|
Reference in New Issue
Block a user