From 2bd7b1555b1f1c08d5f8b17ed2040b0c748bdb61 Mon Sep 17 00:00:00 2001 From: GregValiant <64202104+GregValiant@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:43:15 -0500 Subject: [PATCH] Update MaxVolumetricSpeed.py Added a hard "Max E Speed Reset" to the end of the gcode. Update MaxVolumetricSpeed.py Revised the regular expression. --- plugins/PostProcessingPlugin/scripts/MaxVolumetricSpeed.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/MaxVolumetricSpeed.py b/plugins/PostProcessingPlugin/scripts/MaxVolumetricSpeed.py index 150a16caf1c..7e27ef6d03e 100644 --- a/plugins/PostProcessingPlugin/scripts/MaxVolumetricSpeed.py +++ b/plugins/PostProcessingPlugin/scripts/MaxVolumetricSpeed.py @@ -77,7 +77,7 @@ def execute(self, data): max_e_flow_rate = self.getSettingValueByKey("max_E_flow_rate") # Adjust the search parameter depending on Firmware Retraction if not firmware_retraction: - search_string = "G1 F(\d*\d.?) E(-?\d.*)" + search_string = "G1 F(\d+\.\d+|\d+) E(-?\d+\.\d+|-?\d+)" else: search_string = "G1[0-1]" # Calculate the E Speed Maximum for the print @@ -95,4 +95,6 @@ def execute(self, data): if re.search(search_regex, line) is not None: lines[index] = f"M203 E{speed_e_reset}\n" + line + f"\nM203 E{speed_e_max}" data[num] = "\n".join(lines) + # Reset the E speed at the end of the print + data[len(data)-1] = "M203 E" + str(speed_e_reset) + " ; Reset max E speed\n" + data[len(data)-1] return data