mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
gotthard fixed roi only xmin and xmax.remove updateoffsets
This commit is contained in:
@ -32,7 +32,7 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
|
||||
* @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,
|
||||
DataStreamer(int ind, Fifo* f, uint32_t* dr, ROI* r,
|
||||
uint64_t* fi, int fd, char* ajh, int* nd, bool* gpEnable);
|
||||
|
||||
/**
|
||||
@ -188,7 +188,7 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
|
||||
uint32_t* dynamicRange;
|
||||
|
||||
/** ROI */
|
||||
std::vector<ROI>* roi;
|
||||
ROI* roi;
|
||||
|
||||
/** adc Configured */
|
||||
int adcConfigured;
|
||||
|
@ -142,17 +142,17 @@ public:
|
||||
* Set ROI
|
||||
* @param i ROI
|
||||
*/
|
||||
virtual void SetROI(std::vector<slsDetectorDefs::ROI> i) {
|
||||
virtual void SetROI(slsDetectorDefs::ROI i) {
|
||||
FILE_LOG(logERROR) << "SetROI is a generic function that should be overloaded by a derived class";
|
||||
};
|
||||
|
||||
/**
|
||||
* Get Adc configured
|
||||
* @param index thread index for debugging purposes
|
||||
* @param i pointer to a vector of ROI pointers
|
||||
* @param ROI
|
||||
* @returns adc configured
|
||||
*/
|
||||
virtual int GetAdcConfigured(int index, std::vector<slsDetectorDefs::ROI>* i) const{
|
||||
virtual int GetAdcConfigured(int index, slsDetectorDefs::ROI i) const{
|
||||
FILE_LOG(logERROR) << "GetAdcConfigured is a generic function that should be overloaded by a derived class";
|
||||
return 0;
|
||||
};
|
||||
@ -311,9 +311,9 @@ private:
|
||||
* Set ROI
|
||||
* @param i ROI
|
||||
*/
|
||||
void SetROI(std::vector<slsDetectorDefs::ROI> i) {
|
||||
void SetROI(slsDetectorDefs::ROI i) {
|
||||
// all adcs
|
||||
if(!i.size()) {
|
||||
if(i.xmin == -1) {
|
||||
nPixelsX = 1280;
|
||||
dataSize = 1280;
|
||||
packetSize = GOTTHARD_PACKET_SIZE;
|
||||
@ -352,28 +352,21 @@ private:
|
||||
/**
|
||||
* Get Adc configured
|
||||
* @param index thread index for debugging purposes
|
||||
* @param i pointer to a vector of ROI
|
||||
* @param i ROI
|
||||
* @returns adc configured
|
||||
*/
|
||||
int GetAdcConfigured(int index, std::vector<slsDetectorDefs::ROI>* i) const{
|
||||
int GetAdcConfigured(int index, slsDetectorDefs::ROI i) const{
|
||||
int adc = -1;
|
||||
// single adc
|
||||
if(i->size()) {
|
||||
if(i.xmin != -1) {
|
||||
// gotthard can have only one adc per detector enabled (or all)
|
||||
// so just looking at the first roi is enough (more not possible at the moment)
|
||||
|
||||
//if its for 1 adc or general
|
||||
if ((i->at(0).xmin == 0) && (i->at(0).xmax == nChip * nChan))
|
||||
//adc = mid value/numchans also for only 1 roi
|
||||
adc = ((((i.xmax) + (i.xmin))/2)/
|
||||
(nChan * nChipsPerAdc));
|
||||
if((adc < 0) || (adc > 4)) {
|
||||
FILE_LOG(logWARNING) << index << ": Deleting ROI. "
|
||||
"Adc value should be between 0 and 4";
|
||||
adc = -1;
|
||||
else {
|
||||
//adc = mid value/numchans also for only 1 roi
|
||||
adc = ((((i->at(0).xmax) + (i->at(0).xmin))/2)/
|
||||
(nChan * nChipsPerAdc));
|
||||
if((adc < 0) || (adc > 4)) {
|
||||
FILE_LOG(logWARNING) << index << ": Deleting ROI. "
|
||||
"Adc value should be between 0 and 4";
|
||||
adc = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
FILE_LOG(logINFO) << "Adc Configured: " << adc;
|
||||
|
@ -207,9 +207,9 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
||||
//***acquisition parameters***
|
||||
/**
|
||||
* Get ROI
|
||||
* @return index of adc enabled, else -1 if all enabled
|
||||
* @return roi
|
||||
*/
|
||||
std::vector<ROI> getROI() const;
|
||||
ROI getROI() const;
|
||||
|
||||
/**
|
||||
* Get ADC Enable Mask
|
||||
@ -529,10 +529,10 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
||||
//***acquisition parameters***
|
||||
/**
|
||||
* Set ROI
|
||||
* @param i ROI
|
||||
* @param arg ROI
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int setROI(const std::vector<ROI> new_roi);
|
||||
int setROI(ROI arg);
|
||||
|
||||
/**
|
||||
* Set ADC Enable Mask
|
||||
@ -961,7 +961,7 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
||||
|
||||
//***acquisition parameters***
|
||||
/* ROI */
|
||||
std::vector<ROI> roi;
|
||||
ROI roi;
|
||||
/** ADC Enable Mask */
|
||||
uint32_t adcEnableMask;
|
||||
/** streaming frequency */
|
||||
|
Reference in New Issue
Block a user