virtual_sdcard: Define a default for on_gcode_error
If on_gcode_error is not specified, default to running the TURN_OFF_HEATERS command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -7,6 +7,12 @@ import os, sys, logging, io
|
||||
|
||||
VALID_GCODE_EXTS = ['gcode', 'g', 'gco']
|
||||
|
||||
DEFAULT_ERROR_GCODE = """
|
||||
{% if 'heaters' in printer %}
|
||||
TURN_OFF_HEATERS
|
||||
{% endif %}
|
||||
"""
|
||||
|
||||
class VirtualSD:
|
||||
def __init__(self, config):
|
||||
self.printer = config.get_printer()
|
||||
@@ -27,7 +33,7 @@ class VirtualSD:
|
||||
# Error handling
|
||||
gcode_macro = self.printer.load_object(config, 'gcode_macro')
|
||||
self.on_error_gcode = gcode_macro.load_template(
|
||||
config, 'on_error_gcode', '')
|
||||
config, 'on_error_gcode', DEFAULT_ERROR_GCODE)
|
||||
# Register commands
|
||||
self.gcode = self.printer.lookup_object('gcode')
|
||||
for cmd in ['M20', 'M21', 'M23', 'M24', 'M25', 'M26', 'M27']:
|
||||
|
||||
Reference in New Issue
Block a user