From a861e74183601701c98b6014066472f86b23e3d5 Mon Sep 17 00:00:00 2001 From: Eike Ahmels Date: Wed, 3 Mar 2021 20:36:17 +0100 Subject: [PATCH] new first beta of control pad --- src/App.vue | 1 + src/assets/styles/page.scss | 10 + src/components/panels/ControlPanel.vue | 322 +++++++++++++++--- .../panels/Settings/ControlPanel.vue | 130 +++++-- src/store/gui/index.js | 6 +- 5 files changed, 383 insertions(+), 86 deletions(-) create mode 100644 src/assets/styles/page.scss diff --git a/src/App.vue b/src/App.vue index 159ec50f..28fbe3d8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,7 @@ \ No newline at end of file + diff --git a/src/components/panels/Settings/ControlPanel.vue b/src/components/panels/Settings/ControlPanel.vue index fa97423f..50395444 100644 --- a/src/components/panels/Settings/ControlPanel.vue +++ b/src/components/panels/Settings/ControlPanel.vue @@ -43,42 +43,75 @@ - - - - - - + + + @@ -145,6 +178,22 @@ } }, computed: { + reverseZ: { + get() { + return this.$store.state.gui.dashboard.control.reverseZ; + }, + set(reverseZ) { + return this.$store.dispatch('gui/setSettings', { dashboard: { control: { reverseZ } } }) + } + }, + useCross: { + get() { + return this.$store.state.gui.dashboard.control.useCross; + }, + set(useCross) { + return this.$store.dispatch('gui/setSettings', { dashboard: { control: { useCross } } }) + } + }, feedrateXY: { get() { return this.$store.state.gui.dashboard.control.feedrateXY @@ -153,6 +202,17 @@ return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateXY: feedrate } } }) } }, + stepsAll: { + get() { + const steps = this.$store.state.gui.dashboard.control.stepsAll + return (steps ?? []).sort(function (a,b) { return b-a }) + }, + set(steps) { + const absSteps = [] + for(const value of steps) absSteps.push(Math.abs(value)) + return this.$store.dispatch('gui/setSettings', { dashboard: { control: { stepsAll: absSteps } } }) + } + }, stepsXY: { get() { const steps = this.$store.state.gui.dashboard.control.stepsXY @@ -218,4 +278,4 @@ } } } - \ No newline at end of file + diff --git a/src/store/gui/index.js b/src/store/gui/index.js index 9ea8da63..8487a10e 100644 --- a/src/store/gui/index.js +++ b/src/store/gui/index.js @@ -18,6 +18,10 @@ export function getDefaultState() { stepsXY: [ 100, 10, 1 ], feedrateZ: 25, stepsZ: [ 25, 1, 0.1 ], + stepsAll: [0.1, 1, 10, 25, 50, 100], + selectedCrossStep: null, + reverseZ: false, + useCross: false }, extruder: { feedamount: 25, @@ -75,4 +79,4 @@ export default { getters, actions, mutations -} \ No newline at end of file +}