From ba85c42265b4072ca2cb0a3631cc8a54e9b26ceb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Olivier=20H=C3=A9riveaux?= <olivier.heriveaux@ledger.fr>
Date: Tue, 26 Nov 2024 15:03:19 +0100
Subject: [PATCH] Interlock status display improvement

---
 laserstudio/widgets/toolbars/pdmtoolbar.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

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)