itersolve: Export itersolve_calc_position_from_coord()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
97d976fc53
commit
e43ad4c953
|
@ -51,6 +51,8 @@ defs_itersolve = """
|
|||
void itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq);
|
||||
void itersolve_set_stepcompress(struct stepper_kinematics *sk
|
||||
, struct stepcompress *sc, double step_dist);
|
||||
double itersolve_calc_position_from_coord(struct stepper_kinematics *sk
|
||||
, double x, double y, double z);
|
||||
void itersolve_set_position(struct stepper_kinematics *sk
|
||||
, double x, double y, double z);
|
||||
double itersolve_get_commanded_pos(struct stepper_kinematics *sk);
|
||||
|
|
|
@ -226,7 +226,7 @@ itersolve_set_stepcompress(struct stepper_kinematics *sk
|
|||
sk->step_dist = step_dist;
|
||||
}
|
||||
|
||||
static double
|
||||
double __visible
|
||||
itersolve_calc_position_from_coord(struct stepper_kinematics *sk
|
||||
, double x, double y, double z)
|
||||
{
|
||||
|
|
|
@ -31,6 +31,8 @@ double itersolve_check_active(struct stepper_kinematics *sk, double flush_time);
|
|||
void itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq);
|
||||
void itersolve_set_stepcompress(struct stepper_kinematics *sk
|
||||
, struct stepcompress *sc, double step_dist);
|
||||
double itersolve_calc_position_from_coord(struct stepper_kinematics *sk
|
||||
, double x, double y, double z);
|
||||
void itersolve_set_position(struct stepper_kinematics *sk
|
||||
, double x, double y, double z);
|
||||
double itersolve_get_commanded_pos(struct stepper_kinematics *sk);
|
||||
|
|
|
@ -95,6 +95,9 @@ class MCU_stepper:
|
|||
return self._step_dist
|
||||
def is_dir_inverted(self):
|
||||
return self._invert_dir
|
||||
def calc_position_from_coord(self, coord):
|
||||
return self._ffi_lib.itersolve_calc_position_from_coord(
|
||||
self._stepper_kinematics, coord[0], coord[1], coord[2])
|
||||
def set_position(self, coord):
|
||||
opos = self.get_commanded_position()
|
||||
sk = self._stepper_kinematics
|
||||
|
@ -199,9 +202,11 @@ class PrinterRail:
|
|||
self.steppers = []
|
||||
self.endstops = []
|
||||
self.add_extra_stepper(config)
|
||||
self.get_commanded_position = self.steppers[0].get_commanded_position
|
||||
self.get_tag_position = self.steppers[0].get_tag_position
|
||||
self.set_tag_position = self.steppers[0].set_tag_position
|
||||
mcu_stepper = self.steppers[0]
|
||||
self.get_commanded_position = mcu_stepper.get_commanded_position
|
||||
self.get_tag_position = mcu_stepper.get_tag_position
|
||||
self.set_tag_position = mcu_stepper.set_tag_position
|
||||
self.calc_position_from_coord = mcu_stepper.calc_position_from_coord
|
||||
# Primary endstop position
|
||||
mcu_endstop = self.endstops[0][0]
|
||||
if hasattr(mcu_endstop, "get_position_endstop"):
|
||||
|
|
Loading…
Reference in New Issue