gcode_move: Export extra axes in status reference

Change "homing_origin" and "position" to support more than 4
components.  Export a new "axis_map" value to describe the contents at
each component index.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-10-09 21:43:59 -04:00
parent d0b1b832dd
commit ac6cab9168

View File

@@ -107,9 +107,10 @@ class GCodeMove:
'extrude_factor': self.extrude_factor, 'extrude_factor': self.extrude_factor,
'absolute_coordinates': self.absolute_coord, 'absolute_coordinates': self.absolute_coord,
'absolute_extrude': self.absolute_extrude, 'absolute_extrude': self.absolute_extrude,
'homing_origin': self.Coord(self.homing_position[:4]), 'homing_origin': self.Coord(self.homing_position),
'position': self.Coord(self.last_position[:4]), 'position': self.Coord(self.last_position),
'gcode_position': self.Coord(move_position), 'gcode_position': self.Coord(move_position),
'axis_map': self.axis_map,
} }
def reset_last_position(self): def reset_last_position(self):
if self.is_printer_ready: if self.is_printer_ready:
@@ -122,7 +123,8 @@ class GCodeMove:
if ea is None: if ea is None:
continue continue
gcode_id = ea.get_axis_gcode_id() gcode_id = ea.get_axis_gcode_id()
if gcode_id is None or gcode_id in axis_map or gcode_id in "FN": if (gcode_id is None or len(gcode_id) != 1 or not gcode_id.isupper()
or gcode_id in axis_map or gcode_id in "FN"):
continue continue
axis_map[gcode_id] = index axis_map[gcode_id] = index
self.axis_map = axis_map self.axis_map = axis_map