Switch setting to fully control background gcode analysis queueing
This commit is contained in:
1 parent
4a324b4f5e
commit
46c527d24a
4 files changed
+13
-6
No files matched your search
@@ -19,6 +19,7 @@ from .analysis import QueueEntry, AnalysisQueue
|
||||
from .storage import LocalFileStorage
|
||||
from .util import AbstractFileWrapper, StreamWrapper, DiskFileWrapper
|
||||
from octoprint.util import get_fully_qualified_classname as fqcn
|
||||
from octoprint.settings import settings
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -223,8 +224,7 @@ class FileManager(object):
|
||||
self._progress_plugins = []
|
||||
self._preprocessor_hooks = dict()
|
||||
|
||||
import octoprint.settings
|
||||
self._recovery_file = os.path.join(octoprint.settings.settings().getBaseFolder("data"), "print_recovery_data.yaml")
|
||||
self._recovery_file = os.path.join(settings().getBaseFolder("data"), "print_recovery_data.yaml")
|
||||
|
||||
def initialize(self, process_backlog=False):
|
||||
self.reload_plugins()
|
||||
@@ -232,6 +232,10 @@ class FileManager(object):
|
||||
self.process_backlog()
|
||||
|
||||
def process_backlog(self):
|
||||
# only check for a backlog if gcodeAnalysis is 'idle' or 'always'
|
||||
if settings().get(["gcodeAnalysis", "runAt"]) == "never":
|
||||
return
|
||||
|
||||
def worker():
|
||||
self._logger.info("Adding backlog items from all storage types to analysis queue...".format(**locals()))
|
||||
for storage_type, storage_manager in self._storage_managers.items():
|
||||
|
||||
@@ -176,7 +176,10 @@ class AbstractAnalysisQueue(object):
|
||||
(False, default)
|
||||
"""
|
||||
|
||||
if high_priority:
|
||||
if settings().get(["gcodeAnalysis", "runAt"]) == "never":
|
||||
self._logger.debug("Ignoring entry {entry} for analysis queue".format(entry=entry))
|
||||
return
|
||||
elif high_priority:
|
||||
self._logger.debug("Adding entry {entry} to analysis queue with high priority".format(entry=entry))
|
||||
prio = self.__class__.HIGH_PRIO
|
||||
else:
|
||||
|
||||
@@ -1099,8 +1099,8 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
self._analysisQueue.resume() # printing done, put those cpu cycles to good use
|
||||
|
||||
elif state == comm.MachineCom.STATE_PRINTING:
|
||||
if settings().getBoolean(["gcodeAnalysis", "pauseDuringPrint"]):
|
||||
self._analysisQueue.pause() # do not analyse files while printing
|
||||
if settings().get(["gcodeAnalysis", "runAt"]) == "idle":
|
||||
self._analysisQueue.pause() # only analyse files while idle
|
||||
|
||||
if state == comm.MachineCom.STATE_CLOSED or state == comm.MachineCom.STATE_CLOSED_WITH_ERROR:
|
||||
if self._comm is not None:
|
||||
|
||||
@@ -259,7 +259,7 @@ default_settings = {
|
||||
"throttle_normalprio": 0.01,
|
||||
"throttle_highprio": 0.0,
|
||||
"throttle_lines": 100,
|
||||
"pauseDuringPrint": True
|
||||
"runAt": "idle" # 'never', 'idle', 'always'
|
||||
},
|
||||
"feature": {
|
||||
"temperatureGraph": True,
|
||||
|
||||
Reference in new issue
Block a user