From 87651775c754e268199ed0de2b4cba93e8b4b28b Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 27 Oct 2023 21:33:10 +0200 Subject: [PATCH 1/2] feat: add extruder panel settings Signed-off-by: Stefan Dej --- .../panels/Extruder/ExtruderPanelSettings.vue | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/components/panels/Extruder/ExtruderPanelSettings.vue diff --git a/src/components/panels/Extruder/ExtruderPanelSettings.vue b/src/components/panels/Extruder/ExtruderPanelSettings.vue new file mode 100644 index 000000000..edf57135f --- /dev/null +++ b/src/components/panels/Extruder/ExtruderPanelSettings.vue @@ -0,0 +1,37 @@ + + + From d3ed2214f569b82221cf119ffb9257e8a555a1e4 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 8 Dec 2023 23:37:55 +0100 Subject: [PATCH 2/2] feat: add option to hide parts of the ExtruderPanel Signed-off-by: Stefan Dej --- src/components/mixins/control.ts | 16 +++ .../Extruder/EstimatedExtrusionOutput.vue | 2 +- .../Extruder/ExtruderControlPanelControl.vue | 2 + .../Extruder/ExtruderControlPanelTools.vue | 18 +-- .../panels/Extruder/ExtruderPanelSettings.vue | 76 +++++++++- .../Extruder/ExtrusionFactorSettings.vue | 2 +- .../Extruder/FirmwareRetractionSettings.vue | 1 - .../Extruder/PressureAdvanceSettings.vue | 131 ++++++++---------- .../panels/ExtruderControlPanel.vue | 59 ++++++-- src/locales/de.json | 4 + src/locales/en.json | 4 + src/store/gui/index.ts | 7 + src/store/gui/types.ts | 7 + 13 files changed, 222 insertions(+), 107 deletions(-) diff --git a/src/components/mixins/control.ts b/src/components/mixins/control.ts index 8e4c6834e..0e669f1a4 100644 --- a/src/components/mixins/control.ts +++ b/src/components/mixins/control.ts @@ -1,5 +1,6 @@ import Vue from 'vue' import Component from 'vue-class-component' +import { PrinterStateMacro, PrinterStateToolchangeMacro } from '@/store/printer/types' @Component export default class ControlMixin extends Vue { @@ -83,6 +84,21 @@ export default class ControlMixin extends Vue { return this.homedAxes.includes('z') } + get macros() { + return this.$store.getters['printer/getMacros'] + } + + get toolchangeMacros(): PrinterStateToolchangeMacro[] { + return this.macros + .filter((macro: PrinterStateMacro) => macro.name.toUpperCase().match(/^T\d+/)) + .sort((a: PrinterStateMacro, b: PrinterStateMacro) => { + const numberA = parseInt(a.name.slice(1)) + const numberB = parseInt(b.name.slice(1)) + + return numberA - numberB + }) + } + doHome() { this.$store.dispatch('server/addEvent', { message: 'G28', type: 'command' }) this.$socket.emit('printer.gcode.script', { script: 'G28' }, { loading: 'homeAll' }) diff --git a/src/components/panels/Extruder/EstimatedExtrusionOutput.vue b/src/components/panels/Extruder/EstimatedExtrusionOutput.vue index 251cf1f23..6d252ed84 100644 --- a/src/components/panels/Extruder/EstimatedExtrusionOutput.vue +++ b/src/components/panels/Extruder/EstimatedExtrusionOutput.vue @@ -1,5 +1,5 @@ diff --git a/src/components/panels/Extruder/ExtruderControlPanelTools.vue b/src/components/panels/Extruder/ExtruderControlPanelTools.vue index 740d1f8a8..5248d26f8 100644 --- a/src/components/panels/Extruder/ExtruderControlPanelTools.vue +++ b/src/components/panels/Extruder/ExtruderControlPanelTools.vue @@ -1,5 +1,5 @@