| 208 | } |
| 209 | |
| 210 | void IPProcessGrid::propagateResultReady(IPLProcess* process, bool resultReady) |
| 211 | { |
| 212 | qDebug() << "IPProcessGrid::propagateResultReady: " << QString::fromStdString(process->className()) << ", " << (resultReady ? "true" : "false"); |
| 213 | QQueue<IPProcessStep*> tmpQueue; |
| 214 | |
| 215 | // find step from process |
| 216 | for(auto it = _scene->steps()->begin(); it < _scene->steps()->end(); ++it) |
| 217 | { |
| 218 | IPProcessStep* step = (IPProcessStep*) *it; |
| 219 | IPLProcess* tmpProcess = step->process(); |
| 220 | |
| 221 | if(tmpProcess == process) |
| 222 | { |
| 223 | step->process()->setResultReady(resultReady); |
| 224 | |
| 225 | tmpQueue.enqueue(step); |
| 226 | break; |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | |
| 231 | // add all following processes via BFS |
| 232 | int counter = 0; |
| 233 | int limit = 100; |
| 234 | while(!tmpQueue.isEmpty() && counter < limit) |
| 235 | { |
| 236 | // set status |
| 237 | IPProcessStep* step = tmpQueue.dequeue(); |
| 238 | |
| 239 | for(auto it = step->edgesOut()->begin(); it < step->edgesOut()->end(); ++it) |
| 240 | { |
| 241 | IPProcessEdge* edge = (IPProcessEdge*) *it; |
| 242 | IPProcessStep* nextStep = edge->to(); |
| 243 | |
| 244 | nextStep->process()->setResultReady(resultReady); |
| 245 | |
| 246 | // add to queue and list |
| 247 | tmpQueue.enqueue(nextStep); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | _mainWindow->imageViewer()->updateImage(); |
| 252 | } |
| 253 | |
| 254 | /*! |
| 255 | * \brief IPProcessGrid::execute |
nothing calls this directly
no test coverage detected