Merge pull request #2868 from gdombiak/extrude_speed2

Documentation fixed and extrusion speed value check
This commit is contained in:
Gina Häußge authored and GitHub committed 2018-11-02 10:52:42 +01:00
commit 39b2da3230
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -219,7 +219,7 @@ Issue a print head command
axes values are relative amounts) or to absolute position (provided axes values are coordinates)
* ``speed``: Optional. Speed at which to move. If not provided, minimum speed for all selected axes from printer
profile will be used. If provided but ``false``, no speed parameter will be appended to the command. Otherwise
interpreted as an integer signifying the speed in mm/s, to append to the command.
interpreted as an integer signifying the speed in mm/min, to append to the command.
home
Homes the print head in all of the given axes. Additional parameters are:
+5 -2
View File
@@ -368,11 +368,14 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
printer_profile = self._printerProfileManager.get_current_or_default()
# Use specified speed (if any)
extrusion_speed = speed
max_e_speed = printer_profile["axes"]["e"]["speed"]
if speed is None:
# No speed was specified so default to value configured in printer profile
extrusion_speed = printer_profile["axes"]["e"]["speed"]
extrusion_speed = max_e_speed
else:
# Make sure that specified value is not greater than maximum as defined in printer profile
extrusion_speed = min([speed, max_e_speed])
self.commands(["G91", "G1 E%s F%d" % (amount, extrusion_speed), "G90"],
tags=kwargs.get("tags", set()) | {"trigger:printer.extrude"})