From da5089283b85574739a7f97e2d6acec1e409e4d7 Mon Sep 17 00:00:00 2001
From: "paolo.cinquegrana@elettra.eu" <paolo.cinquegrana@elettra.eu>
Date: Tue, 13 Feb 2024 12:14:38 +0100
Subject: [PATCH] aggiunta disgnostica stato device

---
 src/PilTrigger.py | 63 +++++++++++++++++++++++++----------------------
 1 file changed, 34 insertions(+), 29 deletions(-)

diff --git a/src/PilTrigger.py b/src/PilTrigger.py
index 2123ec8..467cb53 100644
--- a/src/PilTrigger.py
+++ b/src/PilTrigger.py
@@ -13,35 +13,44 @@ nomecartella = '/home/lfo/data/salvatutto/PIL_trigger/'
 os.chdir(nomecartella)
 defaultreffile = 'auto'
 
+app = QApplication([])
+font_importante = QFont("Arial", 14, 1, True)
+font_pannello = QFont("Arial", 12, -1, False)
+app.setFont(font_pannello)
+
+# creo device proxy
+try:
+    global devicetrgEVR
+    devicetrgEVR = PyTango.DeviceProxy('srv-tango-srf-01:20000/ec-pil-plpsr-01/evr/ff100000')
+    devicetrgEVR.State()
+except:
+    msgBox = QMessageBox()
+    msgBox.setIcon(QMessageBox.Critical)
+    msgBox.setText("ec-pil-plpsr-01/evr/ff100000 is not working, fix the problem and restat the panel")
+    msgBox.exec_()
+try:
+    global devicetrgDGQ
+    devicetrgDGQ = PyTango.DeviceProxy('srv-tango-srf-01:20000/pil/delay/dgq_pil.01')
+    devicetrgDGQ.State()
+except:
+    msgBox = QMessageBox()
+    msgBox.setIcon(QMessageBox.Critical)
+    msgBox.setText("pil/delay/dgq_pil.01 is not working, fix the problem and restat the panel")
+    msgBox.exec_()
+try:
+    global devicetrgSDG
+    devicetrgSDG = PyTango.DeviceProxy('srv-tango-srf-01:20000/pil/delay/sdg_pil.01')
+    devicetrgSDG.State()
+except:
+    msgBox = QMessageBox()
+    msgBox.setIcon(QMessageBox.Critical)
+    msgBox.setText("pil/delay/sdg_pil.01 is not working, fix the problem and restat the panel")
+    msgBox.exec_()
 
 class MainWindow(QDialog):
     def __init__(self, parent = None):
         super(MainWindow, self).__init__(parent)
-        # creo device proxy
-        try:
-            global devicetrgEVR
-            devicetrgEVR = PyTango.DeviceProxy('srv-tango-srf-01:20000/ec-pil-plpsr-01/evr/ff100000')
-        except:
-            msgBox = QMessageBox()
-            msgBox.setIcon(QMessageBox.Critical)
-            msgBox.setText("ec-pil-plpsr-01/evr/ff100000 is not working, fix the problem and restat the panel")
-            msgBox.exec_()
-        try:
-            global devicetrgDGQ
-            devicetrgDGQ = PyTango.DeviceProxy('srv-tango-srf-01:20000/pil/delay/dgq_pil.01')
-        except:
-            msgBox = QMessageBox()
-            msgBox.setIcon(QMessageBox.Critical)
-            msgBox.setText("pil/delay/dgq_pil.01 is not working, fix the problem and restat the panel")
-            msgBox.exec_()
-        try:
-            global devicetrgSDG
-            devicetrgSDG = PyTango.DeviceProxy('srv-tango-srf-01:20000/pil/delay/sdg_pil.01')
-        except:
-            msgBox = QMessageBox()
-            msgBox.setIcon(QMessageBox.Critical)
-            msgBox.setText("pil/delay/sdg_pil.01 is not working, fix the problem and restat the panel")
-            msgBox.exec_()
+
         #canali
         self.scialuppa = []
         self.riga0 = canaleEVR('PIL MASTER', devicetrgEVR, 0, 'Shift all the signals')
@@ -635,10 +644,6 @@ class titolicanali(QWidget):
         self.setLayout(layoutriga)
 
 
-app = QApplication([])
-font_importante = QFont("Arial", 14, 1, True)
-font_pannello = QFont("Arial", 12, -1, False)
-app.setFont(font_pannello)
 main = MainWindow()
 main.show()
 app.exec_()
-- 
GitLab