diff --git a/src/components/tecna_marposs_provaset_t3l_registers.py b/src/components/tecna_marposs_provaset_t3l_registers.py index 3b28ab0..77c0edf 100644 --- a/src/components/tecna_marposs_provaset_t3l_registers.py +++ b/src/components/tecna_marposs_provaset_t3l_registers.py @@ -337,5 +337,5 @@ registers = { "T1 Steps - T1 Step %": [753 - 1, {"dt": "16bit_uint", }], # | 15 14 13 12 11 10 9 8 | 7 6 5 4 3 2 1 0 | # | Step % T1 | T1 Steps | - "Sequence": [754 - 1, {"dt": "16bit_uint", }], + "PSQ - Next sequence program PSOUT mode": [754 - 1, {"dt": "16bit_uint", }], } diff --git a/src/main.py b/src/main.py index 2990ee9..050d9ba 100644 --- a/src/main.py +++ b/src/main.py @@ -225,6 +225,7 @@ try: self.main_window.admin_m.menuAction().setVisible(False) # open test self.main_window.open_tab(Test(self.config, self.components,self)) + self.main_window.centralWidget().request_autotest("login") else: self.main_window.admin_m.menuAction().setVisible(False) diff --git a/src/ui/test/test.py b/src/ui/test/test.py index 6d1dc27..74802a1 100755 --- a/src/ui/test/test.py +++ b/src/ui/test/test.py @@ -3,7 +3,7 @@ import logging import os import sys import weakref -from datetime import datetime +from datetime import datetime, timedelta from lib.db import Archive, Steps, Users from lib.helpers import get_shift @@ -112,10 +112,10 @@ class Test(Widget): self.autotesting_reason = None self.autotest_cycle_steps = None if "--no-autotest" not in sys.argv: - self.autotest_period = 8.5 * 60 * 60 * 1000 # 8.5 HOURS + self.autotest_period = 8.5 * 60 * 60 * 1000 # 8.5 HOURS # self.autotest_period = 12 * 60 * 60 * 1000 # 12 HOURS - if not self.config["autotest_done"]: - self.request_autotest("init") + #if not self.config["autotest_done"]: + # self.request_autotest("init") else: self.autotest_period = None # INIT TEST DATA @@ -195,7 +195,7 @@ class Test(Widget): def request_autotest(self, reason): # you can cancel the request calling request_autotest(False) self.log.info(f"cycle request autotest: reason: {reason!r} autotest_request: {self.autotest_request!r}") - if reason == "init": + if reason in ("init","login"): self.autotest_timer = QTimer() self.autotest_timer.setSingleShot(False) self.autotest_timer.timeout.connect(self.request_periodic_autotest) @@ -263,7 +263,11 @@ class Test(Widget): if self.autotesting_reason == "logout": Users.logout() self.main_window.open_login() - + else: + t = datetime.now() + self.last_at_l.setText("{d}/{mo}/{y} {h}:{m}".format(y=t.year, mo=t.month, d=t.day, h=t.hour, m=t.minute)) + t+=timedelta(seconds=int(self.autotest_period/1000)) + self.next_at_l.setText("{d}/{mo}/{y} {h}:{m}".format(y=t.year, mo=t.month, d=t.day, h=t.hour, m=t.minute)) self.autotesting_reason = None self.cycle_index = -1 self.config["autotest_done"] = True diff --git a/src/ui/test/test.ui b/src/ui/test/test.ui index ac9e4b9..7c608ab 100755 --- a/src/ui/test/test.ui +++ b/src/ui/test/test.ui @@ -52,8 +52,28 @@ 3 - - + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + N. DISEGNO: + + + + + Qt::Horizontal @@ -65,6 +85,56 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 12 + 75 + true + + + + PROSSIMO AUTOTEST: + + + Qt::AlignCenter + + + + + + + + 12 + 75 + true + + + + PEZZI FATTI + + + Qt::AlignCenter + + + @@ -91,20 +161,7 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + @@ -121,8 +178,8 @@ - - + + 12 @@ -131,14 +188,15 @@ - 12345 + 12345 +567 Qt::AlignCenter - + @@ -170,93 +228,8 @@ - - - - - 12 - 75 - true - - - - OPERATORE: - - - - - - - - 12 - 75 - true - - - - 12345 -567 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 12 - 75 - true - - - - N. DISEGNO: - - - - - - - - 12 - 75 - true - - - - PEZZI FATTI - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - + + Qt::Horizontal @@ -268,8 +241,8 @@ - - + + 12 @@ -278,7 +251,24 @@ - - + 12345 + + + Qt::AlignCenter + + + + + + + + 12 + 75 + true + + + + OPERATORE: @@ -331,8 +321,21 @@ - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + 12 @@ -341,7 +344,38 @@ - DD/MM/YY HH:MM + - + + + + + + + + 12 + 75 + true + + + + - + + + Qt::AlignCenter + + + + + + + + 12 + 75 + true + + + + - Qt::AlignCenter diff --git a/src/ui/test_assembly/test_assembly.py b/src/ui/test_assembly/test_assembly.py index d10dc5c..fcea393 100755 --- a/src/ui/test_assembly/test_assembly.py +++ b/src/ui/test_assembly/test_assembly.py @@ -22,14 +22,17 @@ class Test_Assembly(Widget): self.img = None self.img_l.setVisible(False) - def set_text(self, text=None,color=None): + def set_text(self, text=None,bg_color=None,text_color=None): if text is not None: self.text = text self.text_l.setText(str(self.text)) self.text_l.setVisible(True) - if color is None: - color = "lime" - self.text_l.setStyleSheet(f"background-color: {color};") + if bg_color is None: + bg_color = "lime" + if text_color is None: + text_color = "black" + + self.text_l.setStyleSheet(f"background-color: {bg_color};color: {text_color}") else: self.text = None diff --git a/src/ui/test_leak/test_leak.py b/src/ui/test_leak/test_leak.py index ac57bb8..b06a9fe 100644 --- a/src/ui/test_leak/test_leak.py +++ b/src/ui/test_leak/test_leak.py @@ -172,10 +172,10 @@ class Test_Leak(Test_Test): }: if self.step.spec.get("autotest", False) == "ok_check": if self.parent_assembly_widget is not None: - self.parent_assembly_widget().set_text(text="AUTOTEST: RIMUOVERE FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA",color="blue") + self.parent_assembly_widget().set_text(text="AUTOTEST: RIMUOVERE FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA",bg_color="blue",text_color="white") elif self.step.spec.get("autotest", False) == "ko_check": if self.parent_assembly_widget is not None : - self.parent_assembly_widget().set_text(text="AUTOTEST: COLLEGARE TUBO-TUBO + FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA DI PROVA",color="blue") + self.parent_assembly_widget().set_text(text="AUTOTEST: COLLEGARE TUBO-TUBO + FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA DI PROVA",bg_color="blue",text_color="white") else: if self.parent_assembly_widget is not None: self.parent_assembly_widget().set_text(text="COLLEGARE GLI ATTACCHI PNEUMATICI E PREMERE START PER INIZIARE LA PROVA TENUTA")