fix(ExtruderPanel): restore mode after extruding/retracting (#1965)

Co-authored-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Patrick Gehrsitz 2024-08-27 21:18:01 +02:00 committed by GitHub
parent 03ca19a8b3
commit cab5ea62b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,13 +263,21 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ExtruderMixi
} }
sendRetract(): void { sendRetract(): void {
const gcode = `M83\nG1 E-${this.feedamount} F${this.feedrate * 60}` const gcode =
`SAVE_GCODE_STATE NAME=ui_retract\n` +
`M83\n` +
`G1 E-${this.feedamount} F${this.feedrate * 60}\n` +
`RESTORE_GCODE_STATE NAME=ui_retract`
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnRetract' }) this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnRetract' })
} }
sendExtrude(): void { sendExtrude(): void {
const gcode = `M83\nG1 E${this.feedamount} F${this.feedrate * 60}` const gcode =
`SAVE_GCODE_STATE NAME=ui_extrude\n` +
`M83\n` +
`G1 E${this.feedamount} F${this.feedrate * 60}\n` +
`RESTORE_GCODE_STATE NAME=ui_extrude`
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnDetract' }) this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnDetract' })
} }