gcode_move: Fix M114 when extra axes are defined

Commit d40fd219 added support for defining extra axes, however that
change could break the M114 command.  Update the code to fix M114.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2025-08-31 12:17:37 -04:00
parent 3aadda6fb3
commit 179a56ce92
2 changed files with 6 additions and 2 deletions

View File

@ -92,7 +92,7 @@ class GCodeMove:
def _get_gcode_position(self):
p = [lp - bp for lp, bp in zip(self.last_position, self.base_position)]
p[3] /= self.extrude_factor
return p
return p[:4]
def _get_gcode_speed(self):
return self.speed / self.speed_factor
def _get_gcode_speed_override(self):
@ -107,7 +107,7 @@ class GCodeMove:
'absolute_extrude': self.absolute_extrude,
'homing_origin': self.Coord(*self.homing_position[:4]),
'position': self.Coord(*self.last_position[:4]),
'gcode_position': self.Coord(*move_position[:4]),
'gcode_position': self.Coord(*move_position),
}
def reset_last_position(self):
if self.is_printer_ready:

View File

@ -33,6 +33,10 @@ G28
G1 X20 Y20 Z10
G1 A10 X22
# Verify position query commands work with extra axis
GET_POSITION
M114
# Test unregistering
MANUAL_STEPPER STEPPER=basic_stepper GCODE_AXIS=
G1 X15