mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-30 09:50:06 +02:00
WIP
This commit is contained in:
parent
df63a6dffe
commit
1d31695cc1
@ -644,24 +644,6 @@ int Module::setStopPort(int port_number) {
|
||||
return shm()->stopPort;
|
||||
}
|
||||
|
||||
int Module::setReceiverPort(int port_number) {
|
||||
LOG(logDEBUG1) << "Setting reciever port to " << port_number;
|
||||
if (port_number >= 0 && port_number != shm()->rxTCPPort) {
|
||||
if (shm()->useReceiver) {
|
||||
int retval = -1;
|
||||
sendToReceiver(F_SET_RECEIVER_PORT, port_number, retval);
|
||||
shm()->rxTCPPort = retval;
|
||||
LOG(logDEBUG1) << "Receiver port: " << retval;
|
||||
|
||||
} else {
|
||||
shm()->rxTCPPort = port_number;
|
||||
}
|
||||
}
|
||||
return shm()->rxTCPPort;
|
||||
}
|
||||
|
||||
int Module::getReceiverPort() const { return shm()->rxTCPPort; }
|
||||
|
||||
int Module::getControlPort() const { return shm()->controlPort; }
|
||||
|
||||
int Module::getStopPort() const { return shm()->stopPort; }
|
||||
@ -1498,29 +1480,11 @@ uint32_t Module::clearBit(uint32_t addr, int n) {
|
||||
|
||||
void Module::setReceiverHostname(const std::string &receiverIP) {
|
||||
LOG(logDEBUG1) << "Setting up Receiver with " << receiverIP;
|
||||
// recieverIP is none
|
||||
if (receiverIP == "none") {
|
||||
memset(shm()->rxHostname, 0, MAX_STR_LENGTH);
|
||||
sls::strcpy_safe(shm()->rxHostname, "none");
|
||||
shm()->useReceiver = false;
|
||||
}
|
||||
|
||||
// stop acquisition if running
|
||||
if (getRunStatus() == RUNNING) {
|
||||
LOG(logWARNING) << "Acquisition already running, Stopping it.";
|
||||
stopAcquisition();
|
||||
}
|
||||
|
||||
// start updating
|
||||
std::string host = receiverIP;
|
||||
auto res = sls::split(host, ':');
|
||||
if (res.size() > 1) {
|
||||
host = res[0];
|
||||
shm()->rxTCPPort = std::stoi(res[1]);
|
||||
}
|
||||
|
||||
sls::strcpy_safe(shm()->rxHostname, host.c_str());
|
||||
shm()->useReceiver = true;
|
||||
checkReceiverVersionCompatibility();
|
||||
|
||||
// populate parameters from detector
|
||||
rxParameters retval;
|
||||
|
@ -238,14 +238,6 @@ class Module : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int getStopPort() const;
|
||||
|
||||
int setReceiverPort(int port_number);
|
||||
|
||||
/**
|
||||
* Returns the receiver TCP port
|
||||
* @returns the receiver TCP port
|
||||
*/
|
||||
int getReceiverPort() const;
|
||||
|
||||
/**
|
||||
* Lock server for this client IP
|
||||
* @param p 0 to unlock, 1 to lock (-1 gets)
|
||||
|
@ -174,14 +174,18 @@ int Receiver::getTCPPort() const {
|
||||
}
|
||||
|
||||
void Receiver::setTCPPort(const int port) {
|
||||
LOG(logDEBUG1) << "Setting reciever port to " << port;
|
||||
if (port >= 0 && port != shm()->tcpPort) {
|
||||
if (strlen(shm()->hostname) != 0) {
|
||||
// send to receiver to change tcpp port
|
||||
shm()->tcpPort = port; // for now
|
||||
int retval = -1;
|
||||
sendToReceiver(F_SET_RECEIVER_PORT, port, retval);
|
||||
shm()->tcpPort = retval;
|
||||
LOG(logDEBUG1) << "Receiver port: " << retval;
|
||||
} else {
|
||||
shm()->tcpPort = port;
|
||||
}
|
||||
}
|
||||
return shm()->tcpPort;
|
||||
}
|
||||
|
||||
void Receiver::configure() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user