This commit is contained in:
2019-08-09 12:11:42 +02:00
parent a3c5c16417
commit 1a60b59a48
12 changed files with 22 additions and 26 deletions

View File

@ -142,8 +142,8 @@ Result<std::string> Detector::getDetectorTypeAsString(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
}
int Detector::getTotalNumberOfDetectors() const {
return pimpl->getNumberOfDetectors();
int Detector::size() const {
return pimpl->size();
}
defs::coordinates Detector::getNumberOfDetectors() const {
@ -675,8 +675,8 @@ Result<bool> Detector::getAutoCompDisable(Positions pos) const {
}
void Detector::setPowerChip(bool on, Positions pos) {
if (on && pimpl->getNumberOfDetectors() > 3) {
for (int i = 0; i != pimpl->getNumberOfDetectors(); ++i) {
if (on && pimpl->size() > 3) {
for (int i = 0; i != pimpl->size(); ++i) {
pimpl->powerChip(static_cast<int>(on), i);
usleep(1000 * 1000);
}

View File

@ -660,7 +660,7 @@ std::string multiSlsDetector::getDetectorTypeAsString(int detPos) {
return sls::concatenateIfDifferent(r);
}
int multiSlsDetector::getNumberOfDetectors() const { return detectors.size(); }
int multiSlsDetector::size() const { return detectors.size(); }
int multiSlsDetector::getNumberOfDetectors(dimension d) const {
return multi_shm()->numberOfDetector[d];
@ -747,7 +747,7 @@ void multiSlsDetector::setDetectorOffset(dimension d, int off, int detPos) {
int multiSlsDetector::getQuad(int detPos) {
int retval = detectors[0]->getQuad();
if (retval && getNumberOfDetectors() > 1) {
if (retval && size() > 1) {
throw RuntimeError("Quad type is available only for 1 Eiger Quad Half "
"module, but it Quad is enabled for 1st readout");
}
@ -755,7 +755,7 @@ int multiSlsDetector::getQuad(int detPos) {
}
void multiSlsDetector::setQuad(const bool enable, int detPos) {
if (enable && getNumberOfDetectors() > 1) {
if (enable && size() > 1) {
throw RuntimeError("Cannot set Quad type as it is available only for 1 "
"Eiger Quad Half module.");
}
@ -2238,7 +2238,7 @@ void multiSlsDetector::setROI(int n, ROI roiLimits[], int detPos) {
ymin = roiLimits[i].ymin;
ymax = roiLimits[i].ymax;
if (getNumberOfDetectors() > 1) {
if (size() > 1) {
// check roi max values
idet = decodeNChannel(xmax, ymax, channelX, channelY);
FILE_LOG(logDEBUG1) << "Decoded Channel max vals: " << std::endl
@ -2885,7 +2885,7 @@ int multiSlsDetector::powerChip(int ival, int detPos) {
}
// multi delayed call for safety
if (ival >= 0 && getNumberOfDetectors() > 3) {
if (ival >= 0 && size() > 3) {
std::vector<int> r;
r.reserve(detectors.size());
for (auto &d : detectors) {

View File

@ -2175,7 +2175,7 @@ std::string slsDetectorCommand::cmdAcquire(int narg, const char * const args[],
if (action == HELP_ACTION) {
return helpAcquire(HELP_ACTION);
}
if (!myDet->getNumberOfDetectors()) {
if (!myDet->size()) {
FILE_LOG(logERROR) << "This shared memory has no detectors added. Aborting.";
return std::string("acquire failed");
}

View File

@ -4,8 +4,8 @@
int slsDetectorUsers::getNumberOfDetectors() const {
return detector.getNumberOfDetectors();
int slsDetectorUsers::size() const {
return detector.size();
}
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){