From 10c530454edc0bf521b5e81a6e0d62575690adda Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 31 Jul 2021 22:37:21 +0200 Subject: [PATCH 01/14] bugfix: fix ToolSlider.vue for printsettings and machine limits Signed-off-by: Stefan Dej --- src/components/inputs/ToolSlider.vue | 22 +++-- src/components/panels/MiscellaneousPanel.vue | 87 +++++++------------- src/components/panels/PrintsettingsPanel.vue | 42 ++++++++++ src/pages/Dashboard.vue | 3 + 4 files changed, 92 insertions(+), 62 deletions(-) create mode 100644 src/components/panels/PrintsettingsPanel.vue diff --git a/src/components/inputs/ToolSlider.vue b/src/components/inputs/ToolSlider.vue index 09e7b1b0..d673583e 100644 --- a/src/components/inputs/ToolSlider.vue +++ b/src/components/inputs/ToolSlider.vue @@ -15,7 +15,7 @@ class="ml-2" x-small icon - @click="processedMin = min; processedMax = max; value = defaultValue; sliding = true; sendCmd()" + @click="resetSlider" > mdi-restart @@ -49,8 +49,6 @@ diff --git a/src/components/panels/PrintsettingsPanel.vue b/src/components/panels/PrintsettingsPanel.vue new file mode 100644 index 00000000..42ca0817 --- /dev/null +++ b/src/components/panels/PrintsettingsPanel.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/pages/Dashboard.vue b/src/pages/Dashboard.vue index a6cee548..19b01ce9 100644 --- a/src/pages/Dashboard.vue +++ b/src/pages/Dashboard.vue @@ -8,6 +8,7 @@ + @@ -32,9 +33,11 @@ import ZOffsetPanel from "@/components/panels/ZOffsetPanel.vue"; import ControlPanel from "@/components/panels/ControlPanel.vue"; import MiscellaneousPanel from "@/components/panels/MiscellaneousPanel.vue"; import MiniconsolePanel from "@/components/panels/MiniconsolePanel.vue"; +import PrintsettingsPanel from "@/components/panels/PrintsettingsPanel.vue"; @Component({ components: { + PrintsettingsPanel, MiniconsolePanel, MiscellaneousPanel, ControlPanel, From 1b679e018547cfd72c86192a856371fd80a2478f Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 31 Jul 2021 22:47:57 +0200 Subject: [PATCH 02/14] remove debug output Signed-off-by: Stefan Dej --- src/components/inputs/ToolSlider.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/inputs/ToolSlider.vue b/src/components/inputs/ToolSlider.vue index d673583e..aaa1e011 100644 --- a/src/components/inputs/ToolSlider.vue +++ b/src/components/inputs/ToolSlider.vue @@ -81,8 +81,6 @@ export default class ToolSlider extends Mixins(BaseMixin) { if (this.value >= this.processedMax) { this.processedMax = (Math.ceil(this.value / this.dynamicStep) + 1) * this.dynamicStep } - - window.console.log(this.label, this.value, this.processedMax, this.max) } get colorBar() { From 9f8db4856ae9ec717033fc7f53ef8d029b71764d Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 1 Aug 2021 13:10:46 +0200 Subject: [PATCH 03/14] rework MachineLimits Signed-off-by: Stefan Dej --- src/components/inputs/MachineLimitsInput.vue | 60 ++++++++++++ src/components/panels/Machine/LimitsPanel.vue | 95 ++++++++++--------- 2 files changed, 108 insertions(+), 47 deletions(-) create mode 100644 src/components/inputs/MachineLimitsInput.vue diff --git a/src/components/inputs/MachineLimitsInput.vue b/src/components/inputs/MachineLimitsInput.vue new file mode 100644 index 00000000..1d8bc165 --- /dev/null +++ b/src/components/inputs/MachineLimitsInput.vue @@ -0,0 +1,60 @@ + + + + + \ No newline at end of file diff --git a/src/components/panels/Machine/LimitsPanel.vue b/src/components/panels/Machine/LimitsPanel.vue index 4c9ce0c5..f6da090f 100644 --- a/src/components/panels/Machine/LimitsPanel.vue +++ b/src/components/panels/Machine/LimitsPanel.vue @@ -5,52 +5,52 @@ mdi-speedometer{{ $t('Machine.LimitsPanel.MachineLimits')}} - - - - - - - + + + + + + + + + + + + + + + + + + @@ -60,8 +60,9 @@ import { Component, Mixins } from 'vue-property-decorator' import BaseMixin from '@/components/mixins/base.ts' import ToolSlider from '@/components/inputs/ToolSlider' +import MachineLimitsInput from '@/components/inputs/MachineLimitsInput' @Component({ - components: {ToolSlider} + components: {MachineLimitsInput, ToolSlider} }) export default class LimitsPanel extends Mixins(BaseMixin) { From aefd4caf5e85478de47d07e709a9abc7a1cdc092 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 1 Aug 2021 14:05:44 +0200 Subject: [PATCH 04/14] Feature/motion report (#317) * test new flow and velocity Signed-off-by: Stefan Dej * test build for live speed & flow Signed-off-by: Stefan Dej * bugfix: fix ToolSlider.vue for printsettings and machine limits Signed-off-by: Stefan Dej * remove debug output Signed-off-by: Stefan Dej * rework MachineLimits Signed-off-by: Stefan Dej * feature: live extruder, toolhead speed and position data in StatusPanel.vue Signed-off-by: Stefan Dej --- src/components/inputs/MachineLimitsInput.vue | 60 ++++++++++++ src/components/inputs/ToolSlider.vue | 20 +++- src/components/panels/Machine/LimitsPanel.vue | 95 ++++++++++--------- src/components/panels/MiscellaneousPanel.vue | 87 ++++++----------- src/components/panels/PrintsettingsPanel.vue | 42 ++++++++ src/components/panels/StatusPanel.vue | 95 ++++++++----------- src/locales/en.json | 1 + src/pages/Dashboard.vue | 3 + src/store/printer/getters.ts | 2 +- 9 files changed, 242 insertions(+), 163 deletions(-) create mode 100644 src/components/inputs/MachineLimitsInput.vue create mode 100644 src/components/panels/PrintsettingsPanel.vue diff --git a/src/components/inputs/MachineLimitsInput.vue b/src/components/inputs/MachineLimitsInput.vue new file mode 100644 index 00000000..1d8bc165 --- /dev/null +++ b/src/components/inputs/MachineLimitsInput.vue @@ -0,0 +1,60 @@ + + + + + \ No newline at end of file diff --git a/src/components/inputs/ToolSlider.vue b/src/components/inputs/ToolSlider.vue index 09e7b1b0..aaa1e011 100644 --- a/src/components/inputs/ToolSlider.vue +++ b/src/components/inputs/ToolSlider.vue @@ -15,7 +15,7 @@ class="ml-2" x-small icon - @click="processedMin = min; processedMax = max; value = defaultValue; sliding = true; sendCmd()" + @click="resetSlider" > mdi-restart @@ -49,8 +49,6 @@ diff --git a/src/components/panels/PrintsettingsPanel.vue b/src/components/panels/PrintsettingsPanel.vue new file mode 100644 index 00000000..42ca0817 --- /dev/null +++ b/src/components/panels/PrintsettingsPanel.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/panels/StatusPanel.vue b/src/components/panels/StatusPanel.vue index cf150093..18320aa8 100644 --- a/src/components/panels/StatusPanel.vue +++ b/src/components/panels/StatusPanel.vue @@ -148,18 +148,31 @@ - {{ $t("Panels.StatusPanel.Speed") }}
- {{ requested_speed }} mm/s + +
- {{ $t("Panels.StatusPanel.Max") }}: {{ maxFlow.maxValue ? maxFlow.maxValue.toFixed(1)+" mm³/s" : "--" }} + {{ $t("Panels.StatusPanel.Max") }}: {{ maxFlow ? maxFlow+" mm³/s" : "--" }} @@ -265,13 +278,7 @@ import VueLoadImage from "vue-load-image" VueLoadImage }) export default class StatusPanel extends Mixins(BaseMixin) { - maxFlow = { - intervalTimer: null, - lastExtruderPos: 0, - lastTime: 0, - lastValue: 0, - maxValue: 0, - } + maxFlow = 0 get current_filename() { return this.$store.state.printer.print_stats?.filename ?? "" @@ -379,6 +386,26 @@ export default class StatusPanel extends Mixins(BaseMixin) { }) } + get live_velocity() { + return Math.abs(this.$store.state.printer.motion_report?.live_velocity?.toFixed(0)) ?? null + } + + get live_extruder_velocity() { + const live_extruder_velocity = this.$store.state.printer.motion_report?.live_extruder_velocity ?? null + if (live_extruder_velocity === null) return null + + return live_extruder_velocity > 0 ? live_extruder_velocity : 0 + } + + get live_flow() { + if (this.live_extruder_velocity === null) return null + + const filamentCrossSection = Math.pow(this.filament_diameter / 2, 2) * Math.PI + const currentFlow = filamentCrossSection * this.live_extruder_velocity + + return currentFlow?.toFixed(1) + } + get requested_speed() { const requested_speed = this.$store.state.printer.gcode_move?.speed ?? 0 const speed_factor = this.$store.state.printer.gcode_move?.speed_factor ?? 0 @@ -533,49 +560,11 @@ export default class StatusPanel extends Mixins(BaseMixin) { return h+":"+m+((diff > 60*60*24*1000) ? "+"+parseInt(diff / (60*60*24*1000)) : "") } - calcMaxFlow() { - const newExtruderPos = parseFloat(this.filament_used) + @Watch('live_flow') + live_flowChanged(newVal) { + newVal = parseFloat(newVal) - if ( - this.maxFlow.lastExtruderPos && - this.maxFlow.lastExtruderPos < newExtruderPos && - this.maxFlow.lastTime - ) { - const timeDiff = (new Date().getTime() - this.maxFlow.lastTime) / 1000 - const filamentDiff = newExtruderPos - this.maxFlow.lastExtruderPos - const filamentCrossSection = Math.pow(this.filament_diameter / 2, 2) * Math.PI - - if (timeDiff < 5000) { - this.maxFlow.lastValue = filamentCrossSection * filamentDiff / timeDiff - - if (this.maxFlow.maxValue < this.maxFlow.lastValue) this.maxFlow.maxValue = this.maxFlow.lastValue - } - } - - this.maxFlow.lastExtruderPos = newExtruderPos - this.maxFlow.lastTime = new Date().getTime() - } - - created() { - this.maxFlow.intervalTimer = setInterval(() => { - this.calcMaxFlow() - }, 3000) - } - - beforeDestroy() { - if (this.maxFlow.intervalTimer) { - clearInterval(this.maxFlow.intervalTimer) - this.maxFlow.intervalTimer = null - } - } - - @Watch('printerState') - printerStateChange(newVal) { - if (['complete', 'cancel', 'error', 'standby'].includes(newVal)) { - this.maxFlow.lastValue = 0 - this.maxFlow.maxValue = 0 - this.maxFlow.lastTime = 0 - } + if (newVal && this.maxFlow < newVal) this.maxFlow = newVal } } \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 0b00642c..0786fcd8 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -317,6 +317,7 @@ "CancelPrint": "Cancel print", "ClearPrintStats": "Clear print stats", "ReprintJob": "Reprint job", + "Requested": "Requested", "Speed": "Speed", "Flow": "Flow", "Max": "max", diff --git a/src/pages/Dashboard.vue b/src/pages/Dashboard.vue index a6cee548..19b01ce9 100644 --- a/src/pages/Dashboard.vue +++ b/src/pages/Dashboard.vue @@ -8,6 +8,7 @@ + @@ -32,9 +33,11 @@ import ZOffsetPanel from "@/components/panels/ZOffsetPanel.vue"; import ControlPanel from "@/components/panels/ControlPanel.vue"; import MiscellaneousPanel from "@/components/panels/MiscellaneousPanel.vue"; import MiniconsolePanel from "@/components/panels/MiniconsolePanel.vue"; +import PrintsettingsPanel from "@/components/panels/PrintsettingsPanel.vue"; @Component({ components: { + PrintsettingsPanel, MiniconsolePanel, MiscellaneousPanel, ControlPanel, diff --git a/src/store/printer/getters.ts b/src/store/printer/getters.ts index aa54c43a..9a8a4cb7 100644 --- a/src/store/printer/getters.ts +++ b/src/store/printer/getters.ts @@ -32,7 +32,7 @@ export const getters: GetterTree = { }, getPositions: (state) => { - const position = state.motion_report?.position ?? state.toolhead?.position ?? [0,0,0] + const position = state.motion_report?.live_position ?? state.toolhead?.position ?? [0,0,0] const gcode_position = state.gcode_move?.gcode_position ?? [0,0,0] const absolute = state.gcode_move?.absolute_coordinates ?? true From 2d743eaa376a5ce4587bc323e64f2547d2d22ae8 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 1 Aug 2021 15:19:53 +0200 Subject: [PATCH 05/14] feature: show gcode thumbnail in full height on focus Signed-off-by: Stefan Dej --- src/components/panels/StatusPanel.vue | 85 +++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 13 deletions(-) diff --git a/src/components/panels/StatusPanel.vue b/src/components/panels/StatusPanel.vue index 18320aa8..6f794894 100644 --- a/src/components/panels/StatusPanel.vue +++ b/src/components/panels/StatusPanel.vue @@ -1,14 +1,6 @@ - @@ -59,9 +51,13 @@ diff --git a/src/components/webcams/Mjpegstreamer.vue b/src/components/webcams/Mjpegstreamer.vue index e010c9c0..52b05884 100644 --- a/src/components/webcams/Mjpegstreamer.vue +++ b/src/components/webcams/Mjpegstreamer.vue @@ -12,7 +12,7 @@
mdi-webcam-off -
{{ $t('Settings.WebcamPanel.UrlNotAvailable') }}
+
{{ $t('Panels.WebcamPanel.UrlNotAvailable') }}
diff --git a/src/components/webcams/Uv4lMjpeg.vue b/src/components/webcams/Uv4lMjpeg.vue index 8eb38f80..0d076e7d 100644 --- a/src/components/webcams/Uv4lMjpeg.vue +++ b/src/components/webcams/Uv4lMjpeg.vue @@ -12,7 +12,7 @@
mdi-webcam-off -
{{ $t('Settings.WebcamPanel.UrlNotAvailable') }}
+
{{ $t('Panels.WebcamPanel.UrlNotAvailable') }}
diff --git a/src/locales/en.json b/src/locales/en.json index 0786fcd8..3d973b01 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -39,14 +39,14 @@ "TitlePreviouslyFrequencyCapped": "Previously Frequency Capped", "TitlePreviouslyThrottled": "Previously Throttled", "TitlePreviouslyTemperatureLimited": "Previously Temperature Limited", - "TooltipUnderVoltageDetected": "rPI supply voltage currently below 4.65V", - "TooltipFrequencyCapped": "rPi ARM max frequency is currently limited to 1.2 GHz.", - "TooltipCurrentlyThrottled": "rPi ARM core(s) are currently throttled down.", - "TooltipTemperatureLimitActive": "rPi uC (3A+/3B+ only) temperature is currently above the soft limit (default 60C).", - "TooltipPreviouslyUnderVolted": "rPI supply voltage dropped below 4.65V at least once since the last power-on.", - "TooltipPreviouslyFrequencyCapped": "rPi ARM max frequency was at least once limited to 1.2 GHz since last power-on.", - "TooltipPreviouslyThrottled": "rPI ARM core(s) where throttled down at least once since last power-on.", - "TooltipPreviouslyTemperatureLimited": "rPi uC (3A+/3B+ only) temperature was at least once above the soft limit (default 60C) since last power-on." + "DescriptionUnderVoltageDetected": "rPI supply voltage currently below 4.65V", + "DescriptionFrequencyCapped": "rPi ARM max frequency is currently limited to 1.2 GHz.", + "DescriptionCurrentlyThrottled": "rPi ARM core(s) are currently throttled down.", + "DescriptionTemperatureLimitActive": "rPi uC (3A+/3B+ only) temperature is currently above the soft limit (default 60C).", + "DescriptionPreviouslyUnderVolted": "rPI supply voltage dropped below 4.65V at least once since the last power-on.", + "DescriptionPreviouslyFrequencyCapped": "rPi ARM max frequency was at least once limited to 1.2 GHz since last power-on.", + "DescriptionPreviouslyThrottled": "rPI ARM core(s) where throttled down at least once since last power-on.", + "DescriptionPreviouslyTemperatureLimited": "rPi uC (3A+/3B+ only) temperature was at least once above the soft limit (default 60C) since last power-on." } }, "ConnectionDialog": { @@ -76,14 +76,12 @@ "Router": { "Dashboard": "Dashboard", "Printers": "Printers", - "Settings": "Settings", "Webcam": "Webcam", "Console": "Console", "Heightmap": "Heightmap", "G-Code Files": "G-Code Files", "History": "History", - "Machine": "Machine", - "Interface": "Interface" + "Machine": "Machine" }, "Editor": { "Minimap": "Show minimap", @@ -149,14 +147,10 @@ "SuccessfullyDeleted": "Successfully deleted {filename}." }, "Console": { - "send": "send", "SetupConsole": "Setup Console", "SendCode": "Send code...", "Empty": "Empty", "HideTemperatures": "Hide temperatures", - "CustomFilters": "Custom filters", - "Date": "Date", - "Event": "Event", "CommandList": "Command list" }, "Heightmap": { @@ -249,7 +243,6 @@ "Z": "Z", "PleaseConfigureSteps": "Please configure steps", "SettingsInterfaceControl": "Settings > Interface > Control", - "Home": "Home", "FeedAmountIn": "Feed amount in", "FeedrateIn": "Feedrate in", "Retract": "Retract", @@ -271,10 +264,7 @@ "Console": "Console", "SetupConsole": "Setup Console", "HideTemperatures": "Hide temperatures", - "CustomFilters": "Custom filters", - "SendCode": "Send code...", - "Send": "Send", - "Empty": "Empty" + "SendCode": "Send code..." }, "MinSettingsPanel": { "MissingConfiguration": "Missing configuration", @@ -362,7 +352,8 @@ "Webcam": "Webcam", "FPS": "FPS", "All": "All", - "UnknownWebcamService": "Unknown Webcam Service" + "UnknownWebcamService": "Unknown Webcam Service", + "UrlNotAvailable": "URL not available" }, "ZOffsetPanel": { "ZOffset": "Z-Offset", @@ -525,15 +516,13 @@ "Console": "Console", "ShowOnDashboard": "Show on dashboard", "HideTemperatures": "Hide temperatures", - "CustomFilters": "Custom filter", "CreateHeadline": "Create filter", "Name": "Name", "Regex": "Regex", "StoreButton": "Store filter", "UpdateButton": "Update filter", "EditHeadline": "Edit filter", - "AddFilter": "add filter", - "Rules": "Rules" + "AddFilter": "add filter" }, "PresetsTab": { "PreheatPresets": "Preheat Presets", @@ -560,8 +549,7 @@ "ThemeTab": { "Theme": "Theme", "Logo": "Logo", - "Primary": "Primary", - "ResetTheme": "reset Theme" + "Primary": "Primary" } } } \ No newline at end of file diff --git a/src/routes/.i18nignore b/src/routes/.i18nignore new file mode 100644 index 00000000..5acd1232 --- /dev/null +++ b/src/routes/.i18nignore @@ -0,0 +1,8 @@ +$t('Router.Dashboard') +$t('Router.Printers') +$t('Router.Webcam') +$t('Router.Console') +$t('Router.Heightmap') +$t('Router.G-Code Files') +$t('Router.History') +$t('Router.Machine') \ No newline at end of file diff --git a/vue-i18n-extract.config.js b/vue-i18n-extract.config.js index d5af30a8..ae603868 100644 --- a/vue-i18n-extract.config.js +++ b/vue-i18n-extract.config.js @@ -1,5 +1,5 @@ module.exports = { - vueFilesPath: './src/**/*.?(vue|js)', + vueFilesPath: './src/**/{*.?(js|ts|vue),.i18nignore}', languageFilesPath: './src/locales/*.json', options: { output: false, From 45f200b40b3cb01dff78874cc27cd61846bbb630 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Mon, 2 Aug 2021 10:57:31 +0200 Subject: [PATCH 14/14] bugfix: editor translation unknown class Signed-off-by: Stefan Dej --- src/components/TheEditor.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/TheEditor.vue b/src/components/TheEditor.vue index 4512467f..edb38811 100644 --- a/src/components/TheEditor.vue +++ b/src/components/TheEditor.vue @@ -65,7 +65,6 @@ import {Component, Mixins} from "vue-property-decorator"; import BaseMixin from "@/components/mixins/base" import {formatFilesize} from "@/plugins/helpers"; import Codemirror from "@/components/inputs/Codemirror.vue"; -import VueI18n from "vue-i18n"; @Component({ components: {Codemirror} }) @@ -119,7 +118,7 @@ export default class TheEditor extends Mixins(BaseMixin) { } get snackbarHeadline() { - let directionUppercase = VueI18n.t("Files.Downloading") + let directionUppercase = this.$t("Files.Downloading") if (this.loaderProgress.direction) { directionUppercase = this.loaderProgress.direction?.charAt(0).toUpperCase() + this.loaderProgress.direction?.slice(1) }