Merge pull request #1832 from alicevision/fix/graphLocalComputations

[ui] Correctly determine if a graph is being computed locally and update nodes' statuses accordingly
This commit is contained in:
Fabien Castan 2022-12-05 16:20:58 +01:00 committed by GitHub
commit 8ce2ac6fe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 2 deletions

View file

@ -11,6 +11,7 @@ from multiprocessing.pool import ThreadPool
from PySide2.QtCore import Slot, QJsonValue, QObject, QUrl, Property, Signal, QPoint
from meshroom import multiview
from meshroom.core import sessionUid
from meshroom.common.qt import QObjectListModel
from meshroom.core.attribute import Attribute, ListAttribute
from meshroom.core.graph import Graph, Edge
@ -283,6 +284,9 @@ class UIGraph(QObject):
""" Set the internal graph. """
if self._graph:
self.stopExecution()
# Clear all the locally submitted nodes at once before the graph gets changed, as it won't receive further updates
if self._computingLocally:
self._graph.clearLocallySubmittedNodes()
self.clear()
oldGraph = self._graph
self._graph = g
@ -457,7 +461,11 @@ class UIGraph(QObject):
def updateGraphComputingStatus(self):
# update graph computing status
computingLocally = any([ch.status.execMode == ExecMode.LOCAL and ch.status.status in (Status.RUNNING, Status.SUBMITTED) for ch in self._sortedDFSChunks])
computingLocally = any([
(ch.status.execMode == ExecMode.LOCAL and
ch.status.sessionUid == sessionUid and
ch.status.status in (Status.RUNNING, Status.SUBMITTED))
for ch in self._sortedDFSChunks])
submitted = any([ch.status.status == Status.SUBMITTED for ch in self._sortedDFSChunks])
if self._computingLocally != computingLocally or self._submitted != submitted:
self._computingLocally = computingLocally