Merge branch 'pr/3503' into maintenance
# Conflicts: # AUTHORS.md
This commit is contained in:
commit
810ee2f6d0
4 files changed
+25
-12
No files matched your search
@@ -117,6 +117,7 @@ date of first contribution):
|
||||
* [Kelly Anderson](https://github.com/cbxbiker61)
|
||||
* [Jim Neill](https://github.com/jneilliii)
|
||||
* [Dustin Kerber](https://github.com/kerber)
|
||||
* [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
|
||||
|
||||
@@ -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 <sec-api-printer-toolcommand>` for more details.
|
||||
|
||||
@@ -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 >0 representing the new feedrate percentage.
|
||||
|
||||
See the ``feedrate`` command in :ref:`Issue a print head command <sec-api-printer-printheadcommand>` for more details.
|
||||
|
||||
|
||||
@@ -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"})
|
||||
|
||||
|
||||
@@ -80,8 +80,12 @@
|
||||
|
||||
<!-- Feed rate -->
|
||||
<div id="control-jog-feedrate" class="jog-panel">
|
||||
<input type="number" style="width: 153px" data-bind="slider: {min: 50, max: 150, step: 1, value: feedRate, tooltip: 'hide'}">
|
||||
<button class="btn btn-block" style="width: 169px" data-bind="enable: isOperational(), click: function() { $root.sendFeedRateCommand() }">{{ _('Feed rate:') }}<span data-bind="text: feedRate() + '%'"></span></button>
|
||||
<label>{{ _('Feed rate modifier:') }} <a class="text-info" href="javascript:void(0)" data-bind="popover: {placement: 'top', trigger: 'hover', title: '{{ _('Please note!') }}', content: '{{ _('The feed rate can only be set, it cannot be read back from the firmware due to a limitation of the communication protocol. The value shown on the UI thus does not reflect the current setting.') }}'}"><i class="fa fa-info-circle"></i></a></label>
|
||||
<div class="input-append control-box">
|
||||
<input type="number" class="input-mini" min="1" step="1" data-bind="value: feedRate">
|
||||
<span class="add-on">%</span>
|
||||
<button class="btn" data-bind="enable: isOperational(), click: function() { $root.sendFeedRateCommand() }">Set</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Extrusion control panel -->
|
||||
@@ -98,15 +102,21 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div class="input-append control-box">
|
||||
<input type="text" class="input-mini text-right" data-bind="value: extrusionAmount, enable: isOperational() && !isPrinting(), attr: {placeholder: settings.printer_defaultExtrusionLength}">
|
||||
<input type="number" class="input-mini text-right" data-bind="value: extrusionAmount, enable: isOperational() && !isPrinting(), attr: {placeholder: settings.printer_defaultExtrusionLength}">
|
||||
<span class="add-on">mm</span>
|
||||
</div>
|
||||
<button class="btn btn-block control-box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendExtrudeCommand() }">{{ _('Extrude') }}</button>
|
||||
<button class="btn btn-block control-box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendRetractCommand() }">{{ _('Retract') }}</button>
|
||||
|
||||
<!-- Flow rate -->
|
||||
<input style="width: 100px" type="number" data-bind="slider: {min: 75, max: 125, step: 1, value: flowRate, tooltip: 'hide'}">
|
||||
<button class="btn btn-block control-box" data-bind="enable: isOperational(), click: function() { $root.sendFlowRateCommand() }">{{ _('Flow rate:') }}<span data-bind="text: flowRate() + '%'"></span></button>
|
||||
<div id="control-jog-feedrate" class="jog-panel">
|
||||
<label>{{ _('Flow rate modifier:') }} <a class="text-info" href="javascript:void(0)" data-bind="popover: {placement: 'top', trigger: 'hover', title: '{{ _('Please note!') }}', content: '{{ _('The flow rate can only be set, it cannot be read back from the firmware due to a limitation of the communication protocol. The value shown on the UI thus does not reflect the current setting.') }}'}"><i class="fa fa-info-circle"></i></a></label>
|
||||
<div class="input-append control-box">
|
||||
<input type="number" class="input-mini" min="1" step="1" data-bind="value: flowRate">
|
||||
<span class="add-on">%</span>
|
||||
<button class="btn" data-bind="enable: isOperational(), click: function() { $root.sendFlowRateCommand() }">Set</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- General control panel -->
|
||||
|
||||
Reference in new issue
Block a user