mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-28 16:36:32 +02:00
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:
commit
8ce2ac6fe8
3 changed files with 22 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue