mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
Merge branch 'apidhanya' of github.com:slsdetectorgroup/slsDetectorPackage into apidhanya
This commit is contained in:
@ -82,16 +82,10 @@ class Detector {
|
||||
/**
|
||||
* Sets the maximum number of channels of complete detector in both
|
||||
* dimensions. -1 means no limit in this dimension. This value is used to
|
||||
* calculate row and column offsets for each module.
|
||||
* calculate row and column channels for each module.
|
||||
*/
|
||||
void setMaxNumberOfChannels(const defs::coordinates value);
|
||||
|
||||
/** [Gotthard] */
|
||||
Result<defs::coordinates> getDetectorOffsets(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard] */
|
||||
void setDetectorOffsets(defs::coordinates value, Positions pos = {});
|
||||
|
||||
/** [Eiger with specific quad hardware] */
|
||||
Result<bool> getQuad(Positions pos = {}) const;
|
||||
|
||||
@ -664,15 +658,16 @@ class Detector {
|
||||
/** [Eiger] If it is set, it resets chips completely (else partially) before an acquisition TODO: if it makes sense */
|
||||
void setCounterBit(bool value, Positions pos = {});
|
||||
|
||||
/** [Gotthard, CTB]*/
|
||||
Result<std::vector<defs::ROI>> getROI(Positions pos = {}) const;
|
||||
/** [Gotthard]*/
|
||||
Result<defs::ROI> getROI(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [Gotthard Options: Only a single chip or all chips, only 1 ROI allowed]
|
||||
* [CTB: multiple ROIs allowed]
|
||||
* subset modules not allowed
|
||||
* [Gotthard]
|
||||
* Options: Only a single ROI per module
|
||||
* Can set only a single ROI at a time
|
||||
* @param module position index
|
||||
*/
|
||||
void setROI(std::vector<defs::ROI> value, Positions pos = {});
|
||||
void setROI(defs::ROI value, int moduleId);
|
||||
|
||||
/** [CTB]*/
|
||||
Result<uint32_t> getADCEnableMask(Positions pos = {}) const;
|
||||
|
@ -65,16 +65,6 @@ struct sharedMultiSlsDetector {
|
||||
/** total number of channels including gap pixels in one dimension */
|
||||
int numberOfChannelInclGapPixels[2];
|
||||
|
||||
/** total number of channels for all detectors */
|
||||
int maxNumberOfChannels;
|
||||
|
||||
/** max number of channels for all detectors in one dimension*/
|
||||
int maxNumberOfChannel[2];
|
||||
|
||||
/** max number of channels including gap pixels for all detectors in
|
||||
* one dimension*/
|
||||
int maxNumberOfChannelInclGapPixels[2];
|
||||
|
||||
/** max number of channels allowed for the complete set of detectors in
|
||||
* one dimension */
|
||||
int maxNumberOfChannelsPerDetector[2];
|
||||
@ -432,8 +422,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
|
||||
/**
|
||||
* Returns the maximum number of channels of all sls detectors in each
|
||||
* dimension d from shared memory. multi detector shared memory variable to
|
||||
* calculate offsets for each sls detector
|
||||
* dimension d from shared memory.
|
||||
* @param d dimension d
|
||||
* @returns the maximum number of channels of all sls detectors in dimension
|
||||
* d
|
||||
@ -442,8 +431,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
|
||||
/**
|
||||
* Sets the maximum number of channels of all sls detectors in each
|
||||
* dimension d from shared memory, multi detector shared memory variable to
|
||||
* calculate offsets for each sls detector
|
||||
* dimension d from shared memory
|
||||
* @param d dimension d
|
||||
* @param i maximum number of channels for multi structure in dimension d
|
||||
* @returns the maximum number of channels of all sls detectors in dimension
|
||||
@ -453,37 +441,18 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
|
||||
/**
|
||||
* Returns maximum number of channels of all sls detectors in each
|
||||
* dimension d from shared memory, multi detector shared memory variable to
|
||||
* calculate offsets for each sls detector
|
||||
* dimension d from shared memory
|
||||
* @returns maximum number of channels of all sls detectors
|
||||
*/
|
||||
slsDetectorDefs::coordinates getMaxNumberOfChannels() const; //
|
||||
|
||||
/**
|
||||
* Sets maximum number of channels of all sls detectors in each
|
||||
* dimension d from shared memory, multi detector shared memory variable to
|
||||
* calculate offsets for each sls detector
|
||||
* dimension d from shared memory
|
||||
* @param c maximum number of channels of all sls detectors
|
||||
*/
|
||||
void setMaxNumberOfChannels(const slsDetectorDefs::coordinates c); //
|
||||
|
||||
/**
|
||||
* Get Detector offset from shared memory in dimension d
|
||||
* @param d dimension d
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns offset in dimension d, -1 if pos is not an actual position in
|
||||
* list
|
||||
*/
|
||||
int getDetectorOffset(dimension d, int detPos = -1); //
|
||||
|
||||
/**
|
||||
* Set Detector offset in shared memory in dimension d
|
||||
* @param d dimension d
|
||||
* @param off offset for detector
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
*/
|
||||
void setDetectorOffset(dimension d, int off, int detPos = -1);//
|
||||
|
||||
/**
|
||||
* Get Quad Type (Only for Eiger Quad detector hardware)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
@ -1376,22 +1345,27 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
int setCounterBit(int i = -1, int detPos = -1); //
|
||||
|
||||
/**
|
||||
* Set ROI (Gotthard)
|
||||
* At the moment only one set allowed
|
||||
* @param n number of rois
|
||||
* @param roiLimits array of roi
|
||||
* Clear ROI (Gotthard)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
*/
|
||||
void setROI(int n = -1, ROI roiLimits[] = nullptr, int detPos = -1);
|
||||
void clearROI(int detPos = -1);
|
||||
|
||||
/**
|
||||
* Get ROI from each detector and convert it to the multi detector scale
|
||||
* (Gotthard)
|
||||
* @param n number of rois
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns OK or FAIL
|
||||
* Set ROI (Gotthard)
|
||||
* At the moment only one set allowed per module
|
||||
* Only allowed to set one ROI per module
|
||||
* @param arg roi
|
||||
* @param detPos specific detector position
|
||||
*/
|
||||
const ROI *getROI(int &n, int detPos = -1);
|
||||
void setROI(slsDetectorDefs::ROI arg, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Get ROI (Gotthard)
|
||||
* Only allowed to set one ROI per module
|
||||
* @param detPos specific detector position
|
||||
* @returns roi
|
||||
*/
|
||||
slsDetectorDefs::ROI getROI(int detPos) const;
|
||||
|
||||
/**
|
||||
* Set ADC Enable Mask (CTB, Moench)
|
||||
@ -2187,14 +2161,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
void initializeMembers(bool verify = true);
|
||||
|
||||
/**
|
||||
* Appends detectors to the end of the list in shared memory
|
||||
* Connects to them
|
||||
* @param name concatenated hostname of the sls detectors to be appended to
|
||||
* the list
|
||||
*/
|
||||
void addMultipleDetectors(const char *name);//
|
||||
|
||||
/**
|
||||
* Update user details in detector structure
|
||||
*/
|
||||
@ -2206,23 +2172,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
bool isAcquireReady();
|
||||
|
||||
/**
|
||||
* Decodes which detector and the corresponding channel numbers for it
|
||||
* Mainly useful in a multi detector setROI (Gotthard)
|
||||
* @param offsetX channel number or total channel offset in x direction
|
||||
* @param offsetY channel number or total channel offset in y direction
|
||||
* @param channelX channel number from detector offset in x direction
|
||||
* @param channelY channel number from detector offset in x direction
|
||||
* @returns detector id or -1 if channel number out of range
|
||||
*/
|
||||
int decodeNChannel(int offsetX, int offsetY, int &channelX, int &channelY);
|
||||
|
||||
/**
|
||||
* Updates the channel offsets in X and Y dimension for all the sls
|
||||
* detectors It is required for decodeNMod and setting ROI
|
||||
*/
|
||||
void updateOffsets();
|
||||
|
||||
/**
|
||||
* Execute in command line and return result
|
||||
* @param cmd command
|
||||
@ -2230,12 +2179,26 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
std::string exec(const char *cmd);
|
||||
|
||||
/**
|
||||
* Appends detectors to the end of the list in shared memory
|
||||
* Connects to them
|
||||
* @param name concatenated hostname of the sls detectors to be appended to
|
||||
* the list
|
||||
*/
|
||||
void addMultipleDetectors(const char *name);//
|
||||
|
||||
/**
|
||||
* Add sls detector
|
||||
* @param s hostname of the single detector
|
||||
*/
|
||||
void addSlsDetector(const std::string &hostname);
|
||||
|
||||
/**
|
||||
* Updates the channel size in X and Y dimension for all the sls
|
||||
* detectors
|
||||
*/
|
||||
void updateDetectorSize();
|
||||
|
||||
/**
|
||||
* increments file index
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
@ -2243,13 +2206,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int incrementFileIndex(int detPos = -1);
|
||||
|
||||
/**
|
||||
* Ensures that min is less than max in both dimensions (Gotthard)
|
||||
* @param n number of rois
|
||||
* @param r array of rois
|
||||
*/
|
||||
void verifyMinMaxROI(int n, ROI r[]);
|
||||
|
||||
/**
|
||||
* add gap pixels to the image (only for Eiger in 4 bit mode)
|
||||
* @param image pointer to image without gap pixels
|
||||
|
@ -13,7 +13,7 @@
|
||||
class ServerInterface;
|
||||
|
||||
#define SLS_SHMAPIVERSION 0x190726
|
||||
#define SLS_SHMVERSION 0x190726
|
||||
#define SLS_SHMVERSION 0x190813
|
||||
|
||||
/**
|
||||
* @short structure allocated in shared memory to store detector settings for
|
||||
@ -35,10 +35,6 @@ struct sharedSlsDetector {
|
||||
|
||||
/** END OF FIXED PATTERN -----------------------------------------------*/
|
||||
|
||||
/** Detector offset in the X & Y direction in the multi detector structure
|
||||
*/
|
||||
int offset[2];
|
||||
|
||||
/** Number of detectors in multi list in x dir and y dir */
|
||||
int multiSize[2];
|
||||
|
||||
@ -75,11 +71,8 @@ struct sharedSlsDetector {
|
||||
/** size of the data that are transfered from the detector */
|
||||
int dataBytes;
|
||||
|
||||
/** number of rois defined */
|
||||
int nROI;
|
||||
|
||||
/** list of rois */
|
||||
slsDetectorDefs::ROI roiLimits[MAX_ROIS];
|
||||
/** roi */
|
||||
slsDetectorDefs::ROI roi;
|
||||
|
||||
/** adc enable mask */
|
||||
uint32_t adcEnableMask;
|
||||
@ -339,7 +332,7 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
|
||||
/**
|
||||
* Update total number of channels (chiptestboard or moench)
|
||||
* depending on the number of samples, roi, readout flags(ctb)
|
||||
* depending on the number of samples, adenablemask, readout flags(ctb)
|
||||
*/
|
||||
void updateTotalNumberOfChannels();
|
||||
|
||||
@ -423,32 +416,6 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int getReadNLines();
|
||||
|
||||
/**
|
||||
* Get Detector offset from shared memory in dimension d
|
||||
* @param d dimension d
|
||||
* @returns offset in dimension d
|
||||
*/
|
||||
int getDetectorOffset(dimension d) const;
|
||||
|
||||
/**
|
||||
* Get Detector offset from shared memory in dimension d
|
||||
* @returns offset
|
||||
*/
|
||||
slsDetectorDefs::coordinates getDetectorOffsets() const;
|
||||
|
||||
/**
|
||||
* Set Detector offset in shared memory in dimension d
|
||||
* @param d dimension d
|
||||
* @param off offset for detector
|
||||
*/
|
||||
void setDetectorOffset(dimension d, int off);
|
||||
|
||||
/**
|
||||
* Set Detector offset in shared memory
|
||||
* @param value offset for detector
|
||||
*/
|
||||
void setDetectorOffsets(slsDetectorDefs::coordinates value);
|
||||
|
||||
/**
|
||||
* Set Detector offset in shared memory in dimension d
|
||||
* @param detx number of detectors in X dir in multi list
|
||||
@ -1143,35 +1110,29 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int setCounterBit(int cb = -1);
|
||||
|
||||
/**
|
||||
* Clear ROI (Gotthard)
|
||||
*/
|
||||
void clearROI();
|
||||
|
||||
/**
|
||||
* Set ROI (Gotthard)
|
||||
* At the moment only one set allowed
|
||||
* @param n number of rois
|
||||
* @param roiLimits array of roi
|
||||
* Also calls configuremac
|
||||
* @param arg roi
|
||||
*/
|
||||
void setROI(int n = -1, ROI roiLimits[] = nullptr);
|
||||
void setROI(slsDetectorDefs::ROI arg);
|
||||
|
||||
/**
|
||||
* Get ROI from each detector and convert it to the multi detector scale
|
||||
* (Gotthard)
|
||||
* @param n number of rois
|
||||
* @returns OK or FAIL
|
||||
* Send ROI from shared memory to Receiver (Gotthard)
|
||||
*/
|
||||
const slsDetectorDefs::ROI *getROI(int &n);
|
||||
void sendROItoReceiver();
|
||||
|
||||
/**
|
||||
* Returns number of rois
|
||||
* @returns number of ROIs
|
||||
* Get ROI (Gotthard)
|
||||
* Update receiver if different from shm
|
||||
* @returns roi
|
||||
*/
|
||||
int getNRoi();
|
||||
|
||||
/**
|
||||
* Send ROI to the detector after calculating
|
||||
* from setROI
|
||||
* @param n number of ROIs (-1 to get)
|
||||
* @param roiLimits ROI
|
||||
*/
|
||||
void sendROI(int n = -1, ROI roiLimits[] = nullptr);
|
||||
slsDetectorDefs::ROI getROI();
|
||||
|
||||
/**
|
||||
* Set ADC Enable Mask (CTB, Moench)
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
/**
|
||||
* Returns the maximum number of channels of all detectors
|
||||
* (provided by user in config file using detsizechan command)
|
||||
* Offsets are calculated according to these dimensions
|
||||
* number of channels in x and y are calculated according to these dimensions
|
||||
* @param nx number of channels in horizontal
|
||||
* @param ny number of channels in vertical
|
||||
* @returns the maximum number of channels of all detectors
|
||||
@ -112,15 +112,13 @@ public:
|
||||
int getMaximumDetectorSize(int &nx, int &ny);
|
||||
|
||||
/**
|
||||
* Returns the size and offsets of detector/multi detector
|
||||
* @param x horizontal position origin in channel number
|
||||
* @param y vertical position origin in channel number
|
||||
* Returns the size of detector/multi detector
|
||||
* @param nx number of channels in horiziontal
|
||||
* @param ny number of channels in vertical
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns the total number of channels of all sls detectors
|
||||
*/
|
||||
int getDetectorSize(int &x, int &y, int &nx, int &ny, int detPos = -1);
|
||||
int getDetectorSize(int &nx, int &ny, int detPos);
|
||||
|
||||
/**
|
||||
* Gets detector type
|
||||
@ -496,22 +494,22 @@ public:
|
||||
int setFlowControl10G(int enable = -1, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Set ROI (Gotthard) (>= 1 roi, but max 1 roi per module)
|
||||
* At the moment only one set allowed
|
||||
* @param n number of rois
|
||||
* @param roiLimits array of roi
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* Set ROI (Gotthard)
|
||||
* At the moment only one set allowed per module
|
||||
* Only allowed to set one ROI per module
|
||||
* @param arg roi
|
||||
* @param detPos specific detector position
|
||||
*/
|
||||
void setROI(int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL, int detPos = -1);
|
||||
void setROI(slsDetectorDefs::ROI arg, int detPos = -1);
|
||||
|
||||
|
||||
/**
|
||||
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
||||
* >= 1 roi, but max 1 roi per module
|
||||
* @param n number of rois
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns pointer to array of ROI structure
|
||||
* Get ROI (Gotthard)
|
||||
* Only allowed to set one ROI per module
|
||||
* @param detPos specific detector position
|
||||
* @returns roi
|
||||
*/
|
||||
const slsDetectorDefs::ROI* getROI(int &n, int detPos = -1);
|
||||
slsDetectorDefs::ROI getROI(int detPos = -1);
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user