]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
NPAL14110 : The count of running graphs does not include now the execution
authorrahuel <rahuel@opencascade.com>
Tue, 13 Feb 2007 09:15:17 +0000 (09:15 +0000)
committerrahuel <rahuel@opencascade.com>
Tue, 13 Feb 2007 09:15:17 +0000 (09:15 +0000)
of SubGraphs (corresponding to MacroNodes). Before that count was wrong.

CheckAllDone method now transmit output values of subgraphs to MacroNodes if
the execution of the SubGraph is finished.

src/GraphExecutor/DataFlowExecutor_OutNode.cxx

index 44eb52782f310fb3620eedd07ce783f2cc922594..55d1df53023bad3f10ca2cbbadbbdf49f5bda57a 100644 (file)
@@ -31,6 +31,7 @@ using namespace std;
 #include "DataFlowExecutor_OutNode.hxx"
 
 #include "DataFlowEditor_DataFlow.hxx"
+#include "DataFlowExecutor_DataFlow.hxx"
 
 // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL    
 //extern Engines_Container_i * _TheContainer ;
@@ -717,7 +718,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
     else {
       State( GraphExecutor::ErroredState ) ;
       Done( true ) ;
-      if ( IsDone() ) {
+      if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
         cdebug << " ==> theAutomaton->Executed() " << endl ;
         theAutomaton->Executed() ;
       }
@@ -737,7 +738,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
 //              two graphs execution with two different python functions with the same name
 //              give aborted state for the second one
 //Example : GraphLoopSwitchOfSwitchNOTValid, GraphLoopSwitchs and GraphLoopSwitchsBranches
-    if ( IsDone() ) {
+    if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
       cdebug << " ==> theAutomaton->Executed() " << endl ;
       theAutomaton->Executed() ;
     }
@@ -842,6 +843,30 @@ void GraphExecutor::OutNode::CheckAllDone() {
             << EventQSize() << endl  ;
     cdebug << "================================================================================" << endl ;
 
+    if ( Graph()->GraphMacroLevel() != 0 ) {
+//JR NPAL14110 09.02.2007 : That must be done only at the end of SubGraph because we may
+//                          have an output of the SubGraph in a Loop !...
+//                          So that code must be done in CheckAllDone instead of OutParametersSet
+      cdebug << "CheckAllDone ToNodeName " << Name() << " CoupledNode "
+             << Graph()->CoupledNodeName() << Graph()->CoupledNode()
+             << endl ;
+      cdebug << "CheckAllDone GraphExecutor " << Graph()->CoupledNode()->GraphEditor()->Executor() << endl ;
+      const GraphBase::InPort * anInPort ;
+      GraphBase::OutPort * anOutPort ;
+      int i ;
+      for ( i = 0 ; i <  Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
+         anInPort = Graph()->GetNodeOutDataNodePort( i ) ;
+         if ( !anInPort->IsGate() ) {
+           anOutPort = anInPort->GetOutPort() ;
+           Graph()->CoupledNode()->GraphEditor()->Executor()->OutputOfAny( Graph()->CoupledNodeName() ,
+                                                                           anInPort->PortName() ,
+                                                                           anOutPort->Value() ) ;
+           cdebug << "CheckAllDone OutputOfAny( " << Graph()->CoupledNodeName() << " , "
+                  << anInPort->PortName() << " , value ) done" << endl ;
+         }
+      }
+    }
+
 //PAL8520
 //JR 23.02.2005, Debug : siftEvents() must be inside the pthread_mutex_lock
     if ( pthread_mutex_lock( &_MutexWait ) ) {
@@ -961,7 +986,7 @@ void GraphExecutor::OutNode::ExitThread( pthread_t ThreadNumber ) {
            << " running threads " << _SuspendedThreads << " suspended threads IsDone() "
            << IsDone() ;
     _run_func_thread = 0 ; // mkr : IPAL14711
-    if ( IsDone() ) {
+    if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
       cdebug << " ==> theAutomaton->Executed() " << endl ;
       theAutomaton->Executed() ;
     }