homing_override: Use gcode_macro style templates on gcode

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-04-02 22:09:37 -04:00
parent 7d246e2624
commit 79ecee0996
1 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,9 @@ class HomingOverride:
self.start_pos = [config.getfloat('set_position_' + a, None)
for a in 'xyz']
self.axes = config.get('axes', 'XYZ').upper()
self.script = config.get('gcode')
config.get('gcode')
gcode_macro = self.printer.try_load_module(config, 'gcode_macro')
self.template = gcode_macro.load_template(config, 'gcode')
self.in_script = False
self.gcode = self.printer.lookup_object('gcode')
self.gcode.register_command("G28", None)
@ -54,7 +56,7 @@ class HomingOverride:
# Perform homing
try:
self.in_script = True
self.gcode.run_script_from_command(self.script)
self.template.run_gcode_from_command()
finally:
self.in_script = False