Skip to content

Commit

Permalink
Update MaxVolumetricSpeed.py
Browse files Browse the repository at this point in the history
Added a hard "Max E Speed Reset" to the end of the gcode.

Update MaxVolumetricSpeed.py

Revised the regular expression.
  • Loading branch information
GregValiant committed Nov 29, 2024
1 parent 9cfacea commit 2bd7b15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/PostProcessingPlugin/scripts/MaxVolumetricSpeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 2bd7b15

Please sign in to comment.