]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
debug of NPAL14110 : Loop of MacroNode. Reset of states of ports and nodes V3_2_5
authorrahuel <rahuel@opencascade.com>
Fri, 9 Feb 2007 15:51:37 +0000 (15:51 +0000)
committerrahuel <rahuel@opencascade.com>
Fri, 9 Feb 2007 15:51:37 +0000 (15:51 +0000)
of SubGraphs was missing

src/GraphExecutor/DataFlowExecutor_DataFlow.cxx
src/GraphExecutor/DataFlowExecutor_DataFlow.hxx
src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx

index 25e0bdd912e7b0d1f37de61a2a352d21db869165..9e08779ec0b617da3badf5078e7a1a9cf19161b0 100644 (file)
@@ -302,6 +302,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() ;
index caf4bf41e5d261da9dc5800ef2a436a7b5697f93..dc8038b0cacd2da6d74641eb89578ef7d65773fa 100644 (file)
@@ -70,13 +70,14 @@ namespace GraphExecutor {
       bool ChangeInputData( const char * ToNodeName ,
                             const char * ToParameterName ,
                             const CORBA::Any aValue = CORBA::Any() ) ;
+
       bool InputOfAny( const char * ToServiceParameterName ,
                        const CORBA::Any & aValue ,
                        const bool SomeDataReady = true ) ;
-
       bool OutputOfAny( const char * aNodeName ,
                         const char * ToServiceParameterName ,
                         const CORBA::Any & aValue ) ;
+      bool SetWaitingStates( const char * ToServiceParameterName ) ;
 
       bool IsValid() ;
       bool IsExecutable() ;
index 1f48695c98ba9c3370f077056b49599c00697078..9a81362ed1ea3abec62a25e95fed25f9b096d899 100644 (file)
@@ -2356,7 +2356,7 @@ int GraphExecutor::InNode::Errored_ExecutingAction() {
 }
 
 #define SetWaitingStatesTrace 0
-// Set SUPERV::WaitingState to all InPorts 
+// Set SUPERV::WaitingState to all InPorts and Nodes
 void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) {
   int i ;
   int j ;
@@ -2403,6 +2403,17 @@ void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) {
     cdebug << "               --> InPort " << Name() << "( " << anInPort->PortName() << " ) "
            << anInPort->PortStatus() << " " << anInPort->PortState() << endl ;
 #endif
+//JR NPAL14110 09.02.2007 : SetWaitingStates was missing in the corresponding SubGraph !...
+    if ( IsMacroNode() ) {
+      GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ;
+#if SetWaitingStatesTrace
+      cdebug << ThreadNo()
+             << " --> GraphExecutor::InNodeThreads::SetWaitingStates MacroNode " << Name()
+             << " ---> MacroGraph " << aMacroGraph->Name() << " Inport "
+             << anInPort->PortName() << endl;
+#endif
+      aMacroGraph->SetWaitingStates( anInPort->PortName() ) ;
+    }
   }
   for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
     GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ;