@@ -94,54 +94,54 @@ def resetDynamicValues(self):
9494 self .execMode : ExecMode = ExecMode .NONE
9595 self .jobInfos : dict = {}
9696
97+ def setNodeType (self , node ):
98+ """
99+ Set the node type and package information from the given node.
100+ We do not set the name in this method as it may vary if there are duplicates.
101+ """
102+ self .nodeType = node .nodeType
103+ self .packageName = node .packageName
104+ self .packageVersion = node .packageVersion
105+ self .mrNodeType = node .getMrNodeType ()
106+
97107 def setNode (self , node ):
98108 """ Set the node information from one node instance. """
99109 self .nodeName = node .name
100110 self .setNodeType (node )
101111
102- def initExternSubmit (self ):
103- """
104- When submitting a node, we reset the status information to ensure that we do not keep
105- outdated information.
106- """
107- self .resetDynamicValues ()
108- self .submitterSessionUid = meshroom .core .sessionUid
109- self .status = Status .SUBMITTED
110- self .execMode = ExecMode .EXTERN
111-
112112 def setJob (self , jid , submitterName ):
113113 """ Set Job infos on the node so that """
114114 self .jobInfos = {
115115 "jid" : str (jid ),
116116 "submitterName" : str (submitterName ),
117117 }
118-
118+
119119 @property
120120 def jobName (self ):
121121 if self .jobInfos :
122122 return f"{ self .jobInfos ['submitterName' ]} <{ self .jobInfos ['jid' ]} >"
123123 else :
124124 return "UNKNOWN"
125125
126- def initLocalSubmit (self ):
126+ def initExternSubmit (self ):
127127 """
128128 When submitting a node, we reset the status information to ensure that we do not keep
129129 outdated information.
130130 """
131131 self .resetDynamicValues ()
132132 self .submitterSessionUid = meshroom .core .sessionUid
133133 self .status = Status .SUBMITTED
134- self .execMode = ExecMode .LOCAL
134+ self .execMode = ExecMode .EXTERN
135135
136- def setNodeType (self , node ):
136+ def initLocalSubmit (self ):
137137 """
138- Set the node type and package information from the given node.
139- We do not set the name in this method as it may vary if there are duplicates .
138+ When submitting a node, we reset the status information to ensure that we do not keep
139+ outdated information .
140140 """
141- self .nodeType = node . nodeType
142- self .packageName = node . packageName
143- self .packageVersion = node . packageVersion
144- self .mrNodeType = node . getMrNodeType ()
141+ self .resetDynamicValues ()
142+ self .submitterSessionUid = meshroom . core . sessionUid
143+ self .status = Status . SUBMITTED
144+ self .execMode = ExecMode . LOCAL
145145
146146 def toDict (self ):
147147 keys = list (self .__slots__ ) or []
@@ -1348,7 +1348,6 @@ def isExtern(self):
13481348 if not self ._chunksCreated :
13491349 if self ._nodeStatus .execMode == ExecMode .EXTERN :
13501350 return True
1351- # TODO : use sessionID
13521351 elif self ._nodeStatus .execMode == ExecMode .LOCAL and self ._nodeStatus .status in (Status .SUBMITTED , Status .RUNNING ):
13531352 return meshroom .core .sessionUid != self ._nodeStatus .submitterSessionUid
13541353 return False
@@ -1621,6 +1620,7 @@ def initStatusOnCompute(self, forceCompute=False):
16211620 hasChunkToLaunch = True
16221621 for chunk in self ._chunks :
16231622 if forceCompute or (chunk ._status .status not in (Status .RUNNING , Status .SUCCESS )):
1623+ hasChunkToLaunch = True
16241624 chunk ._status .setNode (self )
16251625 chunk ._status .initLocalSubmit ()
16261626 chunk .upgradeStatusFile ()
@@ -2046,6 +2046,9 @@ def _hasDisplayableShape(self):
20462046 nodeType = Property (str , nodeType .fget , constant = True )
20472047 documentation = Property (str , getDocumentation , constant = True )
20482048 nodeInfos = Property (Variant , getNodeInfos , constant = True )
2049+ nodeStatusChanged = Signal ()
2050+ nodeStatus = Property (Variant , lambda self : self ._nodeStatus , notify = nodeStatusChanged )
2051+ nodeStatusNodeName = Property (str , lambda self : self ._nodeStatus .nodeName , notify = nodeStatusChanged )
20492052 positionChanged = Signal ()
20502053 position = Property (Variant , position .fget , position .fset , notify = positionChanged )
20512054 x = Property (float , lambda self : self ._position .x , notify = positionChanged )
0 commit comments