| 166 | } |
| 167 | |
| 168 | void IPProcessGrid::propagateNeedsUpdate(IPLProcess* process) |
| 169 | { |
| 170 | qDebug() << "IPProcessGrid::propagateNeedsUpdate: " << QString::fromStdString(process->className()); |
| 171 | QQueue<IPProcessStep*> tmpQueue; |
| 172 | |
| 173 | // find step from process |
| 174 | for(auto it = _scene->steps()->begin(); it < _scene->steps()->end(); ++it) |
| 175 | { |
| 176 | IPProcessStep* step = (IPProcessStep*) *it; |
| 177 | IPLProcess* tmpProcess = step->process(); |
| 178 | |
| 179 | if(tmpProcess == process) |
| 180 | { |
| 181 | step->process()->requestUpdate(); |
| 182 | |
| 183 | tmpQueue.enqueue(step); |
| 184 | break; |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | |
| 189 | // add all following processes via BFS |
| 190 | int counter = 0; |
| 191 | int limit = 100; |
| 192 | while(!tmpQueue.isEmpty() && counter < limit) |
| 193 | { |
| 194 | // set status |
| 195 | IPProcessStep* step = tmpQueue.dequeue(); |
| 196 | |
| 197 | for(auto it = step->edgesOut()->begin(); it < step->edgesOut()->end(); ++it) |
| 198 | { |
| 199 | IPProcessEdge* edge = (IPProcessEdge*) *it; |
| 200 | IPProcessStep* nextStep = edge->to(); |
| 201 | |
| 202 | nextStep->process()->requestUpdate(); |
| 203 | |
| 204 | // add to queue and list |
| 205 | tmpQueue.enqueue(nextStep); |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | void IPProcessGrid::propagateResultReady(IPLProcess* process, bool resultReady) |
| 211 | { |