mirror of https://github.com/Desuuuu/klipper.git
extruder: Verify trapq is unmodified on default SET_PRESSURE_ADVANCE
Check that a SET_PRESSURE_ADVANCE without an explicit EXTRUDER parameter isn't done after the user disables or reassociates the extruder stepper motor (via SYNC_EXTRUDER_MOTION). Otherwise, it could lead to very confusing results. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
4815a946c2
commit
fe2974b8ec
|
@ -81,6 +81,9 @@ class ExtruderStepper:
|
||||||
extruder = self.printer.lookup_object('toolhead').get_extruder()
|
extruder = self.printer.lookup_object('toolhead').get_extruder()
|
||||||
if extruder.extruder_stepper is None:
|
if extruder.extruder_stepper is None:
|
||||||
raise gcmd.error("Active extruder does not have a stepper")
|
raise gcmd.error("Active extruder does not have a stepper")
|
||||||
|
strapq = extruder.extruder_stepper.stepper.get_trapq()
|
||||||
|
if strapq is not extruder.get_trapq():
|
||||||
|
raise gcmd.error("Unable to infer active extruder stepper")
|
||||||
extruder.extruder_stepper.cmd_SET_PRESSURE_ADVANCE(gcmd)
|
extruder.extruder_stepper.cmd_SET_PRESSURE_ADVANCE(gcmd)
|
||||||
def cmd_SET_PRESSURE_ADVANCE(self, gcmd):
|
def cmd_SET_PRESSURE_ADVANCE(self, gcmd):
|
||||||
pressure_advance = gcmd.get_float('ADVANCE', self.pressure_advance,
|
pressure_advance = gcmd.get_float('ADVANCE', self.pressure_advance,
|
||||||
|
|
|
@ -197,6 +197,8 @@ class MCU_stepper:
|
||||||
raise error("Internal error in stepcompress")
|
raise error("Internal error in stepcompress")
|
||||||
self._set_mcu_position(last_pos)
|
self._set_mcu_position(last_pos)
|
||||||
self._mcu.get_printer().send_event("stepper:sync_mcu_position", self)
|
self._mcu.get_printer().send_event("stepper:sync_mcu_position", self)
|
||||||
|
def get_trapq(self):
|
||||||
|
return self._trapq
|
||||||
def set_trapq(self, tq):
|
def set_trapq(self, tq):
|
||||||
ffi_main, ffi_lib = chelper.get_ffi()
|
ffi_main, ffi_lib = chelper.get_ffi()
|
||||||
if tq is None:
|
if tq is None:
|
||||||
|
|
Loading…
Reference in New Issue