Allow configuration of analysis throttling via config.yaml
This commit is contained in:
parent
e6dd37e26e
commit
7f3d4a8380
2 changed files with 9 additions and 6 deletions
|
|
@ -17,6 +17,7 @@ import collections
|
|||
import time
|
||||
|
||||
from octoprint.events import Events, eventManager
|
||||
from octoprint.settings import settings
|
||||
|
||||
import octoprint.util.gcodeInterpreter as gcodeInterpreter
|
||||
|
||||
|
|
@ -306,11 +307,11 @@ class GcodeAnalysisQueue(AbstractAnalysisQueue):
|
|||
|
||||
def _do_analysis(self, high_priority=False):
|
||||
try:
|
||||
def throttle():
|
||||
time.sleep(0.01)
|
||||
|
||||
throttle_callback = throttle
|
||||
if high_priority:
|
||||
throttle = settings().getFloat(["gcodeAnalysis", "throttle_highprio"]) if high_priority else settings().getFloat(["gcodeAnalysis", "throttle_normalprio"])
|
||||
if throttle > 0:
|
||||
def throttle_callback():
|
||||
time.sleep(throttle)
|
||||
else:
|
||||
throttle_callback = None
|
||||
|
||||
self._gcode = gcodeInterpreter.gcode()
|
||||
|
|
|
|||
|
|
@ -178,7 +178,9 @@ default_settings = {
|
|||
"sizeThreshold": 20 * 1024 * 1024, # 20MB
|
||||
},
|
||||
"gcodeAnalysis": {
|
||||
"maxExtruders": 10
|
||||
"maxExtruders": 10,
|
||||
"throttle_normalprio": 0.01,
|
||||
"throttle_highprio": 0.0
|
||||
},
|
||||
"feature": {
|
||||
"temperatureGraph": True,
|
||||
|
|
|
|||
Loading…
Reference in a new issue