mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 02:20:42 +02:00
size
This commit is contained in:
parent
a3c5c16417
commit
1a60b59a48
@ -124,7 +124,7 @@ void qTabAdvanced::PopulateDetectors() {
|
|||||||
SLOT(SetDetector(int)));
|
SLOT(SetDetector(int)));
|
||||||
|
|
||||||
comboDetector->clear();
|
comboDetector->clear();
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
for (int i = 0; i < myDet->size(); ++i)
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
comboDetector->setCurrentIndex(0);
|
comboDetector->setCurrentIndex(0);
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ void qTabDataOutput::PopulateDetectors() {
|
|||||||
|
|
||||||
comboDetector->clear();
|
comboDetector->clear();
|
||||||
comboDetector->addItem("All");
|
comboDetector->addItem("All");
|
||||||
if (myDet->getNumberOfDetectors() > 1) {
|
if (myDet->size() > 1) {
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
for (int i = 0; i < myDet->size(); ++i)
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ void qTabDebugging::PopulateDetectors() {
|
|||||||
FILE_LOG(logDEBUG) << "Populating detectors";
|
FILE_LOG(logDEBUG) << "Populating detectors";
|
||||||
|
|
||||||
comboDetector->clear();
|
comboDetector->clear();
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i) {
|
for (int i = 0; i < myDet->size(); ++i) {
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,8 @@ void qTabDeveloper::PopulateDetectors() {
|
|||||||
|
|
||||||
comboDetector->clear();
|
comboDetector->clear();
|
||||||
comboDetector->addItem("All");
|
comboDetector->addItem("All");
|
||||||
if (myDet->getNumberOfDetectors() > 1) {
|
if (myDet->size() > 1) {
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
for (int i = 0; i < myDet->size(); ++i)
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
}
|
}
|
||||||
comboDetector->setCurrentIndex(0);
|
comboDetector->setCurrentIndex(0);
|
||||||
|
@ -205,7 +205,7 @@ class Detector {
|
|||||||
* Returns the total number of detectors in the multidetector structure
|
* Returns the total number of detectors in the multidetector structure
|
||||||
* @returns total number of detectors in the multidetector structure
|
* @returns total number of detectors in the multidetector structure
|
||||||
*/
|
*/
|
||||||
int getTotalNumberOfDetectors() const;
|
int size() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of detectors in the multidetector structure
|
* Returns the number of detectors in the multidetector structure
|
||||||
|
@ -381,7 +381,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* 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
|
||||||
*/
|
*/
|
||||||
int getNumberOfDetectors() const;//
|
int size() const;//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns number of detectors in dimension d
|
* Returns number of detectors in dimension d
|
||||||
@ -872,10 +872,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
*/
|
*/
|
||||||
int getDataBytes(int detPos = -1);
|
int getDataBytes(int detPos = -1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the number of detectors in the multi structure*/
|
|
||||||
size_t size() const { return detectors.size(); }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get dacs value
|
* Set/get dacs value
|
||||||
* @param val value (in V)
|
* @param val value (in V)
|
||||||
|
@ -101,7 +101,7 @@ class multiSlsDetectorClient {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parser.detector_id() >= detPtr->getNumberOfDetectors()) {
|
if (parser.detector_id() >= detPtr->size()) {
|
||||||
os << "position is out of bounds.\n";
|
os << "position is out of bounds.\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ public:
|
|||||||
* 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
|
||||||
*/
|
*/
|
||||||
int getNumberOfDetectors() const;
|
int size() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the maximum number of channels of all detectors
|
* Returns the maximum number of channels of all detectors
|
||||||
|
@ -142,8 +142,8 @@ Result<std::string> Detector::getDetectorTypeAsString(Positions pos) const {
|
|||||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Detector::getTotalNumberOfDetectors() const {
|
int Detector::size() const {
|
||||||
return pimpl->getNumberOfDetectors();
|
return pimpl->size();
|
||||||
}
|
}
|
||||||
|
|
||||||
defs::coordinates Detector::getNumberOfDetectors() const {
|
defs::coordinates Detector::getNumberOfDetectors() const {
|
||||||
@ -675,8 +675,8 @@ Result<bool> Detector::getAutoCompDisable(Positions pos) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setPowerChip(bool on, Positions pos) {
|
void Detector::setPowerChip(bool on, Positions pos) {
|
||||||
if (on && pimpl->getNumberOfDetectors() > 3) {
|
if (on && pimpl->size() > 3) {
|
||||||
for (int i = 0; i != pimpl->getNumberOfDetectors(); ++i) {
|
for (int i = 0; i != pimpl->size(); ++i) {
|
||||||
pimpl->powerChip(static_cast<int>(on), i);
|
pimpl->powerChip(static_cast<int>(on), i);
|
||||||
usleep(1000 * 1000);
|
usleep(1000 * 1000);
|
||||||
}
|
}
|
||||||
|
@ -660,7 +660,7 @@ std::string multiSlsDetector::getDetectorTypeAsString(int detPos) {
|
|||||||
return sls::concatenateIfDifferent(r);
|
return sls::concatenateIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::getNumberOfDetectors() const { return detectors.size(); }
|
int multiSlsDetector::size() const { return detectors.size(); }
|
||||||
|
|
||||||
int multiSlsDetector::getNumberOfDetectors(dimension d) const {
|
int multiSlsDetector::getNumberOfDetectors(dimension d) const {
|
||||||
return multi_shm()->numberOfDetector[d];
|
return multi_shm()->numberOfDetector[d];
|
||||||
@ -747,7 +747,7 @@ void multiSlsDetector::setDetectorOffset(dimension d, int off, int detPos) {
|
|||||||
|
|
||||||
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 && size() > 1) {
|
||||||
throw RuntimeError("Quad type is available only for 1 Eiger Quad Half "
|
throw RuntimeError("Quad type is available only for 1 Eiger Quad Half "
|
||||||
"module, but it Quad is enabled for 1st readout");
|
"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) {
|
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 "
|
throw RuntimeError("Cannot set Quad type as it is available only for 1 "
|
||||||
"Eiger Quad Half module.");
|
"Eiger Quad Half module.");
|
||||||
}
|
}
|
||||||
@ -2238,7 +2238,7 @@ void multiSlsDetector::setROI(int n, ROI roiLimits[], int detPos) {
|
|||||||
ymin = roiLimits[i].ymin;
|
ymin = roiLimits[i].ymin;
|
||||||
ymax = roiLimits[i].ymax;
|
ymax = roiLimits[i].ymax;
|
||||||
|
|
||||||
if (getNumberOfDetectors() > 1) {
|
if (size() > 1) {
|
||||||
// check roi max values
|
// check roi max values
|
||||||
idet = decodeNChannel(xmax, ymax, channelX, channelY);
|
idet = decodeNChannel(xmax, ymax, channelX, channelY);
|
||||||
FILE_LOG(logDEBUG1) << "Decoded Channel max vals: " << std::endl
|
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
|
// multi delayed call for safety
|
||||||
if (ival >= 0 && getNumberOfDetectors() > 3) {
|
if (ival >= 0 && size() > 3) {
|
||||||
std::vector<int> r;
|
std::vector<int> r;
|
||||||
r.reserve(detectors.size());
|
r.reserve(detectors.size());
|
||||||
for (auto &d : detectors) {
|
for (auto &d : detectors) {
|
||||||
|
@ -2175,7 +2175,7 @@ std::string slsDetectorCommand::cmdAcquire(int narg, const char * const args[],
|
|||||||
if (action == HELP_ACTION) {
|
if (action == HELP_ACTION) {
|
||||||
return helpAcquire(HELP_ACTION);
|
return helpAcquire(HELP_ACTION);
|
||||||
}
|
}
|
||||||
if (!myDet->getNumberOfDetectors()) {
|
if (!myDet->size()) {
|
||||||
FILE_LOG(logERROR) << "This shared memory has no detectors added. Aborting.";
|
FILE_LOG(logERROR) << "This shared memory has no detectors added. Aborting.";
|
||||||
return std::string("acquire failed");
|
return std::string("acquire failed");
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetectorUsers::getNumberOfDetectors() const {
|
int slsDetectorUsers::size() const {
|
||||||
return detector.getNumberOfDetectors();
|
return detector.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user