X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGraphBase%2FDataFlowBase_DataNode.cxx;h=b0644c839e1712cbed4d51420524d101f58a75b6;hb=89e1c3b01ab195d6004bc02b7a45c2fd593cae39;hp=63051cd70240b62bdfab08a140ecdd68934e8e82;hpb=08511b1f8b8a960573a076bd47e21fac8afe23b7;p=modules%2Fsuperv.git diff --git a/src/GraphBase/DataFlowBase_DataNode.cxx b/src/GraphBase/DataFlowBase_DataNode.cxx index 63051cd..b0644c8 100644 --- a/src/GraphBase/DataFlowBase_DataNode.cxx +++ b/src/GraphBase/DataFlowBase_DataNode.cxx @@ -30,121 +30,123 @@ using namespace std; #include "DataFlowBase_DataNode.hxx" GraphBase::DataNode::DataNode() : - InLineNode() { + GOTONode() { MESSAGE( "GraphBase::DataNode::DataNode" ); _Created = false ; } GraphBase::DataNode::DataNode( CORBA::ORB_ptr ORB , SALOME_NamingService* ptrNamingService , - const char *DataFlowName ) : - InLineNode( ORB , ptrNamingService , DataFlowName ) { - MESSAGE( "GraphBase::DataNode::DataNode" ); + const char *DataFlowName , + const SUPERV::KindOfNode DataFlowkind , + int * Graph_prof_debug , + ofstream * Graph_fdebug ) : + GOTONode( ORB , ptrNamingService , DataFlowName , DataFlowkind , Graph_prof_debug , Graph_fdebug ) { +// MESSAGE( "GraphBase::DataNode::DataNode" ); + cdebug << "GraphBase::DataNode::DataNode" << endl ; _Created = false ; } -GraphBase::DataNode::DataNode( - CORBA::ORB_ptr ORB , - SALOME_NamingService* ptrNamingService , - const SALOME_ModuleCatalog::Service& DataFlowService , - const char *DataFlowName , - const SUPERV::KindOfNode DataFlowkind , - const SUPERV::SDate DataFlowFirstCreation , - const SUPERV::SDate DataFlowLastModification , - const char * DataFlowEditorRelease , - const char * DataFlowAuthor , - const char * DataFlowComment ) : - InLineNode( ORB , ptrNamingService , DataFlowService , - DataFlowName , DataFlowkind , - DataFlowFirstCreation , DataFlowLastModification , - DataFlowEditorRelease , DataFlowAuthor , - DataFlowComment , false , 0 , 0) { +GraphBase::DataNode::DataNode( CORBA::ORB_ptr ORB , + SALOME_NamingService* ptrNamingService , + const SALOME_ModuleCatalog::Service& DataFlowService , + const char *DataFlowName , + const SUPERV::KindOfNode DataFlowkind , + const SUPERV::SDate DataFlowFirstCreation , + const SUPERV::SDate DataFlowLastModification , + const char * DataFlowEditorRelease , + const char * DataFlowAuthor , + const char * DataFlowComment ) : + GOTONode( ORB , ptrNamingService , + DataFlowName , SUPERV::ListOfStrings() , DataFlowName , DataFlowkind , + DataFlowFirstCreation , DataFlowLastModification , + DataFlowEditorRelease , DataFlowAuthor , + DataFlowComment , false , 0 , 0) { // MESSAGE( "GraphBase::DataNode::DataNode" ); } GraphBase::DataNode::~DataNode() { // MESSAGE( "GraphBase::DataNode::~DataNode" ); + cdebug << "GraphBase::DataNode::~DataNode" << endl ; } -void GraphBase::DataNode::DataService( - CORBA::ORB_ptr ORB , - SALOME_ModuleCatalog::Service aService , - int * Graph_prof_debug , - ostream * Graph_fdebug ) { -// cout << "GraphBase::DataNode::DataService : DataFlowPortsOfNode of " -// << aService.ServiceName << endl ; -// DefPortsOfNode( aService , aService.ServiceName ) ; +void GraphBase::DataNode::DataService( CORBA::ORB_ptr ORB , + SALOME_ModuleCatalog::Service aService , + int * Graph_prof_debug , + ofstream * Graph_fdebug ) { + cdebug << "GraphBase::DataNode::DataService : DataFlowPortsOfNode of " + << aService << endl ; DefPortsOfNode( ORB , aService , NamePtr() , Kind() , -// true , false , false , false , Graph_prof_debug , Graph_fdebug ) ; - if ( _Created ) + if ( _Created ) { delete _DataFlowDataPorts ; + } SALOME_ModuleCatalog::Service aReversedService ; aReversedService.ServiceName = aService.ServiceName ; aReversedService.ServiceinParameter = aService.ServiceoutParameter ; aReversedService.ServiceoutParameter = aService.ServiceinParameter ; _DataFlowDataPorts = new PortsOfNode() ; -// cout << "GraphBase::DataNode::DataService : Mirrored DataFlowPortsOfNode of " -// << aReversedService.ServiceName << endl ; - _DataFlowDataPorts->DefPortsOfNode( ORB , aReversedService , NamePtr() , - Kind() , -// true , false , false , false , + cdebug << "GraphBase::DataNode::DataService : Mirrored DataFlowPortsOfNode of " + << aReversedService << endl ; + _DataFlowDataPorts->DefPortsOfNode( ORB , aReversedService , NamePtr() , Kind() , Graph_prof_debug , Graph_fdebug ) ; _Created = true ; } int GraphBase::DataNode::CheckDataServerNodes() const { - cdebug << "GraphBase::Graph::DataServerNodes ()" << endl; + cdebug << "GraphBase::DataNode::CheckDataServerNodes :" << endl; int i , ierr = 0 ; for ( i = 0 ; i < _DataFlowDataPorts->GetNodeOutPortsSize() ; i++ ) { - if ( !_DataFlowDataPorts->GetNodeOutPort(i)->IsDataConnected() ) { - cdebug << "InPort " << _DataFlowDataPorts->GetNodeOutPort(i)->PortName() - << " of DataFlow " << Name() << " has NO Data." << endl ; - ierr++ ; +// Not a BUG : Reversed Service of the graph + const GraphBase::OutPort * anOutPort = _DataFlowDataPorts->GetNodeOutPort(i) ; +// if ( !anOutPort->IsGate() && !anOutPort->IsDataStream() && !anOutPort->IsDataConnected() ) { + if ( !anOutPort->IsGate() && !anOutPort->IsDataConnected() ) { + if ( anOutPort->IsExternConnected() && GraphMacroLevel() != 0 ) { + cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType() << " " + << anOutPort->PortStatus() << " of DataFlow " << Name() + << " is ExternConnected. GraphMacroLevel " << GraphMacroLevel() << endl ; + } + else { + cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType() << " " + << anOutPort->PortStatus() << " of DataFlow " << Name() << " has NO Data. GraphMacroLevel " + << GraphMacroLevel() << endl ; + ierr++ ; + } } else { - cdebug << "InPort " << _DataFlowDataPorts->GetNodeOutPort(i)->PortName() - << " of DataFlow " << Name() << " has Data : " -// << _DataFlowDataPorts->GetNodeOutPort(i)->Value() << " kind " -// << _DataFlowDataPorts->GetNodeOutPort(i)->Kind() + cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType() << " " + << anOutPort->PortStatus() << " of DataFlow " << Name() << " has Data : " << endl ; } } for ( i = 0 ; i < _DataFlowDataPorts->GetNodeInPortsSize() ; i++ ) { - if ( !_DataFlowDataPorts->GetNodeInPort(i)->IsConnected() ) { + if ( _DataFlowDataPorts->GetNodeInPort(i)->IsPortConnected() ) { cdebug << "OutPort " << _DataFlowDataPorts->GetNodeInPort(i)->PortName() - << " of DataFlow " << Name() << " has Data " << endl ; -// ierr++ ; + << " of DataFlow " << Name() << " is Connected" << endl ; } else { cdebug << "OutPort " << _DataFlowDataPorts->GetNodeInPort(i)->PortName() - << " of DataFlow " << Name() << " has NO Data : " -// << _DataFlowDataPorts->GetChangeNodeInPort(i)->GetLink()->Value() -// << " kind " -// << _DataFlowDataPorts->GetChangeNodeInPort(i)->GetLink()->Kind() - << endl ; - ierr++ ; + << " of DataFlow " << Name() << " is NOT Connected" << endl ; } } if ( ierr ) { - cdebug << "Some Input Data missing in the DataFlow " << Name() << endl ; + cdebug << "In the DataFlow " << Name() << " " << ierr << " Some Input Data is missing" << endl ; } return ierr ; } -void GraphBase::DataNode::ListDatas(ostrstream & f ) const { +void GraphBase::DataNode::ListDatas(ostream & f ) const { _DataFlowDataPorts->ListPorts( f , false ) ; } -void GraphBase::DataNode::DataNodeInfo(ostrstream & s ) const { - int i ; +void GraphBase::DataNode::DataNodeInfo(ostream & s ) const { s << *this ; s << "Ports :" << endl ; ListPorts( s , true ) ;