mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 07:04:01 -06:00
toolhead: Calculate and store axes_r in move class
Calculate the ratio of axis distance to total move distance (axis_d / move_d) and store in a new member variable axes_r. This avoids needing to recalculate the value in other code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
257058981e
commit
86121ff79e
7 changed files with 30 additions and 30 deletions
|
@ -54,11 +54,11 @@ class ManualStepper:
|
|||
self.sync_print_time()
|
||||
cp = self.stepper.get_commanded_position()
|
||||
dist = movepos - cp
|
||||
accel_t, cruise_t, cruise_v = force_move.calc_move_time(
|
||||
axis_r, accel_t, cruise_t, cruise_v = force_move.calc_move_time(
|
||||
dist, speed, accel)
|
||||
self.trapq_append(self.trapq, self.next_cmd_time,
|
||||
accel_t, cruise_t, accel_t,
|
||||
cp, 0., 0., dist, 0., 0.,
|
||||
cp, 0., 0., axis_r, 0., 0.,
|
||||
0., cruise_v, accel)
|
||||
self.next_cmd_time += accel_t + cruise_t + accel_t
|
||||
self.stepper.generate_steps(self.next_cmd_time)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue