MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / execute

Method execute

ImagePlay/src/IPProcessGrid.cpp:257–415  ·  view source on GitHub ↗

! * \brief IPProcessGrid::execute */

Source from the content-addressed store, hash-verified

255 * \brief IPProcessGrid::execute
256 */
257void 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

Callers

nothing calls this directly

Calls 15

stepsMethod · 0.80
lockSceneMethod · 0.80
resetMessagesMethod · 0.80
beforeProcessingMethod · 0.80
setDurationMethod · 0.80
updateProcessMessagesMethod · 0.80
edgesInMethod · 0.80
indexFromMethod · 0.80
indexToMethod · 0.80
fromMethod · 0.80
showMessageMethod · 0.80
useOpenCVMethod · 0.80

Tested by

no test coverage detected