changing ports only in shared memory and not going to detector/receiver server to change current tcp port

This commit is contained in:
2021-10-06 14:24:57 +02:00
parent fcfbb7040a
commit 34fb823675
7 changed files with 3 additions and 77 deletions

View File

@ -1215,12 +1215,7 @@ int Module::getReceiverPort() const { return shm()->rxTCPPort; }
int Module::setReceiverPort(int port_number) {
if (port_number >= 0 && port_number != shm()->rxTCPPort) {
if (shm()->useReceiverFlag) {
shm()->rxTCPPort =
sendToReceiver<int>(F_SET_RECEIVER_PORT, port_number);
} else {
shm()->rxTCPPort = port_number;
}
shm()->rxTCPPort = port_number;
}
return shm()->rxTCPPort;
}
@ -2567,21 +2562,13 @@ void Module::setADCInvert(uint32_t value) {
int Module::getControlPort() const { return shm()->controlPort; }
void Module::setControlPort(int port_number) {
if (strlen(shm()->hostname) > 0) {
shm()->controlPort = sendToDetector<int>(F_SET_PORT, port_number);
} else {
shm()->controlPort = port_number;
}
shm()->controlPort = port_number;
}
int Module::getStopPort() const { return shm()->stopPort; }
void Module::setStopPort(int port_number) {
if (strlen(shm()->hostname) > 0) {
shm()->stopPort = sendToDetectorStop<int>(F_SET_PORT, port_number);
} else {
shm()->stopPort = port_number;
}
shm()->stopPort = port_number;
}
bool Module::getLockDetector() const {

View File

@ -190,7 +190,6 @@ TEST_CASE("rx_tcpport", "[.cmd][.rx]") {
proxy.Call("rx_tcpport", {}, i, GET, oss);
REQUIRE(oss.str() == "rx_tcpport " + std::to_string(port + i) + '\n');
}
REQUIRE_THROWS(proxy.Call("rx_tcpport", {"15"}, -1, PUT));
port = 5754;
proxy.Call("rx_tcpport", {std::to_string(port)}, -1, PUT);
for (int i = 0; i != det.size(); ++i) {