diff --git a/src/ui/test/test.py b/src/ui/test/test.py index ac3ef25..0eb5143 100755 --- a/src/ui/test/test.py +++ b/src/ui/test/test.py @@ -431,9 +431,6 @@ class Test(Widget): if step.spec["warning_img"]: steps.insert(i, Step(step_type="warning_img", spec={"warning_img": step.spec["warning_img"]})) skip.add(i + 1) - if step.step_type in "pipe_cutter": - self.pipe_cutter_step = step - if "assembly" in step.spec: if step.spec["assembly"]: steps.insert(i, Step(step_type="instructions", spec={})) diff --git a/src/ui/test_pipe_cutter/test_pipe_cutter.py b/src/ui/test_pipe_cutter/test_pipe_cutter.py index 9f4f3a6..ec298c0 100644 --- a/src/ui/test_pipe_cutter/test_pipe_cutter.py +++ b/src/ui/test_pipe_cutter/test_pipe_cutter.py @@ -6,6 +6,16 @@ from PyQt5.QtCore import QByteArray logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) +def get(self, *args, **kwargs): + """ + Retrieve the current cutting length and update the interface. + """ + try: + self.current_cut_length = self.components["pipe_cutter"]._get_length() + logger.info(f"Current cut length: {self.current_cut_length}") + self.visualize() + except Exception as e: + logger.error(f"Failed to get current cut length: {e}") class Test_Pipe_Cutter(Test_Test): """ @@ -40,6 +50,7 @@ class Test_Pipe_Cutter(Test_Test): if step is not None : self.start_cutting() self.stop_cutting() + self.stop() return show def start_cutting(self,recipe=None,step=None): @@ -77,10 +88,11 @@ class Test_Pipe_Cutter(Test_Test): logger.error(f"Failed to stop the pipe cutting process: {e}") def stop(self): - self.components["pipe_cutter"].pause() self.disconnect(self.get_connection) - super().stop() + super().emit_ok() + + def reset_machine(self): """ @@ -91,4 +103,3 @@ class Test_Pipe_Cutter(Test_Test): except Exception as e: logger.error(f"Failed to reset the pipe cutter machine: {e}") -