Skip to content

Commit

Permalink
feat: hide axis controls during print
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Duerholt <[email protected]>
  • Loading branch information
Sebastian Duerholt committed Jul 1, 2023
1 parent 98a7509 commit fa9b3f3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/panels/ToolheadControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@
<!-- MOVE TO CONTROL -->
<move-to-control class="py-0 pt-3"></move-to-control>
<!-- AXIS CONTROL -->
<v-container>
<v-container v-if="axisControlVisible">
<component :is="`${controlStyle}-control`"></component>
</v-container>
<v-container v-if="!axisControlVisible" class="py-0 pt-3"></v-container>
<!-- Z-OFFSET CONTROL -->
<v-divider></v-divider>
<v-container>
Expand Down Expand Up @@ -164,5 +165,13 @@ export default class ToolheadControlPanel extends Mixins(BaseMixin, ControlMixin
get speedFactor(): number {
return this.$store.state.printer?.gcode_move?.speed_factor ?? 1
}
get isPrinting() {
return ['printing'].includes(this.printer_state)
}
get axisControlVisible() {
return !(this.isPrinting && (this.$store.state.gui.control.hideDuringPrint ?? false))
}
}
</script>
14 changes: 14 additions & 0 deletions src/components/settings/SettingsControlTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
</settings-row>
<v-divider class="my-2"></v-divider>
</template>
<settings-row
:title="$t('Settings.ControlTab.HideDuringPrint').toString()"
:dynamic-slot-width="true">
<v-switch v-model="hideDuringPrint" hide-details class="mt-0"></v-switch>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row
:title="$t('Settings.ControlTab.EnableXYHoming').toString()"
:dynamic-slot-width="true">
Expand Down Expand Up @@ -336,6 +342,14 @@ export default class SettingsControlTab extends Mixins(BaseMixin, ControlMixin)
this.$store.dispatch('gui/saveSetting', { name: 'control.style', value: newVal })
}
get hideDuringPrint(): Boolean {
return this.$store.state.gui.control.hideDuringPrint ?? false
}
set hideDuringPrint(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'control.hideDuringPrint', value: newVal })
}
get actionOptions() {
let actions = [
{
Expand Down
1 change: 1 addition & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@
"Circle": "Kreis",
"Control": "Steuerung",
"Cross": "Kreuz",
"HideDuringPrint": "Achsensteuerung während des Drucks ausblenden",
"EnableXYHoming": "Aktiviere kombiniertes X & Y homing",
"EstimatedExtrusionInfo": "Zeige Info zur geschätzten Extrusion",
"EstimatedExtrusionInfoDescription": "Anzeigen/ausblenden der Info zur geschätzten Extrusion, basierend auf Extrusionmenge und Extrusionsgeschwindigkeit",
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@
"Circle": "Circle",
"Control": "Control",
"Cross": "Cross",
"HideDuringPrint": "Hide axis controls during print",
"EnableXYHoming": "Enable combined X & Y axes homing",
"EstimatedExtrusionInfo": "Show estimated extrusion info",
"EstimatedExtrusionInfoDescription": "Show / Hide info for estimated extrusions based on extrusion amount and feedrate",
Expand Down
1 change: 1 addition & 0 deletions src/store/gui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const getDefaultState = (): GuiState => {
control: {
style: 'bars',
actionButton: null,
hideDuringPrint: false,
enableXYHoming: false,
feedrateXY: 100,
stepsXY: [100, 10, 1],
Expand Down
1 change: 1 addition & 0 deletions src/store/gui/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface GuiState {
console?: GuiConsoleState
control: {
style: 'bars' | 'circle' | 'cross'
hideDuringPrint: boolean
actionButton: null | 'm84' | 'qgl' | 'ztilt'
enableXYHoming: boolean
feedrateXY: number
Expand Down

0 comments on commit fa9b3f3

Please sign in to comment.