| 129 | } |
| 130 | |
| 131 | int 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 | |
| 168 | void IPProcessGrid::propagateNeedsUpdate(IPLProcess* process) |
| 169 | { |
nothing calls this directly
no test coverage detected