! * \brief IPProcessGrid::execute */
| 255 | * \brief IPProcessGrid::execute |
| 256 | */ |
| 257 | void IPProcessGrid::execute(bool forcedUpdate /* = false*/) |
| 258 | { |
| 259 | // if no processes yet, then exit |
| 260 | if(_scene->steps()->size() < 1) |
| 261 | { |
| 262 | return; |
| 263 | } |
| 264 | |
| 265 | // if already running or nothing has changed, exit |
| 266 | if(_isRunning || !_updateNeeded) |
| 267 | { |
| 268 | return; |
| 269 | } |
| 270 | // prevent user changes during execution |
| 271 | _mainWindow->lockScene(); |
| 272 | _isRunning = true; |
| 273 | _sequenceCount = 0; |
| 274 | |
| 275 | buildQueue(); |
| 276 | |
| 277 | int totalDurationMs = 0; |
| 278 | |
| 279 | // execute the processes |
| 280 | int counter = 0; |
| 281 | int limit = 10000; |
| 282 | bool blockFailLoop = false; |
| 283 | |
| 284 | QList<IPProcessStep*> afterProcessingList; |
| 285 | |
| 286 | QListIterator<IPProcessStep *> it(_processList); |
| 287 | while (it.hasNext() && counter < limit) |
| 288 | { |
| 289 | if(_stopExecution) |
| 290 | return; |
| 291 | |
| 292 | IPProcessStep* step = it.next(); |
| 293 | _currentStep = step; |
| 294 | |
| 295 | // make sure the progress bar gets filled |
| 296 | updateProgress(1); |
| 297 | |
| 298 | // source processes don't have inputs |
| 299 | if(step->process()->isSource()) |
| 300 | { |
| 301 | // execute thread |
| 302 | if(step->process()->updateNeeded() || forcedUpdate) |
| 303 | { |
| 304 | step->process()->resetMessages(); |
| 305 | step->process()->beforeProcessing(); |
| 306 | int durationMs = executeThread(step->process()); |
| 307 | if ( !_lastProcessSuccess ) blockFailLoop = true; |
| 308 | |
| 309 | // afterProcessing will be called later |
| 310 | afterProcessingList.append(step); |
| 311 | |
| 312 | totalDurationMs += durationMs; |
| 313 | step->setDuration(durationMs); |
| 314 |
nothing calls this directly
no test coverage detected