From: rahuel Date: Tue, 13 Feb 2007 09:15:17 +0000 (+0000) Subject: NPAL14110 : The count of running graphs does not include now the execution X-Git-Tag: V3_2_6a1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bd7e20da2604d5276896bf20d23f470c67d6ac9d;p=modules%2Fsuperv.git NPAL14110 : The count of running graphs does not include now the execution 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. --- diff --git a/src/GraphExecutor/DataFlowExecutor_OutNode.cxx b/src/GraphExecutor/DataFlowExecutor_OutNode.cxx index 44eb527..55d1df5 100644 --- a/src/GraphExecutor/DataFlowExecutor_OutNode.cxx +++ b/src/GraphExecutor/DataFlowExecutor_OutNode.cxx @@ -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() ; }