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

Method executeThread

ImagePlay/src/IPProcessGrid.cpp:131–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131int IPProcessGrid::executeThread(IPLProcess* process, IPLImage *image /*= NULL*/, int inputIndex /*= 0*/, bool useOpenCV /*= false*/)
132{
133 qDebug() << "IPProcessGrid::executeThread: " << QString::fromStdString(process->className());
134 QElapsedTimer timer;
135 timer.start();
136
137 // create new thread
138 _thread = new IPProcessThread(process, image, inputIndex, useOpenCV);
139
140 connect(_thread, &IPProcessThread::progressUpdated, this, &IPProcessGrid::updateProgress);
141
142 _mainWindow->setThreadRunning(true);
143 _mainWindow->imageViewer()->zoomWidget()->zoomUpdateMutex()->lock();
144 process->setResultReady(false);
145 process->resetMessages();
146
147 _thread->start();
148 while(!_thread->isFinished())
149 {
150 if(_longProcess)
151 _currentStep->update();
152
153 QApplication::processEvents();
154 }
155 process->setResultReady(_thread->success());
156 _mainWindow->setThreadRunning(false);
157 _mainWindow->imageViewer()->zoomWidget()->zoomUpdateMutex()->unlock();
158
159 _lastProcessSuccess = _thread->success();
160
161 delete _thread;
162 _thread = NULL;
163
164 // return duration
165 return timer.elapsed();
166}
167
168void IPProcessGrid::propagateNeedsUpdate(IPLProcess* process)
169{

Callers

nothing calls this directly

Calls 7

startMethod · 0.80
setThreadRunningMethod · 0.80
zoomUpdateMutexMethod · 0.80
zoomWidgetMethod · 0.80
imageViewerMethod · 0.80
resetMessagesMethod · 0.80
successMethod · 0.80

Tested by

no test coverage detected