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

@@ -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");