From 329c5c5c110642cbfa247c462b8c30a92dc3ea4f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 30 Mar 2020 17:20:59 +0200 Subject: [PATCH] Rename pause duration to disarm timeout and set default to give same behavior as before The name wasn't really covering what it was doing. It wasn't setting the duration of the pause, it was setting the timeout for the stepper disarm. Also, ive set the defaults so that the behavior remains the same, unlesss a user explicitly enables this CURA-7331 --- .../PostProcessingPlugin/scripts/PauseAtHeight.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py index 204c259655..1ba8b8213b 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py @@ -49,14 +49,14 @@ class PauseAtHeight(Script): "minimum_value_warning": "1", "enabled": "pause_at == 'layer_no'" }, - "pause_duration": + "disarm_timeout": { - "label": "Pause Duration", - "description": "After this time steppers are going to disarm (meaning that they can easyly lose their positions)", + "label": "Disarm timeout", + "description": "After this time steppers are going to disarm (meaning that they can easily lose their positions). Set this to 0 if you don't want to set any duration.", "type": "int", - "value": "120", + "value": "0", "minimum_value": "0", - "minimum_value_warning": "30", + "minimum_value_warning": "0", "maximum_value_warning": "1800", "unit": "s" }, @@ -152,7 +152,7 @@ class PauseAtHeight(Script): pause_at = self.getSettingValueByKey("pause_at") pause_height = self.getSettingValueByKey("pause_height") pause_layer = self.getSettingValueByKey("pause_layer") - pause_duration = self.getSettingValueByKey("pause_duration") + disarm_timeout = self.getSettingValueByKey("disarm_timeout") retraction_amount = self.getSettingValueByKey("retraction_amount") retraction_speed = self.getSettingValueByKey("retraction_speed") extrude_amount = self.getSettingValueByKey("extrude_amount") @@ -320,7 +320,8 @@ class PauseAtHeight(Script): prepend_gcode += "M117 " + display_text + "\n" # Set the disarm timeout - prepend_gcode += self.putValue(M = 18, S = pause_duration) + " ; Set the disarm timeout\n" + if disarm_timeout > 0: + prepend_gcode += self.putValue(M = 18, S = disarm_timeout) + " ; Set the disarm timeout\n" # Wait till the user continues printing prepend_gcode += self.putValue(M = 0) + " ; Do the actual pause\n"