diff --git a/laserstudio/widgets/toolbars/pdmtoolbar.py b/laserstudio/widgets/toolbars/pdmtoolbar.py index 6122300..17859cf 100644 --- a/laserstudio/widgets/toolbars/pdmtoolbar.py +++ b/laserstudio/widgets/toolbars/pdmtoolbar.py @@ -56,10 +56,6 @@ def __init__(self, laser: PDMInstrument, laser_num: int): w.toggled.connect(lambda b: self.laser.__setattr__("on_off", b)) self.addWidget(w) - # Laser interlock status - self.interlock_label = w = QLabel("Interlock status: Unknown") - self.addWidget(w) - grid = QGridLayout() grid.setContentsMargins(0, 4, 0, 0) row = 0 @@ -131,13 +127,19 @@ def __init__(self, laser: PDMInstrument, laser_num: int): grid.addWidget(w, row, 1) row += 1 + # Laser interlock status + grid.addWidget(QLabel("Interlock status:"), row, 0) + self.interlock_label = w = QLabel("Unknown") + grid.addWidget(w, row, 1) + row += 1 + w = QWidget() w.setLayout(grid) self.addWidget(w) self.reload_parameters() self.laser.parameter_changed.connect(self.refresh_interface) - + def refresh_interface(self, name: str, value: Any): """Refresh the Toolbar UI according to given parameter and value""" if name == "on_off": @@ -153,7 +155,7 @@ def refresh_interface(self, name: str, value: Any): self.offset_current_input.setValue(value) self.offset_current_input.blockSignals(False) elif name == "interlock_status": - self.interlock_label.setText(f"Interlock status: {'opened' if value else 'closed'}") + self.interlock_label.setText('Opened' if value else 'Closed') def reload_parameters(self): self.sweep_min_input.setValue(self.laser.sweep_min)