1.0.0-rc.86

This commit is contained in:
2025-09-27 12:29:56 +02:00
parent 9d3e3944a3
commit 27c4a426a2
141 changed files with 218 additions and 196 deletions
+11 -36
View File
@@ -17,40 +17,11 @@ void SLSDetectorWrapper::Initialize(DiffractionExperiment& experiment,
det_type = experiment.GetDetectorSetup().GetDetectorType();
try {
auto module_hostname = experiment.GetDetectorModuleHostname();
if (det.empty()) {
if (!module_hostname.empty())
det.setHostname(module_hostname);
else
throw JFJochException(JFJochExceptionCategory::Detector,
"Detector not configured and hostname not provided");
} else {
// Stop the detector
InternalStop();
if (det_type == DetectorType::JUNGFRAU) {
// Clear synchronization prior to reconfiguring the detector
det.setMaster(false, 0);
det.setSynchronization(false);
}
if (!module_hostname.empty()) {
bool reset = true;
auto det_module_hostname = det.getHostname();
if (module_hostname.size() == det_module_hostname.size()) {
reset = false;
for (int i = 0; i < module_hostname.size(); i++) {
if (module_hostname[i] != det_module_hostname[i])
reset = true;
}
}
if (reset) {
logger.Info("Resetting detector module host names");
det.setHostname(module_hostname);
}
}
}
if (!module_hostname.empty())
det.setHostname(module_hostname);
else
throw JFJochException(JFJochExceptionCategory::Detector,
"Detector hostname not provided");
auto mod_cfg = experiment.GetDetectorModuleConfig(net_config);
@@ -61,6 +32,9 @@ void SLSDetectorWrapper::Initialize(DiffractionExperiment& experiment,
"Discrepancy in module number between DAQ and detector");
}
// always try to stop new detector first
det.stopDetector();
det.setNumberofUDPInterfaces(experiment.GetUDPInterfaceCount());
for (int i = 0; i < mod_cfg.size(); i++) {
logger.Info("Configure network for module {}", i);
@@ -214,9 +188,10 @@ void SLSDetectorWrapper::Deactivate() {
logger.Info("Deactivate");
try {
InternalStop();
det.setHighVoltage(0);
std::this_thread::sleep_for(std::chrono::seconds(5));
if (det_type == DetectorType::JUNGFRAU) {
det.setHighVoltage(0);
std::this_thread::sleep_for(std::chrono::seconds(5));
det.setPowerChip(false);
det.setMaster(false, 0);
det.setSynchronization(false);