quad implemented

This commit is contained in:
2019-07-10 17:39:43 +02:00
parent 3e2b471ee1
commit 1189b991e5
32 changed files with 558 additions and 76 deletions

View File

@@ -30,9 +30,11 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
* @param fd flipped data enable for x and y dimensions
* @param ajh additional json header
* @param sm pointer to silent mode
* @param nd pointer to number of detectors in each dimension
* @param gpEnable pointer to gap pixels enable
*/
DataStreamer(int ind, Fifo*& f, uint32_t* dr, std::vector<ROI>* r,
uint64_t* fi, int* fd, char* ajh, bool* sm);
uint64_t* fi, int* fd, char* ajh, bool* sm, int* nd, bool* gpEnable);
/**
* Destructor
@@ -88,6 +90,18 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
*/
int SetThreadPriority(int priority);
/**
* Set number of detectors
* @param number of detectors in both dimensions
*/
void SetNumberofDetectors(int* nd);
/**
* Set Flipped data enable across both dimensions
* @param flipped data enable in both dimensions
*/
void SetFlippedData(int* fd);
/**
* Creates Zmq Sockets
* (throws an exception if it couldnt create zmq sockets)
@@ -184,7 +198,7 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
uint64_t* fileIndex;
/** flipped data across both dimensions enable */
int* flippedData;
int flippedData[2];
/** additional json header */
char* additionJsonHeader;
@@ -207,5 +221,11 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
/** Complete buffer used for roi, eg. shortGotthard */
char* completeBuffer;
/** Number of Detectors in X and Y dimension */
int numDet[2];
/** Gap Pixels Enable */
bool* gapPixelsEnable;
};

View File

@@ -72,6 +72,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
*/
bool getGapPixelsEnable() const;
/**
* Get Quad type Enable (eiger and hardware specific)
* @return true if quad enabled, else false
*/
bool getQuad() const;
//***file parameters***
/**
@@ -341,7 +347,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
void setMultiDetectorSize(const int* size);
/*
* Get flipped data across 'axis'
* Set flipped data across 'axis'
* @return if data is flipped across 'axis'
*/
void setFlippedData(int axis=0, int enable=-1);
@@ -353,6 +359,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
*/
int setGapPixelsEnable(const bool b);
/**
* Set Quad type Enable (eiger and hardware specific)
* @param true if quad enabled, else false
*/
void setQuad(const bool b);
//***file parameters***
/**
@@ -739,6 +751,8 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
int flippedData[2];
/** gap pixels enable */
bool gapPixelsEnable;
/** quad type enable */
bool quadEnable;
//***receiver parameters***
/** Maximum Number of Listening Threads/ UDP Ports */

View File

