Remove curaEngine from code

This commit is contained in:
Ross Hendrickson 2013-09-08 19:35:24 -05:00
parent 4b7300c2e8
commit 7a4bb8b94e
7 changed files with 1038 additions and 25 deletions

1008
octoprint/1q Normal file

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@ class CuraFactory(object):
if path:
return CuraEngine(path)
current_settings = settings(init=True)
path = current_settings.get(["curaEngine", "path"])
path = current_settings.get(["cura", "path"])
return CuraEngine(path)

View file

@ -138,7 +138,7 @@ class GcodeManager:
if isGcodeFileName(filename):
return self.processGcode(absolutePath)
curaEnabled = self._settings.get(["curaEngine", "enabled"])
curaEnabled = self._settings.get(["cura", "enabled"])
if isSTLFileName(filename) and curaEnabled and local:
gcodePath = util.genGcodeFileName(absolutePath)
@ -163,11 +163,11 @@ class GcodeManager:
from octoprint.cura import CuraFactory
curaEngine = CuraFactory.create_slicer()
cura = CuraFactory.create_slicer()
gcodePath = util.genGcodeFileName(absolutePath)
config = self._settings.get(["curaEngine", "config"])
config = self._settings.get(["cura", "config"])
curaEngine.process_file(
cura.process_file(
config, gcodePath, absolutePath, callBack, callBackArgs)
def processGcode(self, absolutePath):
if absolutePath is None:

View file

@ -176,7 +176,12 @@ class Printer():
self._comm.sendCommand(command)
def selectFile(self, filename, sd, printAfterSelect=False):
if self._comm is not None and (self._comm.isBusy() or self._comm.isStreaming()):
if not self._comm:
logging.info("No printer is connected, cannot load file")
return
if self._comm.isBusy() or self._comm.isStreaming():
return
self._printAfterSelect = printAfterSelect

View file

@ -580,10 +580,10 @@ def getSettings():
"actions": s.get(["system", "actions"]),
"events": s.get(["system", "events"])
},
"curaEngine": {
"enabled": s.getBoolean(["curaEngine", "enabled"]),
"path": s.get(["curaEngine", "path"]),
"config": s.get(["curaEngine", "config"])
"cura": {
"enabled": s.getBoolean(["cura", "enabled"]),
"path": s.get(["cura", "path"]),
"config": s.get(["cura", "config"])
}
})
@ -657,20 +657,20 @@ def setSettings():
if "events" in data["system"].keys(): s.set(["system", "events"], data["system"]["events"])
curaEngine = data.get("curaEngine", None)
cura = data.get("cura", None)
if curaEngine:
path = curaEngine.get("path")
if cura:
path = cura.get("path")
if path:
s.set(["curaEngine", "path"], path)
s.set(["cura", "path"], path)
config = curaEngine.get("config")
config = cura.get("config")
if config:
s.set(["curaEngine", "config"], config)
s.set(["cura", "config"], config)
# Enabled is a boolean so we cannot check that we have a result
enabled = curaEngine.get("enabled")
s.setBoolean(["curaEngine", "enabled"], enabled)
enabled = cura.get("enabled")
s.setBoolean(["cura", "enabled"], enabled)
s.save()

View file

@ -89,10 +89,10 @@ default_settings = {
"userManager": "octoprint.users.FilebasedUserManager",
"userfile": None
},
"curaEngine": {
"cura": {
"enabled": False,
"path": "/default/path/to/curaEngine/dir/",
"config": "/default/path/to/your/curaEngine/config/file/"
"path": "/default/path/to/cura",
"config": "/default/path/to/your/cura/config.ini"
},
"events": {
"systemCommandTrigger": {

View file

@ -1472,9 +1472,9 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) {
self.folder_timelapseTmp(response.folder.timelapseTmp);
self.folder_logs(response.folder.logs);
self.cura_enabled(response.curaEngine.enabled);
self.cura_path(response.curaEngine.path);
self.cura_config(response.curaEngine.config);
self.cura_enabled(response.cura.enabled);
self.cura_path(response.cura.path);
self.cura_config(response.cura.config);
self.temperature_profiles(response.temperature.profiles);
@ -1533,7 +1533,7 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) {
"system": {
"actions": self.system_actions()
},
"curaEngine": {
"cura": {
"enabled": self.cura_enabled(),
"path": self.cura_path(),
"config": self.cura_config()