From e60ee861f883059d80f32f27f254a9a96f1acf16 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 7 Jun 2019 10:42:22 -0400 Subject: [PATCH] extruder: Use template evaluation on gcode Signed-off-by: Kevin O'Connor --- klippy/kinematics/extruder.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index 14540d74..11d00703 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -41,8 +41,11 @@ class PrinterExtruder: self.stepper.set_max_jerk(9999999.9, 9999999.9) self.max_e_dist = config.getfloat( 'max_extrude_only_distance', 50., minval=0.) - self.activate_gcode = config.get('activate_gcode', '') - self.deactivate_gcode = config.get('deactivate_gcode', '') + gcode_macro = self.printer.try_load_module(config, 'gcode_macro') + self.activate_gcode = gcode_macro.load_template( + config, 'activate_gcode', '') + self.deactivate_gcode = gcode_macro.load_template( + config, 'deactivate_gcode', '') self.pressure_advance = config.getfloat( 'pressure_advance', 0., minval=0.) self.pressure_advance_lookahead_time = config.getfloat( @@ -75,8 +78,8 @@ class PrinterExtruder: return self.extrude_pos def get_activate_gcode(self, is_active): if is_active: - return self.activate_gcode - return self.deactivate_gcode + return self.activate_gcode.render() + return self.deactivate_gcode.render() def stats(self, eventtime): return self.heater.stats(eventtime) def motor_off(self, print_time):