From 76c5e503037baaaf6719c85ff4f3e1665d5464cf Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 3 Nov 2023 23:41:10 +0100 Subject: [PATCH 1/3] feat: add buttons for PURGE_FILAMENT and CLEAN_NOZZLE in extruder panel Signed-off-by: Stefan Dej --- .../panels/ExtruderControlPanel.vue | 44 +++++++++++++++++++ src/locales/en.json | 2 + 2 files changed, 46 insertions(+) diff --git a/src/components/panels/ExtruderControlPanel.vue b/src/components/panels/ExtruderControlPanel.vue index ff2395c9b..e6a4e9aed 100644 --- a/src/components/panels/ExtruderControlPanel.vue +++ b/src/components/panels/ExtruderControlPanel.vue @@ -51,6 +51,32 @@ + + + + + + {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} + {{ minExtrudeTemp }} °C + + + + + + + @@ -106,6 +132,18 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin return this.macros.find((macro: PrinterStateMacro) => macro.name.toUpperCase() === 'UNLOAD_FILAMENT') } + get purgeFilamentMacro(): PrinterStateMacro | undefined { + const macros = ['PURGE_FILAMENT', 'FILAMENT_PURGE'] + + return this.macros.find((macro: PrinterStateMacro) => macros.includes(macro.name.toUpperCase())) + } + + get cleanNozzleMacro(): PrinterStateMacro | undefined { + const macros = ['CLEAN_NOZZLE', 'NOZZLE_CLEAN', 'WIPE_NOZZLE', 'NOZZLE_WIPE'] + + return this.macros.find((macro: PrinterStateMacro) => macros.includes(macro.name.toUpperCase())) + } + /** * test if the load and unload macro include specific keywords. if true, we allow * execution of that macro even if at the current time extrudePossible === false @@ -122,6 +160,12 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin return this.heatWaitGcodes.some((gcode) => this.unloadFilamentMacro?.prop.gcode.includes(gcode)) } + get canExecutePurgeMacro(): boolean { + if (this.extrudePossible) return true + + return this.heatWaitGcodes.some((gcode) => this.purgeFilamentMacro?.prop.gcode.includes(gcode)) + } + get showFilamentMacros(): boolean { return this.loadFilamentMacro !== undefined || this.unloadFilamentMacro !== undefined } diff --git a/src/locales/en.json b/src/locales/en.json index d37a31640..ae067d0a4 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -536,6 +536,7 @@ "Panels": { "ExtruderControlPanel": { "Allowed": "Allowed", + "CleanNozzle": "Clean Nozzle", "EstimatedExtrusion": "Extrusion:", "Extrude": "Extrude", "ExtruderTempTooLow": "Extruder temp. <", @@ -550,6 +551,7 @@ }, "Headline": "Extruder", "LoadFilament": "Load Filament", + "PurgeFilament": "Purge Filament", "PressureAdvanceSettings": { "Advance": "Pressure Advance", "Extruder": "Extruder", From 9ffca525015cfb94b2e14e4df40138f613fb7987 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 3 Nov 2023 23:41:20 +0100 Subject: [PATCH 2/3] locale(de): add german locale Signed-off-by: Stefan Dej --- src/locales/de.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/locales/de.json b/src/locales/de.json index 8d0290c99..5e727b86b 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -536,6 +536,7 @@ "Panels": { "ExtruderControlPanel": { "Allowed": "Erlaubt", + "CleanNozzle": "Düse reinigen", "EstimatedExtrusion": "Extrusion:", "Extrude": "Extrudieren", "ExtruderTempTooLow": "Extruder Temp. <", @@ -550,6 +551,7 @@ }, "Headline": "Extruder", "LoadFilament": "Filament laden", + "PurgeFilament": "Filament reinigen", "PressureAdvanceSettings": { "Advance": "Pressure Advance", "Extruder": "Extruder", From 42bdfc5d06c35147549292e02a799d7d41d80e36 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 3 Nov 2023 23:47:23 +0100 Subject: [PATCH 3/3] style: fix lint issue in locale files Signed-off-by: Stefan Dej --- src/locales/de.json | 2 +- src/locales/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/de.json b/src/locales/de.json index 5e727b86b..b6e494ec9 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -551,12 +551,12 @@ }, "Headline": "Extruder", "LoadFilament": "Filament laden", - "PurgeFilament": "Filament reinigen", "PressureAdvanceSettings": { "Advance": "Pressure Advance", "Extruder": "Extruder", "SmoothTime": "Smooth Time" }, + "PurgeFilament": "Filament reinigen", "Requested": "Angefordert", "Retract": "Rückzug", "TooLargeExtrusion": "Extrusion zu groß!", diff --git a/src/locales/en.json b/src/locales/en.json index ae067d0a4..5124825d5 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -551,12 +551,12 @@ }, "Headline": "Extruder", "LoadFilament": "Load Filament", - "PurgeFilament": "Purge Filament", "PressureAdvanceSettings": { "Advance": "Pressure Advance", "Extruder": "Extruder", "SmoothTime": "Smooth Time" }, + "PurgeFilament": "Purge Filament", "Requested": "Requested", "Retract": "Retract", "TooLargeExtrusion": "Extrusion too large!",