extruder: store currently sync'ed motion queue name
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
This commit is contained in:
parent
17f7c03921
commit
da8d4b0231
|
@ -126,6 +126,9 @@ The following information is available for extruder_stepper objects (as well as
|
||||||
[extruder](Config_Reference.md#extruder) objects):
|
[extruder](Config_Reference.md#extruder) objects):
|
||||||
- `pressure_advance`: The current [pressure advance](Pressure_Advance.md) value.
|
- `pressure_advance`: The current [pressure advance](Pressure_Advance.md) value.
|
||||||
- `smooth_time`: The current pressure advance smooth time.
|
- `smooth_time`: The current pressure advance smooth time.
|
||||||
|
- `motion_queue`: The name of the extruder that this extruder stepper is
|
||||||
|
currently synchronized to. This is reported as `None` if the extruder stepper
|
||||||
|
is not currently associated with an extruder.
|
||||||
|
|
||||||
## fan
|
## fan
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ class ExtruderStepper:
|
||||||
self.sk_extruder = ffi_main.gc(ffi_lib.extruder_stepper_alloc(),
|
self.sk_extruder = ffi_main.gc(ffi_lib.extruder_stepper_alloc(),
|
||||||
ffi_lib.free)
|
ffi_lib.free)
|
||||||
self.stepper.set_stepper_kinematics(self.sk_extruder)
|
self.stepper.set_stepper_kinematics(self.sk_extruder)
|
||||||
|
self.motion_queue = None
|
||||||
# Register commands
|
# Register commands
|
||||||
self.printer.register_event_handler("klippy:connect",
|
self.printer.register_event_handler("klippy:connect",
|
||||||
self._handle_connect)
|
self._handle_connect)
|
||||||
|
@ -49,7 +50,8 @@ class ExtruderStepper:
|
||||||
self._set_pressure_advance(self.config_pa, self.config_smooth_time)
|
self._set_pressure_advance(self.config_pa, self.config_smooth_time)
|
||||||
def get_status(self, eventtime):
|
def get_status(self, eventtime):
|
||||||
return {'pressure_advance': self.pressure_advance,
|
return {'pressure_advance': self.pressure_advance,
|
||||||
'smooth_time': self.pressure_advance_smooth_time}
|
'smooth_time': self.pressure_advance_smooth_time,
|
||||||
|
'motion_queue': self.motion_queue}
|
||||||
def find_past_position(self, print_time):
|
def find_past_position(self, print_time):
|
||||||
mcu_pos = self.stepper.get_past_mcu_position(print_time)
|
mcu_pos = self.stepper.get_past_mcu_position(print_time)
|
||||||
return self.stepper.mcu_to_commanded_position(mcu_pos)
|
return self.stepper.mcu_to_commanded_position(mcu_pos)
|
||||||
|
@ -58,6 +60,7 @@ class ExtruderStepper:
|
||||||
toolhead.flush_step_generation()
|
toolhead.flush_step_generation()
|
||||||
if not extruder_name:
|
if not extruder_name:
|
||||||
self.stepper.set_trapq(None)
|
self.stepper.set_trapq(None)
|
||||||
|
self.motion_queue = None
|
||||||
return
|
return
|
||||||
extruder = self.printer.lookup_object(extruder_name, None)
|
extruder = self.printer.lookup_object(extruder_name, None)
|
||||||
if extruder is None or not isinstance(extruder, PrinterExtruder):
|
if extruder is None or not isinstance(extruder, PrinterExtruder):
|
||||||
|
@ -65,6 +68,7 @@ class ExtruderStepper:
|
||||||
% (extruder_name,))
|
% (extruder_name,))
|
||||||
self.stepper.set_position([extruder.last_position, 0., 0.])
|
self.stepper.set_position([extruder.last_position, 0., 0.])
|
||||||
self.stepper.set_trapq(extruder.get_trapq())
|
self.stepper.set_trapq(extruder.get_trapq())
|
||||||
|
self.motion_queue = extruder_name
|
||||||
def _set_pressure_advance(self, pressure_advance, smooth_time):
|
def _set_pressure_advance(self, pressure_advance, smooth_time):
|
||||||
old_smooth_time = self.pressure_advance_smooth_time
|
old_smooth_time = self.pressure_advance_smooth_time
|
||||||
if not self.pressure_advance:
|
if not self.pressure_advance:
|
||||||
|
|
Loading…
Reference in New Issue