stepper: Add mcu_to_commanded_position() method
Convert stepper.get_past_commanded_position() to the more general stepper.mcu_to_commanded_position(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
f2d10b5729
commit
809f1ccea6
|
@ -155,7 +155,8 @@ class PrinterExtruder:
|
||||||
1., pressure_advance, 0.,
|
1., pressure_advance, 0.,
|
||||||
start_v, cruise_v, accel)
|
start_v, cruise_v, accel)
|
||||||
def find_past_position(self, print_time):
|
def find_past_position(self, print_time):
|
||||||
return self.stepper.get_past_commanded_position(print_time)
|
mcu_pos = self.stepper.get_past_mcu_position(print_time)
|
||||||
|
return self.stepper.mcu_to_commanded_position(mcu_pos)
|
||||||
def cmd_M104(self, gcmd, wait=False):
|
def cmd_M104(self, gcmd, wait=False):
|
||||||
# Set Extruder Temperature
|
# Set Extruder Temperature
|
||||||
temp = gcmd.get_float('S', 0.)
|
temp = gcmd.get_float('S', 0.)
|
||||||
|
|
|
@ -119,8 +119,7 @@ class MCU_stepper:
|
||||||
ffi_main, ffi_lib = chelper.get_ffi()
|
ffi_main, ffi_lib = chelper.get_ffi()
|
||||||
pos = ffi_lib.stepcompress_find_past_position(self._stepqueue, clock)
|
pos = ffi_lib.stepcompress_find_past_position(self._stepqueue, clock)
|
||||||
return int(pos)
|
return int(pos)
|
||||||
def get_past_commanded_position(self, print_time):
|
def mcu_to_commanded_position(self, mcu_pos):
|
||||||
mcu_pos = self.get_past_mcu_position(print_time)
|
|
||||||
return mcu_pos * self._step_dist - self._mcu_position_offset
|
return mcu_pos * self._step_dist - self._mcu_position_offset
|
||||||
def dump_steps(self, count, start_clock, end_clock):
|
def dump_steps(self, count, start_clock, end_clock):
|
||||||
ffi_main, ffi_lib = chelper.get_ffi()
|
ffi_main, ffi_lib = chelper.get_ffi()
|
||||||
|
|
Loading…
Reference in New Issue