From ad0b4357274b53fd18ecd324140831281aac561e Mon Sep 17 00:00:00 2001 From: "Crom (Thibaut CHARLES)" Date: Fri, 29 Mar 2024 19:44:30 +0100 Subject: [PATCH] feat: Allow extruder moves when force move is enabled Signed-off-by: Thibaut CHARLES --- .../widgets/toolhead/ExtruderMoves.vue | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/widgets/toolhead/ExtruderMoves.vue b/src/components/widgets/toolhead/ExtruderMoves.vue index 6f101deef9..ee78de2437 100644 --- a/src/components/widgets/toolhead/ExtruderMoves.vue +++ b/src/components/widgets/toolhead/ExtruderMoves.vue @@ -29,9 +29,10 @@ {{ $t('app.general.btn.retract') }} $chevronUp @@ -66,7 +67,8 @@ @@ -136,19 +138,19 @@ export default class ExtruderMoves extends Mixins(StateMixin, ToolheadMixin) { return this.$rules.numberLessThanOrEqual(this.maxExtrudeSpeed)(value) } - sendRetractGcode (amount: number, rate: number, wait?: string) { - if (this.valid) { - const gcode = `M83 - G1 E-${amount} F${rate * 60}` - this.sendGcode(gcode, wait) - } + get forceMove () { + return this.$store.state.config.uiSettings.toolhead.forceMove } sendExtrudeGcode (amount: number, rate: number, wait?: string) { if (this.valid) { - const gcode = `M83 - G1 E${amount} F${rate * 60}` - this.sendGcode(gcode, wait) + if (this.forceMove) { + const extruderName = this.$store.state.printer.printer.toolhead.extruder + this.sendGcode(`FORCE_MOVE STEPPER=${extruderName} DISTANCE=${amount} VELOCITY=${rate}`, wait) + } else { + this.sendGcode(`M83 + G1 E${amount} F${rate * 60}`, wait) + } } }