mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 08:10:02 +02:00
moved updateDetector/Receiver
This commit is contained in:
parent
82ce6b639c
commit
f1d055138c
@ -763,12 +763,30 @@ std::string multiSlsDetector::checkOnline(int detPos) {
|
||||
return sls::concatenateNonEmptyStrings(r);
|
||||
}
|
||||
|
||||
int multiSlsDetector::setPort(portType t, int num, int detPos) {
|
||||
int multiSlsDetector::setControlPort(int port_number, int detPos) {
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setPort(t, num);
|
||||
return detectors[detPos]->setControlPort(port_number);
|
||||
}
|
||||
|
||||
auto r = serialCall(&slsDetector::setPort, t, num);
|
||||
auto r = serialCall(&slsDetector::setControlPort, port_number);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
int multiSlsDetector::setStopPort(int port_number, int detPos) {
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setStopPort(port_number);
|
||||
}
|
||||
|
||||
auto r = serialCall(&slsDetector::setStopPort, port_number);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
int multiSlsDetector::setReceiverPort(int port_number, int detPos) {
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setReceiverPort(port_number);
|
||||
}
|
||||
|
||||
auto r = serialCall(&slsDetector::setReceiverPort, port_number);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
|
@ -418,13 +418,30 @@ class multiSlsDetector : public virtual slsDetectorDefs,
|
||||
std::string checkOnline(int detPos = -1);
|
||||
|
||||
/**
|
||||
* Set/Gets TCP Port of detector or receiver
|
||||
* @param t port type
|
||||
* @param num port number (-1 gets)
|
||||
* Set/Gets TCP Port of the detector
|
||||
* @param port_number (-1 gets)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns port number
|
||||
*/
|
||||
int setPort(portType t, int num = -1, int detPos = -1);
|
||||
int setControlPort(int port_number = -1, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Set/Gets TCP STOP Port of the detector
|
||||
* @param port_number (-1 gets)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns port number
|
||||
*/
|
||||
int setStopPort(int port_number = -1, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Set/Gets TCP Port of the receiver
|
||||
* @param port_number (-1 gets)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns port number
|
||||
*/
|
||||
int setReceiverPort(int port_number = -1, int detPos = -1);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Lock server for this client IP
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -470,16 +470,6 @@ public:
|
||||
*/
|
||||
std::string checkOnline();
|
||||
|
||||
|
||||
/**
|
||||
* Set/Gets TCP Port of detector or receiver
|
||||
* @param t port type
|
||||
* @param num port number (-1 gets)
|
||||
* @returns port number
|
||||
*/
|
||||
int setPort(portType index, int num=-1);
|
||||
|
||||
|
||||
int setControlPort(int port_number);
|
||||
|
||||
/**
|
||||
@ -496,6 +486,8 @@ public:
|
||||
*/
|
||||
int getStopPort() const;
|
||||
|
||||
int setReceiverPort(int port_number);
|
||||
|
||||
/**
|
||||
* Returns the receiver TCP port \sa sharedSlsDetector
|
||||
* @returns the receiver TCP port
|
||||
|
@ -2919,9 +2919,7 @@ std::string slsDetectorCommand::cmdPort(int narg, char *args[], int action, int
|
||||
if (action == HELP_ACTION)
|
||||
return helpPort(action);
|
||||
int val; //ret,
|
||||
char ans[1000];
|
||||
portType index;
|
||||
|
||||
char ans[MAX_STR_LENGTH];
|
||||
if (action == PUT_ACTION) {
|
||||
if (sscanf(args[1], "%d", &val))
|
||||
;
|
||||
@ -2929,20 +2927,22 @@ std::string slsDetectorCommand::cmdPort(int narg, char *args[], int action, int
|
||||
return std::string("could not scan port number") + std::string(args[1]);
|
||||
}
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG, detPos);
|
||||
if (cmd == "port") {
|
||||
index = CONTROL_PORT;
|
||||
if (action == PUT_ACTION)
|
||||
myDet->setControlPort(val, detPos);
|
||||
sprintf(ans, "%d", myDet->setControlPort(-1, detPos));
|
||||
} else if (cmd == "rx_tcpport") {
|
||||
index = DATA_PORT;
|
||||
if (action == PUT_ACTION)
|
||||
myDet->setReceiverPort(val, detPos);
|
||||
sprintf(ans, "%d", myDet->setReceiverPort(-1, detPos));
|
||||
} else if (cmd == "stopport") {
|
||||
index = STOP_PORT;
|
||||
if (action == PUT_ACTION)
|
||||
myDet->setStopPort(val, detPos);
|
||||
sprintf(ans, "%d", myDet->setStopPort(-1, detPos));
|
||||
} else
|
||||
return std::string("unknown port type ") + cmd;
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG, detPos);
|
||||
if (action == PUT_ACTION)
|
||||
myDet->setPort(index, val, detPos);
|
||||
|
||||
sprintf(ans, "%d", myDet->setPort(index, -1, detPos));
|
||||
return std::string(ans);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user