From 2c991744949d496d87193b37231395f29e585845 Mon Sep 17 00:00:00 2001 From: rahuel Date: Fri, 9 Feb 2007 15:51:37 +0000 Subject: [PATCH] debug of NPAL14110 : Loop of MacroNode. Reset of states of ports and nodes of SubGraphs was missing --- .../DataFlowExecutor_DataFlow.cxx | 25 +++++++++++++++++++ .../DataFlowExecutor_DataFlow.hxx | 3 ++- .../DataFlowExecutor_InNodeThreads.cxx | 13 +++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx b/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx index 25e0bdd..9e08779 100644 --- a/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx +++ b/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx @@ -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() ; diff --git a/src/GraphExecutor/DataFlowExecutor_DataFlow.hxx b/src/GraphExecutor/DataFlowExecutor_DataFlow.hxx index caf4bf4..dc8038b 100644 --- a/src/GraphExecutor/DataFlowExecutor_DataFlow.hxx +++ b/src/GraphExecutor/DataFlowExecutor_DataFlow.hxx @@ -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() ; diff --git a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx index 1f48695..9a81362 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx @@ -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 ) ; -- 2.39.2