mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-20 08:38:00 +02:00
moved shm numUdpInterfaces initialization up front, moved updating this value in DetectorImpl::setHostname to DetectorImpl::addModule for more readability, renamed getNumberofUdpInterfaces to an updateNumberofUdpInterfaces as the shm was being updated and is used only in setHostname, everywhere else getNumberofUdpInterfaces is replaced by getNumberofUdpInterfacesFromShm
This commit is contained in:
@ -245,15 +245,6 @@ void DetectorImpl::setHostname(const std::vector<std::string> &name) {
|
||||
addModule(hostname);
|
||||
}
|
||||
updateDetectorSize();
|
||||
|
||||
// update zmq port (especially for eiger)
|
||||
int numInterfaces = modules[0]->getNumberofUDPInterfaces();
|
||||
if (numInterfaces == 2) {
|
||||
for (size_t i = 0; i < modules.size(); ++i) {
|
||||
modules[i]->setClientStreamingPort(DEFAULT_ZMQ_CL_PORTNO +
|
||||
i * numInterfaces);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DetectorImpl::addModule(const std::string &hostname) {
|
||||
@ -288,11 +279,20 @@ void DetectorImpl::addModule(const std::string &hostname) {
|
||||
modules[pos]->setControlPort(port);
|
||||
modules[pos]->setStopPort(port + 1);
|
||||
modules[pos]->setHostname(host, shm()->initialChecks);
|
||||
|
||||
// module type updated by now
|
||||
shm()->detType = Parallel(&Module::getDetectorType, {})
|
||||
.tsquash("Inconsistent detector types.");
|
||||
// for moench and ctb
|
||||
modules[pos]->updateNumberOfChannels();
|
||||
|
||||
// for eiger, jungfrau, gotthard2
|
||||
modules[pos]->updateNumberofUDPInterfaces();
|
||||
|
||||
// update zmq port in case numudpinterfaces changed
|
||||
int numInterfaces = modules[pos]->getNumberofUDPInterfacesFromShm();
|
||||
modules[pos]->setClientStreamingPort(DEFAULT_ZMQ_CL_PORTNO +
|
||||
pos * numInterfaces);
|
||||
}
|
||||
|
||||
void DetectorImpl::updateDetectorSize() {
|
||||
@ -1361,10 +1361,6 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
sls::Result<int> DetectorImpl::getNumberofUDPInterfaces(Positions pos) const {
|
||||
return Parallel(&Module::getNumberofUDPInterfaces, pos);
|
||||
}
|
||||
|
||||
sls::Result<int> DetectorImpl::getDefaultDac(defs::dacIndex index,
|
||||
defs::detectorSettings sett,
|
||||
Positions pos) {
|
||||
|
Reference in New Issue
Block a user