Skip to content

Commit

Permalink
fix: fix some issues with unreadable values in the control panel (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored May 16, 2022
1 parent 35716ea commit 257c317
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 34 deletions.
24 changes: 20 additions & 4 deletions src/components/mixins/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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' })
Expand Down
15 changes: 0 additions & 15 deletions src/components/panels/ToolheadControls/CrossControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
15 changes: 0 additions & 15 deletions src/components/panels/ToolheadControls/MoveToControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 257c317

Please sign in to comment.