Work on SD file refresh
This commit is contained in:
parent
43cd85b8e4
commit
d4bb75a2ee
3 changed files with 4 additions and 7 deletions
|
|
@ -4,7 +4,6 @@ __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agp
|
|||
import logging
|
||||
|
||||
from octoprint.settings import settings
|
||||
from octoprint.gcodefiles import GcodeManager
|
||||
|
||||
class CuraFactory(object):
|
||||
|
||||
|
|
@ -48,9 +47,6 @@ class CuraEngine(object):
|
|||
logging.info("Subprocess args: %s" % str(call_args))
|
||||
process = subprocess.call(call_args)
|
||||
call_back(*call_back_args)
|
||||
# TODO: Figure out a better way to have the file manager refresh
|
||||
manager = GcodeManager()
|
||||
manager.processGcode(call_args[4])
|
||||
logging.info("Slicing call back complete:%s" % str(call_back))
|
||||
|
||||
args = [self.cura_path, '-s', config, '-o', gcode, file_path]
|
||||
|
|
|
|||
|
|
@ -463,7 +463,6 @@ class Printer():
|
|||
def addSdFile(self, filename, absolutePath):
|
||||
from octoprint.util import isGcodeFileName
|
||||
from octoprint.util import isSTLFileName
|
||||
from octoprint.gcodefiles import GcodeManager
|
||||
|
||||
logging.info("Adding SD Card file:%s" % filename)
|
||||
if not self._comm or self._comm.isBusy():
|
||||
|
|
@ -481,8 +480,7 @@ class Printer():
|
|||
callBackArgs = [gcodeFileName, gcodePath]
|
||||
callBack = self.streamSdFile
|
||||
|
||||
gcodeManager = GcodeManager()
|
||||
gcodeManager.processSTL(
|
||||
self._gcodeManager.processSTL(
|
||||
absolutePath, callBack, callBackArgs)
|
||||
|
||||
def streamSdFile(self, filename, path):
|
||||
|
|
|
|||
|
|
@ -409,6 +409,7 @@ class MachineCom(object):
|
|||
|
||||
def endSdFileTransfer(self, filename):
|
||||
if not self.isOperational() or self.isBusy():
|
||||
logging.info("endSdFile busy")
|
||||
return
|
||||
|
||||
self.sendCommand("M29 %s" % filename.lower())
|
||||
|
|
@ -426,7 +427,9 @@ class MachineCom(object):
|
|||
self.refreshSdFiles()
|
||||
|
||||
def refreshSdFiles(self):
|
||||
logging.info("refresh sd files")
|
||||
if not self.isOperational() or self.isBusy():
|
||||
logging.info("refresh busy")
|
||||
return
|
||||
self.sendCommand("M20")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue