removed typedef for shared struct

This commit is contained in:
Erik Frojdh
2019-03-12 14:42:27 +01:00
parent d4e4fb8ffe
commit 7e793539ca
2 changed files with 682 additions and 701 deletions

View File

@ -7,10 +7,10 @@
* @short This is the base class for multi detector system functionalities * @short This is the base class for multi detector system functionalities
* @author Anna Bergamaschi * @author Anna Bergamaschi
*/ */
#include "SharedMemory.h"
#include "error_defs.h" #include "error_defs.h"
#include "logger.h" #include "logger.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
#include "SharedMemory.h"
class slsDetector; class slsDetector;
// class SharedMemory; // class SharedMemory;
class ZmqSocket; class ZmqSocket;
@ -27,12 +27,11 @@ class detectorData;
#define SHORT_STRING_LENGTH 50 #define SHORT_STRING_LENGTH 50
#define DATE_LENGTH 30 #define DATE_LENGTH 30
/** /**
* @short structure allocated in shared memory to store detector settings * @short structure allocated in shared memory to store detector settings
* for IPC and cache * for IPC and cache
*/ */
typedef struct sharedMultiSlsDetector { struct sharedMultiSlsDetector {
/* FIXED PATTERN FOR STATIC FUNCTIONS. DO NOT CHANGE, ONLY APPEND /* FIXED PATTERN FOR STATIC FUNCTIONS. DO NOT CHANGE, ONLY APPEND
* ------*/ * ------*/
@ -107,15 +106,13 @@ class detectorData;
/** data streaming (up stream) enable in receiver */ /** data streaming (up stream) enable in receiver */
bool receiver_upstream; bool receiver_upstream;
};
} sharedMultiSlsDetector;
class multiSlsDetector : public virtual slsDetectorDefs, class multiSlsDetector : public virtual slsDetectorDefs,
public virtual errorDefs { public virtual errorDefs {
// private: // private:
public: public:
/** /**
* Constructor * Constructor
@ -444,8 +441,6 @@ class multiSlsDetector : public virtual slsDetectorDefs,
*/ */
int setReceiverPort(int port_number = -1, int detPos = -1); int setReceiverPort(int port_number = -1, int detPos = -1);
/** /**
* Lock server for this client IP * Lock server for this client IP
* @param p 0 to unlock, 1 to lock * @param p 0 to unlock, 1 to lock
@ -951,7 +946,6 @@ class multiSlsDetector : public virtual slsDetectorDefs,
*/ */
int setReceiverUDPPort(int udpport, int detPos = -1); int setReceiverUDPPort(int udpport, int detPos = -1);
/** /**
* Returns the receiver UDP port * Returns the receiver UDP port
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
@ -1968,7 +1962,6 @@ class multiSlsDetector : public virtual slsDetectorDefs,
/** Shared Memory object */ /** Shared Memory object */
SharedMemory<sharedMultiSlsDetector> sharedMemory{0, -1}; SharedMemory<sharedMultiSlsDetector> sharedMemory{0, -1};
/** pointers to the slsDetector structures */ /** pointers to the slsDetector structures */
std::vector<std::unique_ptr<slsDetector>> detectors; std::vector<std::unique_ptr<slsDetector>> detectors;

View File

@ -9,11 +9,11 @@
* @author Anna Bergamaschi * @author Anna Bergamaschi
*/ */
#include "sls_detector_defs.h"
#include "error_defs.h"
#include "logger.h"
#include "ClientSocket.h" #include "ClientSocket.h"
#include "SharedMemory.h" #include "SharedMemory.h"
#include "error_defs.h"
#include "logger.h"
#include "sls_detector_defs.h"
class ClientInterface; class ClientInterface;
#include <cmath> #include <cmath>
@ -41,11 +41,10 @@ typedef struct detParameterList {
int nGappixelsY; int nGappixelsY;
} detParameterList; } detParameterList;
/** /**
* @short structure allocated in shared memory to store detector settings for IPC and cache * @short structure allocated in shared memory to store detector settings for IPC and cache
*/ */
typedef struct sharedSlsDetector { struct sharedSlsDetector {
/* FIXED PATTERN FOR STATIC FUNCTIONS. DO NOT CHANGE, ONLY APPEND ------*/ /* FIXED PATTERN FOR STATIC FUNCTIONS. DO NOT CHANGE, ONLY APPEND ------*/
@ -69,9 +68,6 @@ typedef struct detParameterList {
/** END OF FIXED PATTERN -----------------------------------------------*/ /** END OF FIXED PATTERN -----------------------------------------------*/
/** Detector offset in the X & Y direction in the multi detector structure */ /** Detector offset in the X & Y direction in the multi detector structure */
int offset[2]; int offset[2];
@ -257,12 +253,10 @@ typedef struct detParameterList {
/** overwriteenable */ /** overwriteenable */
bool receiver_overWriteEnable; bool receiver_overWriteEnable;
};
} sharedSlsDetector;
class slsDetector : public virtual slsDetectorDefs, public virtual errorDefs { class slsDetector : public virtual slsDetectorDefs, public virtual errorDefs {
public: public:
/** /**
* Constructor called when creating new shared memory * Constructor called when creating new shared memory
* @param type detector type * @param type detector type
@ -456,7 +450,6 @@ public:
*/ */
int setOnline(int value = GET_ONLINE_FLAG); int setOnline(int value = GET_ONLINE_FLAG);
/** /**
* Returns the online flag * Returns the online flag
*/ */
@ -596,7 +589,6 @@ public:
*/ */
int getThresholdEnergy(); int getThresholdEnergy();
/** /**
* Set threshold energy (Mythen and Eiger) * Set threshold energy (Mythen and Eiger)
* For Eiger, calls setThresholdEneryAndSettings * For Eiger, calls setThresholdEneryAndSettings
@ -1253,7 +1245,6 @@ public:
*/ */
int setAutoComparatorDisableMode(int ival = -1); int setAutoComparatorDisableMode(int ival = -1);
/** /**
* Returns the trimbits from the detector's shared memmory (Eiger) * Returns the trimbits from the detector's shared memmory (Eiger)
* @param retval is the array with the trimbits * @param retval is the array with the trimbits
@ -1272,7 +1263,6 @@ public:
*/ */
int setModule(sls_detector_module module, int tb = 1); int setModule(sls_detector_module module, int tb = 1);
/** /**
* Get module structure from detector (all detectors) * Get module structure from detector (all detectors)
* @returns pointer to module structure (which has been created and must then be deleted) * @returns pointer to module structure (which has been created and must then be deleted)
@ -1643,7 +1633,6 @@ public:
int setDigitalIODelay(uint64_t pinMask, int delay); int setDigitalIODelay(uint64_t pinMask, int delay);
private: private:
/** /**
* Get Detector Type from Shared Memory (opening shm without verifying size) * Get Detector Type from Shared Memory (opening shm without verifying size)
* @param multiId multi detector Id * @param multiId multi detector Id
@ -1783,7 +1772,6 @@ private:
*/ */
int writeSettingsFile(const std::string &fname, sls_detector_module mod); int writeSettingsFile(const std::string &fname, sls_detector_module mod);
/** slsDetector Id or position in the detectors list */ /** slsDetector Id or position in the detectors list */
int detId; int detId;