@@ -162,6 +162,12 @@ class UDPInterface {
*/
virtual bool getGapPixelsEnable() const = 0;
/**
* Get Quad type Enable (eiger and hardware specific)
* @return true if quad enabled, else false
*/
virtual bool getQuad() const = 0;
//***file parameters***
/**
@@ -444,6 +450,12 @@ class UDPInterface {
*/
virtual int setGapPixelsEnable(const bool b) = 0;
/**
* Set Quad type Enable (eiger and hardware specific)
* @param true if quad enabled, else false
*/
virtual void setQuad(const bool b) = 0;
//***file parameters***
/**

View File

@@ -53,6 +53,18 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
*/
int64_t getAcquisitionIndex() const;
/*
* Set multi detector size
* @param pointer to array of multi detector size in every dimension
*/
void setMultiDetectorSize(const int* size);
/*
* Set flipped data across 'axis'
* @return if data is flipped across 'axis'
*/
void setFlippedData(int axis=0, int enable=-1);
/**
* Set Gap Pixels Enable (eiger specific)
* @param b true for gap pixels enable, else false
@@ -60,6 +72,12 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
*/
int setGapPixelsEnable(const bool b);
/**
* Set Quad type Enable (eiger and hardware specific)
* @param true if quad enabled, else false
*/
void setQuad(const bool b);
/**
* Set File Format
* @param f fileformat binary or hdf5

View File

@@ -238,19 +238,42 @@ public:
/**
* Send Message Header
* @param buf message
* @param length length of message
* @param dummy true if end of acquistion else false
* @param index self index for debugging
* @param dummy true if a dummy message for end of acquisition
* @param jsonversion json version
* @param dynamicrange dynamic range
* @param fileIndex file or acquisition index
* @param ndetx number of detectors in x axis
* @param ndety number of detectors in y axis
* @param npixelsx number of pixels/channels in x axis for this zmq socket
* @param npixelsy number of pixels/channels in y axis for this zmq socket
* @param imageSize number of bytes for an image in this socket
* @param frameNumber current frame number
* @param expLength exposure length or subframe index if eiger
* @param packetNumber number of packets caught for this frame
* @param bunchId bunch id
* @param timestamp time stamp
* @param modId module Id
* @param row row index in complete detector
* @param column column index in complete detector
* @param reserved reserved
* @param debug debug
* @param roundRNumber not used yet
* @param detType detector enum
* @param version detector header version
* @param gapPixelsEnable gap pixels enable (exception: if gap pixels enable for 4 bit mode, data is not yet gap pixel enabled in receiver)
* @param flippedData int array of 2 elements for x and y, if it is flipped across x or y axis
* @param additionalJsonHeader additional json header
* @returns 0 if error, else 1
*/
int SendHeaderData ( int index, bool dummy, uint32_t jsonversion, uint32_t dynamicrange = 0, uint64_t fileIndex = 0,
uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
uint32_t ndetx = 0, uint32_t ndety = 0, uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
uint64_t acqIndex = 0, uint64_t fIndex = 0, char* fname = NULL,
uint64_t frameNumber = 0, uint32_t expLength = 0, uint32_t packetNumber = 0,
uint64_t bunchId = 0, uint64_t timestamp = 0,
uint16_t modId = 0, uint16_t row = 0, uint16_t column = 0, uint16_t reserved = 0,
uint32_t debug = 0, uint16_t roundRNumber = 0,
uint8_t detType = 0, uint8_t version = 0, int* flippedData = 0,
uint8_t detType = 0, uint8_t version = 0, int gapPixelsEnable = 0, int* flippedData = 0,
char* additionalJsonHeader = 0) {
@@ -261,6 +284,7 @@ public:
"\"jsonversion\":%u, "
"\"bitmode\":%u, "
"\"fileIndex\":%llu, "
"\"detshape\":[%u, %u], "
"\"shape\":[%u, %u], "
"\"size\":%u, "
"\"acqIndex\":%llu, "
@@ -283,11 +307,12 @@ public:
"\"version\":%u, "
//additional stuff
"\"gappixels\":%u, "
"\"flippedDataX\":%u"
;//"}\n";
int length = sprintf(buf, jsonHeaderFormat,
jsonversion, dynamicrange, fileIndex, npixelsx, npixelsy, imageSize,
jsonversion, dynamicrange, fileIndex, ndetx, ndety, npixelsx, npixelsy, imageSize,
acqIndex, fIndex, (fname == NULL)? "":fname, dummy?0:1,
frameNumber, expLength, packetNumber, bunchId, timestamp,
@@ -295,6 +320,7 @@ public:
detType, version,
//additional stuff
gapPixelsEnable,
((flippedData == 0 ) ? 0 :flippedData[0])
);
if (additionalJsonHeader && strlen(additionalJsonHeader)) {

View File

@@ -284,6 +284,9 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
/** set deactivated receiver padding enable */
int set_deactivated_receiver_padding_enable();
/** set quad type */
int set_quad_type();
/** detector type */
detectorType myDetectorType;

View File

@@ -71,6 +71,7 @@ enum recFuncs{
F_RECEIVER_DISCARD_POLICY, /** < frames discard policy */
F_RECEIVER_PADDING_ENABLE, /** < partial frames padding enable */
F_RECEIVER_DEACTIVATED_PADDING_ENABLE, /** < deactivated receiver padding enable */
F_RECEIVER_QUAD,
/* Always append functions hereafter!!! */