diff --git a/src/components/panels/ControlPanel.vue b/src/components/panels/ControlPanel.vue index 5849dbc6..9d3d4e53 100644 --- a/src/components/panels/ControlPanel.vue +++ b/src/components/panels/ControlPanel.vue @@ -227,6 +227,31 @@ + + + + + + + + Feed amount [mm] + + {{ amount }} + + + + Feedrate [mm/s] + + {{ rate }} + + + + + + mdi-arrow-up-bold Retract + mdi-arrow-down-bold Extrude + + @@ -273,6 +298,10 @@ config: state => state.printer.configfile.config, loadings: state => state.socket.loadings, printer_state: state => state.printer.print_stats.state, + extruder: state => state.printer.extruder, + + feedamounts: state => state.gui.dashboard.extruder.feedamounts, + feedrates: state => state.gui.dashboard.extruder.feedrates, feedrateXY: state => state.gui.dashboard.control.feedrateXY, stepsXY: state => state.gui.dashboard.control.stepsXY, @@ -284,6 +313,7 @@ }), ...mapGetters([ 'printer/getMacros', + 'printer/getExtrudePossible', ]), reverseZ: { get() { @@ -342,6 +372,32 @@ ...(this.stepsAll ?? []), ])).sort((a, b) => a-b) } + }, + feedamountsSorted: { + get() { + return [...this.feedamounts].sort((a,b) => { return b-a }) + } + }, + feedratesSorted: { + get() { + return [...this.feedrates].sort((a,b) => { return b-a }) + } + }, + currentFeedAmount: { + get() { + return parseFloat(this.$store.state.gui.dashboard.extruder.feedamount) + }, + set(newVal) { + return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedamount: newVal } } }) + } + }, + currentFeedRate: { + get() { + return parseFloat(this.$store.state.gui.dashboard.extruder.feedrate) + }, + set(newVal) { + return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedrate: newVal } } }) + } } }, created() { @@ -405,6 +461,24 @@ this.$store.commit('socket/addLoading', { name: 'macro_'+gcode }); Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'macro_'+gcode }); }, + setFeedAmount(value) { + this.currentFeedAmount = value; + }, + setFeedrate(value) { + this.currentFeedRate = value; + }, + sendRetract() { + let gcode = "M83\nG1 E-"+this.currentFeedAmount+" F"+(this.currentFeedRate * 60); + this.$store.commit('server/addEvent', { message: gcode, type: 'command' }); + this.$store.commit('socket/addLoading', { name: 'btnRetract' }); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' }); + }, + sendDetract() { + let gcode = "M83\nG1 E"+this.currentFeedAmount+" F"+(this.currentFeedRate * 60); + this.$store.commit('server/addEvent', { message: gcode, type: 'command' }); + this.$store.commit('socket/addLoading', { name: 'btnDetract' }); + Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' }); + }, }, } diff --git a/src/components/panels/ExtruderPanel.vue b/src/components/panels/ExtruderPanel.vue deleted file mode 100644 index 1fef72f4..00000000 --- a/src/components/panels/ExtruderPanel.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - diff --git a/src/components/panels/index.js b/src/components/panels/index.js index e7269e04..3206ecbe 100644 --- a/src/components/panels/index.js +++ b/src/components/panels/index.js @@ -6,7 +6,6 @@ import MinSettingsPanel from './MinSettingsPanel.vue' import MoonrakerFailedPluginsPanel from './MoonrakerFailedPluginsPanel.vue' import ToolsPanel from './ToolsPanel.vue' import ControlPanel from "./ControlPanel"; -import ExtruderPanel from "./ExtruderPanel"; import ZOffsetPanel from "./ZOffsetPanel"; import Miscellaneous from "./MiscellaneousPanel"; import WebcamPanel from "./WebcamPanel"; @@ -20,7 +19,6 @@ Vue.component('min-settings-panel', MinSettingsPanel); Vue.component('moonraker-failed-plugins-panel', MoonrakerFailedPluginsPanel); Vue.component('tools-panel', ToolsPanel); Vue.component('control-panel', ControlPanel); -Vue.component('extruder-panel', ExtruderPanel); Vue.component('zoffset-panel', ZOffsetPanel); Vue.component('miscellaneous-panel', Miscellaneous); Vue.component('webcam-panel', WebcamPanel); diff --git a/src/pages/Dashboard.vue b/src/pages/Dashboard.vue index 4313e236..3f3ca335 100644 --- a/src/pages/Dashboard.vue +++ b/src/pages/Dashboard.vue @@ -8,7 +8,6 @@ -