calibrated leak image

This commit is contained in:
neo-dl 2023-08-24 18:20:52 +02:00
parent b0c101d54c
commit 09db085651
4 changed files with 20 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 KiB

View File

@ -2,8 +2,9 @@ import sys
import time
import weakref
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QMessageBox, QDialog, QApplication
from PyQt5.QtCore import Qt
from ui import Dialog
from ui.test_instructions_reminder import Test_Instructions_Reminder
from ui.test_test import Test_Test
@ -20,7 +21,7 @@ class Test_Leak(Test_Test):
self.step=step
self.recipe_written = False
self.start_b.clicked.connect(self.start_test)
self.stop_b.clicked.connect(lambda checked, self=weakref.ref(self): self().components["tecna_t3"].stop_test())
self.stop_b.clicked.connect(self.stop_test)
self.show_instruction_b.setVisible("show_instructions" in self.parent.config["hardware_config"].keys())
self.show_instruction_b.clicked.connect(self.show_instruction)
@ -29,6 +30,13 @@ class Test_Leak(Test_Test):
dialog.setCentralWidget(Test_Instructions_Reminder(recipe=self.parent.recipe,bench_name=self.parent.config.machine_id))
dialog.show()
def stop_test(self):
self.components["tecna_t3"].stop_test()
self.display_text(text="PROVA INTERROTTA", bg_color="yellow")
time.sleep(1)
self.start_b.setEnabled(True)
self.stop_b.setEnabled(False)
def start_test(self):
# print extra labels
if self.step.type == "leak_1":
@ -105,12 +113,16 @@ class Test_Leak(Test_Test):
if self.step.spec.get("autotest", False) == "ok_check":
self.display_text(text="AUTOTEST: RIMUOVERE FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA",
bg_color="blue", text_color="white")
super().visualize(None, img=self.status_imgs_full["calibrated-leak-remove"])
elif self.step.spec.get("autotest", False) == "ko_check":
self.display_text(
text="AUTOTEST: COLLEGARE TUBO-TUBO + FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA DI PROVA",
bg_color="blue", text_color="white")
super().visualize(None, img=self.status_imgs_full["calibrated-leak"])
else:
self.display_text(text="COLLEGARE GLI ATTACCHI PNEUMATICI E PREMERE START PER INIZIARE LA PROVA TENUTA")
self.display_image(img="wait")
if self.simulate:
QApplication.processEvents()
time.sleep(2)
@ -236,8 +248,9 @@ class Test_Leak(Test_Test):
self.display_text(text="AUTOTEST: PROVA TENUTA IN CORSO")
self.start_b.setEnabled(False)
self.stop_b.setEnabled(True)
ok = data.get("results", {}).get("ok", None)
super().visualize(data, img=self.status_imgs_full[ok])
ok = data.get("results", {}).get("ok", None)
super().visualize(data, img=self.status_imgs_full[ok])
def display_text(self,text="", bg_color=None,text_color=None):
if self.parent_assembly_widget is not None:
@ -245,6 +258,7 @@ class Test_Leak(Test_Test):
QApplication.processEvents()
time.sleep(0.3)
QApplication.processEvents()
def set_digital_out(self,name=None,state=1):
if self.io_ok:
bit=int(self.parent.config["digital_io"][name])

View File

@ -60,6 +60,8 @@ class Test_Test(Widget):
"": QPixmap("src/ui/imgs/neo.ico"),
"warning": QPixmap("src/ui/imgs/warning.png"),
"wait": QPixmap("src/ui/imgs/wait.png"),
"calibrated-leak": QPixmap("src/ui/imgs/calibrated-leak.png"),
"calibrated-leak-remove": QPixmap("src/ui/imgs/calibrated-leak-remove.png"),
False: QPixmap("src/ui/imgs/fail.png"),
None: QPixmap("src/ui/imgs/wait.png"),
}