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:
Kevin O'Connor 2019-11-06 08:41:50 -05:00
parent 257058981e
commit 86121ff79e
7 changed files with 30 additions and 30 deletions

View file

@ -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)