Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ab539bd50f
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
16
src/main.py
16
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,16 +218,22 @@ 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)
|
||||
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):
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -1503,6 +1503,15 @@
|
||||
<property name="text">
|
||||
<string>START</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="0" colspan="3">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user