From ddb8311890a130e3735d77fbb7fb24900a5152b2 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 22 Apr 2020 12:40:32 -0400 Subject: gcode: Create new wrapper class for gcode command parameters Instead of passing a dictionary to the command handlers, create a wrapper class and pass that class to the command handlers. This can simplify the command handler code. Signed-off-by: Kevin O'Connor --- klippy/extras/safe_z_home.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'klippy/extras/safe_z_home.py') diff --git a/klippy/extras/safe_z_home.py b/klippy/extras/safe_z_home.py index 4e0801c4..265cbf41 100644 --- a/klippy/extras/safe_z_home.py +++ b/klippy/extras/safe_z_home.py @@ -63,7 +63,8 @@ class SafeZHoming: if need_y: new_params['Y'] = '0' if new_params: - self.prev_G28(new_params) + g28_gcmd = self.gcode.create_gcode_command("G28", "G28", new_params) + self.prev_G28(g28_gcmd) # Home Z axis if necessary if need_z: # Move to safe XY homing position @@ -75,7 +76,8 @@ class SafeZHoming: toolhead.move(pos, self.speed) self.gcode.reset_last_position() # Home Z - self.prev_G28({'Z': '0'}) + g28_gcmd = self.gcode.create_gcode_command("G28", "G28", {'Z': '0'}) + self.prev_G28(g28_gcmd) # Perform Z Hop again for pressure-based probes pos = toolhead.get_position() if self.z_hop: -- cgit v1.2.3-70-g09d2