cartesian: Remove the unnecessary StepList constant

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-06-22 13:20:17 -04:00
parent 890298d34d
commit 13acdf7832
1 changed files with 6 additions and 8 deletions

View File

@ -6,8 +6,6 @@
import logging
import stepper, homing, chelper
StepList = (0, 1, 2)
class CartKinematics:
def __init__(self, toolhead, config):
self.printer = config.get_printer()
@ -111,14 +109,14 @@ class CartKinematics:
self.need_motor_enable = True
def _check_motor_enable(self, print_time, move):
need_motor_enable = False
for i in StepList:
for i, rail in enumerate(self.rails):
if move.axes_d[i]:
self.rails[i].motor_enable(print_time, 1)
need_motor_enable |= not self.rails[i].is_motor_enabled()
rail.motor_enable(print_time, 1)
need_motor_enable |= not rail.is_motor_enabled()
self.need_motor_enable = need_motor_enable
def _check_endstops(self, move):
end_pos = move.end_pos
for i in StepList:
for i in (0, 1, 2):
if (move.axes_d[i]
and (end_pos[i] < self.limits[i][0]
or end_pos[i] > self.limits[i][1])):
@ -149,9 +147,9 @@ class CartKinematics:
move.start_pos[0], move.start_pos[1], move.start_pos[2],
move.axes_d[0], move.axes_d[1], move.axes_d[2],
move.start_v, move.cruise_v, move.accel)
for i in StepList:
for i, rail in enumerate(self.rails):
if move.axes_d[i]:
self.rails[i].step_itersolve(self.cmove)
rail.step_itersolve(self.cmove)
# Dual carriage support
def _activate_carriage(self, carriage):
toolhead = self.printer.lookup_object('toolhead')