From bf555c113fbe17a5eb6b28cf0e411d9b13ef2e93 Mon Sep 17 00:00:00 2001 From: Nathan Regner <9659564+nathanregner@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:28:14 -0600 Subject: [PATCH 01/17] perf: fix hang when leaving G-Code Preview page (#1949) --- src/store/gcodeviewer/mutations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/gcodeviewer/mutations.ts b/src/store/gcodeviewer/mutations.ts index 2639357a1..86e2d3682 100644 --- a/src/store/gcodeviewer/mutations.ts +++ b/src/store/gcodeviewer/mutations.ts @@ -1,7 +1,7 @@ import { getDefaultState } from './index' import { MutationTree } from 'vuex' import { GcodeviewerState } from '@/store/gcodeviewer/types' -import Vue from 'vue' +import Vue, { markRaw } from 'vue' export const mutations: MutationTree = { reset(state) { @@ -9,7 +9,7 @@ export const mutations: MutationTree = { }, setViewerBackup(state, backup) { - Vue.set(state, 'viewerBackup', backup) + Vue.set(state, 'viewerBackup', markRaw(backup) /* viewer object is large and quite slow to proxy */) }, setCanvasBackup(state, backup) { From 477c9589e0112717918cf320dfdaeefd1c40e08d Mon Sep 17 00:00:00 2001 From: Samuel Wang Date: Thu, 18 Jul 2024 12:40:05 -0700 Subject: [PATCH 02/17] locale(zh): update chinese locale (#1951) --- src/locales/zh.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/locales/zh.json b/src/locales/zh.json index 9ff1fadbf..884c60b6d 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -35,7 +35,11 @@ "OneHourShort": "1小时", "OneWeekShort": "1周", "Remind": "提醒:", - "ShowDetails": "显示详情" + "ShowDetails": "显示详情", + "TmcOtFlag": "步进驱动器错误:OT 标志设置", + "TmcOtFlagText": "步进驱动器 '{name}' 已触发 OT 标志并停止工作。这可能是由于电流过高引起的。请检查步进驱动器设置和冷却。", + "TmcOtpwFlag": "步进驱动器警告:OTPW 标志设置", + "TmcOtpwFlagText": "步进驱动器 '{name}' 已触发 OTPW 标志,如果温度再升高可能会停止工作。这表明存在过热情况。可能是由于电流过高引起的。请检查步进驱动器设置和冷却。" }, "NumberInput": { "GreaterOrEqualError": "必须大于或等于{min}!", @@ -1112,7 +1116,9 @@ "Autorender": "自动渲染", "AutorenderDescription": "如果开启将在打印结束后自动渲染延时摄影的视频", "Camera": "摄像头", - "CameraDescription": "选择拍摄使用的摄像头", + "CameraDescriptionWithSnapshotUrl": "选择使用哪个摄像头(带快照 URL)", + "CameraWarningAlreadySet": "该值已在 Moonraker 配置文件中设置。", + "CameraWarningAlreadySetSmall": "[timelapse] 部分中的 snapshoturl", "ConstantRateFactor": "固定码率系数(CRF)", "ConstantRateFactorDescription": "这里设置渲染视频的质量和文件大小。CRF的参数区间是0–51,0为无损画质,预设值为23,51是最差画质。数值越低画质越好,建议数值为17–28。设置为17或者18在视觉上的效果和无损画质差不多。", "duplicatelastframe": "重复最后一帧", @@ -1130,6 +1136,7 @@ "HyperlapseCycleDescription": "每隔X秒获取一张快照", "Mode": "模式", "ModeDescription": "选择Layermacro模式(基于层变化)或者Hyperlapse模式(基于时间)", + "NoWebcamFound": "没有发现摄像头", "OutputFramerate": "输出帧率", "OutputFramerateDescription": "设置视频帧率。注意:如果可变FPS设置开启,此设置会被忽略", "Parkhead": "放置打印头到停靠位置", @@ -1160,6 +1167,7 @@ "RulesZeroAndPositive": "值必须大于等于0!", "SaveFrames": "保存帧", "SaveFramesDescription": "保存帧到zip文件用于外部渲染", + "SelectWebcam": "选择网络摄像头...", "StreamDelayCompensation": "视频流延迟补偿", "StreamDelayCompensationDescription": "帧延迟捕获", "Targetlength": "目标时长", @@ -1217,6 +1225,8 @@ "Logo": "Logo颜色", "ManualProbeDialog": "手动Probe助手对话框", "ManualProbeDialogDescription": "显示PROBE_CALIBRATE或Z_ENDSTOP_CALIBRATE辅助对话框。", + "Mode": "模式", + "ModeDescription": "更改应用程序的整体外观和感觉", "NavigationStyle": "侧边栏样式", "NavigationStyleDescription": "更改侧边栏外观", "NavigationStyleIconsAndText": "图标+文字", @@ -1224,6 +1234,8 @@ "PowerDeviceName": "打印机电源设备", "PowerDeviceNameDescription": "请选择可以控制打印机供电的Moonraker电源设备。", "Primary": "高亮颜色", + "PrintstatusThumbnailZoom": "大缩略图缩放", + "PrintstatusThumbnailZoomDescription": "这将取消状态面板中缩略图的缩放效果。", "ProgressAsFavicon": "显示进度到浏览器标签", "ProgressAsFaviconDescription": "将浏览器标签的Mainsail图标更改为进度圆圈。", "ScrewsTiltAdjustDialog": "螺丝倾斜调整对话框", From 762bd760890e40253bb8fe2037ec5fa2cd284d7a Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 27 Jul 2024 12:07:10 +0200 Subject: [PATCH 03/17] fix(gcodeviewer): fix gcodeviewer simulation while printing (#1954) Signed-off-by: Stefan Dej --- src/components/gcodeviewer/Viewer.vue | 69 ++++++++++++++------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/src/components/gcodeviewer/Viewer.vue b/src/components/gcodeviewer/Viewer.vue index 6e195f752..a7257a165 100644 --- a/src/components/gcodeviewer/Viewer.vue +++ b/src/components/gcodeviewer/Viewer.vue @@ -209,7 +209,7 @@ - +
{{ $t('GCodeViewer.Rendering') }} - {{ loadingPercent }}%
@@ -222,7 +222,7 @@ - + @@ -31,6 +35,7 @@ export default class WebcamWrapper extends Mixins(BaseMixin) { @Prop({ type: Object, required: true }) webcam!: GuiWebcamStateWebcam @Prop({ type: Boolean, default: true }) showFps!: Boolean @Prop({ type: String, default: null }) printerUrl!: string | null + @Prop({ type: String, default: null }) page!: string | null get webcams(): GuiWebcamStateWebcam[] { return this.$store.getters['gui/webcams/getWebcams'] diff --git a/src/components/webcams/WebcamWrapperItem.vue b/src/components/webcams/WebcamWrapperItem.vue index 4e7217ef1..8d95a42f7 100644 --- a/src/components/webcams/WebcamWrapperItem.vue +++ b/src/components/webcams/WebcamWrapperItem.vue @@ -25,7 +25,7 @@ @@ -204,6 +211,14 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) { this.$store.dispatch('gui/saveSetting', { name: 'console.autoscroll', value: newVal }) } + get rawOutput(): boolean { + return this.$store.state.gui.console.rawOutput ?? false + } + + set rawOutput(newVal) { + this.$store.dispatch('gui/saveSetting', { name: 'console.rawOutput', value: newVal }) + } + commandClick(msg: string): void { this.gcode = msg diff --git a/src/locales/en.json b/src/locales/en.json index 5c403574b..2f0c91bf3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -663,6 +663,7 @@ "Headline": "Console", "HideTemperatures": "Hide temperatures", "HideTimelapse": "Hide Timelapse", + "RawOutput": "RAW-Output (for debugging)", "SendCode": "Send code...", "SetupConsole": "Setup Console" }, diff --git a/src/pages/Console.vue b/src/pages/Console.vue index a37067bcb..39a5da20b 100644 --- a/src/pages/Console.vue +++ b/src/pages/Console.vue @@ -71,6 +71,13 @@ :label="filter.name" @change="toggleFilter(filter)" /> + + + @@ -193,6 +200,14 @@ export default class PageConsole extends Mixins(BaseMixin) { this.$store.dispatch('gui/saveSetting', { name: 'console.autoscroll', value: newVal }) } + get rawOutput(): boolean { + return this.$store.state.gui.console.rawOutput ?? false + } + + set rawOutput(newVal) { + this.$store.dispatch('gui/saveSetting', { name: 'console.rawOutput', value: newVal }) + } + commandClick(msg: string): void { this.gcode = msg diff --git a/src/store/gui/console/index.ts b/src/store/gui/console/index.ts index b152a5c7e..d8e6e31c8 100644 --- a/src/store/gui/console/index.ts +++ b/src/store/gui/console/index.ts @@ -13,6 +13,7 @@ export const getDefaultState = (): GuiConsoleState => { height: 300, autoscroll: true, consolefilters: {}, + rawOutput: false, } } diff --git a/src/store/gui/console/types.ts b/src/store/gui/console/types.ts index 35e63cda8..6e487f9f3 100644 --- a/src/store/gui/console/types.ts +++ b/src/store/gui/console/types.ts @@ -9,6 +9,7 @@ export interface GuiConsoleState { consolefilters: { [key: string]: GuiConsoleStateFilter } + rawOutput: boolean } export interface GuiConsoleStateFilter { From cab5ea62b7c1a97d2673f8c110d073eb1844e5e6 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Tue, 27 Aug 2024 21:18:01 +0200 Subject: [PATCH 14/17] fix(ExtruderPanel): restore mode after extruding/retracting (#1965) Co-authored-by: Stefan Dej --- .../panels/Extruder/ExtruderControlPanelControl.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/panels/Extruder/ExtruderControlPanelControl.vue b/src/components/panels/Extruder/ExtruderControlPanelControl.vue index fdb7a10a8..25d1d053b 100644 --- a/src/components/panels/Extruder/ExtruderControlPanelControl.vue +++ b/src/components/panels/Extruder/ExtruderControlPanelControl.vue @@ -263,13 +263,21 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ExtruderMixi } sendRetract(): void { - const gcode = `M83\nG1 E-${this.feedamount} F${this.feedrate * 60}` + const gcode = + `SAVE_GCODE_STATE NAME=ui_retract\n` + + `M83\n` + + `G1 E-${this.feedamount} F${this.feedrate * 60}\n` + + `RESTORE_GCODE_STATE NAME=ui_retract` this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnRetract' }) } sendExtrude(): void { - const gcode = `M83\nG1 E${this.feedamount} F${this.feedrate * 60}` + const gcode = + `SAVE_GCODE_STATE NAME=ui_extrude\n` + + `M83\n` + + `G1 E${this.feedamount} F${this.feedrate * 60}\n` + + `RESTORE_GCODE_STATE NAME=ui_extrude` this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnDetract' }) } From 21dab3913c4ad5833a88d46ee8a8e1f0fa897ff4 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Tue, 27 Aug 2024 21:42:58 +0200 Subject: [PATCH 15/17] refactor(timelapse): refactor the timelapse status panel (#1982) --- .../TimelapseRenderingsettingsDialog.vue | 134 ++++++ src/components/mixins/timelapse.ts | 78 ++++ .../panels/Timelapse/TimelapseStatusPanel.vue | 398 +++++------------- 3 files changed, 314 insertions(+), 296 deletions(-) create mode 100644 src/components/dialogs/TimelapseRenderingsettingsDialog.vue create mode 100644 src/components/mixins/timelapse.ts diff --git a/src/components/dialogs/TimelapseRenderingsettingsDialog.vue b/src/components/dialogs/TimelapseRenderingsettingsDialog.vue new file mode 100644 index 000000000..035b84561 --- /dev/null +++ b/src/components/dialogs/TimelapseRenderingsettingsDialog.vue @@ -0,0 +1,134 @@ + + diff --git a/src/components/mixins/timelapse.ts b/src/components/mixins/timelapse.ts new file mode 100644 index 000000000..c1ad6be45 --- /dev/null +++ b/src/components/mixins/timelapse.ts @@ -0,0 +1,78 @@ +import Component from 'vue-class-component' +import Vue from 'vue' + +@Component +export default class TimelapseMixin extends Vue { + get variable_fps() { + return this.$store.state.server.timelapse?.settings?.variable_fps ?? false + } + + set variable_fps(newVal) { + this.$store.dispatch('server/timelapse/saveSetting', { variable_fps: newVal }) + } + + get variable_fps_min() { + return this.$store.state.server.timelapse?.settings?.variable_fps_min ?? 5 + } + + set variable_fps_min(newVal) { + this.$store.dispatch('server/timelapse/saveSetting', { variable_fps_min: newVal }) + } + + get variable_fps_max() { + return this.$store.state.server.timelapse?.settings?.variable_fps_max ?? 60 + } + + set variable_fps_max(newVal) { + this.$store.dispatch('server/timelapse/saveSetting', { variable_fps_max: newVal }) + } + + get targetlength() { + return this.$store.state.server.timelapse?.settings?.targetlength ?? 10 + } + + set targetlength(newVal) { + this.$store.dispatch('server/timelapse/saveSetting', { targetlength: newVal }) + } + + get output_framerate() { + return this.$store.state.server.timelapse?.settings?.output_framerate ?? 30 + } + + set output_framerate(newVal) { + this.$store.dispatch('server/timelapse/saveSetting', { output_framerate: newVal }) + } + + get duplicatelastframe() { + return this.$store.state.server.timelapse?.settings?.duplicatelastframe ?? 0 + } + + set duplicatelastframe(newVal) { + this.$store.dispatch('server/timelapse/saveSetting', { duplicatelastframe: newVal }) + } + + get framesCount() { + return this.$store.state.server.timelapse?.lastFrame?.count ?? 0 + } + + get estimatedVideoLength() { + let seconds = Math.round((this.framesCount + this.duplicatelastframe) / this.output_framerate) + + if (this.variable_fps) { + seconds = Math.round((this.framesCount + this.duplicatelastframe) / this.variableTargetFps) + if (seconds < this.targetlength) seconds = this.targetlength + } + + return seconds > 60 + ? Math.floor(seconds / 60) + 'm ' + (seconds - Math.floor(seconds / 60) * 60) + 's' + : seconds + 's' + } + + get variableTargetFps() { + let targetFps = Math.floor(this.framesCount / this.targetlength) + targetFps = Math.max(targetFps, this.variable_fps_min) + targetFps = Math.min(targetFps, this.variable_fps_max) + + return targetFps + } +} diff --git a/src/components/panels/Timelapse/TimelapseStatusPanel.vue b/src/components/panels/Timelapse/TimelapseStatusPanel.vue index 2129fc85c..29a3ca7d3 100644 --- a/src/components/panels/Timelapse/TimelapseStatusPanel.vue +++ b/src/components/panels/Timelapse/TimelapseStatusPanel.vue @@ -1,223 +1,100 @@ - - From f6f3c77d9756d4db90f0a8de1b7a9b4b21dd3c34 Mon Sep 17 00:00:00 2001 From: FatalBulletHit <37146617+FatalBulletHit@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:12:37 +0200 Subject: [PATCH 17/17] feat: added second layer confirmation for Cancel Job (#1978) Co-authored-by: Stefan Dej --- src/components/dialogs/CancelJobDialog.vue | 50 +++++++++++++++++++ src/components/panels/StatusPanel.vue | 18 +++++++ .../settings/SettingsUiSettingsTab.vue | 15 ++++++ src/locales/de.json | 8 +++ src/locales/en.json | 8 +++ src/store/gui/index.ts | 1 + src/store/gui/types.ts | 1 + 7 files changed, 101 insertions(+) create mode 100644 src/components/dialogs/CancelJobDialog.vue diff --git a/src/components/dialogs/CancelJobDialog.vue b/src/components/dialogs/CancelJobDialog.vue new file mode 100644 index 000000000..db9edc6b9 --- /dev/null +++ b/src/components/dialogs/CancelJobDialog.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/src/components/panels/StatusPanel.vue b/src/components/panels/StatusPanel.vue index ba405f501..d0a3833bb 100644 --- a/src/components/panels/StatusPanel.vue +++ b/src/components/panels/StatusPanel.vue @@ -110,6 +110,10 @@ +
@@ -141,9 +145,11 @@ import { mdiDotsVertical, } from '@mdi/js' import { PrinterStateMacro } from '@/store/printer/types' +import CancelJobDialog from '@/components/dialogs/CancelJobDialog.vue' @Component({ components: { + CancelJobDialog, KlippyStatePanel, MinSettingsPanel, Panel, @@ -166,6 +172,7 @@ export default class StatusPanel extends Mixins(BaseMixin) { bigThumbnail: any } + showCancelJobDialog = false boolShowObjects = false boolShowPauseAtLayer = false @@ -392,6 +399,17 @@ export default class StatusPanel extends Mixins(BaseMixin) { } btnCancelJob() { + const confirmOnCancelJob = this.$store.state.gui.uiSettings.confirmOnCancelJob + if (confirmOnCancelJob) { + this.showCancelJobDialog = true + return + } + + this.cancelJob() + } + + cancelJob() { + this.showCancelJobDialog = false this.$socket.emit('printer.print.cancel', {}, { loading: 'statusPrintCancel' }) } diff --git a/src/components/settings/SettingsUiSettingsTab.vue b/src/components/settings/SettingsUiSettingsTab.vue index 0bc26e456..14bb0f33e 100644 --- a/src/components/settings/SettingsUiSettingsTab.vue +++ b/src/components/settings/SettingsUiSettingsTab.vue @@ -178,6 +178,13 @@ + + + + @@ -426,6 +433,14 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin, ThemeMixin) this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.confirmOnPowerDeviceChange', value: newVal }) } + get confirmOnCancelJob() { + return this.$store.state.gui.uiSettings.confirmOnCancelJob + } + + set confirmOnCancelJob(newVal) { + this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.confirmOnCancelJob', value: newVal }) + } + get lockSliders() { return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices } diff --git a/src/locales/de.json b/src/locales/de.json index 67220131d..bc4ac382c 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -144,6 +144,12 @@ "ScrewName": "Name der Schraube", "ScrewOutput": "{current} von {max}" }, + "CancelJobDialog": { + "AreYouSure": "Bist du sicher?", + "CancelJob": "Druck abbrechen", + "No": "Nein", + "Yes": "Ja" + }, "ConnectionDialog": { "CannotConnectTo": "Kann keine Verbindung zu Moonraker ({host}) herstellen.", "CheckMoonrakerLog": "Wenn diese Meldung wiederholt erscheint, schaue bitte in die Logdatei unter:", @@ -1196,6 +1202,8 @@ "BoolBigThumbnailDescription": "Zeige ein großes Thumbnail in der Status-Anzeige während eines Drucks.", "BoolHideUploadAndPrintButton": "\"Hochladen & Drucken\" Schaltfläche ausblenden", "BoolHideUploadAndPrintButtonDescription": "Blendet die \"Hochladen & Drucken\" Schaltfläche in der Kopfleiste ein oder aus.", + "ConfirmOnCancelJob": "Bestätigung für Druck abbrechen erforderlich", + "ConfirmOnCancelJobDescription": "Zeige vor dem Druck abbrechen einen Bestätigungsdialog.", "ConfirmOnCoolDown": "Bestätigung für Abkühlen erforderlich", "ConfirmOnCoolDownDescription": "Zeige vor dem Abkühlen einen Bestätigungsdialog.", "ConfirmOnEmergencyStop": "Bestätigung für Notstopp erforderlich", diff --git a/src/locales/en.json b/src/locales/en.json index 2f0c91bf3..002e964e7 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -144,6 +144,12 @@ "ScrewName": "Screw Name", "ScrewOutput": "{current} of {max}" }, + "CancelJobDialog": { + "AreYouSure": "Are you sure?", + "CancelJob": "Cancel Job", + "No": "No", + "Yes": "Yes" + }, "ConnectionDialog": { "CannotConnectTo": "Cannot connect to Moonraker ({host}).", "CheckMoonrakerLog": "If this message appears repeatedly, please have a look in the log file located at:", @@ -1197,6 +1203,8 @@ "BoolBigThumbnailDescription": "Display a large thumbnail in the status panel during a print.", "BoolHideUploadAndPrintButton": "Hide Upload and Print Button", "BoolHideUploadAndPrintButtonDescription": "Show or hide the \"Upload and Print\" button in the top bar.", + "ConfirmOnCancelJob": "Require confirm on Cancel Job", + "ConfirmOnCancelJobDescription": "Show a confirmation dialog on Cancel Job", "ConfirmOnCoolDown": "Require confirm on CoolDown", "ConfirmOnCoolDownDescription": "Show a confirmation dialog on CoolDown", "ConfirmOnEmergencyStop": "Require confirm on Emergency Stop", diff --git a/src/store/gui/index.ts b/src/store/gui/index.ts index 6f94a5344..b8aaa2903 100644 --- a/src/store/gui/index.ts +++ b/src/store/gui/index.ts @@ -166,6 +166,7 @@ export const getDefaultState = (): GuiState => { confirmOnEmergencyStop: false, confirmOnCoolDown: false, confirmOnPowerDeviceChange: false, + confirmOnCancelJob: false, boolBigThumbnail: true, bigThumbnailBackground: defaultBigThumbnailBackground, boolWideNavDrawer: false, diff --git a/src/store/gui/types.ts b/src/store/gui/types.ts index a1bef68e2..fb3589081 100644 --- a/src/store/gui/types.ts +++ b/src/store/gui/types.ts @@ -108,6 +108,7 @@ export interface GuiState { confirmOnEmergencyStop: boolean confirmOnCoolDown: boolean confirmOnPowerDeviceChange: boolean + confirmOnCancelJob: boolean boolBigThumbnail: boolean bigThumbnailBackground: string boolWideNavDrawer: boolean