RetVal = Graph()->AddOutputData( aNodeName , ToServiceParameterName , aValue ) ;
GraphBase::OutPort * anOutPort = aMacroNode->GetChangeOutPort( ToServiceParameterName ) ;
int i ;
+ for ( i = 0 ; i < aMacroNode->GetNodeOutPortsSize() ; i++ ) {
+ cdebug << "Out" << i << " " << aMacroNode->GetNodeOutPort( i )->PortName() << " "
+ << aMacroNode->GetChangeNodeOutPort( i )->PortState() << " Done="
+ << aMacroNode->GetChangeNodeOutPort( i )->PortDone() << " " ;
+ if ( GraphBase::Base::_prof_debug ) {
+ aMacroNode->GetNodeOutPort( i )->StringValue( *GraphBase::Base::_fdebug ) ;
+ }
+ if ( aMacroNode->GetChangeNodeOutPort( i )->IsGate() ) {
+ cdebug << " BoolValue " << aMacroNode->GetChangeNodeOutPort( i )->BoolValue() ;
+ }
+ cdebug << endl ;
+ }
// Loop over Inports linked to that OutPort of the MacroNode
for ( i = 0 ; i < anOutPort->InPortsSize() ; i++ ) {
const char * ToNodeName = anOutPort->ChangeInPorts( i )->NodeName() ;
// cdebug << "GraphExecutor::DataFlow::OutputOfAny " << aLinkedNode->Name()
// << " IsLockedDataWait --> UnLockDataWait" << endl ;
// }
+ aLinkedNode->LockDataReady() ;
sts = aLinkedNode->SendSomeDataReady( (char * ) aNodeName ) ;
cdebug << pthread_self() << "/" << aLinkedNode->ThreadNo()
<< "GraphExecutor::DataFlow::OutputOfAny " << aLinkedNode->Name()
<< "->SendSomeDataReady( " << aNodeName << " ) sts " << sts << " " << aLinkedNode->State() << endl ;
if ( sts ) {
- if ( aLinkedNode->State() == GraphExecutor::DataReadyState ) {
+// if ( aLinkedNode->State() == GraphExecutor::DataReadyState ) {
+ if ( aLinkedNode->HasAllDataReady() ) {
+ cdebug << pthread_self() << "/" << aLinkedNode->ThreadNo()
+ << "GraphExecutor::DataFlow::OutputOfAny SendEvent(ExecuteEvent) to "
+ << aLinkedNode->Name() << endl ;
//JR 15.04.2005 Debug PAL8624 RetroConception :
// aLinkedNode->CreateNewThreadIf( true ) ;
// aLinkedNode->UnLockDataWait() ;
- aLinkedNode->SendEvent( GraphExecutor::ExecuteEvent ) ;
+ aLinkedNode->CreateNewThread( true ) ;
+ aLinkedNode->UnLockDataReady() ;
+ aLinkedNode->HasAllDataReady( false ) ;
+// aLinkedNode->SendEvent( GraphExecutor::ExecuteEvent ) ;
+ aLinkedNode->SendEvent( GraphExecutor::AllDataReadyEvent ) ;
}
+ else {
+ aLinkedNode->UnLockDataReady() ;
+ cdebug << pthread_self() << "/" << aLinkedNode->ThreadNo()
+ << "GraphExecutor::DataFlow::OutputOfAny NO SendEvent(ExecuteEvent) to "
+ << aLinkedNode->Name() << endl ;
+ }
+ }
+ else {
+ aLinkedNode->UnLockDataReady() ;
}
}
else if ( Graph()->GraphMacroLevel() != 0 ) {
aDataFlowNode->SetObjRef( SUPERV::CNode::_duplicate( SUPERV::CNode::_narrow( obj ) ) ) ;
aDataFlowNode->SetObjImpl( this ) ;
+ GraphBase::Graph * aSubGraph = NULL ;
// GraphBase::Graph * aGraph = DataFlowEditor()->Automaton()->MapGraph( myMacroGraph->Name() ) ;
- GraphBase::Graph * aGraph ;
//DataFlowEditor()->Automaton()->GraphBase( &aGraph ) ;
+//JR 20.09.2005 Debug SAB_data_1609_bugPAL.py from CEA (Anthony)
+// Graph_Impl * aSubGraphImpl = dynamic_cast<Graph_Impl * >( _Poa->id_to_servant( *myMacroGraph->_Id ) ) ;
+ myMacroGraph->ping() ;
+ Graph_Impl * aSubGraphImpl = theAutomaton->GraphImpl() ;
+ aSubGraph = aSubGraphImpl->DataFlowEditor()->Graph() ;
myMacroGraph->Coupled() ;
GraphBase::Graph * aGraphOfMacroGraph = myMacroNode->DataFlowEditor()->Graph() ;
GraphBase::Graph * aMacroGraph = myMacroNode->DataFlowNode()->GraphMacroNode() ;
aMacroGraph->Kind( SUPERV::MacroNode ) ;
aMacroGraph->GraphEditor( DataFlowEditor() ) ;
// Creation of the Ports of the MacroNode from the ports of the GraphMacroNode
- aMacroGraph->SetMacroPorts( aGraph ) ;
+ aMacroGraph->SetMacroPorts( aSubGraph ) ;
// Valid ==> creation of Service and the ports of the current Graph
DataFlowEditor()->IsValid() ;
// Set the Input Datas from the GraphMacroNode to the current Graph
- aMacroGraph->SetMacroDatas( aGraph , aGraphOfMacroGraph ) ;
+ aMacroGraph->SetMacroDatas( aSubGraph , aGraphOfMacroGraph ) ;
// aMacroGraphDataFlowEditor->UnValid() ;
- aGraph->GraphEditor()->UnValid() ;
+ aSubGraph->GraphEditor()->UnValid() ;
// Set the MacroNode ObjRef in the GraphMacroNode
- aGraph->CoupledNode( aMacroGraph ) ;
- aGraph->MacroObject( SUPERV::Graph::_duplicate( macroiobject ) ) ;
+ aSubGraph->CoupledNode( aMacroGraph ) ;
+ aSubGraph->MacroObject( SUPERV::Graph::_duplicate( macroiobject ) ) ;
// Set the GraphMacroNode ObjRef in the MacroNode
aDataFlowNode->GraphMacroNode()->GraphMacroLevel( aGraphOfMacroGraph->GraphMacroLevel() + 1 ) ;
- aMacroGraph->CoupledNode( aGraph ) ;
+ aMacroGraph->CoupledNode( aSubGraph ) ;
aMacroGraph->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ;
-// aDataFlowNode->CoupledNode( aGraph ) ;
+// aDataFlowNode->CoupledNode( aSubGraph ) ;
// aDataFlowNode->ComputingNode()->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ;
// Set the MacroLevel of that graph
- aGraph->GraphMacroLevel( aGraphOfMacroGraph->GraphMacroLevel() + 1 ) ;
+ aSubGraph->GraphMacroLevel( aGraphOfMacroGraph->GraphMacroLevel() + 1 ) ;
aMacroGraph->Coordinates( 0 , 0 ) ;
- MESSAGE( aGraph->Name() << "->CoupledNode()->GraphEditor() : " << aGraph->CoupledNode()->GraphEditor() ) ;
+ MESSAGE( aSubGraph->Name() << "->CoupledNode()->GraphEditor() : " << aSubGraph->CoupledNode()->GraphEditor() ) ;
MESSAGE( aMacroGraph->Name() << "->CoupledNode()->GraphEditor() : "
<< aMacroGraph->CoupledNode()->GraphEditor() ) ;
MESSAGE( "DataFlowNode Graph " << this << " DataFlowEditor " << DataFlowEditor() << " aDataFlowNode "