Merge branch 'maintenance' into devel
Conflicts: src/octoprint/plugins/cura/__init__.py src/octoprint/plugins/cura/templates/cura_settings.jinja2
This commit is contained in:
commit
5062c1ce68
5 changed files with 50 additions and 13 deletions
|
|
@ -50,12 +50,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")),
|
||||
dict(type="wizard", name=gettext("CuraEngine"))
|
||||
]
|
||||
def get_template_vars(self):
|
||||
return dict(
|
||||
homepage=__plugin_url__
|
||||
)
|
||||
|
||||
##~~ WizardPlugin API
|
||||
|
||||
|
|
@ -522,10 +520,10 @@ def _get_usage_from_length(filament_length, filament_diameter):
|
|||
|
||||
return usage
|
||||
|
||||
__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()
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<small>{% trans %}
|
||||
You can import your existing profile <code>.ini</code> files from Cura (version up to and
|
||||
including 15.04) here. Please be aware that neither the <code>.json</code> 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 %}</small>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">{{ _('Abort') }}</button>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
<h4>{{ _('General') }}</h4>
|
||||
|
||||
<p>{% trans %}
|
||||
Specify the path to the CuraEngine binary. Note that only
|
||||
<strong>versions up to and including 15.04</strong> are supported.
|
||||
CuraEngine version 15.06 or newer is <strong>not</strong>
|
||||
compatible with this plugin.
|
||||
{% endtrans %}</p>
|
||||
|
||||
<form class="form-horizontal">
|
||||
{% include "_snippets/settings/cura/enginePath.jinja2" %}
|
||||
{% include "_snippets/settings/cura/engineLog.jinja2" %}
|
||||
|
|
@ -11,4 +18,8 @@
|
|||
|
||||
<button class="btn pull-right" data-bind="click: function() { $root.showImportProfileDialog() }">{{ _('Import Profile...') }}</button>
|
||||
|
||||
<div style="clear: both">
|
||||
<small>{% trans %}For more information on configuration and usage please <a href="{{ plugin_cura_homepage }}" target="_blank">see the Plugin's homepage</a>.{% endtrans %}</small>
|
||||
</div>
|
||||
|
||||
{% include "_snippets/settings/cura/profileImporter.jinja2" %}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
<div style="clear: both; margin-top: 20px;">
|
||||
<small>{% trans %}
|
||||
<strong>Don't know where to get a profile?</strong> In order to export
|
||||
a slicing profile from the Cura desktop UI, open it, set up your
|
||||
profile, then click on "File" and there on "Save Profile". You can
|
||||
import the .ini-file this creates via the "Import Profile" button.
|
||||
a slicing profile from the Cura desktop UI up to and including version 15.04,
|
||||
open it, set up your profile, then click on "File" and there on "Save Profile". You can
|
||||
import the <code>.ini</code> file this creates via the "Import Profile" button.
|
||||
{% endtrans %}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -277,6 +277,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 = []
|
||||
|
|
@ -776,21 +777,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):
|
||||
|
|
@ -801,13 +809,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
|
||||
|
|
@ -815,6 +831,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
|
||||
|
|
@ -1398,6 +1417,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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue