mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Log console output (SAGA; OTB; GRASS).
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@339 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
This commit is contained in:
parent
4bb5e36e44
commit
ec1424b1d8
@ -274,7 +274,7 @@ class GrassAlgorithm(GeoAlgorithm):
|
||||
loglines = []
|
||||
loglines.append("GRASS execution commands")
|
||||
for line in commands:
|
||||
progress.setInfo(line)
|
||||
progress.setCommand(line)
|
||||
loglines.append(line)
|
||||
if SextanteConfig.getSetting(GrassUtils.GRASS_LOG_COMMANDS):
|
||||
SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines)
|
||||
|
@ -265,6 +265,7 @@ class GrassUtils:
|
||||
pass
|
||||
else:
|
||||
loglines.append(line)
|
||||
progress.setConsoleInfo(line)
|
||||
if SextanteConfig.getSetting(GrassUtils.GRASS_LOG_CONSOLE):
|
||||
SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines)
|
||||
shutil.rmtree(GrassUtils.grassMapsetFolder(), True)
|
||||
|
@ -209,6 +209,7 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
if SextanteConfig.getSetting(SextanteConfig.SHOW_DEBUG_IN_DIALOG):
|
||||
self.algEx.commandSet.connect(self.setCommand)
|
||||
self.algEx.debugInfoSet.connect(self.setDebugInfo)
|
||||
self.algEx.consoleInfoSet.connect(self.setConsoleInfo)
|
||||
self.algEx.start()
|
||||
self.setInfo("<b>Algorithm %s started</b>" % self.alg.name)
|
||||
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(True)
|
||||
@ -304,6 +305,10 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
def setDebugInfo(self, msg):
|
||||
self.setInfo('<span style="color:blue">' + msg + '</span>')
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setConsoleInfo(self, msg):
|
||||
self.setCommand('<span style="color:darkgray">' + msg + '</span>')
|
||||
|
||||
def setPercentage(self, i):
|
||||
if self.progress.maximum() == 0:
|
||||
self.progress.setMaximum(100)
|
||||
|
@ -14,6 +14,7 @@ class AlgorithmExecutor(QThread):
|
||||
infoSet = pyqtSignal(str)
|
||||
commandSet = pyqtSignal(str)
|
||||
debugInfoSet = pyqtSignal(str)
|
||||
consoleInfoSet = pyqtSignal(str)
|
||||
#started & finished inherited from QThread
|
||||
|
||||
def __init__(self, alg, iterParam = None, parent = None):
|
||||
@ -34,6 +35,8 @@ class AlgorithmExecutor(QThread):
|
||||
self.algorithmExecutor.commandSet.emit(cmd)
|
||||
def setDebugInfo(self, info):
|
||||
self.algorithmExecutor.debugInfoSet.emit(info)
|
||||
def setConsoleInfo(self, info):
|
||||
self.algorithmExecutor.consoleInfoSet.emit(info)
|
||||
self.progress = Progress(self)
|
||||
if self.parameterToIterate:
|
||||
self.run = self.runalgIterating
|
||||
|
@ -83,3 +83,6 @@ class SilentProgress():
|
||||
|
||||
def setDebugInfo(self, _):
|
||||
pass
|
||||
|
||||
def setConsoleInfo(self, _):
|
||||
pass
|
||||
|
@ -65,6 +65,7 @@ class OTBUtils:
|
||||
progress.setPercentage(perc)
|
||||
else:
|
||||
loglines.append(line)
|
||||
progress.setConsoleInfo(line)
|
||||
SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines)
|
||||
|
||||
|
||||
|
@ -79,6 +79,7 @@ class SagaUtils:
|
||||
line = line.strip()
|
||||
if line!="/" and line!="-" and line !="\\" and line!="|":
|
||||
loglines.append(line)
|
||||
progress.setConsoleInfo(line)
|
||||
if SextanteConfig.getSetting(SagaUtils.SAGA_LOG_CONSOLE):
|
||||
SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user