[ui] only load nodes in Viewer2D when at least one chunk is finished

This commit is contained in:
Loïc Vital 2022-09-29 11:15:11 +02:00 committed by Fabien Castan
parent c71449535d
commit b91d0b372e
2 changed files with 9 additions and 1 deletions

View file

@ -393,6 +393,9 @@ class NodeChunk(BaseObject):
def isStopped(self): def isStopped(self):
return self._status.status == Status.STOPPED return self._status.status == Status.STOPPED
def isFinished(self):
return self._status.status == Status.SUCCESS
def process(self, forceCompute=False): def process(self, forceCompute=False):
if not forceCompute and self._status.status == Status.SUCCESS: if not forceCompute and self._status.status == Status.SUCCESS:
logging.info("Node chunk already computed: {}".format(self.name)) logging.info("Node chunk already computed: {}".format(self.name))
@ -752,6 +755,11 @@ class BaseNode(BaseObject):
""" Return True if all chunks of this Node is either finished or running, False otherwise. """ """ Return True if all chunks of this Node is either finished or running, False otherwise. """
return all(chunk.isFinishedOrRunning() for chunk in self._chunks) return all(chunk.isFinishedOrRunning() for chunk in self._chunks)
@Slot(result=bool)
def isPartiallyFinished(self):
""" Return True is at least one chunk of this Node is finished, False otherwise. """
return any(chunk.isFinished() for chunk in self._chunks)
def alreadySubmittedChunks(self): def alreadySubmittedChunks(self):
return [ch for ch in self._chunks if ch.isAlreadySubmitted()] return [ch for ch in self._chunks if ch.isAlreadySubmitted()]

View file

@ -161,7 +161,7 @@ FocusScope {
} }
// node must be computed or at least running // node must be computed or at least running
if (!node.isFinishedOrRunning()) { if (!node.isPartiallyFinished()) {
return false; return false;
} }