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