mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
ctb: removed setroi, instead using adcenablemask
This commit is contained in:
@ -212,12 +212,12 @@ public:
|
||||
|
||||
/**
|
||||
* Set databytes (ctb, moench)
|
||||
* @param f readout flags
|
||||
* @param r roi
|
||||
* @param a adc enable mask
|
||||
* @param s number of samples
|
||||
* @param t tengiga enable
|
||||
* @param f readout flags
|
||||
*/
|
||||
virtual void setImageSize(std::vector<slsDetectorDefs::ROI> r, int s, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
virtual void setImageSize(uint32_t a, int s, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
cprintf(RED,"setImageSize is a generic function that should be overloaded by a derived class\n");
|
||||
};
|
||||
|
||||
@ -584,26 +584,26 @@ public:
|
||||
headerWriteEnable = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set databytes (ctb, moench)
|
||||
/**
|
||||
* Set databytes (ctb, moench)
|
||||
* @param a adc enable mask
|
||||
* @param s number of samples
|
||||
* @param t tengiga enable
|
||||
* @param f readout flags
|
||||
* @param r roi
|
||||
* @param s number of samples
|
||||
* @param t tengiga enable
|
||||
*/
|
||||
void setImageSize(std::vector<slsDetectorDefs::ROI> r, int s, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
*/
|
||||
void setImageSize(uint32_t a, int s, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
int nchans = 0;
|
||||
if (f != slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
// analog channels
|
||||
if (f == slsDetectorDefs::NORMAL_READOUT || f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
nchans += NCHAN_ANALOG;
|
||||
// if roi
|
||||
if (r.size()) {
|
||||
nchans = 0;
|
||||
for (auto &roi : r) {
|
||||
nchans += (roi.xmax - roi.xmin + 1);
|
||||
}
|
||||
}
|
||||
if (a == BIT32_MASK) {
|
||||
nchans = 32;
|
||||
} else {
|
||||
for (int ich = 0; ich < 32; ++ich) {
|
||||
if (a & (1 << ich))
|
||||
++nchans;
|
||||
}
|
||||
}
|
||||
}
|
||||
// digital channels
|
||||
if (f & slsDetectorDefs::DIGITAL_ONLY || f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
@ -686,22 +686,22 @@ public:
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set databytes (ctb, moench)
|
||||
/**
|
||||
* Set databytes (ctb, moench)
|
||||
* @param a adc enable mask
|
||||
* @param s number of samples
|
||||
* @param t tengiga enable
|
||||
* @param f readout flags
|
||||
* @param r roi
|
||||
* @param s number of samples
|
||||
* @param t tengiga enable
|
||||
*/
|
||||
void setImageSize(std::vector<slsDetectorDefs::ROI> r, int s, bool t,
|
||||
slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
*/
|
||||
void setImageSize(uint32_t a, int s, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||
int nchans = 32;
|
||||
// if roi
|
||||
if (r.size()) {
|
||||
nchans = 0;
|
||||
for (auto &roi : r) {
|
||||
nchans += abs(roi.xmax - roi.xmin) + 1;
|
||||
}
|
||||
if (a == BIT32_MASK) {
|
||||
nchans = 32;
|
||||
} else {
|
||||
for (int ich = 0; ich < 32; ++ich) {
|
||||
if (a & (1 << ich))
|
||||
++nchans;
|
||||
}
|
||||
}
|
||||
|
||||
nPixelsX = nchans;
|
||||
|
@ -194,6 +194,12 @@ class slsReceiverImplementation: private virtual slsDetectorDefs {
|
||||
*/
|
||||
std::vector<ROI> getROI() const;
|
||||
|
||||
/**
|
||||
* Get ADC Enable Mask
|
||||
* @return ADC Enable Mask
|
||||
*/
|
||||
uint32_t getADCEnableMask() const;
|
||||
|
||||
/**
|
||||
* Get the streaming frequency
|
||||
* @return 0 for timer, n for nth frame frequency
|
||||
@ -474,6 +480,13 @@ class slsReceiverImplementation: private virtual slsDetectorDefs {
|
||||
*/
|
||||
int setROI(const std::vector<ROI> new_roi);
|
||||
|
||||
/**
|
||||
* Set ADC Enable Mask
|
||||
* @param mask ADC Enable Mask
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setADCEnableMask(const uint32_t mask);
|
||||
|
||||
/**
|
||||
* Set the streaming frequency
|
||||
* @param freq 0 for timer, n for nth frame frequency
|
||||
@ -855,6 +868,8 @@ private:
|
||||
//***acquisition parameters***
|
||||
/* ROI */
|
||||
std::vector<ROI> roi;
|
||||
/** ADC Enable Mask */
|
||||
uint32_t adcEnableMask;
|
||||
/** streaming frequency */
|
||||
uint32_t streamingFrequency;
|
||||
/** Streaming timer when frequency is 0 */
|
||||
|
@ -282,6 +282,9 @@ class slsReceiverTCPIPInterface : private virtual slsDetectorDefs {
|
||||
/** set readout flags */
|
||||
int set_readout_flags();
|
||||
|
||||
/** set adc mask */
|
||||
int set_adc_mask();
|
||||
|
||||
|
||||
/** detector type */
|
||||
detectorType myDetectorType;
|
||||
|
Reference in New Issue
Block a user