From a22820fcfae14fa8bed94e7aea64e76e7752de4e Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 1 Sep 2024 23:53:28 +0200 Subject: [PATCH] refactor(ControlPanel): use SAVE/RESTORE_GCODE_STATE when sending move commands Signed-off-by: Stefan Dej --- src/components/mixins/control.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/mixins/control.ts b/src/components/mixins/control.ts index 0e669f1a4..1361396de 100644 --- a/src/components/mixins/control.ts +++ b/src/components/mixins/control.ts @@ -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) }