fix: fix some issues with unreadable values in the control panel (#817)

This commit is contained in:
Stefan Dej
2022-05-17 00:09:34 +02:00
committed by GitHub
parent 35716eae24
commit 257c31790f
3 changed files with 20 additions and 34 deletions

View File

@@ -7,10 +7,6 @@ export default class ControlMixin extends Vue {
return this.$store.state.printer?.gcode_move?.absolute_coordinates ?? true
}
get homedAxes(): string {
return this.$store.state.printer?.toolhead?.homed_axes ?? ''
}
get enableXYHoming(): boolean {
return this.$store.state.gui.control.enableXYHoming
}
@@ -63,6 +59,26 @@ export default class ControlMixin extends Vue {
return this.$store.getters['gui/getDefaultControlActionButton']
}
/**
* Axes home states
*/
get homedAxes(): string {
return this.$store.state.printer?.toolhead?.homed_axes ?? ''
}
get xAxisHomed(): boolean {
return this.homedAxes.includes('x')
}
get yAxisHomed(): boolean {
return this.homedAxes.includes('y')
}
get zAxisHomed(): boolean {
return this.homedAxes.includes('z')
}
doHome() {
this.$store.dispatch('server/addEvent', { message: 'G28', type: 'command' })
this.$socket.emit('printer.gcode.script', { script: 'G28' }, { loading: 'homeAll' })

View File

@@ -417,20 +417,5 @@ export default class CrossControl extends Mixins(BaseMixin, ControlMixin) {
get stepsReversed() {
return Array.from(new Set([...(this.stepsAll ?? [])])).sort((a, b) => a - b)
}
/**
* Axes home states
*/
get xAxisHomed(): boolean {
return this.$store.state.printer.toolhead?.homed_axes.includes('x') ?? false
}
get yAxisHomed(): boolean {
return this.$store.state.printer.toolhead?.homed_axes.includes('y') ?? false
}
get zAxisHomed(): boolean {
return this.$store.state.printer.toolhead?.homed_axes.includes('z') ?? false
}
}
</script>

View File

@@ -97,21 +97,6 @@ export default class MoveToControl extends Mixins(BaseMixin, ControlMixin) {
this.input.z.pos = newVal
}
/**
* Axes home states
*/
get xAxisHomed(): boolean {
return this.$store.state.printer.toolhead?.homed_axes.includes('x') ?? false
}
get yAxisHomed(): boolean {
return this.$store.state.printer.toolhead?.homed_axes.includes('y') ?? false
}
get zAxisHomed(): boolean {
return this.$store.state.printer.toolhead?.homed_axes.includes('z') ?? false
}
/**
* Axis limits
*/