Add option to set pause method gcode command

Contributes to #7198
This commit is contained in:
fieldOfView 2020-03-01 16:00:02 +01:00
parent 7c70ace8f0
commit a0a353e33c

View file

@ -25,7 +25,7 @@ class PauseAtHeight(Script):
"label": "Pause at",
"description": "Whether to pause at a certain height or at a certain layer.",
"type": "enum",
"options": {"height": "Height", "layer_no": "Layer No."},
"options": {"height": "Height", "layer_no": "Layer Number"},
"default_value": "height"
},
"pause_height":
@ -49,6 +49,14 @@ class PauseAtHeight(Script):
"minimum_value_warning": "1",
"enabled": "pause_at == 'layer_no'"
},
"pause_method":
{
"label": "Method",
"description": "The method or gcode command to use for pausing.",
"type": "enum",
"options": {"marlin": "Marlin (M0)", "bq": "BQ (M25)", "reprap": "RepRap (M226)", "repetier": "Repetier (@pause)"},
"default_value": "marlin"
},
"head_park_x":
{
"label": "Park Print Head X",
@ -155,6 +163,14 @@ class PauseAtHeight(Script):
initial_layer_height = Application.getInstance().getGlobalContainerStack().getProperty("layer_height_0", "value")
display_text = self.getSettingValueByKey("display_text")
pause_method = self.getSettingValueByKey("pause_method")
pause_command = {
"marlin": self.putValue(M = 0),
"bq": self.putValue(M = 25),
"reprap": self.putValue(M = 226),
"repetier": self.putValue("@pause")
}[pause_method]
is_griffin = False
# T = ExtruderManager.getInstance().getActiveExtruderStack().getProperty("material_print_temperature", "value")
@ -308,7 +324,7 @@ class PauseAtHeight(Script):
prepend_gcode += "M117 " + display_text + "\n"
# Wait till the user continues printing
prepend_gcode += self.putValue(M = 0) + " ; Do the actual pause\n"
prepend_gcode += pause_command + " ; Do the actual pause\n"
if not is_griffin:
if control_temperatures: