From 323c374cc4477a3a143b932fefb77929c70da7ec Mon Sep 17 00:00:00 2001 From: Rodrigo Sclosa Date: Thu, 23 Apr 2020 20:15:10 -0300 Subject: [PATCH 1/3] Included two fields on PauseAtHeight script for user to put custom GCODE before and after the pause, such as a beep code. --- plugins/PostProcessingPlugin/plugin.json | 2 +- .../scripts/PauseAtHeight.py | 24 +++++++++++++++++ .../scripts/PauseAtHeightforRepetier.py | 27 +++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/plugin.json b/plugins/PostProcessingPlugin/plugin.json index 21a7cedb75..9f74d54b2a 100644 --- a/plugins/PostProcessingPlugin/plugin.json +++ b/plugins/PostProcessingPlugin/plugin.json @@ -1,7 +1,7 @@ { "name": "Post Processing", "author": "Ultimaker", - "version": "2.2.1", + "version": "2.3.0", "api": "7.2.0", "description": "Extension that allows for user created scripts for post processing", "catalog": "cura" diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py index 1ba8b8213b..2d8a82c1d0 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py @@ -130,6 +130,20 @@ class PauseAtHeight(Script): "description": "Text that should appear on the display while paused. If left empty, there will not be any message.", "type": "str", "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": "" + }, + "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": "" } } }""" @@ -166,6 +180,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") is_griffin = False @@ -323,9 +339,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 += self.putValue(M = 0) + " ; Do the actual pause\n" + # Set a custom GCODE section before pause + if gcode_after: + prepend_gcode += gcode_after + "\n" + if not is_griffin: if control_temperatures: # Set extruder resume temperature diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py index 0353574289..ac80361e0d 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py @@ -67,6 +67,21 @@ class PauseAtHeightforRepetier(Script): "unit": "layers", "type": "int", "default_value": 0 + }, + , + "custom_gcode_before_pause": + { + "label": "GCODE Before Pause", + "description": "Any custom GCODE to run before the pause, for example, M300 S300 P1000 to beep.", + "type": "str", + "default_value": "" + }, + "custom_gcode_after_pause": + { + "label": "GCODE After Pause", + "description": "Any custom GCODE to run after the pause, for example, M300 S300 P1000 to beep.", + "type": "str", + "default_value": "" } } }""" @@ -84,6 +99,9 @@ class PauseAtHeightforRepetier(Script): move_Z = self.getSettingValueByKey("head_move_Z") layers_started = False redo_layers = self.getSettingValueByKey("redo_layers") + gcode_before = self.getSettingValueByKey("custom_gcode_before_pause") + gcode_after = self.getSettingValueByKey("custom_gcode_after_pause") + for layer in data: lines = layer.split("\n") for line in lines: @@ -132,9 +150,18 @@ class PauseAtHeightforRepetier(Script): #Disable the E steppers prepend_gcode += "M84 E0\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 now change filament and press continue printing ;Do the actual pause\n" + # Set a custom GCODE section before pause + if gcode_after: + prepend_gcode += gcode_after + "\n" + #Push the filament back, if retraction_amount != 0: prepend_gcode += "G1 E%f F6000\n" % (retraction_amount) From f9868a5aa4e7c436fb8f0078de48e57d8d4750d6 Mon Sep 17 00:00:00 2001 From: Rodrigo Sclosa Date: Thu, 30 Apr 2020 16:34:20 -0300 Subject: [PATCH 2/3] Revert "Included two fields on PauseAtHeight script for user to put custom GCODE before and after the pause, such as a beep code." This reverts commit 323c374cc4477a3a143b932fefb77929c70da7ec. --- plugins/PostProcessingPlugin/plugin.json | 2 +- .../scripts/PauseAtHeight.py | 24 ----------------- .../scripts/PauseAtHeightforRepetier.py | 27 ------------------- 3 files changed, 1 insertion(+), 52 deletions(-) diff --git a/plugins/PostProcessingPlugin/plugin.json b/plugins/PostProcessingPlugin/plugin.json index 9f74d54b2a..21a7cedb75 100644 --- a/plugins/PostProcessingPlugin/plugin.json +++ b/plugins/PostProcessingPlugin/plugin.json @@ -1,7 +1,7 @@ { "name": "Post Processing", "author": "Ultimaker", - "version": "2.3.0", + "version": "2.2.1", "api": "7.2.0", "description": "Extension that allows for user created scripts for post processing", "catalog": "cura" diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py index 2d8a82c1d0..1ba8b8213b 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py @@ -130,20 +130,6 @@ class PauseAtHeight(Script): "description": "Text that should appear on the display while paused. If left empty, there will not be any message.", "type": "str", "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": "" - }, - "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": "" } } }""" @@ -180,8 +166,6 @@ 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") is_griffin = False @@ -339,17 +323,9 @@ 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 += self.putValue(M = 0) + " ; Do the actual pause\n" - # Set a custom GCODE section before pause - if gcode_after: - prepend_gcode += gcode_after + "\n" - if not is_griffin: if control_temperatures: # Set extruder resume temperature diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py index ac80361e0d..0353574289 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py @@ -67,21 +67,6 @@ class PauseAtHeightforRepetier(Script): "unit": "layers", "type": "int", "default_value": 0 - }, - , - "custom_gcode_before_pause": - { - "label": "GCODE Before Pause", - "description": "Any custom GCODE to run before the pause, for example, M300 S300 P1000 to beep.", - "type": "str", - "default_value": "" - }, - "custom_gcode_after_pause": - { - "label": "GCODE After Pause", - "description": "Any custom GCODE to run after the pause, for example, M300 S300 P1000 to beep.", - "type": "str", - "default_value": "" } } }""" @@ -99,9 +84,6 @@ class PauseAtHeightforRepetier(Script): move_Z = self.getSettingValueByKey("head_move_Z") layers_started = False redo_layers = self.getSettingValueByKey("redo_layers") - gcode_before = self.getSettingValueByKey("custom_gcode_before_pause") - gcode_after = self.getSettingValueByKey("custom_gcode_after_pause") - for layer in data: lines = layer.split("\n") for line in lines: @@ -150,18 +132,9 @@ class PauseAtHeightforRepetier(Script): #Disable the E steppers prepend_gcode += "M84 E0\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 now change filament and press continue printing ;Do the actual pause\n" - # Set a custom GCODE section before pause - if gcode_after: - prepend_gcode += gcode_after + "\n" - #Push the filament back, if retraction_amount != 0: prepend_gcode += "G1 E%f F6000\n" % (retraction_amount) From d354c9f8ca0e53bbc7e124e35167de435c52e884 Mon Sep 17 00:00:00 2001 From: Rodrigo Sclosa Date: Thu, 30 Apr 2020 16:37:20 -0300 Subject: [PATCH 3/3] Included two fields on PauseAtHeight script for user to put custom GCODE before and after the pause, such as a beep code. --- .../scripts/PauseAtHeight.py | 24 +++++++++++++++++ .../scripts/PauseAtHeightforRepetier.py | 27 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py index 1ba8b8213b..ff4abedd38 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py @@ -130,6 +130,20 @@ class PauseAtHeight(Script): "description": "Text that should appear on the display while paused. If left empty, there will not be any message.", "type": "str", "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": "" } } }""" @@ -166,6 +180,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") is_griffin = False @@ -323,9 +339,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 += self.putValue(M = 0) + " ; Do the actual pause\n" + # Set a custom GCODE section before pause + if gcode_after: + prepend_gcode += gcode_after + "\n" + if not is_griffin: if control_temperatures: # Set extruder resume temperature diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py index 0353574289..f2f23c0459 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py @@ -67,6 +67,21 @@ class PauseAtHeightforRepetier(Script): "unit": "layers", "type": "int", "default_value": 0 + }, + , + "custom_gcode_before_pause": + { + "label": "GCODE Before Pause", + "description": "Any custom GCODE to run before the pause, for example, M300 S300 P1000 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 S300 P1000 to beep.", + "type": "str", + "default_value": "" } } }""" @@ -84,6 +99,9 @@ class PauseAtHeightforRepetier(Script): move_Z = self.getSettingValueByKey("head_move_Z") layers_started = False redo_layers = self.getSettingValueByKey("redo_layers") + gcode_before = self.getSettingValueByKey("custom_gcode_before_pause") + gcode_after = self.getSettingValueByKey("custom_gcode_after_pause") + for layer in data: lines = layer.split("\n") for line in lines: @@ -132,9 +150,18 @@ class PauseAtHeightforRepetier(Script): #Disable the E steppers prepend_gcode += "M84 E0\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 now change filament and press continue printing ;Do the actual pause\n" + # Set a custom GCODE section before pause + if gcode_after: + prepend_gcode += gcode_after + "\n" + #Push the filament back, if retraction_amount != 0: prepend_gcode += "G1 E%f F6000\n" % (retraction_amount)