Skip to content

Commit

Permalink
refactor(ControlPanel): use SAVE/RESTORE_GCODE_STATE when sending mov…
Browse files Browse the repository at this point in the history
…e commands

Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Sep 1, 2024
1 parent 21dab39 commit a22820f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/mixins/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ export default class ControlMixin extends Vue {
}

doSendMove(gcode: string, feedrate: number) {
gcode = 'G91' + '\n' + 'G1 ' + gcode + ' F' + feedrate * 60

if (this.absolute_coordinates) gcode += '\nG90'
gcode =
`SAVE_GCODE_STATE NAME=ui_retract\n` +
`G91\n` +
`G1 ${gcode} F${feedrate * 60}\n` +
`RESTORE_GCODE_STATE NAME=ui_retract`

this.doSend(gcode)
}
Expand Down

0 comments on commit a22820f

Please sign in to comment.