This commit is contained in:
2019-08-07 15:51:25 +02:00
parent dc1e01b444
commit 0a2a5933da
2 changed files with 69 additions and 69 deletions

View File

@ -131,37 +131,6 @@ void multiSlsDetector::parallelCall(
return;
}
int multiSlsDetector::decodeNChannel(int offsetX, int offsetY, int &channelX,
int &channelY) {
channelX = -1;
channelY = -1;
// loop over
for (size_t i = 0; i < detectors.size(); ++i) {
int x = detectors[i]->getDetectorOffset(X);
int y = detectors[i]->getDetectorOffset(Y);
// check x offset range
if ((offsetX >= x) &&
(offsetX <
(x + detectors[i]->getTotalNumberOfChannelsInclGapPixels(X)))) {
if (offsetY == -1) {
channelX = offsetX - x;
return i;
} else {
// check y offset range
if ((offsetY >= y) &&
(offsetY <
(y + detectors[i]->getTotalNumberOfChannelsInclGapPixels(
Y)))) {
channelX = offsetX - x;
channelY = offsetY - y;
return i;
}
}
}
}
return -1;
}
void multiSlsDetector::setAcquiringFlag(bool flag) {
multi_shm()->acquiringFlag = flag;
}
@ -170,18 +139,6 @@ bool multiSlsDetector::getAcquiringFlag() const {
return multi_shm()->acquiringFlag;
}
bool multiSlsDetector::isAcquireReady() {
if (multi_shm()->acquiringFlag) {
FILE_LOG(logWARNING)
<< "Acquire has already started. "
"If previous acquisition terminated unexpectedly, "
"reset busy flag to restart.(sls_detector_put busy 0)";
return FAIL != 0u;
}
multi_shm()->acquiringFlag = true;
return OK != 0u;
}
void multiSlsDetector::checkDetectorVersionCompatibility(int detPos) {
if (detPos >= 0) {
detectors[detPos]->checkDetectorVersionCompatibility();
@ -362,6 +319,49 @@ void multiSlsDetector::updateUserdetails() {
}
}
bool multiSlsDetector::isAcquireReady() {
if (multi_shm()->acquiringFlag) {
FILE_LOG(logWARNING)
<< "Acquire has already started. "
"If previous acquisition terminated unexpectedly, "
"reset busy flag to restart.(sls_detector_put busy 0)";
return FAIL != 0u;
}
multi_shm()->acquiringFlag = true;
return OK != 0u;
}
int multiSlsDetector::decodeNChannel(int offsetX, int offsetY, int &channelX,
int &channelY) {
channelX = -1;
channelY = -1;
// loop over
for (size_t i = 0; i < detectors.size(); ++i) {
int x = detectors[i]->getDetectorOffset(X);
int y = detectors[i]->getDetectorOffset(Y);
// check x offset range
if ((offsetX >= x) &&
(offsetX <
(x + detectors[i]->getTotalNumberOfChannelsInclGapPixels(X)))) {
if (offsetY == -1) {
channelX = offsetX - x;
return i;
} else {
// check y offset range
if ((offsetY >= y) &&
(offsetY <
(y + detectors[i]->getTotalNumberOfChannelsInclGapPixels(
Y)))) {
channelX = offsetX - x;
channelY = offsetY - y;
return i;
}
}
}
}
return -1;
}
std::string multiSlsDetector::exec(const char *cmd) {
int bufsize = 128;
char buffer[bufsize];