From 3390caa65b6f724a4af93d66741fdc80bd68f601 Mon Sep 17 00:00:00 2001 From: HelgeKeck Date: Thu, 24 Oct 2024 14:31:28 +0200 Subject: [PATCH] Post Processor: fix new prusa slicer z-hop bug --- klippy/ratos.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/klippy/ratos.py b/klippy/ratos.py index 9e153f59..9631e374 100644 --- a/klippy/ratos.py +++ b/klippy/ratos.py @@ -79,7 +79,7 @@ def cmd_TEST_PROCESS_GCODE_FILE(self, gcmd): filename = gcmd.get('FILENAME', "") if filename[0] == '/': filename = filename[1:] - self.process_gode_file(filename, False) + self.process_gode_file(filename, True) self.dual_carriage = dual_carriage desc_HELLO_RATOS = "RatOS mainsail welcome message" @@ -403,11 +403,14 @@ def process_gode_file(self, filename, enable_post_processing): # toolchange retraction retraction_line = 0 + retraction_z_hop_line = 0 if tower_line == 0 and toolchange_line > 0: for i2 in range(20): if slicer_name == PRUSA_SLICER or slicer_name == SUPER_SLICER: if lines[toolchange_line + i2].rstrip().startswith("G1 E-"): retraction_line = toolchange_line + i2 + if lines[toolchange_line + i2 + 1].rstrip().startswith("G1 Z"): + retraction_z_hop_line = toolchange_line + i2 + 1 break elif slicer_name == ORCA_SLICER: if lines[toolchange_line - i2].rstrip().startswith("G1 E-"): @@ -482,6 +485,8 @@ def process_gode_file(self, filename, enable_post_processing): if retraction_line > 0 and extrusion_line > 0: lines[retraction_line] = REMOVED_BY_POST_PROCESSOR + lines[retraction_line].rstrip() + '\n' lines[extrusion_line] = REMOVED_BY_POST_PROCESSOR + lines[extrusion_line].rstrip() + '\n' + if retraction_z_hop_line > 0: + lines[retraction_z_hop_line] = REMOVED_BY_POST_PROCESSOR + lines[retraction_z_hop_line].rstrip() + '\n' # add START_PRINT parameters if (enable_post_processing):