Don't lock graph and node editor while computing nodes

Add possibilty to, while computing nodes:
add more nodes to the task manager,
edit, duplicate and remove nodes without breaking the tasks that are submitted
This commit is contained in:
Lee Geertsen 2019-08-12 18:41:15 +02:00 committed by Yann Lanthony
parent 51d6c18840
commit c00db25c23
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642
5 changed files with 94 additions and 28 deletions

View file

@ -225,6 +225,9 @@ class NodeChunk(BaseObject):
if newStatus.value <= self.status.status.value:
print('WARNING: downgrade status on node "{}" from {} to {}'.format(self.name, self.status.status,
newStatus))
if(newStatus == Status.SUBMITTED):
self.status = StatusData(self.node.name, self.node.nodeType, self.node.packageName, self.node.packageVersion)
if execMode is not None:
self.status.execMode = execMode
self.execModeNameChanged.emit()
@ -282,7 +285,8 @@ class NodeChunk(BaseObject):
try:
self.node.nodeDesc.processChunk(self)
except Exception as e:
self.upgradeStatusTo(Status.ERROR)
if self.status.status != Status.STOPPED:
self.upgradeStatusTo(Status.ERROR)
raise
except (KeyboardInterrupt, SystemError, GeneratorExit) as e:
self.upgradeStatusTo(Status.STOPPED)
@ -314,6 +318,9 @@ class NodeChunk(BaseObject):
logFile = Property(str, logFile.fget, notify=nodeFolderChanged)
statisticsFile = Property(str, statisticsFile.fget, notify=nodeFolderChanged)
nodeName = Property(str, lambda self: self.node.name, constant=True)
statusNodeName = Property(str, lambda self: self.status.nodeName, constant=True)
# simple structure for storing node position
Position = namedtuple("Position", ["x", "y"])