Skip to content

Commit

Permalink
Updated multiple functions to accomodate U and V axes
Browse files Browse the repository at this point in the history
  • Loading branch information
nick3621 committed Dec 11, 2024
1 parent bad4bd4 commit 11ed6f2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions klippy/extras/gcode_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ def __init__(self, config):
self.Coord = gcode.Coord
# G-Code coordinate manipulation
self.absolute_coord = self.absolute_extrude = True
self.base_position = [0.0, 0.0, 0.0, 0.0]
self.last_position = [0.0, 0.0, 0.0, 0.0]
self.homing_position = [0.0, 0.0, 0.0, 0.0]
self.base_position = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
self.last_position = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
self.homing_position = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
self.speed = 25.0
self.speed_factor = 1.0 / 60.0
self.extrude_factor = 1.0
# G-Code state
self.saved_states = {}
self.move_transform = self.move_with_transform = None
self.position_with_transform = lambda: [0.0, 0.0, 0.0, 0.0]
self.position_with_transform = lambda: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

def _handle_ready(self):
self.is_printer_ready = True
Expand Down Expand Up @@ -209,7 +209,7 @@ def cmd_G91(self, gcmd):

def cmd_G92(self, gcmd):
# Set position
offsets = [gcmd.get_float(a, None) for a in "XYZE"]
offsets = [gcmd.get_float(a, None) for a in "XYZEUV"]
for i, offset in enumerate(offsets):
if offset is not None:
if i == 3:
Expand All @@ -221,7 +221,7 @@ def cmd_G92(self, gcmd):
def cmd_M114(self, gcmd):
# Get Current Position
p = self._get_gcode_position()
gcmd.respond_raw("X:%.3f Y:%.3f Z:%.3f E:%.3f" % tuple(p))
gcmd.respond_raw("X:%.3f Y:%.3f Z:%.3f E:%.3f U:%.3f V:%3f" % tuple(p))

def cmd_M220(self, gcmd):
# Set speed factor override percentage
Expand All @@ -240,7 +240,7 @@ def cmd_M221(self, gcmd):
cmd_SET_GCODE_OFFSET_help = "Set a virtual offset to g-code positions"

def cmd_SET_GCODE_OFFSET(self, gcmd):
move_delta = [0.0, 0.0, 0.0, 0.0]
move_delta = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
for pos, axis in enumerate("XYZE"):
offset = gcmd.get_float(axis, None)
if offset is None:
Expand Down Expand Up @@ -322,13 +322,13 @@ def cmd_GET_POSITION(self, gcmd):
]
)
gcode_pos = " ".join(
["%s:%.6f" % (a, v) for a, v in zip("XYZE", self.last_position)]
["%s:%.6f" % (a, v) for a, v in zip("XYZEUV", self.last_position)]
)
base_pos = " ".join(
["%s:%.6f" % (a, v) for a, v in zip("XYZE", self.base_position)]
["%s:%.6f" % (a, v) for a, v in zip("XYZEUV", self.base_position)]
)
homing_pos = " ".join(
["%s:%.6f" % (a, v) for a, v in zip("XYZ", self.homing_position)]
["%s:%.6f" % (a, v) for a, v in zip("XYZUV", self.homing_position)]
)
gcmd.respond_info(
"mcu: %s\n"
Expand Down

0 comments on commit 11ed6f2

Please sign in to comment.