Add manual beamline selection (for development)
CI for debye_bec / test (push) Successful in 1m11s
CI for debye_bec / test (pull_request) Successful in 1m4s

This commit is contained in:
2026-06-11 10:34:34 +02:00
parent ab1553b8f2
commit b2db410887
@@ -136,7 +136,7 @@ class DigitalTwin(BECWidget, QWidget):
widget_layout.setSpacing(0)
widget_layout.addWidget(self.content_widget)
self.setWindowTitle("Digital Twin")
self.resize(1450, 760)
self.resize(1450, 950)
self.input.energy.value_changed_connect(self.calc_assistant)
self.input.sldi_hacc.value_changed_connect(self.calc_assistant)
@@ -219,7 +219,17 @@ class DigitalTwin(BECWidget, QWidget):
case _:
raise ValueError(f"Not implemented beamline {beamline}")
else:
raise ValueError(f"Failed to extract beamline from bec server hostname {bec_hostname}")
logger.warning(f"Failed to extract beamline from bec server hostname {bec_hostname}")
choice = input("Do you want to manually select a beamline? (yes/no): ").strip().lower()
if choice in ["yes", "y"]:
bl = input(f"Choose from: {[bl.value for bl in BeamlineId]}")
if bl in BeamlineId:
logger.info(f'Manually selected beamline {bl}')
return BeamlineId(bl)
else:
raise ValueError(f'Wrong selection {bl}')
else:
raise ValueError('Cannot open digital twin without a beamline')
@SafeSlot()
def check_bec_config(self, *args):