From 58bbbb19e94e9891c9251e46fb4f0449a9327ad1 Mon Sep 17 00:00:00 2001 From: eduar Date: Fri, 23 Jan 2026 14:42:45 +0100 Subject: [PATCH] Free_fall --- config/machine_settings/st-ten-11.ini | 3 ++- src/components/usb_586x.py | 2 +- src/ui/test_leak/test_leak.py | 13 +++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/config/machine_settings/st-ten-11.ini b/config/machine_settings/st-ten-11.ini index c24c0be..cd2e413 100644 --- a/config/machine_settings/st-ten-11.ini +++ b/config/machine_settings/st-ten-11.ini @@ -46,7 +46,8 @@ risoluzione:300 [digital_io] # OUTPUT MAP FOR FIXTURE CONNECTOR -id: USB-5862,BID#0 +id: USB-5860,BID#0 +first_output: 0 [fixture_rfid] diff --git a/src/components/usb_586x.py b/src/components/usb_586x.py index 93d0272..0647e84 100644 --- a/src/components/usb_586x.py +++ b/src/components/usb_586x.py @@ -53,7 +53,7 @@ class USB_586x(Component): self.info.ModuleIndex = 0 self.open_device() - #self.out_bits = self.config["digital_outputs"] + self.out_bits = self.config[self.name] #self.in_bits = self.config["digital_inputs"] # SET ALL RELAYS OFF diff --git a/src/ui/test_leak/test_leak.py b/src/ui/test_leak/test_leak.py index 6514389..135e2be 100644 --- a/src/ui/test_leak/test_leak.py +++ b/src/ui/test_leak/test_leak.py @@ -5,7 +5,7 @@ import os from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QMessageBox, QDialog, QApplication -from PyQt5.QtCore import Qt, pyqtSlot +from PyQt5.QtCore import Qt, pyqtSlot, QTimer from ui import Dialog from ui.test_instructions_reminder import Test_Instructions_Reminder from ui.test_test import Test_Test @@ -30,6 +30,13 @@ class Test_Leak(Test_Test): # Connect to the tecna_error_signal to handle connection issues self.components[self.tester_component].tecna_error_signal.connect(self.handle_modbus_error) + def _test_output_sequence(self, step): + """Sets the first digital output of the usb_586x based on the step type.""" + if step.step_type == "test_freefall_leak": + self.set_digital_out("first_output", 1) # Set high + else: + self.set_digital_out("first_output", 0) # Set low + def show_instruction(self): dialog=Dialog() dialog.setCentralWidget(Test_Instructions_Reminder(recipe=self.parent.recipe,bench_name=self.parent.config.machine_id)) @@ -88,6 +95,7 @@ class Test_Leak(Test_Test): def start(self, recipe=None, step=None, pieces=None): + self._test_output_sequence(step) # Call with the step object # TESTING if "--test-leak" in sys.argv: self.simulate = True @@ -263,6 +271,7 @@ class Test_Leak(Test_Test): self.components[self.tester_component].stop_test() self.components[self.tester_component].pause() self.disconnect(self.get_connection) + self.set_digital_out("first_output", 0) # Set low when test stops super().stop() self.start_b.setEnabled(False) self.stop_b.setEnabled(False) @@ -488,7 +497,7 @@ class Test_Leak(Test_Test): QMessageBox.warning(self, "Avviso", text) QApplication.processEvents() - def set_digital_out(self,out_name=None,state=1,component_name="digital_io_flush_blow"): + def set_digital_out(self,out_name=None,state=1,component_name="digital_io"): if self.io_ok: bit = int(self.parent.config[component_name][out_name]) ret = self.components[component_name].set_bit_verify(0,bit,state)