diff options
author | Stefan Dej <meteyou@gmail.com> | 2021-08-31 19:37:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-31 13:37:48 -0400 |
commit | 3a497d04ac91b693075c79ad661f4de0c50a74f4 (patch) | |
tree | 817c70ce9aa456bf9dd5ada5f621c75d43576790 /klippy/toolhead.py | |
parent | caec91b1499db0fc18ca1e18fcacab58c25865c5 (diff) | |
download | kutter-3a497d04ac91b693075c79ad661f4de0c50a74f4.tar.gz kutter-3a497d04ac91b693075c79ad661f4de0c50a74f4.tar.xz kutter-3a497d04ac91b693075c79ad661f4de0c50a74f4.zip |
toolhead: change SET_VELOCITY_LIMIT respond (fixed) (#4620)
Returns only the current values if no new ones have been passed.
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r-- | klippy/toolhead.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 155848be..db2d47f4 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -553,25 +553,34 @@ class ToolHead: cmd_SET_VELOCITY_LIMIT_help = "Set printer velocity limits" def cmd_SET_VELOCITY_LIMIT(self, gcmd): print_time = self.get_last_move_time() - max_velocity = gcmd.get_float('VELOCITY', self.max_velocity, above=0.) - max_accel = gcmd.get_float('ACCEL', self.max_accel, above=0.) + max_velocity = gcmd.get_float('VELOCITY', None, above=0.) + max_accel = gcmd.get_float('ACCEL', None, above=0.) square_corner_velocity = gcmd.get_float( - 'SQUARE_CORNER_VELOCITY', self.square_corner_velocity, minval=0.) - self.requested_accel_to_decel = gcmd.get_float( - 'ACCEL_TO_DECEL', self.requested_accel_to_decel, above=0.) - self.max_velocity = max_velocity - self.max_accel = max_accel - self.square_corner_velocity = square_corner_velocity + 'SQUARE_CORNER_VELOCITY', None, minval=0.) + requested_accel_to_decel = gcmd.get_float( + 'ACCEL_TO_DECEL', None, above=0.) + if max_velocity is not None: + self.max_velocity = max_velocity + if max_accel is not None: + self.max_accel = max_accel + if square_corner_velocity is not None: + self.square_corner_velocity = square_corner_velocity + if requested_accel_to_decel is not None: + self.requested_accel_to_decel = requested_accel_to_decel self._calc_junction_deviation() msg = ("max_velocity: %.6f\n" "max_accel: %.6f\n" "max_accel_to_decel: %.6f\n" - "square_corner_velocity: %.6f"% ( + "square_corner_velocity: %.6f" % ( self.max_velocity, self.max_accel, self.requested_accel_to_decel, self.square_corner_velocity)) self.printer.set_rollover_info("toolhead", "toolhead: %s" % (msg,)) - gcmd.respond_info(msg, log=False) + if (max_velocity is None and + max_accel is None and + square_corner_velocity is None and + requested_accel_to_decel is None): + gcmd.respond_info(msg, log=False) def cmd_M204(self, gcmd): # Use S for accel accel = gcmd.get_float('S', None, above=0.) |