mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
WIP
This commit is contained in:
parent
553b7d8568
commit
8740e4f683
@ -167,7 +167,7 @@ class Detector {
|
||||
* Get Client Software version
|
||||
* @returns client software version
|
||||
*/
|
||||
Result<int64_t> getClientSoftwareVersion() const;
|
||||
int64_t getClientSoftwareVersion() const;
|
||||
|
||||
/**
|
||||
* Get Receiver software version
|
||||
@ -187,7 +187,7 @@ class Detector {
|
||||
* Also updates local detector cache
|
||||
* @param name hostnames for the positions given
|
||||
*/
|
||||
void setHostname(const std::vector<std::string> &name);
|
||||
void setHostname(const std::vector<std::string> &value);
|
||||
|
||||
/**
|
||||
* Get Detector type as an enum
|
||||
@ -209,25 +209,48 @@ class Detector {
|
||||
*/
|
||||
Result<std::string> getDetectorTypeAsString(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* Returns the total number of detectors in the multidetector structure
|
||||
* @returns total number of detectors in the multidetector structure
|
||||
*/
|
||||
int getTotalNumberOfDetectors() const;
|
||||
|
||||
/**
|
||||
* Returns the number of detectors in the multidetector structure
|
||||
* @returns number of detectors
|
||||
* @returns number of detectors in the multidetector structure
|
||||
*/
|
||||
int getNumberOfDetectors() const;
|
||||
defs::coordinates getNumberOfDetectors() const;
|
||||
|
||||
/**
|
||||
* Returns number of detectors in dimension d
|
||||
* @param d dimension d
|
||||
* @returns number of detectors in dimension d
|
||||
* Returns the number of channels
|
||||
* @param pos detector position
|
||||
* @returns the number of channels
|
||||
*/
|
||||
int getNumberOfDetectors(defs::dimension d) const;
|
||||
Result<defs::coordinates> getNumberOfChannels(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* Returns the number of detectors in each direction
|
||||
@param nx number of detectors in x direction
|
||||
@param ny number of detectors in y direction
|
||||
* Returns the number of channels including gap pixels
|
||||
* @param pos detector position
|
||||
* @returns the number of channels including gap pixels
|
||||
*/
|
||||
void getNumberOfDetectors(int &nx, int &ny) const;
|
||||
Result<defs::coordinates>
|
||||
getNumberOfChannelsInclGapPixels(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* Returns 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.
|
||||
* @returns the maximum number of channels of complete detector
|
||||
*/
|
||||
defs::coordinates getMaxNumberOfChannels() const;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @param value the maximum number of channels of complete detector
|
||||
*/
|
||||
void setMaxNumberOfChannels(const defs::coordinates value);
|
||||
|
||||
// Erik
|
||||
|
||||
|
@ -396,7 +396,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns the total number of channels of all sls detectors
|
||||
*/
|
||||
int getTotalNumberOfChannels(int detPos = -1);
|
||||
int getTotalNumberOfChannels(int detPos = -1);//
|
||||
|
||||
/**
|
||||
* Returns the total number of channels of all sls detectors in dimension d
|
||||
@ -405,7 +405,13 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns the total number of channels of all sls detectors in dimension d
|
||||
*/
|
||||
int getTotalNumberOfChannels(dimension d, int detPos = -1);
|
||||
int getTotalNumberOfChannels(dimension d, int detPos = -1);//
|
||||
|
||||
/**
|
||||
* Returns the total number of channels from shared memory in each dimension
|
||||
* @returns the total number of channels in each dimension
|
||||
*/
|
||||
slsDetectorDefs::coordinates getNumberOfChannels() const; //
|
||||
|
||||
/**
|
||||
* Returns the total number of channels of all sls detectors in dimension d
|
||||
@ -415,7 +421,13 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
* @returns the total number of channels of all sls detectors in dimension d
|
||||
* including gap pixels
|
||||
*/
|
||||
int getTotalNumberOfChannelsInclGapPixels(dimension d, int detPos = -1);
|
||||
int getTotalNumberOfChannelsInclGapPixels(dimension d, int detPos = -1);//
|
||||
|
||||
/**
|
||||
* Returns the total number of channels including gap pixels
|
||||
* @returns the total number of channels including gap pixels
|
||||
*/
|
||||
slsDetectorDefs::coordinates getTotalNumberOfChannelsInclGapPixels() const; //
|
||||
|
||||
/**
|
||||
* Returns the maximum number of channels of all sls detectors in each
|
||||
@ -425,7 +437,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
* @returns the maximum number of channels of all sls detectors in dimension
|
||||
* d
|
||||
*/
|
||||
int getMaxNumberOfChannelsPerDetector(dimension d);
|
||||
int getMaxNumberOfChannelsPerDetector(dimension d);//
|
||||
|
||||
/**
|
||||
* Sets the maximum number of channels of all sls detectors in each
|
||||
@ -436,7 +448,23 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
* @returns the maximum number of channels of all sls detectors in dimension
|
||||
* d
|
||||
*/
|
||||
int setMaxNumberOfChannelsPerDetector(dimension d, int i);
|
||||
int setMaxNumberOfChannelsPerDetector(dimension d, int i);//
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @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
|
||||
* @param c maximum number of channels of all sls detectors
|
||||
*/
|
||||
void setMaxNumberOfChannels(const slsDetectorDefs::coordinates c); //
|
||||
|
||||
/**
|
||||
* Get Quad Type (Only for Eiger Quad detector hardware)
|
||||
|
@ -350,6 +350,12 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int getTotalNumberOfChannels(dimension d) const;
|
||||
|
||||
/**
|
||||
* Returns the total number of channels from shared memory in each dimension
|
||||
* @returns the total number of channels in each dimension
|
||||
*/
|
||||
slsDetectorDefs::coordinates getNumberOfChannels() const;
|
||||
|
||||
/**
|
||||
* Returns the total number of channels of in dimension d including gap
|
||||
* pixels from shared memory
|
||||
@ -359,6 +365,12 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int getTotalNumberOfChannelsInclGapPixels(dimension d) const;
|
||||
|
||||
/**
|
||||
* Returns the total number of channels including gap pixels
|
||||
* @returns the total number of channels including gap pixels
|
||||
*/
|
||||
slsDetectorDefs::coordinates getNumberOfChannelsInclGapPixels() const;
|
||||
|
||||
/**
|
||||
* returns the number of channels per chip from shared memory (Mythen)
|
||||
* @returns number of channels per chip
|
||||
|
@ -142,7 +142,7 @@ Result<int64_t> Detector::getDetectorSerialNumber(Positions pos) const {
|
||||
defs::DETECTOR_SERIAL_NUMBER);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getClientSoftwareVersion() const {
|
||||
int64_t Detector::getClientSoftwareVersion() const {
|
||||
return pimpl->getClientSoftwareVersion();
|
||||
}
|
||||
|
||||
@ -152,8 +152,8 @@ Result<int64_t> Detector::getReceiverSoftwareVersion(Positions pos) const {
|
||||
|
||||
std::string Detector::getUserDetails() const { return pimpl->getUserDetails(); }
|
||||
|
||||
void Detector::setHostname(const std::vector<std::string> &name) {
|
||||
pimpl->setHostname(name);
|
||||
void Detector::setHostname(const std::vector<std::string> &value) {
|
||||
pimpl->setHostname(value);
|
||||
}
|
||||
|
||||
defs::detectorType Detector::getDetectorTypeAsEnum() const {
|
||||
@ -169,18 +169,39 @@ Result<std::string> Detector::getDetectorTypeAsString(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
||||
}
|
||||
|
||||
int Detector::getNumberOfDetectors() const {
|
||||
int Detector::getTotalNumberOfDetectors() const {
|
||||
return pimpl->getNumberOfDetectors();
|
||||
}
|
||||
|
||||
int Detector::getNumberOfDetectors(defs::dimension d) const {
|
||||
return pimpl->getNumberOfDetectors(d);
|
||||
defs::coordinates Detector::getNumberOfDetectors() const {
|
||||
defs::coordinates coord;
|
||||
coord.x = pimpl->getNumberOfDetectors(defs::X);
|
||||
coord.y = pimpl->getNumberOfDetectors(defs::Y);
|
||||
return coord;
|
||||
}
|
||||
|
||||
void Detector::getNumberOfDetectors(int &nx, int &ny) const {
|
||||
pimpl->getNumberOfDetectors(nx, ny);
|
||||
Result<defs::coordinates> Detector::getNumberOfChannels(Positions pos) const {
|
||||
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
|
||||
return {pimpl->getNumberOfChannels()};
|
||||
}
|
||||
return pimpl->Parallel(&slsDetector::getNumberOfChannels, pos);
|
||||
}
|
||||
|
||||
Result<defs::coordinates>
|
||||
Detector::getNumberOfChannelsInclGapPixels(Positions pos) const {
|
||||
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
|
||||
return {pimpl->getTotalNumberOfChannelsInclGapPixels()};
|
||||
}
|
||||
return pimpl->Parallel(&slsDetector::getNumberOfChannelsInclGapPixels, pos);
|
||||
}
|
||||
|
||||
defs::coordinates Detector::getMaxNumberOfChannels() const {
|
||||
return pimpl->getMaxNumberOfChannels();
|
||||
}
|
||||
|
||||
void Detector::setMaxNumberOfChannels(const defs::coordinates value) {
|
||||
pimpl->setMaxNumberOfChannels(value);
|
||||
}
|
||||
// Erik
|
||||
|
||||
Result<uint64_t> Detector::getPatternMask(Positions pos) {
|
||||
|
@ -534,6 +534,13 @@ int multiSlsDetector::getTotalNumberOfChannels(dimension d, int detPos) {
|
||||
return multi_shm()->numberOfChannel[d];
|
||||
}
|
||||
|
||||
slsDetectorDefs::coordinates multiSlsDetector::getNumberOfChannels() const {
|
||||
slsDetectorDefs::coordinates coord;
|
||||
coord.x = multi_shm()->numberOfChannel[X];
|
||||
coord.y = multi_shm()->numberOfChannel[Y];
|
||||
return coord;
|
||||
}
|
||||
|
||||
int multiSlsDetector::getTotalNumberOfChannelsInclGapPixels(dimension d,
|
||||
int detPos) {
|
||||
// single
|
||||
@ -545,6 +552,13 @@ int multiSlsDetector::getTotalNumberOfChannelsInclGapPixels(dimension d,
|
||||
return multi_shm()->numberOfChannelInclGapPixels[d];
|
||||
}
|
||||
|
||||
slsDetectorDefs::coordinates multiSlsDetector::getTotalNumberOfChannelsInclGapPixels() const {
|
||||
slsDetectorDefs::coordinates coord;
|
||||
coord.x = multi_shm()->numberOfChannelInclGapPixels[X];
|
||||
coord.y = multi_shm()->numberOfChannelInclGapPixels[Y];
|
||||
return coord;
|
||||
}
|
||||
|
||||
int multiSlsDetector::getMaxNumberOfChannelsPerDetector(dimension d) {
|
||||
return multi_shm()->maxNumberOfChannelsPerDetector[d];
|
||||
}
|
||||
@ -554,6 +568,18 @@ int multiSlsDetector::setMaxNumberOfChannelsPerDetector(dimension d, int i) {
|
||||
return multi_shm()->maxNumberOfChannelsPerDetector[d];
|
||||
}
|
||||
|
||||
slsDetectorDefs::coordinates multiSlsDetector::getMaxNumberOfChannels() const {
|
||||
slsDetectorDefs::coordinates coord;
|
||||
coord.x = multi_shm()->maxNumberOfChannelsPerDetector[X];
|
||||
coord.y = multi_shm()->maxNumberOfChannelsPerDetector[Y];
|
||||
return coord;
|
||||
}
|
||||
|
||||
void multiSlsDetector::setMaxNumberOfChannels(const slsDetectorDefs::coordinates c) {
|
||||
multi_shm()->maxNumberOfChannelsPerDetector[X] = c.x;
|
||||
multi_shm()->maxNumberOfChannelsPerDetector[Y] = c.y;
|
||||
}
|
||||
|
||||
int multiSlsDetector::getQuad(int detPos) {
|
||||
int retval = detectors[0]->getQuad();
|
||||
if (retval && getNumberOfDetectors() > 1) {
|
||||
|
@ -626,11 +626,26 @@ int slsDetector::getTotalNumberOfChannels(dimension d) const {
|
||||
return shm()->nChan[d] * shm()->nChip[d];
|
||||
}
|
||||
|
||||
slsDetectorDefs::coordinates slsDetector::getNumberOfChannels() const {
|
||||
slsDetectorDefs::coordinates coord;
|
||||
coord.x = shm()->nChan[X] * shm()->nChip[X];
|
||||
coord.y = shm()->nChan[Y] * shm()->nChip[Y];
|
||||
return coord;
|
||||
}
|
||||
|
||||
int slsDetector::getTotalNumberOfChannelsInclGapPixels(dimension d) const {
|
||||
return (shm()->nChan[d] * shm()->nChip[d] +
|
||||
shm()->gappixels * shm()->nGappixels[d]);
|
||||
}
|
||||
|
||||
slsDetectorDefs::coordinates slsDetector::getNumberOfChannelsInclGapPixels() const {
|
||||
slsDetectorDefs::coordinates coord;
|
||||
coord.x = (shm()->nChan[X] * shm()->nChip[X] + shm()->gappixels * shm()->nGappixels[X]);
|
||||
coord.y = (shm()->nChan[Y] * shm()->nChip[Y] + shm()->gappixels * shm()->nGappixels[Y]);
|
||||
return coord;
|
||||
}
|
||||
|
||||
|
||||
int slsDetector::getNChans() const { return shm()->nChans; }
|
||||
|
||||
int slsDetector::getNChans(dimension d) const { return shm()->nChan[d]; }
|
||||
|
@ -284,6 +284,12 @@ format
|
||||
Y = 1 /**< Y dimension */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
struct coordinates {
|
||||
int x{0};
|
||||
int y{0};
|
||||
};
|
||||
#endif
|
||||
/**
|
||||
enable/disable flags
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user