Skip to content

Commit

Permalink
More modeler algorithm debug info.
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@338 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com committed Aug 7, 2012
1 parent 0b22244 commit 4bb5e36
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sextante/modeler/ModelerAlgorithm.py
Expand Up @@ -17,6 +17,7 @@
from sextante.parameters.ParameterTableField import ParameterTableField
from sextante.gui.Help2Html import Help2Html
import codecs
import time

class ModelerAlgorithm(GeoAlgorithm):

Expand Down Expand Up @@ -375,12 +376,18 @@ def processAlgorithm(self, progress):
progress.setText("Running " + alg.name + " [" + str(iAlg+1) + "/"
+ str(len(self.algs) - len(self.deactivated)) +"]")
outputs = {}
progress.setDebugInfo("Parameters: " +
', '.join([str(p).strip() + "=" + str(p.value) for p in alg.parameters]))
t0 = time.time()
alg.execute(progress)
dt = time.time() - t0
for out in alg.outputs:
outputs[out.name] = out.value
progress.setDebugInfo("Outputs: " +
', '.join([str(out).strip() + "=" + str(outputs[out.name]) for out in alg.outputs]))
self.producedOutputs[iAlg] = outputs
executed.append(iAlg)
progress.setDebugInfo("OK. %i outputs" % len(outputs))
progress.setDebugInfo("OK. Execution took %0.3f ms (%i outputs)." % (dt, len(outputs)))
except GeoAlgorithmExecutionException, e :
progress.setDebugInfo("Failed")
raise GeoAlgorithmExecutionException("Error executing algorithm " + str(iAlg) + "\n" + e.msg)
Expand Down

0 comments on commit 4bb5e36

Please sign in to comment.