Browse Source

Merge remote-tracking branch 'easygo/EasyG0ing1' into CURA-9822_pause_at_height_improvements

Remco Burema 2 years ago
parent
commit
1b12e99869
1 changed files with 5 additions and 5 deletions
  1. 5 5
      plugins/PostProcessingPlugin/scripts/PauseAtHeight.py

+ 5 - 5
plugins/PostProcessingPlugin/scripts/PauseAtHeight.py

@@ -2,7 +2,7 @@
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from ..Script import Script
-
+import re
 from UM.Application import Application #To get the current printer's settings.
 from UM.Logger import Logger
 
@@ -220,14 +220,14 @@ class PauseAtHeight(Script):
                 "custom_gcode_before_pause":
                 {
                     "label": "G-code Before Pause",
-                    "description": "Any custom g-code to run before the pause, for example, M300 S440 P200 to beep.",
+                    "description": "Any custom g-code to run before the pause, for example, M300 S440 P200 to beep. Separate multiple commands with a comma.",
                     "type": "str",
                     "default_value": ""
                 },
                 "custom_gcode_after_pause":
                 {
                     "label": "G-code After Pause",
-                    "description": "Any custom g-code to run after the pause, for example, M300 S440 P200 to beep.",
+                    "description": "Any custom g-code to run after the pause, for example, M300 S440 P200 to beep. Separate multiple commands with a comma.",
                     "type": "str",
                     "default_value": ""
                 }
@@ -284,8 +284,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")
+        gcode_before = re.sub("\\s*,\\s*", "\n", self.getSettingValueByKey("custom_gcode_before_pause"))
+        gcode_after = re.sub("\\s*,\\s*", "\n", self.getSettingValueByKey("custom_gcode_after_pause"))
         beep_at_pause = self.getSettingValueByKey("beep_at_pause")
         beep_length = self.getSettingValueByKey("beep_length")