DiffractionExperiment: Store detector module hostname

This commit is contained in:
2023-04-13 10:55:20 +02:00
parent dbf50d33e9
commit 85bcb25af3
5 changed files with 122 additions and 81 deletions
+14
View File
@@ -16,10 +16,24 @@ void DetectorWrapper::Configure(const JFJochProtoBuf::DetectorConfig &request) {
}
try {
InternalStop();
if (request.module_hostname_size() > 0) {
if (det.size() != request.module_hostname_size()) {
logger.Error("Discrepancy in module number between DAQ and detector");
throw JFJochException(JFJochExceptionCategory::Detector,
"Discrepancy in module number between DAQ and detector");
}
std::vector<std::string> module_hostname;
for (const auto &iter: request.module_hostname())
module_hostname.push_back(iter);
logger.Info("Resetting detector module host names");
det.setHostname(module_hostname);
}
det.setNumberofUDPInterfaces(2);
for (int i = 0; i < request.modules_size(); i++) {
logger.Info("Configure network for module {}", i);
auto &cfg = request.modules(i);
det.setSourceUDPIP(sls::IpAddr(cfg.ipv4_src_addr_1()), {i});