mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Restore feedrate at end of Pause at Height script
CURA-6799
This commit is contained in:
parent
5a95788493
commit
e51efe6cbc
1 changed files with 13 additions and 1 deletions
|
@ -4,6 +4,8 @@
|
||||||
from ..Script import Script
|
from ..Script import Script
|
||||||
|
|
||||||
from UM.Application import Application #To get the current printer's settings.
|
from UM.Application import Application #To get the current printer's settings.
|
||||||
|
from UM.Logger import Logger
|
||||||
|
|
||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
|
|
||||||
class PauseAtHeight(Script):
|
class PauseAtHeight(Script):
|
||||||
|
@ -152,6 +154,7 @@ class PauseAtHeight(Script):
|
||||||
# use offset to calculate the current height: <current_height> = <current_z> - <layer_0_z>
|
# use offset to calculate the current height: <current_height> = <current_z> - <layer_0_z>
|
||||||
layer_0_z = 0
|
layer_0_z = 0
|
||||||
current_z = 0
|
current_z = 0
|
||||||
|
current_f = 0
|
||||||
got_first_g_cmd_on_layer_0 = False
|
got_first_g_cmd_on_layer_0 = False
|
||||||
current_t = 0 #Tracks the current extruder for tracking the target temperature.
|
current_t = 0 #Tracks the current extruder for tracking the target temperature.
|
||||||
target_temperature = {} #Tracks the current target temperature for each extruder.
|
target_temperature = {} #Tracks the current target temperature for each extruder.
|
||||||
|
@ -185,6 +188,10 @@ class PauseAtHeight(Script):
|
||||||
if not layers_started:
|
if not layers_started:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# If a F instruction is in the line, read the current F
|
||||||
|
if self.getValue(line, "F") is not None:
|
||||||
|
current_f = self.getValue(line, "F")
|
||||||
|
|
||||||
# If a Z instruction is in the line, read the current Z
|
# If a Z instruction is in the line, read the current Z
|
||||||
if self.getValue(line, "Z") is not None:
|
if self.getValue(line, "Z") is not None:
|
||||||
current_z = self.getValue(line, "Z")
|
current_z = self.getValue(line, "Z")
|
||||||
|
@ -320,7 +327,12 @@ class PauseAtHeight(Script):
|
||||||
prepend_gcode += self.putValue(G = 11) + "\n"
|
prepend_gcode += self.putValue(G = 11) + "\n"
|
||||||
else:
|
else:
|
||||||
prepend_gcode += self.putValue(G = 1, E = retraction_amount, F = retraction_speed * 60) + "\n"
|
prepend_gcode += self.putValue(G = 1, E = retraction_amount, F = retraction_speed * 60) + "\n"
|
||||||
prepend_gcode += self.putValue(G = 1, F = 9000) + "\n"
|
|
||||||
|
if current_f != 0:
|
||||||
|
prepend_gcode += self.putValue(G = 1, F = current_f) + "\n"
|
||||||
|
else:
|
||||||
|
Logger.log("w", "No previous feedrate found in gcode, feedrate for next layer(s) might be incorrect")
|
||||||
|
|
||||||
prepend_gcode += self.putValue(M = 82) + " ; switch back to absolute E values\n"
|
prepend_gcode += self.putValue(M = 82) + " ; switch back to absolute E values\n"
|
||||||
|
|
||||||
# reset extrude value to pre pause value
|
# reset extrude value to pre pause value
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue