Skip to content
Permalink
Browse files
SAGA commandline to algorithm execution dialog log
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@331 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com committed Aug 2, 2012
1 parent ae44e7b commit f2c9b03
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
@@ -199,6 +199,7 @@ def accept(self):
self.algEx.percentageChanged.connect(self.setPercentage)
self.algEx.textChanged.connect(self.setText)
self.algEx.iterated.connect(self.iterate)
self.algEx.infoSet.connect(self.log)
self.algEx.start()
self.log("Algorithm %s started" % self.alg.name)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(True)
@@ -274,9 +275,8 @@ def cancel(self):
except:
pass

@pyqtSlot(str, bool)
@pyqtSlot(str)
def log(self, msg, error = False):
print "!", msg
if error:
SextanteLog.addToLog(SextanteLog.LOG_ERROR, msg)
self.logText.append('<b>' + msg + '</b>')
@@ -10,6 +10,7 @@ class AlgorithmExecutor(QThread):
textChanged = pyqtSignal(QString)
error = pyqtSignal(str)
iterated = pyqtSignal(int)
infoSet = pyqtSignal(str)
#started & finished inherited from QThread

def __init__(self, alg, iterParam = None, parent = None):
@@ -24,6 +25,8 @@ def setText(self, text):
self.algorithmExecutor.textChanged.emit(text)
def setPercentage(self, p):
self.algorithmExecutor.percentageChanged.emit(p)
def setInfo(self, info):
self.algorithmExecutor.infoSet.emit(info)
self.progress = Progress(self)
if self.parameterToIterate:
self.run = self.runalgIterating
@@ -278,6 +278,7 @@ def processAlgorithm(self, progress):
loglines = []
loglines.append("SAGA execution commands")
for line in commands:
progress.setInfo(line)
loglines.append(line)
if SextanteConfig.getSetting(SagaUtils.SAGA_LOG_COMMANDS):
SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines)

0 comments on commit f2c9b03

Please sign in to comment.