diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 212c2f03b..33a43e90b 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -209,6 +209,26 @@ class Detector { */ Result getDetectorTypeAsString(Positions pos = {}) const; + /** + * Returns the number of detectors in the multidetector structure + * @returns number of detectors + */ + int getNumberOfDetectors() const; + + /** + * Returns number of detectors in dimension d + * @param d dimension d + * @returns number of detectors in dimension d + */ + int getNumberOfDetectors(defs::dimension d) 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 + */ + void getNumberOfDetectors(int &nx, int &ny) const; + // Erik /** CTB only.Sets the mask applied to every pattern. */ diff --git a/slsDetectorSoftware/include/multiSlsDetector.h b/slsDetectorSoftware/include/multiSlsDetector.h index 36e45fa29..6b8198404 100755 --- a/slsDetectorSoftware/include/multiSlsDetector.h +++ b/slsDetectorSoftware/include/multiSlsDetector.h @@ -347,19 +347,11 @@ class multiSlsDetector : public virtual slsDetectorDefs { */ std::string getHostname(int detPos = -1) const;// - /** - * Appends detectors to the end of the list in shared memory - * Connects to them - * @param name concatenated hostname of the sls detectors to be appended to - * the list - */ - void addMultipleDetectors(const char *name);// ???? - /** * Get Detector type as an enum * @returns detector type */ - detectorType getDetectorTypeAsEnum() const; + detectorType getDetectorTypeAsEnum() const; // /** * Get Detector type for a particular sls detector or get the first one @@ -367,7 +359,7 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @returns detector type of sls detector in position pos, if -1, returns * the first det type */ - detectorType getDetectorTypeAsEnum(int detPos);//?? + detectorType getDetectorTypeAsEnum(int detPos);// /** * Concatenates string types of all sls detectors or @@ -376,27 +368,27 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @returns detector type of sls detector in position pos, if -1, * concatenates */ - std::string getDetectorTypeAsString(int detPos = -1); + std::string getDetectorTypeAsString(int detPos = -1);// /** * Returns the number of detectors in the multidetector structure * @returns number of detectors */ - int getNumberOfDetectors() const; + int getNumberOfDetectors() const;// /** * Returns number of detectors in dimension d * @param d dimension d * @returns number of detectors in dimension d */ - int getNumberOfDetectors(dimension d) const; + int getNumberOfDetectors(dimension d) 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 */ - void getNumberOfDetectors(int &nx, int &ny) const; + void getNumberOfDetectors(int &nx, int &ny) const;// /** * Returns the total number of channels of all sls detectors from shared @@ -2241,6 +2233,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { */ void initializeMembers(bool verify = true); + /** + * Appends detectors to the end of the list in shared memory + * Connects to them + * @param name concatenated hostname of the sls detectors to be appended to + * the list + */ + void addMultipleDetectors(const char *name);// + /** * Update user details in detector structure */ diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index f8a5c8a4d..9d38a5fb1 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -169,18 +169,29 @@ Result Detector::getDetectorTypeAsString(Positions pos) const { return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos); } +int Detector::getNumberOfDetectors() const { + return pimpl->getNumberOfDetectors(); +} + +int Detector::getNumberOfDetectors(defs::dimension d) const { + return pimpl->getNumberOfDetectors(d); +} + +void Detector::getNumberOfDetectors(int &nx, int &ny) const { + pimpl->getNumberOfDetectors(nx, ny); +} + // Erik - -Result Detector::getPatternMask(Positions pos){ +Result Detector::getPatternMask(Positions pos) { return pimpl->Parallel(&slsDetector::getPatternMask, pos); } -void Detector::setPatternBitMask(uint64_t mask, Positions pos){ +void Detector::setPatternBitMask(uint64_t mask, Positions pos) { pimpl->Parallel(&slsDetector::setPatternBitMask, pos, mask); } -Result Detector::getPatternBitMask(Positions pos) const{ +Result Detector::getPatternBitMask(Positions pos) const { return pimpl->Parallel(&slsDetector::getPatternBitMask, pos); } @@ -192,7 +203,7 @@ Result Detector::getLEDEnable(Positions pos) const { return pimpl->Parallel(&slsDetector::setLEDEnable, pos, -1); } -void Detector::setDigitalIODelay(uint64_t pinMask, int delay, Positions pos){ +void Detector::setDigitalIODelay(uint64_t pinMask, int delay, Positions pos) { pimpl->Parallel(&slsDetector::setDigitalIODelay, pos, pinMask, delay); } diff --git a/slsDetectorSoftware/src/slsDetectorCommand.cpp b/slsDetectorSoftware/src/slsDetectorCommand.cpp index e5f3ee928..af2d12e85 100755 --- a/slsDetectorSoftware/src/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/src/slsDetectorCommand.cpp @@ -275,13 +275,6 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdHostname; ++i; - /*! \page config - - \b add appends a hostname (or IP address) at the end of the multi-detector structure. Only allowed at multi detector level. Cannot get. \c Returns the current list of detector hostnames. \c (string) - */ - descrToFuncMap[i].m_pFuncName = "add"; - descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdHostname; - ++i; - /*! \page config - replace \c Sets the hostname (or IP adress) for a single detector. Only allowed at single detector level. Cannot get. \c Returns the hostnames for that detector \c (string) */ @@ -2379,12 +2372,12 @@ std::string slsDetectorCommand::cmdHostname(int narg, const char * const args[], return helpHostname(HELP_ACTION); } if (action == GET_ACTION) { - if ((cmd == "add") || (cmd == "replace")) + if (cmd == "replace") return std::string("cannot get"); } if (action == PUT_ACTION) { - if (((cmd == "add") || (cmd == "hostname")) && + if ((cmd == "hostname") && (detPos >= 0)) { return std::string("Wrong usage - setting hostname/add only from " "multiDetector level"); @@ -2403,10 +2396,7 @@ std::string slsDetectorCommand::cmdHostname(int narg, const char * const args[], strcat(hostname, "+"); } - if (cmd == "add") - myDet->addMultipleDetectors(hostname); - else - myDet->setHostname(hostname, detPos); + myDet->setHostname(hostname, detPos); } return myDet->getHostname(detPos); @@ -2416,15 +2406,11 @@ std::string slsDetectorCommand::helpHostname(int action) { std::ostringstream os; if (action == GET_ACTION || action == HELP_ACTION) { os << std::string("hostname \t returns the hostname(s) of the multi detector structure.\n"); - os << std::string("add \t cannot get\n"); os << std::string("replace \t cannot get\n"); } if (action == PUT_ACTION || action == HELP_ACTION) { os << std::string("hostname name [name name]\t frees shared memory and " "sets the hostname (or IP adress). Only allowed at multi detector level.\n"); - os << std::string("add det [det det]\t appends a hostname (or IP address) at " - "the end of the multi-detector structure. Only allowed at multi detector level." - "Returns hostnames in the multi detector structure\n"); os << std::string("replace det \t Sets the hostname (or IP adress) for a " "single detector. Only allowed at single detector level. " "Returns the hostnames for that detector\n");