@@ -154,8 +154,7 @@ def accept(self):
154
154
continue
155
155
widget = self .table .cellWidget (row , col )
156
156
if not self .setParameterValueFromWidget (param , widget , alg ):
157
- self .progressLabel .setText ("<b>Missing parameter value: " + param .description + " (row " + str (row + 1 ) + ")</b>" )
158
- #QMessageBox.critical(self, "Unable to execute batch process", "Wrong or missing parameter values")
157
+ self .progressLabel .setText ("<b>Missing parameter value: " + param .description + " (row " + str (row + 1 ) + ")</b>" )
159
158
self .algs = None
160
159
return
161
160
col += 1
@@ -168,8 +167,7 @@ def accept(self):
168
167
out .value = text
169
168
col += 1
170
169
else :
171
- self .progressLabel .setText ("<b>Wrong or missing parameter value: " + out .description + " (row " + str (row + 1 ) + ")</b>" )
172
- #QMessageBox.critical(self, "Unable to execute batch process", "Wrong or missing parameter values")
170
+ self .progressLabel .setText ("<b>Wrong or missing parameter value: " + out .description + " (row " + str (row + 1 ) + ")</b>" )
173
171
self .algs = None
174
172
return
175
173
self .algs .append (alg )
@@ -179,15 +177,14 @@ def accept(self):
179
177
QApplication .setOverrideCursor (QCursor (Qt .WaitCursor ))
180
178
self .table .setEnabled (False )
181
179
if SextanteConfig .getSetting (SextanteConfig .USE_THREADS ):
180
+ self .tabWidget .setCurrentIndex (1 )
182
181
self .nextAlg (0 )
183
182
else :
184
183
i = 0
185
184
self .progress .setMaximum (len (self .algs ))
186
185
for alg in self .algs :
187
186
self .setBaseText ("Processing algorithm " + str (i + 1 ) + "/" + str (len (self .algs )) + "..." )
188
187
if UnthreadedAlgorithmExecutor .runalg (alg , self ):
189
- #self.progress.setValue(i)
190
- #self.loadHTMLResults(alg, i)
191
188
if self .load [i ]:
192
189
SextantePostprocessing .handleAlgorithmResults (alg , self , False )
193
190
i += 1
@@ -209,15 +206,13 @@ def cancel(self):
209
206
if self .algEx :
210
207
self .algEx .terminate ()
211
208
self .table .setEnabled (True )
212
- #self.close()
213
209
214
210
@pyqtSlot ()
215
211
def finish (self , i ):
216
212
if not self .stop :
217
213
if self .load [i ]:
218
214
SextantePostprocessing .handleAlgorithmResults (self .algs [i ], self , False )
219
215
i += 1
220
- #self.progress.setValue(i)
221
216
if len (self .algs ) == i :
222
217
self .finishAll ()
223
218
self .algEx = None
@@ -232,17 +227,21 @@ def error(self, msg):
232
227
if self .algEx :
233
228
self .algEx .terminate ()
234
229
self .table .setEnabled (True )
235
- #self.close()
236
230
237
231
238
232
def nextAlg (self , i ):
239
233
self .stop = False
240
- self .setBaseText ("Processing algorithm " + str (i ) + "/" + str (len (self .algs )) + "..." )
234
+ self .setBaseText ("Processing algorithm " + str (i + 1 ) + "/" + str (len (self .algs )) + "..." )
241
235
self .algEx = AlgorithmExecutor (self .algs [i ]);
242
236
self .algEx .percentageChanged .connect (self .setPercentage )
243
237
self .algEx .textChanged .connect (self .setText )
244
238
self .algEx .error .connect (self .error )
245
239
self .algEx .finished .connect (lambda : self .finish (i ))
240
+ self .algEx .infoSet .connect (self .setInfo )
241
+ if SextanteConfig .getSetting (SextanteConfig .SHOW_DEBUG_IN_DIALOG ):
242
+ self .algEx .commandSet .connect (self .setCommand )
243
+ self .algEx .debugInfoSet .connect (self .setDebugInfo )
244
+ self .algEx .consoleInfoSet .connect (self .setConsoleInfo )
246
245
self .algEx .start ()
247
246
248
247
def createSummaryTable (self ):
@@ -273,7 +272,6 @@ def finishAll(self):
273
272
QApplication .restoreOverrideCursor ()
274
273
self .table .setEnabled (True )
275
274
QMessageBox .information (self , "Batch processing" , "Batch processing successfully completed!" )
276
- #self.close()
277
275
278
276
def setParameterValueFromWidget (self , param , widget , alg = None ):
279
277
if isinstance (param , (ParameterRaster , ParameterVector , ParameterTable , ParameterMultipleInput )):
0 commit comments