Remove development logging
This commit is contained in:
parent
26ebfe3e1f
commit
a7b7f26da5
6 changed files with 2 additions and 28 deletions
|
|
@ -30,8 +30,6 @@ class CuraEngine(object):
|
|||
|
||||
self.cura_path = cura_path
|
||||
|
||||
logging.info('CuraEngine Created')
|
||||
|
||||
|
||||
def process_file(
|
||||
self, config, gcode, file_path, call_back=None,
|
||||
|
|
@ -49,19 +47,12 @@ class CuraEngine(object):
|
|||
|
||||
def start_thread(call_back, call_back_args, call_args, cwd):
|
||||
import subprocess
|
||||
logging.info("Starting SubProcess in Thread %s", str(cwd))
|
||||
logging.info("Subprocess args: %s" % str(call_args))
|
||||
process = subprocess.call(call_args, cwd=cwd)
|
||||
call_back(*call_back_args)
|
||||
logging.info("Slicing call back complete:%s" % str(call_back))
|
||||
|
||||
|
||||
args = ['python', '-m', 'Cura.cura', '-i', config, '-s', file_path, '-o', gcode]
|
||||
|
||||
logging.info('Cura args:%s' % str(args))
|
||||
|
||||
thread = threading.Thread(target=start_thread, args=(call_back,
|
||||
call_back_args, args, self.cura_path))
|
||||
|
||||
thread.start()
|
||||
logging.info('Cura Slicing File:%s' % file_path)
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ class CuraFactoryTestCase(unittest.TestCase):
|
|||
def test_cura_engine_process_file(self, thread, process):
|
||||
path = 'rosshendrickson/workspaces/opensource/CuraEngine/'
|
||||
|
||||
cura_engine = CuraFactory.create_slicer(path)
|
||||
cura = CuraFactory.create_slicer(path)
|
||||
file_path = './cura/tests/test.stl'
|
||||
config_path = './cura/tests/config'
|
||||
gcode_filename= './cura/tests/output.gcode'
|
||||
|
||||
cura_engine.process_file(config_path, gcode_filename, file_path)
|
||||
cura.process_file(config_path, gcode_filename, file_path)
|
||||
self.assertTrue(thread.called)
|
||||
|
||||
|
|
|
|||
|
|
@ -129,8 +129,6 @@ class GcodeManager:
|
|||
|
||||
absolutePath = self.getAbsolutePath(file.filename, mustExist=False)
|
||||
|
||||
logging.info("Adding file:%s" % absolutePath)
|
||||
|
||||
if absolutePath is None:
|
||||
return None
|
||||
|
||||
|
|
@ -138,16 +136,12 @@ class GcodeManager:
|
|||
filename = file.filename
|
||||
|
||||
if isGcodeFileName(filename):
|
||||
logging.info("File is Gcode File")
|
||||
return self.processGcode(absolutePath)
|
||||
|
||||
curaEnabled = self._settings.get(["curaEngine", "enabled"])
|
||||
logging.info("Cura Enabled %s" % str(curaEnabled))
|
||||
|
||||
if isSTLFileName(filename) and curaEnabled and local:
|
||||
logging.info("File is STL - Needs to be sliced")
|
||||
gcodePath = util.genGcodeFileName(absolutePath)
|
||||
logging.info("FILENAME: %s" % filename)
|
||||
|
||||
callBackArgs = [gcodePath]
|
||||
callBack = self.processGcode
|
||||
|
|
|
|||
|
|
@ -464,17 +464,14 @@ class Printer():
|
|||
from octoprint.util import isGcodeFileName
|
||||
from octoprint.util import isSTLFileName
|
||||
|
||||
logging.info("Adding SD Card file:%s" % filename)
|
||||
if not self._comm or self._comm.isBusy():
|
||||
logging.error("No connection to printer or printer is busy")
|
||||
return
|
||||
|
||||
if isGcodeFileName(filename):
|
||||
logging.info("Sending Gcode to SD card")
|
||||
self.streamSdFile(filename, absolutePath)
|
||||
|
||||
if isSTLFileName(filename):
|
||||
logging.info("Slicing stl and then sending to SD card")
|
||||
gcodePath = util.genGcodeFileName(absolutePath)
|
||||
gcodeFileName = util.genGcodeFileName(filename)
|
||||
callBackArgs = [gcodeFileName, gcodePath]
|
||||
|
|
|
|||
|
|
@ -313,16 +313,12 @@ def readGcodeFile(filename):
|
|||
@login_required
|
||||
def uploadGcodeFile():
|
||||
if "gcode_file" in request.files.keys():
|
||||
logging.info("Uploading Gcode File")
|
||||
file = request.files["gcode_file"]
|
||||
sd = "target" in request.values.keys() and request.values["target"] == "sd";
|
||||
|
||||
logging.info("SD:%s" % str(sd))
|
||||
|
||||
currentFilename = None
|
||||
currentSd = None
|
||||
currentJob = printer.getCurrentJob()
|
||||
logging.info("Current Job:%s" % str(currentJob))
|
||||
if currentJob is not None and "filename" in currentJob.keys() and "sd" in currentJob.keys():
|
||||
currentFilename = currentJob["filename"]
|
||||
currentSd = currentJob["sd"]
|
||||
|
|
@ -344,7 +340,6 @@ def uploadGcodeFile():
|
|||
|
||||
absFilename = gcodeManager.getAbsolutePath(filename)
|
||||
if sd:
|
||||
logging.info("Add to SD file")
|
||||
printer.addSdFile(filename, absFilename)
|
||||
|
||||
if currentFilename == filename and currentSd == sd:
|
||||
|
|
|
|||
|
|
@ -332,13 +332,11 @@ class MachineCom(object):
|
|||
eventManager().fire("Error", self.getErrorString())
|
||||
|
||||
def startFileTransfer(self, filename, remoteFilename):
|
||||
logging.info("Starting File Transfer:%s" % filename)
|
||||
if not self.isOperational() or self.isBusy():
|
||||
logging.info("Printer is not operation or busy")
|
||||
return
|
||||
|
||||
self._currentFile = StreamingGcodeFileInformation(filename)
|
||||
logging.info("Starting to send currentfile:%s" % str(self._currentFile))
|
||||
self._currentFile.start()
|
||||
|
||||
self.sendCommand("M28 %s" % remoteFilename)
|
||||
|
|
@ -408,7 +406,6 @@ 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())
|
||||
|
|
|
|||
Loading…
Reference in a new issue