This commit is contained in:
edo-neo 2025-01-23 11:15:13 +01:00
parent 47b9d8aa4f
commit 561ab6c84d
2 changed files with 14 additions and 6 deletions

View File

@ -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={}))

View File

@ -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}")