From 88ac7a5caec3d56cc0e3ce19df3b9aee4ae01548 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 7 Feb 2021 03:26:06 +0100 Subject: [PATCH] feature: add customize feedrate for ControlPanel.vue (fix #49) Signed-off-by: Stefan Dej --- src/components/panels/ControlPanel.vue | 45 ++++++------- .../panels/Settings/ControlPanel.vue | 63 +++++++++++++++++++ src/components/panels/Settings/index.js | 2 + src/pages/settings/interface.vue | 3 +- src/store/gui/index.js | 4 ++ 5 files changed, 95 insertions(+), 22 deletions(-) create mode 100644 src/components/panels/Settings/ControlPanel.vue diff --git a/src/components/panels/ControlPanel.vue b/src/components/panels/ControlPanel.vue index 4574c5faf..17d80f615 100644 --- a/src/components/panels/ControlPanel.vue +++ b/src/components/panels/ControlPanel.vue @@ -22,39 +22,39 @@ - -100 - -10 - -1 + -100 + -10 + -1 X - +1 - +10 - +100 + +1 + +10 + +100 - -100 - -10 - -1 + -100 + -10 + -1 Y - +1 - +10 - +100 + +1 + +10 + +100 - -25 - -1 - -0.1 + -25 + -1 + -0.1 Z - +0.1 - +1 - +25 + +0.1 + +1 + +25 @@ -85,7 +85,10 @@ homedAxes: state => state.printer.toolhead.homed_axes, config: state => state.printer.configfile.config, loadings: state => state.socket.loadings, - printer_state: state => state.printer.print_stats.state + printer_state: state => state.printer.print_stats.state, + + feedrateXY: state => state.gui.dashboard.control.feedrateXY, + feedrateZ: state => state.gui.dashboard.control.feedrateZ, }), ...mapGetters([ 'printer/getMacros', @@ -122,9 +125,9 @@ this.$store.commit('socket/addLoading', { name: 'zTilt' }); this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' }); }, - doSendMove(gcode) { + doSendMove(gcode, feedrate) { gcode = "G91" + "\n" + - "G1 " + gcode + " F6000" + "\n" + + "G1 " + gcode + " F"+feedrate*60 + "\n" + "G90"; this.doSend(gcode); diff --git a/src/components/panels/Settings/ControlPanel.vue b/src/components/panels/Settings/ControlPanel.vue new file mode 100644 index 000000000..8f8363f3b --- /dev/null +++ b/src/components/panels/Settings/ControlPanel.vue @@ -0,0 +1,63 @@ + + + + + \ No newline at end of file diff --git a/src/components/panels/Settings/index.js b/src/components/panels/Settings/index.js index ba99e2e6b..de5748ed4 100644 --- a/src/components/panels/Settings/index.js +++ b/src/components/panels/Settings/index.js @@ -1,6 +1,7 @@ import Vue from 'vue' import GeneralPanel from './GeneralPanel' +import ControlPanel from './ControlPanel' import WebcamPanel from './WebcamPanel' import DashboardPanel from "./DashboardPanel"; import ConsolePanel from "./ConsolePanel"; @@ -15,6 +16,7 @@ import RemotePrintersPanel from "./RemotePrintersPanel"; import PresetsPanel from "./PresetsPanel"; Vue.component('settings-general-panel', GeneralPanel); +Vue.component('settings-control-panel', ControlPanel); Vue.component('settings-webcam-panel', WebcamPanel); Vue.component('settings-dashboard-panel', DashboardPanel); Vue.component('settings-console-panel', ConsolePanel); diff --git a/src/pages/settings/interface.vue b/src/pages/settings/interface.vue index bce8971af..480297850 100644 --- a/src/pages/settings/interface.vue +++ b/src/pages/settings/interface.vue @@ -8,7 +8,8 @@ - + + diff --git a/src/store/gui/index.js b/src/store/gui/index.js index 717c6b2dd..3f14e4892 100644 --- a/src/store/gui/index.js +++ b/src/store/gui/index.js @@ -13,6 +13,10 @@ export function getDefaultState() { boolConsole: true, hiddenMacros: [], hiddenTempChart: [], + control: { + feedrateXY: 100, + feedrateZ: 25, + } }, webcam: { url: "",