rxr: removed slsReceiverUsers, start() and stop()

This commit is contained in:
2019-11-18 15:16:20 +01:00
parent f2c0ff7f98
commit dc78e23449
10 changed files with 46 additions and 262 deletions

View File

@ -1,20 +1,10 @@
#pragma once
/********************************************//**
* @file slsReceiver.h
* @short creates the UDP and TCP class objects
***********************************************/
#include <memory>
#include "slsReceiverTCPIPInterface.h"
#include "sls_detector_defs.h"
#include <memory>
/**
*@short creates the UDP and TCP class objects
*/
class slsReceiver : private virtual slsDetectorDefs {
class Receiver : private virtual slsDetectorDefs {
public:
/**
@ -25,7 +15,7 @@ class slsReceiver : private virtual slsDetectorDefs {
* @param argc from command line
* @param argv from command line
*/
slsReceiver(int argc, char *argv[]);
Receiver(int argc, char *argv[]);
/**
* Constructor
@ -34,18 +24,7 @@ class slsReceiver : private virtual slsDetectorDefs {
* throws an exception in case of failure
* @param tcpip_port_no TCP/IP port number
*/
slsReceiver(int tcpip_port_no = 1954);
/**
* starts listening on the TCP port for client comminication
\return 0 for success or 1 for FAIL in creating TCP server
*/
int start();
/**
* stops listening to the TCP & UDP port and exit receiver program
*/
void stop();
Receiver(int tcpip_port_no = 1954);
/**
* get get Receiver Version
@ -70,16 +49,16 @@ class slsReceiver : private virtual slsDetectorDefs {
/**
* Call back for acquisition finished
* callback argument is
* total frames caught
* @param total frames caught
*/
void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg);
/**
* Call back for raw data
* args to raw data ready callback are
* sls_receiver_header frame metadata
* dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes.
* @param sls_receiver_header frame metadata
* @param dataPointer is the pointer to the data
* @param dataSize in bytes is the size of the data in bytes.
*/
void registerCallBackRawDataReady(void (*func)(char* ,
char*, uint32_t, void*),void *arg);
@ -87,9 +66,9 @@ class slsReceiver : private virtual slsDetectorDefs {
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* sls_receiver_header frame metadata
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes.
* @param sls_receiver_header frame metadata
* @param dataPointer is the pointer to the data
* @param revDatasize is the reference of data size in bytes.
* Can be modified to the new size to be written/streamed. (only smaller value).
*/
void registerCallBackRawDataModifyReady(void (*func)(char* ,

View File

@ -37,9 +37,8 @@ class slsReceiverTCPIPInterface : private virtual slsDetectorDefs {
/**
* Starts listening on the TCP port for client comminication
\returns OK or FAIL
*/
int start();
void start();
/** stop listening on the TCP & UDP port for client comminication */
void stop();

View File

@ -1,92 +0,0 @@
#pragma once
#include <stdio.h>
#include <stdint.h>
#include <memory>
#include "slsReceiver.h"
/**
@short Class for implementing the SLS data receiver in the users application. Callbacks can be defined for processing and/or saving data
slsReceiverUsers is a class that can be instantiated in the users software to receive the data from the detectors. Callbacks can be defined for processing and/or saving data
***********************************************/
class slsReceiverUsers {
public:
/**
* Constructor
* reads config file, creates socket, assigns function table
* @param argc from command line
* @param argv from command line
* @param success socket creation was successfull
*/
slsReceiverUsers(int argc, char *argv[], int &success);
/**
* Constructor
* reads config file, creates socket, assigns function table
* @param tcpip_port_no TCP/IP port
* @throws
*/
slsReceiverUsers(int tcpip_port_no = 1954);
/**
* starts listening on the TCP port for client comminication
\return 0 for success or 1 for FAIL in creating TCP server
*/
int start();
/** stops listening to the TCP & UDP port and exit receiver program*/
void stop();
/**
get get Receiver Version
\returns id
*/
int64_t getReceiverVersion();
/**
@short register calbback for starting the acquisition
\param func callback to be called when starting the acquisition. Its arguments are filepath, filename, fileindex, datasize
\param arg argument
\return value is insignificant at the moment, we write depending on file write enable, users get data to write depending on call backs registered
*/
void registerCallBackStartAcquisition(int (*func)(std::string filepath, std::string filename, uint64_t fileindex, uint32_t datasize, void*),void *arg);
/**
@short register callback for end of acquisition
\param func end of acquisition callback. Argument nf is total frames caught
\param arg argument
\returns nothing
*/
void registerCallBackAcquisitionFinished(void (*func)(uint64_t nf, void*),void *arg);
/**
@short register callback to be called when data are available (to process and/or save the data).
\param func raw data ready callback. arguments are sls_receiver_header, dataPointer, dataSize
\param arg argument
\returns nothing
*/
void registerCallBackRawDataReady(void (*func)(char* header,
char* datapointer, uint32_t datasize, void*),void *arg);
/**
@short register callback to be called when data are available (to process and/or save the data).
\param func raw data ready callback. arguments are sls_receiver_header, dataPointer, revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
\param arg argument
\returns nothing
*/
void registerCallBackRawDataModifyReady(void (*func)(char* header,
char* datapointer, uint32_t &revDatasize, void*),void *arg);
//receiver object
std::unique_ptr<slsReceiver> receiver;
};