This commit is contained in:
2019-08-08 11:11:08 +02:00
parent 095a7eac05
commit 553b7d8568
4 changed files with 53 additions and 36 deletions

View File

@@ -169,18 +169,29 @@ Result<std::string> 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<uint64_t> Detector::getPatternMask(Positions pos){
Result<uint64_t> 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<uint64_t> Detector::getPatternBitMask(Positions pos) const{
Result<uint64_t> Detector::getPatternBitMask(Positions pos) const {
return pimpl->Parallel(&slsDetector::getPatternBitMask, pos);
}
@@ -192,7 +203,7 @@ Result<bool> 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);
}

View File

@@ -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
- <b>replace</b> \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");