From 54b990c0bd32dc7d2ee231a3453e89cb8440e954 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 9 Jul 2018 11:21:16 +0200 Subject: [PATCH] Retract further if we can't set the temperature to stand-by temp Because we can't set the temperature and we don't know the correct temperature to set it back to, we will just retract further in order to prevent damage to the material. Contributes to issue CURA-5491. --- .../PostProcessingPlugin/scripts/PauseAtHeight.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py index 545db24048..6354dd4f04 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py @@ -266,8 +266,10 @@ class PauseAtHeight(Script): # Retraction prepend_gcode += self.putValue(M = 83) + "\n" if retraction_amount != 0: - if firmware_retract: - prepend_gcode += self.putValue(G = 10) + if firmware_retract: #Can't set the distance directly to what the user wants. We have to choose ourselves. + retraction_count = 1 if control_temperatures else 3 #Retract more if we don't control the temperature. + for i in range(retraction_count): + prepend_gcode += self.putValue(G = 10) + "\n" else: prepend_gcode += self.putValue(G = 1, E = -retraction_amount, F = retraction_speed * 60) + "\n" @@ -309,8 +311,10 @@ class PauseAtHeight(Script): prepend_gcode += self.putValue(G = 1, Z = current_z + 1, F = 300) + "\n" prepend_gcode += self.putValue(G = 1, X = x, Y = y, F = 9000) + "\n" if retraction_amount != 0: - if firmware_retract: - prepend_gcode += self.putValue(G = 11) + if firmware_retract: #Can't set the distance directly to what the user wants. We have to choose ourselves. + retraction_count = 1 if control_temperatures else 3 #Retract more if we don't control the temperature. + for i in range(retraction_count): + prepend_gcode += self.putValue(G = 11) + "\n" else: prepend_gcode += self.putValue(G = 1, E = retraction_amount, F = retraction_speed * 60) + "\n" prepend_gcode += self.putValue(G = 1, F = 9000) + "\n"