From 9ed79adb8dd44bcf59761123f5a7263166dacede Mon Sep 17 00:00:00 2001 From: Salandora Date: Tue, 17 Nov 2015 19:32:34 +0100 Subject: [PATCH 01/65] Fix SD Support deactivated bug and added "unknown command" to the whitelist of errors --- src/octoprint/util/comm.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index a0308fda..9023a006 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -262,6 +262,7 @@ class MachineCom(object): self._serial_factory_hooks = self._pluginManager.get_hooks("octoprint.comm.transport.serial.factory") # SD status data + self._sdEnabled = settings().getBoolean(["feature", "sdSupport"]) self._sdAvailable = False self._sdFileList = False self._sdFiles = [] @@ -719,21 +720,28 @@ class MachineCom(object): return self._sdFiles def startSdFileTransfer(self, filename): - if not self.isOperational() or self.isBusy(): + if not self._sdEnabled: return + if not self.isOperational() or self.isBusy(): + return self._changeState(self.STATE_TRANSFERING_FILE) self.sendCommand("M28 %s" % filename.lower()) def endSdFileTransfer(self, filename): - if not self.isOperational() or self.isBusy(): + if not self._sdEnabled: return + if not self.isOperational() or self.isBusy(): + return self.sendCommand("M29 %s" % filename.lower()) self._changeState(self.STATE_OPERATIONAL) self.refreshSdFiles() def deleteSdFile(self, filename): + if not self._sdEnabled: + return + if not self.isOperational() or (self.isBusy() and isinstance(self._currentFile, PrintingSdFileInformation) and self._currentFile.getFilename() == filename): @@ -744,13 +752,21 @@ class MachineCom(object): self.refreshSdFiles() def refreshSdFiles(self): + if not self._sdEnabled: + return + if not self.isOperational() or self.isBusy(): return + self.sendCommand("M20") def initSdCard(self): + if not self._sdEnabled: + return + if not self.isOperational(): return + self.sendCommand("M21") if settings().getBoolean(["feature", "sdAlwaysAvailable"]): self._sdAvailable = True @@ -758,6 +774,9 @@ class MachineCom(object): self._callback.on_comm_sd_state_change(self._sdAvailable) def releaseSdCard(self): + if not self._sdEnabled: + return + if not self.isOperational() or (self.isBusy() and self.isSdFileSelected()): # do not release the sd card if we are currently printing from it return @@ -1331,6 +1350,9 @@ class MachineCom(object): or "error writing to file" in line.lower(): #Also skip errors with the SD card pass + elif 'unknown command' in line.lower(): + #Ignore unkown command errors, it could be a typo or some missing feature + pass elif not self.isError(): self._errorValue = line[6:] if line.startswith("Error:") else line[2:] self._changeState(self.STATE_ERROR) From 7820c17d087dd02573bca5f3dde32229ec9d107c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 19 Nov 2015 11:42:12 +0100 Subject: [PATCH 02/65] [Cura] Make plugin a bit more verbose regarding usage & setup --- src/octoprint/plugins/cura/__init__.py | 13 ++++++------ .../cura/templates/cura_settings.jinja2 | 20 ++++++++++++++++++- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/octoprint/plugins/cura/__init__.py b/src/octoprint/plugins/cura/__init__.py index fd326a10..095a274b 100644 --- a/src/octoprint/plugins/cura/__init__.py +++ b/src/octoprint/plugins/cura/__init__.py @@ -37,11 +37,10 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin, ##~~ TemplatePlugin API - def get_template_configs(self): - from flask.ext.babel import gettext - return [ - dict(type="settings", name=gettext("CuraEngine")) - ] + def get_template_vars(self): + return dict( + homepage=__plugin_url__ + ) ##~~ StartupPlugin API @@ -413,9 +412,9 @@ def _sanitize_name(name): sanitized_name = sanitized_name.replace(" ", "_") return sanitized_name.lower() -__plugin_name__ = "CuraEngine" +__plugin_name__ = "CuraEngine (<= 15.04)" __plugin_author__ = "Gina Häußge" __plugin_url__ = "https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura" -__plugin_description__ = "Adds support for slicing via CuraEngine from within OctoPrint" +__plugin_description__ = "Adds support for slicing via CuraEngine versions up to and including version 15.04 from within OctoPrint" __plugin_license__ = "AGPLv3" __plugin_implementation__ = CuraPlugin() diff --git a/src/octoprint/plugins/cura/templates/cura_settings.jinja2 b/src/octoprint/plugins/cura/templates/cura_settings.jinja2 index 6779f95c..92cfe0ae 100644 --- a/src/octoprint/plugins/cura/templates/cura_settings.jinja2 +++ b/src/octoprint/plugins/cura/templates/cura_settings.jinja2 @@ -1,5 +1,12 @@

{{ _('General') }}

+

{% trans %} + Specify the path to the CuraEngine binary. Note that only + versions up to and including 15.04 are supported. + CuraEngine version 15.06 or newer is not + compatible with this plugin. +{% endtrans %}

+
@@ -10,7 +17,7 @@
@@ -53,6 +60,10 @@ +
+ {% trans %}For more information on configuration and usage please see the Plugin's homepage.{% endtrans %} +
+ + + {% trans %} + You can import your existing profile .ini files from Cura (version up to and + including 15.04) here. Please be aware that neither the .json profile format + from Cura versions starting with 15.06 is supported, nor are the custom Cura profile formats + that third party tools like e.g. Repetier create. + {% endtrans %}