From 05cf0d481cd8a080481c08a7f07e8ac7c5721324 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Tue, 13 Sep 2022 23:31:00 +0200 Subject: [PATCH 1/9] feat: add manual_probe dialog Signed-off-by: Stefan Dej --- .../panels/ToolheadControlPanel.vue | 3 + .../ToolheadControls/ManualProbeDialog.vue | 204 ++++++++++++++++++ src/locales/en.json | 7 + 3 files changed, 214 insertions(+) create mode 100644 src/components/panels/ToolheadControls/ManualProbeDialog.vue diff --git a/src/components/panels/ToolheadControlPanel.vue b/src/components/panels/ToolheadControlPanel.vue index 46dd5df02..8d83e4911 100644 --- a/src/components/panels/ToolheadControlPanel.vue +++ b/src/components/panels/ToolheadControlPanel.vue @@ -118,6 +118,7 @@ command="M220" attribute-name="S"> + @@ -132,6 +133,7 @@ import MoveToControl from '@/components/panels/ToolheadControls/MoveToControl.vu import Panel from '@/components/ui/Panel.vue' import ToolSlider from '@/components/inputs/ToolSlider.vue' import ZoffsetControl from '@/components/panels/ToolheadControls/ZoffsetControl.vue' +import ManualProbeDialog from '@/components/panels/ToolheadControls/ManualProbeDialog.vue' import { mdiDotsVertical, mdiEngineOff, mdiGamepad, mdiSpeedometer, mdiMenuDown, mdiRestore } from '@mdi/js' @Component({ @@ -143,6 +145,7 @@ import { mdiDotsVertical, mdiEngineOff, mdiGamepad, mdiSpeedometer, mdiMenuDown, Panel, ToolSlider, ZoffsetControl, + ManualProbeDialog, }, }) export default class ToolheadControlPanel extends Mixins(BaseMixin, ControlMixin) { diff --git a/src/components/panels/ToolheadControls/ManualProbeDialog.vue b/src/components/panels/ToolheadControls/ManualProbeDialog.vue new file mode 100644 index 000000000..760449242 --- /dev/null +++ b/src/components/panels/ToolheadControls/ManualProbeDialog.vue @@ -0,0 +1,204 @@ + + + + + diff --git a/src/locales/en.json b/src/locales/en.json index c243288f7..d984df092 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -603,6 +603,13 @@ "ALL": "ALL", "Headline": "Toolhead", "Invalid": "Invalid", + "ManualProbe": { + "Abort": "abort", + "Accept": "accept", + "Current": "current", + "Headline": "Manual Probe", + "MinMax": "min: {min} / max: {max}" + }, "OutOfRange": "Out of range!", "PleaseConfigureSteps": "Please configure steps", "Position": "Position", From 03d96e708e86397cc0a80999a9a231fba544967a Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Tue, 13 Sep 2022 23:33:56 +0200 Subject: [PATCH 2/9] feat: add loading function to abort & accept buttons Signed-off-by: Stefan Dej --- .../ToolheadControls/ManualProbeDialog.vue | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/panels/ToolheadControls/ManualProbeDialog.vue b/src/components/panels/ToolheadControls/ManualProbeDialog.vue index 760449242..7cb8cbc63 100644 --- a/src/components/panels/ToolheadControls/ManualProbeDialog.vue +++ b/src/components/panels/ToolheadControls/ManualProbeDialog.vue @@ -84,8 +84,10 @@ - {{ $t('Panels.ToolheadControlPanel.ManualProbe.Abort') }} - + + {{ $t('Panels.ToolheadControlPanel.ManualProbe.Abort') }} + + {{ $t('Panels.ToolheadControlPanel.ManualProbe.Accept') }} @@ -135,24 +137,30 @@ export default class ManualProbeDialog extends Mixins(BaseMixin) { return (this.$store.state.printer.manual_probe?.z_position_upper ?? 0).toFixed(3) } - sendGcode(gcode: string) { - this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) - this.$socket.emit('printer.gcode.script', { script: gcode }) + get loadingAbort() { + return this.loadings.includes('manualProbeAbort') + } + + get loadingAccept() { + return this.loadings.includes('manualProbeAccept') } sendTestZ(offset: string) { const gcode = `TESTZ Z=${offset}` - this.sendGcode(gcode) + this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) + this.$socket.emit('printer.gcode.script', { script: gcode }) } sendAbort() { const gcode = `ABORT` - this.sendGcode(gcode) + this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) + this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'manualProbeAbort' }) } sendAccept() { const gcode = `ACCEPT` - this.sendGcode(gcode) + this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' }) + this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'manualProbeAccept' }) } } From 28caca276b75ea57ba827c51bf0d4f1328a47752 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 17 Sep 2022 23:25:32 +0200 Subject: [PATCH 3/9] refactor: rework manual probe dialog Signed-off-by: Stefan Dej --- .../ToolheadControls/ManualProbeDialog.vue | 152 ++++++++++-------- 1 file changed, 85 insertions(+), 67 deletions(-) diff --git a/src/components/panels/ToolheadControls/ManualProbeDialog.vue b/src/components/panels/ToolheadControls/ManualProbeDialog.vue index 7cb8cbc63..7c1f161b0 100644 --- a/src/components/panels/ToolheadControls/ManualProbeDialog.vue +++ b/src/components/panels/ToolheadControls/ManualProbeDialog.vue @@ -1,5 +1,5 @@ @@ -59,6 +60,7 @@ import { panelToolbarHeight, topbarHeight, navigationItemHeight } from '@/store/ import TheTimelapseRenderingSnackbar from '@/components/TheTimelapseRenderingSnackbar.vue' import TheFullscreenUpload from '@/components/TheFullscreenUpload.vue' import TheUploadSnackbar from '@/components/TheUploadSnackbar.vue' +import TheManualProbeDialog from '@/components/dialogs/TheManualProbeDialog.vue' @Component({ components: { @@ -71,6 +73,7 @@ import TheUploadSnackbar from '@/components/TheUploadSnackbar.vue' TheSidebar, TheFullscreenUpload, TheUploadSnackbar, + TheManualProbeDialog, }, metaInfo() { const title = this.$store.getters['getTitle'] diff --git a/src/components/panels/ToolheadControls/ManualProbeDialog.vue b/src/components/dialogs/TheManualProbeDialog.vue similarity index 93% rename from src/components/panels/ToolheadControls/ManualProbeDialog.vue rename to src/components/dialogs/TheManualProbeDialog.vue index 45bb79814..e9bf8dc84 100644 --- a/src/components/panels/ToolheadControls/ManualProbeDialog.vue +++ b/src/components/dialogs/TheManualProbeDialog.vue @@ -1,7 +1,7 @@ @@ -133,7 +132,6 @@ import MoveToControl from '@/components/panels/ToolheadControls/MoveToControl.vu import Panel from '@/components/ui/Panel.vue' import ToolSlider from '@/components/inputs/ToolSlider.vue' import ZoffsetControl from '@/components/panels/ToolheadControls/ZoffsetControl.vue' -import ManualProbeDialog from '@/components/panels/ToolheadControls/ManualProbeDialog.vue' import { mdiDotsVertical, mdiEngineOff, mdiGamepad, mdiSpeedometer, mdiMenuDown, mdiRestore } from '@mdi/js' @Component({ @@ -145,7 +143,6 @@ import { mdiDotsVertical, mdiEngineOff, mdiGamepad, mdiSpeedometer, mdiMenuDown, Panel, ToolSlider, ZoffsetControl, - ManualProbeDialog, }, }) export default class ToolheadControlPanel extends Mixins(BaseMixin, ControlMixin) { diff --git a/src/locales/en.json b/src/locales/en.json index 12571ed78..9042871dc 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -458,6 +458,14 @@ "UpToDate": "up-to-date" } }, + "ManualProbe": { + "Abort": "abort", + "Accept": "accept", + "Advanced": "Advanced", + "Current": "current", + "Headline": "Manual Probe", + "MinMax": "min: {min} / max: {max}" + }, "Panels": { "ExtruderControlPanel": { "Allowed": "Allowed", @@ -605,14 +613,6 @@ "ALL": "ALL", "Headline": "Toolhead", "Invalid": "Invalid", - "ManualProbe": { - "Abort": "abort", - "Accept": "accept", - "Advanced": "Advanced", - "Current": "current", - "Headline": "Manual Probe", - "MinMax": "min: {min} / max: {max}" - }, "OutOfRange": "Out of range!", "PleaseConfigureSteps": "Please configure steps", "Position": "Position", From d6985b07813ea37330c9ee21a72dbfd2b1698acd Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 18 Sep 2022 00:24:41 +0200 Subject: [PATCH 8/9] locale(en): remove unused keys Signed-off-by: Stefan Dej --- src/locales/en.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 9042871dc..1ee743a6e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -462,9 +462,7 @@ "Abort": "abort", "Accept": "accept", "Advanced": "Advanced", - "Current": "current", - "Headline": "Manual Probe", - "MinMax": "min: {min} / max: {max}" + "Headline": "Manual Probe" }, "Panels": { "ExtruderControlPanel": { From 606f070a90354a8f6d1c4aaf2e77343f3465b4cd Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 18 Sep 2022 00:24:52 +0200 Subject: [PATCH 9/9] locale(de): add DE locale Signed-off-by: Stefan Dej --- src/locales/de.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/locales/de.json b/src/locales/de.json index f2f363f00..fae95c673 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -458,6 +458,12 @@ "UpToDate": "aktuell" } }, + "ManualProbe": { + "Abort": "abbrechen", + "Accept": "akzeptieren", + "Advanced": "Erweitert", + "Headline": "Manuelle Messung" + }, "Panels": { "ExtruderControlPanel": { "Allowed": "Erlaubt",