From 84b782e8ada1ca5d7b3e12a5c206d688243f1e20 Mon Sep 17 00:00:00 2001 From: EiNSTeiN- Date: Wed, 15 Nov 2023 16:11:42 -0500 Subject: [PATCH 1/7] Show filament sensor state even when the sensor is disabled --- src/components/inputs/FilamentSensor.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/inputs/FilamentSensor.vue b/src/components/inputs/FilamentSensor.vue index 8e0565815..ac2967dc5 100644 --- a/src/components/inputs/FilamentSensor.vue +++ b/src/components/inputs/FilamentSensor.vue @@ -13,6 +13,7 @@ {{ convertName(name) }} {{ statusText }} + ({{ disabledText }}) {{ enabled ? mdiToggleSwitch : mdiToggleSwitchOffOutline }} @@ -51,11 +52,15 @@ export default class FilamentSensor extends Mixins(BaseMixin) { } get statusText() { - if (!this.enabled) return this.$t('Panels.MiscellaneousPanel.RunoutSensor.Disabled') - else if (this.filament_detected) return this.$t('Panels.MiscellaneousPanel.RunoutSensor.Detected') + if (this.filament_detected) return this.$t('Panels.MiscellaneousPanel.RunoutSensor.Detected') else return this.$t('Panels.MiscellaneousPanel.RunoutSensor.Empty') } + get disabledText() { + if (!this.enabled) return this.$t('Panels.MiscellaneousPanel.RunoutSensor.Disabled') + else return null + } + changeSensor() { const gcode = 'SET_FILAMENT_SENSOR SENSOR=' + this.name + ' ENABLE=' + (this.enabled ? 0 : 1) this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) From a7167979be36832a644a1f9adc7c2221a8d90e3a Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 8 Dec 2023 21:23:27 +0100 Subject: [PATCH 2/7] fix: remove disabled output Signed-off-by: Stefan Dej --- src/components/inputs/FilamentSensor.vue | 6 ------ src/locales/de.json | 1 - src/locales/en.json | 1 - 3 files changed, 8 deletions(-) diff --git a/src/components/inputs/FilamentSensor.vue b/src/components/inputs/FilamentSensor.vue index ac2967dc5..794600823 100644 --- a/src/components/inputs/FilamentSensor.vue +++ b/src/components/inputs/FilamentSensor.vue @@ -13,7 +13,6 @@ {{ convertName(name) }} {{ statusText }} - ({{ disabledText }}) {{ enabled ? mdiToggleSwitch : mdiToggleSwitchOffOutline }} @@ -56,11 +55,6 @@ export default class FilamentSensor extends Mixins(BaseMixin) { else return this.$t('Panels.MiscellaneousPanel.RunoutSensor.Empty') } - get disabledText() { - if (!this.enabled) return this.$t('Panels.MiscellaneousPanel.RunoutSensor.Disabled') - else return null - } - changeSensor() { const gcode = 'SET_FILAMENT_SENSOR SENSOR=' + this.name + ' ENABLE=' + (this.enabled ? 0 : 1) this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) diff --git a/src/locales/de.json b/src/locales/de.json index b6e494ec9..555197a89 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -614,7 +614,6 @@ }, "RunoutSensor": { "Detected": "erkannt", - "Disabled": "deaktiviert", "Empty": "Leer" } }, diff --git a/src/locales/en.json b/src/locales/en.json index 5124825d5..deeb5a9bb 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -614,7 +614,6 @@ }, "RunoutSensor": { "Detected": "detected", - "Disabled": "disabled", "Empty": "Empty" } }, From 43b292f158e6da1c0312642a9340c879c642bc78 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 8 Dec 2023 21:23:59 +0100 Subject: [PATCH 3/7] refactor: move style section at the end and simplify some code Signed-off-by: Stefan Dej --- src/components/inputs/FilamentSensor.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/inputs/FilamentSensor.vue b/src/components/inputs/FilamentSensor.vue index 794600823..4f2335c00 100644 --- a/src/components/inputs/FilamentSensor.vue +++ b/src/components/inputs/FilamentSensor.vue @@ -1,9 +1,3 @@ - -