Skip to content

Commit

Permalink
fix(extruderPanel): restore extrusion mode after extruding/retracting
Browse files Browse the repository at this point in the history
  • Loading branch information
mryel00 committed Aug 8, 2024
1 parent 85d898a commit a449a0b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,17 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ExtruderMixi
this.setFeedamount({ value: this.maxExtrudeOnlyDistance })
}
}
private counter: number = 0;
sendRetract(): void {
const gcode = `M83\nG1 E-${this.feedamount} F${this.feedrate * 60}`
this.counter++;
const gcode = `SAVE_GCODE_STATE NAME=mainsail_ui_retract${this.counter}\nM83\nG1 E-${this.feedamount} F${this.feedrate * 60}\nRESTORE_GCODE_STATE NAME=mainsail_ui_retract${this.counter}`
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnRetract' })
}
sendExtrude(): void {
const gcode = `M83\nG1 E${this.feedamount} F${this.feedrate * 60}`
this.counter++;
const gcode = `SAVE_GCODE_STATE NAME=mainsail_ui_extrude${this.counter}\nM83\nG1 E${this.feedamount} F${this.feedrate * 60}\nRESTORE_GCODE_STATE NAME=mainsail_ui_extrude${this.counter}`
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnDetract' })
}
Expand Down

0 comments on commit a449a0b

Please sign in to comment.