Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/superv.git] / src / GraphExecutor / DataFlowExecutor_DataFlow.cxx
index 25e0bdd912e7b0d1f37de61a2a352d21db869165..4552e07d21771cdd1a483eec219d40579f9ba7b8 100644 (file)
@@ -239,8 +239,8 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
   for ( i = 0 ; i < anOutPort->InPortsSize() ; i++ ) {
     const char * ToNodeName = anOutPort->ChangeInPorts( i )->NodeName() ;
     const char * ToParameterName = anOutPort->ChangeInPorts( i )->PortName() ;
-    GraphBase::ComputingNode * aComputingNode = Graph()->GetChangeGraphNode( ToNodeName ) ;
     if ( strcmp( ToNodeName , Name() ) ) {
+      GraphBase::ComputingNode * aComputingNode = Graph()->GetChangeGraphNode( ToNodeName ) ;
       GraphExecutor::InNode * aLinkedNode = (GraphExecutor::InNode * ) aComputingNode->GetInNode() ;
       cdebug << pthread_self() << "/" << aLinkedNode->ThreadNo()
              << "GraphExecutor::DataFlow::OutputOfAny to Node "
@@ -293,8 +293,9 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
                                                             anOutPort->Value() ) ;
     }
     else {
-      cdebug << "GraphExecutor::DataFlow::OutputOfAny to Graph " << ToNodeName
-             << "(" << ToParameterName << ") ignored" << endl ;
+      cdebug << pthread_self() << "GraphExecutor::DataFlow::OutputOfAny to Node "
+             << ToNodeName << "(" << ToParameterName << ") from MacroNode " << aNodeName
+             << ") ignored" << endl ;
     }
   }
   cdebug_out << pthread_self() << "/" << ThreadNo() << " GraphExecutor::DataFlow::OutputOfAny " << RetVal
@@ -302,6 +303,31 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
   return RetVal ;
 }
 
+//JR NPAL14110 09.02.2007 : SetWaitingStates was missing in SubGraph of MacroNode !...
+bool GraphExecutor::DataFlow::SetWaitingStates( const char * ToServiceParameterName ) {
+  cdebug_in << pthread_self() << "/" << ThreadNo() << "GraphExecutor::DataFlow::SetWaitingStates( "
+            << ToServiceParameterName << " ) MacroGraph " << Name() << endl ;
+  bool RetVal = true ;
+  State( GraphExecutor::DataWaitingState ) ;
+  Done( false ) ;
+  GraphBase::OutPort * anOutPort ;
+  anOutPort = Graph()->GetChangeInDataNodePort( ToServiceParameterName ) ;
+  anOutPort->PortState(  SUPERV::WaitingState ) ;
+  anOutPort->PortDone( false ) ;
+  cdebug << pthread_self() << "GraphExecutor::DataFlow::SetWaitingStates " << Name()
+         << " " << State() << " " << ToServiceParameterName << " " << anOutPort->PortState()
+         << " Done : " << anOutPort->PortDone() << endl ;
+  if ( ! anOutPort->IsGate() ) {
+    GraphExecutor::InNode * anInNode = (GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( anOutPort->InPorts( 0 )->NodeName() )->GetInNode() ;
+    cdebug << pthread_self() << "GraphExecutor::DataFlow::SetWaitingStates : "
+           << anInNode->Name() << "->SetWaitingStates( NULL ) for Port "
+           << anOutPort->InPorts( 0 )->PortName() << endl ;
+    anInNode->SetWaitingStates( NULL ) ;
+  }
+  cdebug_out << "GraphExecutor::DataFlow::SetWaitingStates() " << RetVal << endl;
+  return RetVal ;
+}
+
 bool GraphExecutor::DataFlow::Kill() {
   cdebug_in << "GraphExecutor::DataFlow::Kill()" << endl;
   bool RetVal = GraphExecutor::OutNode::Kill() ;