From 3dfbad68c97e65ba53bd141f89eae5caa6fac3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Sch=C3=BCrg?= Date: Wed, 1 Apr 2020 22:46:07 +0200 Subject: [PATCH 1/4] Allow feedrate between 25 and 300 percent. Allow feedrate slider to move between 25 and 300 percent. --- src/octoprint/templates/tabs/control.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/templates/tabs/control.jinja2 b/src/octoprint/templates/tabs/control.jinja2 index c30e198a2..a862991c2 100644 --- a/src/octoprint/templates/tabs/control.jinja2 +++ b/src/octoprint/templates/tabs/control.jinja2 @@ -80,7 +80,7 @@
- +
From 0861e6f176eeeac029718301a61a31245ab2ef82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Sch=C3=BCrg?= Date: Wed, 1 Apr 2020 23:00:53 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Add=20Tobias=20Sch=C3=BCrg=20to=20AUTHORS.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... as requested in PR checklist. --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 8398e0cb5..bf21dca93 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -115,6 +115,7 @@ date of first contribution): * [Ludovico de Nittis](https://github.com/RyuzakiKK) * [Dominik Paľo](https://github.com/DominikPalo) * [Kelly Anderson](https://github.com/cbxbiker61) + * [Tobias Schürg](https://github.com/tobiasschuerg) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and From 596a01ab308409401f12314d37205b434a3cc023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Sch=C3=BCrg?= Date: Wed, 1 Apr 2020 23:06:16 +0200 Subject: [PATCH 3/4] Update documentation for factor. --- docs/jsclientlib/printer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/jsclientlib/printer.rst b/docs/jsclientlib/printer.rst index d79d3d6de..88b9f61fa 100644 --- a/docs/jsclientlib/printer.rst +++ b/docs/jsclientlib/printer.rst @@ -325,7 +325,7 @@ Sets the feedrate multiplier to use. - ``factor`` is expected to be a integer value between 0 and 200 representing the new feedrate percentage. + ``factor`` is expected to be a integer value between 0 and 300 representing the new feedrate percentage. See the ``feedrate`` command in :ref:`Issue a print head command ` for more details. From 09b07274ab631fe1dd051bb7a1e418bd6c1f8e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 7 Apr 2020 15:33:55 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=E2=9C=A8=20Remove=20feed/flow=20rate=20upp?= =?UTF-8?q?er=20limits=20altogether?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of sliders as well (since those don't work without an upper limit) and adds a note to both that they are "write-only" as we don't have a way to query the current values from the firmware (yay...). Modifies #3503 Also fixes a bug in #3503, which only adjusted the client side boundaries but forgot about the server side. --- docs/jsclientlib/printer.rst | 4 ++-- src/octoprint/printer/standard.py | 12 +++++++----- src/octoprint/templates/tabs/control.jinja2 | 20 +++++++++++++++----- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/docs/jsclientlib/printer.rst b/docs/jsclientlib/printer.rst index 88b9f61fa..e0c014bab 100644 --- a/docs/jsclientlib/printer.rst +++ b/docs/jsclientlib/printer.rst @@ -144,7 +144,7 @@ Sets the current flowrate multiplier. - ``factor`` is expected to be a integer value between 75 and 125 representing the new flowrate percentage. + ``factor`` is expected to be a integer value >0 representing the new flowrate percentage. See the ``flowrate`` command in :ref:`Issue a tool command ` for more details. @@ -325,7 +325,7 @@ Sets the feedrate multiplier to use. - ``factor`` is expected to be a integer value between 0 and 300 representing the new feedrate percentage. + ``factor`` is expected to be a integer value >0 representing the new feedrate percentage. See the ``feedrate`` command in :ref:`Issue a print head command ` for more details. diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index e870c36e6..3ca5282d0 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -456,25 +456,27 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): self._comm.setTemperatureOffset(offsets) self._setOffsets(self._comm.getOffsets()) - def _convert_rate_value(self, factor, min=0, max=200): + def _convert_rate_value(self, factor, min_val=None, max_val=None): if not isinstance(factor, (int, float, long)): raise ValueError("factor is not a number") if isinstance(factor, float): factor = int(factor * 100.0) - if factor < min or factor > max: - raise ValueError("factor must be a value between {} and {}".format(min, max)) + if min_val and factor < min_val: + raise ValueError("factor must be a value >={}".format(min_val)) + elif max_val and factor > max_val: + raise ValueError("factor must be a value <={}".format(max_val)) return factor def feed_rate(self, factor, *args, **kwargs): - factor = self._convert_rate_value(factor, min=50, max=200) + factor = self._convert_rate_value(factor, min_val=1) self.commands("M220 S%d" % factor, tags=kwargs.get("tags", set()) | {"trigger:printer.feed_rate"}) def flow_rate(self, factor, *args, **kwargs): - factor = self._convert_rate_value(factor, min=75, max=125) + factor = self._convert_rate_value(factor, min_val=1) self.commands("M221 S%d" % factor, tags=kwargs.get("tags", set()) | {"trigger:printer.flow_rate"}) diff --git a/src/octoprint/templates/tabs/control.jinja2 b/src/octoprint/templates/tabs/control.jinja2 index a862991c2..ea58b269b 100644 --- a/src/octoprint/templates/tabs/control.jinja2 +++ b/src/octoprint/templates/tabs/control.jinja2 @@ -80,8 +80,12 @@
- - + +
+ + % + +
@@ -98,15 +102,21 @@
- + mm
- - +
+ +
+ + % + +
+