using namespace std;
#include <stdio.h>
#include <fstream>
-#include <strstream>
+//#include <sstream>
#include <string>
-#include "utilities.h"
+//#include "utilities.h"
#include "Graph_Impl.hxx"
_DebugFileName = new char[ strlen( dbgfile.c_str() )+1 ] ;
strcpy( _DebugFileName , dbgfile.c_str() ) ;
- _NamingService = new SALOME_NamingService(orb);
-// _DataFlowEditor = new SALOME_DataFlowEditor_impl( NS ) ;
- GraphEditor::DataFlow * aDataFlowEditor = new GraphEditor::DataFlow(
- _Orb , _NamingService ,
- theDataFlowName ,
- _DebugFileName ) ;
+ _NamingService = new SALOME_NamingService( orb ) ;
+ GraphEditor::DataFlow * aDataFlowEditor = new GraphEditor::DataFlow( _Orb , _NamingService ,
+ theDataFlowName ,
+ _DebugFileName ) ;
DataFlowEditor( aDataFlowEditor ) ;
DataFlowEditor()->SetObjImpl( this ) ;
_DataFlowExecutor = NULL ;
-// _DataFlowDataNode = DataFlowEditor() ;
delete [] theDataFlowName ;
endService( "Graph_Impl::Graph_Impl" );
}
CNode_Impl * myNode = new CNode_Impl( _Orb , _Poa , _ContId ,
instanceName() , interfaceName() ,
DataFlowEditor() ,
- NodeService , (char * ) NULL ,
- SUPERV::ComputingNode , (char * ) NULL ) ;
+ NodeService , NULLSTRING ,
+ SUPERV::ComputingNode , NULLSTRING ) ;
if ( myNode->DataFlowNode() ) {
PortableServer::ObjectId * id = myNode->getId() ;
CORBA::Object_var obj = _poa->id_to_reference(*id);
const char * NodeComponentName ,
const char * NodeInterfaceName ,
const SALOME_ModuleCatalog::Service &NodeService ) {
- beginService( "Graph_Impl::Node" );
+ beginService( "Graph_Impl::FNode" );
SUPERV::FNode_var iobject = SUPERV::FNode::_nil() ;
if ( DataFlowEditor()->IsEditing() && !DataFlowEditor()->IsReadOnly() ) {
FNode_Impl * myNode = new FNode_Impl( _Orb , _Poa , _ContId ,
myNode->SetObjRef( SUPERV::FNode::_duplicate( iobject ) ) ;
}
}
- endService( "Graph_Impl::Node" );
+ endService( "Graph_Impl::FNode" );
return SUPERV::FNode::_duplicate( iobject ) ;
}
else {
anEndName += "Switch" ;
}
- cout << "Graph_Impl::SNode anEndName " << (void *) FuncName << " " << FuncName
- << " " << strlen(FuncName) << " " << (void *) anEndName.c_str() << " "
- << anEndName.c_str() << endl ;
+// cout << "Graph_Impl::SNode anEndName " << (void *) FuncName << " " << FuncName
+// << " " << strlen(FuncName) << " " << (void *) anEndName.c_str() << " "
+// << anEndName.c_str() << endl ;
ESNode_Impl * myEndNode = new ESNode_Impl( _Orb , _Poa , _ContId ,
instanceName() , interfaceName() ,
DataFlowEditor() ,
anEndName.c_str() ,
SUPERV::EndSwitchNode ) ;
- cout << "Graph_Impl::SNode returned anEndName " << (void *) FuncName << " "
- << FuncName << " " << strlen(FuncName) << " " << (void *) anEndName.c_str()
- << " " << anEndName.c_str() << endl ;
+// cout << "Graph_Impl::SNode returned anEndName " << (void *) FuncName << " "
+// << FuncName << " " << strlen(FuncName) << " " << (void *) anEndName.c_str()
+// << " " << anEndName.c_str() << endl ;
PortableServer::ObjectId * endid = myEndNode->getId() ;
CORBA::Object_var endobj = _poa->id_to_reference(*endid);
iendobject = SUPERV::ESNode::_narrow(endobj) ;
if ( theNode == NULL ||
( theNode != NULL && theNode->IsEndSwitchNode() &&
!strcmp( theNode->Name() , aNode->Name() ) ) ) {
- if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
+ if ( anInPort->IsLoop() || anOutPort->IsLoop() ||
+ ( aNode->IsEndLoopNode() && !strcmp( aNode->CoupledNode()->Name() ,
+ anOutPort->NodeName() ) ) ) {
+ MESSAGE( "Link " << anOutPort->NodeName() << "("
+ << anOutPort->PortName() << ") --> " << aNode->Name() << "("
+ << anInPort->PortName() << ")" << " ignored" ) ;
+ }
+ else if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
if ( begin ) {
- beginService( "Graph_Impl::ListOfLinks" );
+ beginService( "Graph_Impl::Links" );
begin = false ;
}
GraphEditor::InNode * anOutNode = NULL ;
if ( theNode || ( toNode->IsEndSwitchNode() && !aNode->IsSwitchNode() ) ) {
if ( anInputParam == NULL ||
!strcmp( anInPort->PortName() , anInputParam ) ) {
- if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
+ if ( anInPort->IsLoop() || anOutPort->IsLoop() ||
+ ( toNode->IsEndLoopNode() && !strcmp( toNode->CoupledNode()->Name() ,
+ anOutPort->NodeName() ) ) ) {
+ MESSAGE( "Link " << anOutPort->NodeName() << "("
+ << anOutPort->PortName() << ") --> " << aNode->Name() << "("
+ << anInPort->PortName() << ")" << " ignored" ) ;
+ }
+ else if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
if ( begin ) {
- beginService( "Graph_Impl::ListOfLinks" );
+ beginService( "Graph_Impl::Links" );
begin = false ;
}
Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
}
}
if ( !begin ) {
- endService( "Graph_Impl::ListOfLinks" );
+ endService( "Graph_Impl::Links" );
}
return ( RetVal._retn() ) ;
}
int i ;
SUPERV::ListOfStrings_var Nodes = DataFlowEditor()->LevelNodes( aLevel ) ;
// RetVal->length( Nodes->length() );
- for ( i = 0 ; i < Nodes->length() ; i++ ) {
+ for ( i = 0 ; i < (int ) Nodes->length() ; i++ ) {
// char * aNode = Nodes[ i ] ;
GraphBase::ComputingNode * aNode = DataFlowEditor()->GetChangeGraphNode( Nodes[ i ] ) ;
RetVal = SetNode( RetVal , aNode ) ;
int i ;
map< string , int > aMapOfNodes ;
- for ( i = 0 ; i < aGraphNodes->CNodes.length() ; i++ ) {
+ for ( i = 0 ; i < (int ) aGraphNodes->CNodes.length() ; i++ ) {
SUPERV::CNode_var aNode = (aGraphNodes->CNodes)[ i ] ;
GraphEditor::InNode * myNode ;
GraphBase::ListOfFuncName aFuncName = GraphBase::ListOfFuncName() ;
myNode = DataFlowEditor()->AddNode( *(aNode->Service()) ,
"" ,
"" ,
- NULL ,
+ NULLSTRING ,
SUPERV::ComputingNode ,
aFuncName ,
aPythonFunction ,
break ;
}
}
- for ( i = 0 ; i < aGraphNodes->FNodes.length() ; i++ ) {
+ for ( i = 0 ; i < (int ) aGraphNodes->FNodes.length() ; i++ ) {
SUPERV::FNode_var aNode = (aGraphNodes->FNodes)[ i ] ;
GraphEditor::InNode * myNode ;
GraphBase::ListOfFuncName aFuncName = GraphBase::ListOfFuncName() ;
myNode = DataFlowEditor()->AddNode( *(aNode->Service()) ,
aNode->GetComponentName() ,
aNode->GetInterfaceName() ,
- NULL ,
+ NULLSTRING ,
SUPERV::ComputingNode ,
aFuncName ,
aPythonFunction ,
}
}
if ( RetVal ) {
- for ( i = 0 ; i < aGraphLinks->length() ; i++ ) {
+ for ( i = 0 ; i < (int ) aGraphLinks->length() ; i++ ) {
SUPERV::Link_var aLink = (*aGraphLinks)[ i ] ;
SUPERV::Port_var OutPort = aLink->OutPort() ;
SUPERV::Port_var InPort = aLink->InPort() ;
}
}
if ( RetVal ) {
- for ( i = 0 ; i < aGraphPorts->length() ; i++ ) {
+ for ( i = 0 ; i < (int ) aGraphPorts->length() ; i++ ) {
SUPERV::Port_var aPort = (*aGraphPorts)[ i ] ;
if ( aPort->HasInput() ) {
char * aNode = new char[ strlen( aPort->Name() + 1 ) ] ;