diff --git a/config/machine_settings/st-ten-6.ini b/config/machine_settings/st-ten-6.ini index 328d6ac..313002e 100644 --- a/config/machine_settings/st-ten-6.ini +++ b/config/machine_settings/st-ten-6.ini @@ -73,10 +73,12 @@ filling_time: 15 settling_time: 10 settling_pressure_min_percent: 5 settling_pressure_max_percent: 5 -test_time: 10 -test_pressure_min_delta: 35 test_pressure: 15000 -test_pressure_max_delta: 5 +test_time: 10 +test_pressure_min_delta: 35 # MAXIMUM LEAK ACCEPTED WITH REF LEAK INSERTED +test_pressure_max_delta: -25 # MINIMUM LEAK ACCEPTED WITH REF LEAK INSERTED +test_pressure_tt_min_delta: -5 #MAXIMUM LEAK ACCEPTED WITH TUBE-TUBE +test_pressure_tt_max_delta: 5 #MINIMUM LEAK ACCEPTED TUBE-TUBE flush_time: 1 flush_pressure: 100 relay_config: 1 \ No newline at end of file diff --git a/src/components/tecna_marposs_provaset_t3.py b/src/components/tecna_marposs_provaset_t3.py index ce2de1f..8b1d980 100644 --- a/src/components/tecna_marposs_provaset_t3.py +++ b/src/components/tecna_marposs_provaset_t3.py @@ -212,9 +212,9 @@ class TecnaMarpossProvasetT3(ModbusComponent): "Running test: active phase", "Running test: test type", "Running test: measured leak", - #"Running test: sequence index", - #"Digital inputs status (mask)", - # "Digital outputs status (mask)", + "Running test: sequence index", + "Digital inputs status (mask)", + "Digital outputs status (mask)", ]} if self.model == "t3p": pass diff --git a/src/lib/db/models/archive.py b/src/lib/db/models/archive.py index bd1be74..1aae510 100644 --- a/src/lib/db/models/archive.py +++ b/src/lib/db/models/archive.py @@ -23,7 +23,7 @@ class Archive(BaseModel): @db.atomic() def archive(cls, test_data, result, overridden): time=datetime.now() - test_data["time"]=time.strftime("%Y/%m/%dT %H:%M:%S") + test_data["time"]=time.strftime("%d/%m/%Y %H:%M:%S") test_data["user"]=Users.get_session().username return cls.create( time=time, diff --git a/src/main.py b/src/main.py index a5c0a8e..d779608 100644 --- a/src/main.py +++ b/src/main.py @@ -68,7 +68,7 @@ try: from lib.helpers import ConfigReader from PyQt5.QtCore import QObject, QThread, pyqtSignal from PyQt5.QtWidgets import QApplication, QMessageBox - from ui import About, Archive, Login, Main_Window, Test, Users_Management + from ui import About, Archive, Login, Main_Window, Test, Users_Management, Recipe_Selection if "--vision" in sys.argv: from components import GalaxyCamera, NeoPixels, UVCCamera, Vision, VisionSaver @@ -218,17 +218,23 @@ try: else: self.main_window.admin_m.menuAction().setVisible(False) # open test - self.main_window.open_tab(Test(self.config, self.components)) + self.main_window.open_tab(Test(self.config, self.components,self)) else: self.main_window.admin_m.menuAction().setVisible(False) def logout(self): - if type(self.main_window.centralWidget) is Test: - self.main_window.centralWidget.change_recipe() - self.main_window.centralWidget.request_autotest("logout") Users.logout() self.main_window.admin_m.menuAction().setVisible(False) - self.open_login() + if type(self.main_window.centralWidget().centralWidget.widget) is Recipe_Selection: + # LOGOUT IMMEDIATELY IF NOT TESTING + self.open_login() + else: + if not self.main_window.centralWidget().autotesting: + self.main_window.centralWidget().change_recipe() # STOP CURRENT TEST + self.main_window.centralWidget().request_autotest("logout") + else: + # LOGOUT IMMEDIATELY IF AUTOTESTING + self.open_login() def set_recipe_mode_table(self): self.main_window.centralWidget().set_recipe_mode_table() diff --git a/src/ui/test/test.py b/src/ui/test/test.py index 63d9071..ee1a0b9 100755 --- a/src/ui/test/test.py +++ b/src/ui/test/test.py @@ -29,8 +29,9 @@ from ui.widget import Widget class Test(Widget): - def __init__(self, config, components=None): + def __init__(self, config, components=None,main_window=None): super().__init__() + self.main_window=main_window self.config = config self.components = components # GET LOGGER @@ -350,6 +351,7 @@ class Test(Widget): self.cycle_steps = steps self.check_steps_dependencies(self.cycle_steps) leak_autotest_steps=[] + # CONFIGURE LEAK AUTOTEST PARAMETERS if self.config["autotest_leak"]["enabled"]=="true": l_at_1=copy.deepcopy(self.config["autotest_leak"]) l_at_1.pop("enabled") @@ -358,6 +360,8 @@ class Test(Widget): l_at_2=copy.deepcopy(self.config["autotest_leak"]) l_at_2.pop("enabled") l_at_2={a: float(x) for a, x in l_at_2.items()} + l_at_2["test_pressure_min_delta"]=l_at_2["test_pressure_tt_min_delta"] + l_at_2["test_pressure_max_delta"]=l_at_2["test_pressure_tt_max_delta"] l_at_2["autotest"]="ok_check" leak_autotest_steps=[Steps(type="leak_1",spec=l_at_1),Steps(type="leak_1",spec=l_at_2)] @@ -506,6 +510,11 @@ class Test(Widget): self.pieces["ok"] += 1 else: self.pieces["ko"] += 1 + else: + if self.autotesting_reason == "logout": + if ok: + self.main_window.show_login() + return archived @staticmethod diff --git a/src/ui/test_leak/test_leak.py b/src/ui/test_leak/test_leak.py index 33f7e4f..37c3c34 100644 --- a/src/ui/test_leak/test_leak.py +++ b/src/ui/test_leak/test_leak.py @@ -122,7 +122,7 @@ class Test_Leak(Test_Test): if step == "ok_check": ok = type(result) is str and "passed" in result.lower() # AUTOTEST - NO LEAK elif step == "ko_check": - ok = type(result) is str and "failed" in result.lower() # AUTOTEST - LEAK + ok = type(result) is str and "passed" in result.lower() # AUTOTEST - LEAK else: ok = type(result) is str and "passed" in result.lower() # NORMAL TEST @@ -181,6 +181,9 @@ class Test_Leak(Test_Test): 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") self.start_b.setEnabled(True) + self.start_b.setDefault(True) + self.start_b.setFocus() + self.stop_b.setEnabled(False) else: if self.step is not None: diff --git a/src/ui/test_leak/test_leak.ui b/src/ui/test_leak/test_leak.ui index 23dfb7e..a9844d9 100644 --- a/src/ui/test_leak/test_leak.ui +++ b/src/ui/test_leak/test_leak.ui @@ -1503,6 +1503,15 @@ START + + false + + + false + + + false +