diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py index aa879ef889..314fc5a25d 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from ..Script import Script @@ -183,6 +183,21 @@ class PauseAtHeight(Script): }, "default_value": "RepRap (Marlin/Sprinter)", "enabled": false + "default_value": "" + }, + "custom_gcode_before_pause": + { + "label": "GCODE Before Pause", + "description": "Any custom GCODE to run before the pause, for example, M300 S440 P200 to beep.", + "type": "str", + "default_value": "M300 S440 P200; M300 S660 P250; M300 S880 P300;" + }, + "custom_gcode_after_pause": + { + "label": "GCODE After Pause", + "description": "Any custom GCODE to run after the pause, for example, M300 S440 P200 to beep.", + "type": "str", + "default_value": "" } } }""" @@ -235,6 +250,8 @@ class PauseAtHeight(Script): control_temperatures = Application.getInstance().getGlobalContainerStack().getProperty("machine_nozzle_temp_enabled", "value") initial_layer_height = Application.getInstance().getGlobalContainerStack().getProperty("layer_height_0", "value") display_text = self.getSettingValueByKey("display_text") + gcode_before = self.getSettingValueByKey("custom_gcode_before_pause") + gcode_after = self.getSettingValueByKey("custom_gcode_after_pause") pause_method = self.getSettingValueByKey("pause_method") pause_command = { @@ -411,9 +428,17 @@ class PauseAtHeight(Script): if disarm_timeout > 0: prepend_gcode += self.putValue(M = 18, S = disarm_timeout) + " ; Set the disarm timeout\n" + # Set a custom GCODE section before pause + if gcode_before: + prepend_gcode += gcode_before + "\n" + # Wait till the user continues printing prepend_gcode += pause_command + " ; Do the actual pause\n" + # Set a custom GCODE section before pause + if gcode_after: + prepend_gcode += gcode_after + "\n" + if pause_method == "repetier": #Push the filament back, if retraction_amount != 0: