From 0ff07836ed0894598339b47cfd3c56e29c46495d Mon Sep 17 00:00:00 2001 From: germano laptop Date: Mon, 24 Jul 2023 18:11:47 +0200 Subject: [PATCH] blow&flush beta ok --- config/machine_settings/defaults.ini | 2 ++ config/machine_settings/st-ten-6.ini | 17 +++++++++-------- designer_win.bat | 2 +- src/ui/leak_step_editor/leak_step_editor.py | 4 +++- src/ui/test_leak/test_leak.py | 18 +++++++++++------- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/config/machine_settings/defaults.ini b/config/machine_settings/defaults.ini index 2ce4bcc..7b9f780 100644 --- a/config/machine_settings/defaults.ini +++ b/config/machine_settings/defaults.ini @@ -149,6 +149,8 @@ pressione_di_test_2: 2222 pressione_di_test_delta_massimo_2: 200 tempo_svuotamento_2: 1 pressione_svuotamento_2: 100 +tempo_soffiaggio_esterno_2: 3 +tempo_svuotamento_esterno_2: 2 canale_di_prova_2: 0 test_visione_abilitato: ricetta_visione: termorestringente_923578.ini diff --git a/config/machine_settings/st-ten-6.ini b/config/machine_settings/st-ten-6.ini index b977ac0..c650fd7 100644 --- a/config/machine_settings/st-ten-6.ini +++ b/config/machine_settings/st-ten-6.ini @@ -14,6 +14,7 @@ screwdriver: absent digital_io: present second_leak_test: present external_flush_blow: present # EXTERNAL BOX CONTROLLING MULTI-CHANNEL TEST (IF PRESENT), BLOW-CLEANING AND EXTERNAL FLUSH +dual_channel: present [tecna_t3] port: COM4 @@ -29,14 +30,14 @@ printer: zd421 [digital_io] id: USB-5860,BID#0 # OUTPUT MAP -blow_on: 0 # INPUT VALVE TO SERVICE AIR -out_channel_select: 1 # AIR OUT VALVE (0=CH1, 1=CH2) -in_channel_select: 2 # AIR IN VALVE (0=CH1, 1=CH2) -flush_on: 3 # OUTPUT VALVE TO DIRT COLLECTOR -blow_led:4 # CLEAN INDICATOR -ch1_led:5 # CHANNEL 1 ACTIVE INDICATOR -ch2_led:6 # CHANNEL 2 ACTIVE INDICATOR -flush_led:7 # FLUSH INDICATOR +blow_on: 3 # INPUT VALVE TO SERVICE AIR +out_channel_select: 2 # AIR OUT VALVE (0=CH1, 1=CH2) +in_channel_select: 0 # AIR IN VALVE (0=CH1, 1=CH2) +flush_on: 1 # OUTPUT VALVE TO DIRT COLLECTOR +blow_led:7 # CLEAN INDICATOR +ch1_led:6 # CHANNEL 1 ACTIVE INDICATOR +ch2_led:5 # CHANNEL 2 ACTIVE INDICATOR +flush_led:4 # FLUSH INDICATOR [recipe] recipe_name_field: codice_ricetta diff --git a/designer_win.bat b/designer_win.bat index ce9cbec..6784207 100644 --- a/designer_win.bat +++ b/designer_win.bat @@ -1 +1 @@ -.\venv\Lib\site-packages\qt5_applications\Qt\bin\designer.exe +pyqt5-tools designer \ No newline at end of file diff --git a/src/ui/leak_step_editor/leak_step_editor.py b/src/ui/leak_step_editor/leak_step_editor.py index b4fb284..267c341 100644 --- a/src/ui/leak_step_editor/leak_step_editor.py +++ b/src/ui/leak_step_editor/leak_step_editor.py @@ -22,5 +22,7 @@ class Leak_Step_Editor(Editor): "flush_time": self.flush_time_sb, "flush_pressure": self.flush_pressure_sb, # relay - "chan_sel": self.chan_sel_sb + "chan_sel": self.chan_sel_sb, + "ext_blow_time": self.ext_blow_time_sb, + "ext_flush_time": self.ext_flush_time_sb, }) diff --git a/src/ui/test_leak/test_leak.py b/src/ui/test_leak/test_leak.py index 689fcef..6e46634 100644 --- a/src/ui/test_leak/test_leak.py +++ b/src/ui/test_leak/test_leak.py @@ -31,26 +31,28 @@ class Test_Leak(Test_Test): # SELECT TEST CHANNEL if "digital_io" in self.components.keys(): - if "chan_sel" in self.step.spec.keys(): + if self.parent.config["hardware_config"].get("dual_channel", None) == "present": chan_sel = self.step.spec["chan_sel"] # 0=CH1, 1=CH2 self.set_digital_out("out_channel_select", chan_sel) self.set_digital_out("in_channel_select", chan_sel) # SET LED INDICATORS - self.set_digital_out("blow_led", chan_sel) - if chan_sel: - self.set_digital_out("ch1_led", chan_sel) + if chan_sel == 0: + self.set_digital_out("ch1_led", True) else: - self.set_digital_out("ch2_led", chan_sel) + self.set_digital_out("ch2_led", True) if self.parent.config["hardware_config"].get("external_flush_blow",None)=="present": self.display_text("SOFFIAGGIO IN CORSO...") self.set_digital_out("blow_led",True) self.set_digital_out("blow_on",True) + self.set_digital_out("flush_on", True) blow_time=int(self.step.spec['ext_blow_time']) + self.set_digital_out("blow_led", True) time.sleep(blow_time) self.set_digital_out("blow_led", False) self.set_digital_out("blow_on", False) + self.set_digital_out("flush_on", False) self.components["tecna_t3"].start_test() @@ -144,9 +146,11 @@ class Test_Leak(Test_Test): time.sleep(flush_time) self.set_digital_out("flush_led", False) self.set_digital_out("flush_on", False) - + if self.parent.config["hardware_config"].get("dual_channel", None) == "present": self.set_digital_out("out_channel_select", False) self.set_digital_out("in_channel_select", False) + self.set_digital_out("ch1_led", False) + self.set_digital_out("ch2_led", False) else: #result = None @@ -217,7 +221,7 @@ class Test_Leak(Test_Test): def display_text(self,text="", bg_color=None,text_color=None): if self.parent_assembly_widget is not None: self.parent_assembly_widget().set_text(text=text, bg_color=bg_color,text_color=text_color) - + QApplication.processEvents() def set_digital_out(self,name=None,state=1): if self.io_ok: bit=int(self.parent.config["digital_io"][name])