Rebuilt the "Move to [XY|Z] zero?" dialogs in Svelte.

This commit is contained in:
David Carley
2022-08-23 07:20:45 +00:00
parent baf3ef4b7e
commit 5a65ffaba2
6 changed files with 82 additions and 49 deletions

View File

@@ -48,8 +48,6 @@ module.exports = {
c: false
},
ask_home: true,
ask_zero_xy_msg: false,
ask_zero_z_msg: false,
showGcodeMessage: false
}
},
@@ -244,7 +242,6 @@ module.exports = {
SvelteComponents.registerControllerMethods({
stop: (...args) => this.stop(...args),
send: (...args) => this.send(...args),
goto_zero: (...args) => this.goto_zero(...args),
isAxisHomed: (axis) => this[axis].homed,
unhome: (...args) => this.unhome(...args),
set_position: (...args) => this.set_position(...args),
@@ -253,18 +250,6 @@ module.exports = {
},
methods: {
goto_zero(zero_x, zero_y, zero_z, zero_a) {
const xcmd = zero_x ? "X0" : "";
const ycmd = zero_y ? "Y0" : "";
const zcmd = zero_z ? "Z0" : "";
const acmd = zero_a ? "A0" : "";
this.ask_zero_xy_msg = false;
this.ask_zero_z_msg = false;
this.send('G90\nG0' + xcmd + ycmd + zcmd + acmd + '\n');
},
getJogIncrStyle(value) {
const weight = `font-weight:${this.jog_incr === value ? 'bold' : 'normal'}`;
const color = this.jog_incr === value ? "color:#0078e7" : "";