cartesian: Remove the unnecessary StepList constant
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
890298d34d
commit
13acdf7832
|
@ -6,8 +6,6 @@
|
||||||
import logging
|
import logging
|
||||||
import stepper, homing, chelper
|
import stepper, homing, chelper
|
||||||
|
|
||||||
StepList = (0, 1, 2)
|
|
||||||
|
|
||||||
class CartKinematics:
|
class CartKinematics:
|
||||||
def __init__(self, toolhead, config):
|
def __init__(self, toolhead, config):
|
||||||
self.printer = config.get_printer()
|
self.printer = config.get_printer()
|
||||||
|
@ -111,14 +109,14 @@ class CartKinematics:
|
||||||
self.need_motor_enable = True
|
self.need_motor_enable = True
|
||||||
def _check_motor_enable(self, print_time, move):
|
def _check_motor_enable(self, print_time, move):
|
||||||
need_motor_enable = False
|
need_motor_enable = False
|
||||||
for i in StepList:
|
for i, rail in enumerate(self.rails):
|
||||||
if move.axes_d[i]:
|
if move.axes_d[i]:
|
||||||
self.rails[i].motor_enable(print_time, 1)
|
rail.motor_enable(print_time, 1)
|
||||||
need_motor_enable |= not self.rails[i].is_motor_enabled()
|
need_motor_enable |= not rail.is_motor_enabled()
|
||||||
self.need_motor_enable = need_motor_enable
|
self.need_motor_enable = need_motor_enable
|
||||||
def _check_endstops(self, move):
|
def _check_endstops(self, move):
|
||||||
end_pos = move.end_pos
|
end_pos = move.end_pos
|
||||||
for i in StepList:
|
for i in (0, 1, 2):
|
||||||
if (move.axes_d[i]
|
if (move.axes_d[i]
|
||||||
and (end_pos[i] < self.limits[i][0]
|
and (end_pos[i] < self.limits[i][0]
|
||||||
or end_pos[i] > self.limits[i][1])):
|
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.start_pos[0], move.start_pos[1], move.start_pos[2],
|
||||||
move.axes_d[0], move.axes_d[1], move.axes_d[2],
|
move.axes_d[0], move.axes_d[1], move.axes_d[2],
|
||||||
move.start_v, move.cruise_v, move.accel)
|
move.start_v, move.cruise_v, move.accel)
|
||||||
for i in StepList:
|
for i, rail in enumerate(self.rails):
|
||||||
if move.axes_d[i]:
|
if move.axes_d[i]:
|
||||||
self.rails[i].step_itersolve(self.cmove)
|
rail.step_itersolve(self.cmove)
|
||||||
# Dual carriage support
|
# Dual carriage support
|
||||||
def _activate_carriage(self, carriage):
|
def _activate_carriage(self, carriage):
|
||||||
toolhead = self.printer.lookup_object('toolhead')
|
toolhead = self.printer.lookup_object('toolhead')
|
||||||
|
|
Loading…
Reference in New Issue