mirror of https://github.com/Desuuuu/klipper.git
homing_override: Use gcode_macro style templates on gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
7d246e2624
commit
79ecee0996
|
@ -10,7 +10,9 @@ class HomingOverride:
|
||||||
self.start_pos = [config.getfloat('set_position_' + a, None)
|
self.start_pos = [config.getfloat('set_position_' + a, None)
|
||||||
for a in 'xyz']
|
for a in 'xyz']
|
||||||
self.axes = config.get('axes', 'XYZ').upper()
|
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.in_script = False
|
||||||
self.gcode = self.printer.lookup_object('gcode')
|
self.gcode = self.printer.lookup_object('gcode')
|
||||||
self.gcode.register_command("G28", None)
|
self.gcode.register_command("G28", None)
|
||||||
|
@ -54,7 +56,7 @@ class HomingOverride:
|
||||||
# Perform homing
|
# Perform homing
|
||||||
try:
|
try:
|
||||||
self.in_script = True
|
self.in_script = True
|
||||||
self.gcode.run_script_from_command(self.script)
|
self.template.run_gcode_from_command()
|
||||||
finally:
|
finally:
|
||||||
self.in_script = False
|
self.in_script = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue