using namespace std;
#include "DataFlowBase_Base.hxx"
-char *SuperVision_Version = "1.05" ;
+char *SuperVision_Version = "2.0" ;
char *NULLSTRING = "" ;
_prof_debug = theprof_debug ;
_fdebug = thefdebug ;
}
+ else {
+ MESSAGE( "GraphBase::Base::SetDebug with theprof_debug == NULL" ) ;
+ }
+ }
+ else {
+ cdebug << "GraphBase::Base::SetDebug already done" << endl ;
}
// cdebug_in << "GraphBase::Base::SetDebug" << endl ;
// cdebug << "GraphBase::Base::SetDebug" << endl ;
CORBA::Object_ptr GraphBase::Base::StringToObject( char * obj ) const {
return _Orb->string_to_object( obj );
}
+
+string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) {
+ string aIdlType ;
+ switch ( aDataStreamType ) {
+ case SALOME_ModuleCatalog::DATASTREAM_UNKNOWN : {
+ aIdlType = "Unknown" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_INTEGER : {
+ aIdlType = "int" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_FLOAT : {
+ aIdlType = "float" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_DOUBLE : {
+ aIdlType = "double" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_STRING : {
+ aIdlType = "string" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_BOOLEAN : {
+ aIdlType = "bool" ;
+ break;
+ }
+ default: {
+ aIdlType = "Unknown" ;
+ break;
+ }
+ }
+ return aIdlType ;
+}
+
+SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlType ) {
+ SALOME_ModuleCatalog::DataStreamType aDataStreamType ;
+ if ( !strcmp( aIdlType , "Unknown" ) ) {
+ aDataStreamType = SALOME_ModuleCatalog::DATASTREAM_UNKNOWN ;
+ }
+ else if ( !strcmp( aIdlType , "int" ) ) {
+ aDataStreamType = SALOME_ModuleCatalog::DATASTREAM_INTEGER ;
+ }
+ else if ( !strcmp( aIdlType , "float" ) ) {
+ aDataStreamType = SALOME_ModuleCatalog::DATASTREAM_FLOAT ;
+ }
+ else if ( !strcmp( aIdlType , "double" ) ) {
+ aDataStreamType = SALOME_ModuleCatalog::DATASTREAM_DOUBLE ;
+ }
+ else if ( !strcmp( aIdlType , "string" ) ) {
+ aDataStreamType = SALOME_ModuleCatalog::DATASTREAM_STRING ;
+ }
+ else if ( !strcmp( aIdlType , "bool" ) ) {
+ aDataStreamType = SALOME_ModuleCatalog::DATASTREAM_BOOLEAN ;
+ }
+ else {
+ aDataStreamType = SALOME_ModuleCatalog::DATASTREAM_UNKNOWN ;
+ }
+ return aDataStreamType ;
+}
+
+string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) {
+ string aTrace ;
+ switch ( aDataStreamTrace ) {
+ case SUPERV::WithoutTrace :
+ aTrace = "SANS";
+ break;
+ case SUPERV::SummaryTrace :
+ aTrace = "SUCCINT";
+ break;
+ case SUPERV::DetailedTrace :
+ aTrace = "DETAILLE";
+ break;
+ default :
+ aTrace = "UndefinedTrace";
+ break;
+ }
+ return aTrace ;
+}
+
+string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDependency aDataStreamDependency ) {
+ string aDependency ;
+ switch ( aDataStreamDependency ) {
+ case SALOME_ModuleCatalog::DATASTREAM_UNDEFINED :
+ aDependency = "U" ;
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_TEMPORAL :
+ aDependency = "T" ;
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_ITERATIVE :
+ aDependency = "I" ;
+ break;
+ default :
+ aDependency = "?" ;
+ break;
+ }
+
+ return aDependency;
+}
+
+string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) {
+ string aStreamType ;
+ switch ( aDataStreamType ) {
+ case SALOME_ModuleCatalog::DATASTREAM_UNKNOWN : {
+ aStreamType = "Unknown" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_INTEGER : {
+ aStreamType = "ENTIER" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_FLOAT : {
+ aStreamType = "REEL" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_DOUBLE : {
+ aStreamType = "DOUBLE" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_STRING : {
+ aStreamType = "CHAINE" ;
+ break;
+ }
+ case SALOME_ModuleCatalog::DATASTREAM_BOOLEAN : {
+ aStreamType = "LOGIQUE" ;
+ break;
+ }
+ default: {
+ aStreamType = "?" ;
+ break;
+ }
+ }
+ return aStreamType ;
+}
+
+ostream & operator<< (ostream & f ,const SALOME_ModuleCatalog::DataStreamType & s ) {
+ switch (s) {
+ case SALOME_ModuleCatalog::DATASTREAM_UNKNOWN :
+ f << "DATASTREAM_UNKNOWN";
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_INTEGER :
+ f << "DATASTREAM_INTEGER";
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_FLOAT :
+ f << "DATASTREAM_FLOAT";
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_DOUBLE :
+ f << "DATASTREAM_DOUBLE";
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_STRING :
+ f << "DATASTREAM_STRING";
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_BOOLEAN :
+ f << "DATASTREAM_BOOLEAN";
+ break;
+ default :
+ f << "DATASTREAM_UNKNOWN";
+ break;
+ }
+
+ return f;
+}
+
return t;
}
+string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
+SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlType ) ;
+
+string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) ;
+
+string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDependency aDataStreamDependency ) ;
+
+string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
+
enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
DataConnected } ;
typedef vector<const SUPERV::ListOfStrings *> ListOfPythonFunctions ;
- struct NodeParameter {
- SALOME_ModuleCatalog::ServicesParameter theInParameter ;
- SALOME_ModuleCatalog::ServicesParameter theOutParameter ;
- };
+ typedef vector<SALOME_ModuleCatalog::ServicesParameter> ListOfParameters;
+
+ struct InDataStreamParameter {
+ SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
+ SUPERV::KindOfSchema theKindOfSchema ;
+ SUPERV::KindOfInterpolation theKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation theKindOfExtrapolation ;
+ };
+ typedef vector<InDataStreamParameter> ListOfInDataStreamParameters;
- typedef vector<NodeParameter> ListOfParameters;
+ struct OutDataStreamParameter {
+ SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
+ long theNumberOfValues ;
+ };
+ typedef vector<OutDataStreamParameter> ListOfOutDataStreamParameters;
struct SNode {
string theComponentName ;
string theInterfaceName ;
string theName ;
SUPERV::KindOfNode theKind ;
+ long theTimeout ;
+ SUPERV::KindOfDataStreamTrace theDataStreamTrace ;
+ double theDeltaTime ;
string theCoupledNode ;
+// int theDataStreamInArgsNumber ;
+// int theDataStreamOutArgsNumber ;
SALOME_ModuleCatalog::Service theService ;
- ListOfParameters theListOfParameters ;
+ ListOfInDataStreamParameters theListOfInDataStreams ;
+ ListOfOutDataStreamParameters theListOfOutDataStreams ;
ListOfFuncName theListOfFuncName ;
ListOfPythonFunctions theListOfPythonFunctions ;
SUPERV::SDate theFirstCreation ;
} ;
+ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);
+
#endif
//
//
//
-// File : DataFlowBase_Node.cxx
+// File : DataFlowBase_ComputingNode.cxx
// Author : Jean Rahuel, CEA
// Module : SUPERV
// $Header:
//#include <sstream>
//#include <iostream>
-#include "DataFlowBase_InLineNode.hxx"
-#include "DataFlowBase_LoopNode.hxx"
+#include "DataFlowBase_StreamGraph.hxx"
+//#include "DataFlowBase_LoopNode.hxx"
-static void InitFields( SUPERV::KindOfNode &_Kind ,
+static void InitFields( //SUPERV::KindOfNode &_Kind ,
SUPERV::SDate &_FirstCreation ,
SUPERV::SDate &_LastModification ,
char * &_EditorRelease ,
char * &_Author ,
char * &_Comment ,
- bool &_HeadNode ,
+ //bool &_HeadNode ,
bool &_GeneratedName ,
+ //int &_DataStreamInPortsNumber ,
+ //int &_DataStreamOutPortsNumber ,
int &_ConnectedInPortsNumber ,
- int &_DecrConnectedInPortsNumber,
- int &_LinkedNodesSize ,
- int &_SubGraphNumber ) {
+ int &_DecrConnectedInPortsNumber ) {
+ //int &_LinkedNodesSize ,
+ //int &_SubGraphNumber ) {
time_t T = time(NULL);
struct tm * Tm = localtime(&T);
- _Kind = SUPERV::DataFlowNode ;
+// _Kind = SUPERV::DataFlowGraph ;
_FirstCreation.Second = _LastModification.Second = Tm->tm_sec;
_FirstCreation.Minute = _LastModification.Minute = Tm->tm_min;
// strcpy( _Computer , FACTORYSERVER ) ;
_Comment = NULLSTRING ;
- _SubGraphNumber = 0 ;
- _HeadNode = false ;
+// _SubGraphNumber = 0 ;
+// _HeadNode = false ;
_GeneratedName = false ;
+// _DataStreamInPortsNumber = 0 ;
+// _DataStreamOutPortsNumber = 0 ;
+
_ConnectedInPortsNumber = 0 ;
_DecrConnectedInPortsNumber = 0 ;
- _LinkedNodesSize = 0 ;
- _SubGraphNumber = 0 ;
+// _LinkedNodesSize = 0 ;
+// _SubGraphNumber = 0 ;
}
GraphBase::ComputingNode::ComputingNode() :
- GraphBase::PortsOfNode::PortsOfNode() {
+// GraphBase::PortsOfNode::PortsOfNode() {
+ GraphBase::StreamNode::StreamNode() {
- InitFields( _Kind ,
+ InitFields( //_Kind ,
_FirstCreation ,
_LastModification ,
_EditorRelease ,
_Author ,
_Comment ,
- _HeadNode ,
+ //_HeadNode ,
_GeneratedName ,
+ //_DataStreamInPortsNumber ,
+ //_DataStreamOutPortsNumber ,
_ConnectedInPortsNumber ,
- _DecrConnectedInPortsNumber ,
- _LinkedNodesSize ,
- _SubGraphNumber ) ;
+ _DecrConnectedInPortsNumber ) ;
+ //_LinkedNodesSize ,
+ //_SubGraphNumber ) ;
+ Kind( SUPERV::DataFlowGraph ) ;
_NamingService = NULL ;
_Node = SUPERV::CNode::_nil() ;
_InNode = NULL ;
_ThreadNo = pthread_self() ;
- _Name = NULL ;
cdebug << "GraphBase::Node::Node " << this << " " << endl ;
}
const char * aDataFlowName ,
int * Graph_prof_debug ,
ofstream * Graph_fdebug ) :
- GraphBase::PortsOfNode::PortsOfNode( aDataFlowName ) {
+// GraphBase::PortsOfNode::PortsOfNode( aDataFlowName ) {
+ GraphBase::StreamNode::StreamNode( aDataFlowName ) {
- MESSAGE( "GraphBase::ComputingNode::ComputingNode( " << aDataFlowName << " Graph_fdebug " << Graph_fdebug ) ;
- InitFields( _Kind ,
+// MESSAGE( "GraphBase::ComputingNode::ComputingNode " << aDataFlowName << " Graph_prof_debug " << Graph_prof_debug ) ;
+ InitFields( //_Kind ,
_FirstCreation ,
_LastModification ,
_EditorRelease ,
_Author ,
_Comment ,
- _HeadNode ,
+ //_HeadNode ,
_GeneratedName ,
+ //_DataStreamInPortsNumber ,
+ //_DataStreamOutPortsNumber ,
_ConnectedInPortsNumber ,
- _DecrConnectedInPortsNumber ,
- _LinkedNodesSize ,
- _SubGraphNumber ) ;
+ _DecrConnectedInPortsNumber ) ;
+ //_LinkedNodesSize ,
+ //_SubGraphNumber ) ;
+ Kind( SUPERV::DataFlowGraph ) ;
_ORB = CORBA::ORB::_duplicate( ORB ) ;
_NamingService = ptrNamingService ;
_Node = SUPERV::CNode::_nil() ;
_InNode = NULL ;
_ThreadNo = pthread_self() ;
- if ( aDataFlowName != NULLSTRING && strlen( aDataFlowName ) ) {
- _Name = new char[ strlen( aDataFlowName )+1 ] ;
- strcpy( _Name , aDataFlowName ) ;
- }
- else {
- _Name = NULLSTRING ;
- }
if ( Graph_prof_debug ) {
// MESSAGE( "GraphBase::ComputingNode::ComputingNode --> SetDebug" ) ;
// cout << "GraphBase::ComputingNode::ComputingNode --> SetDebug" << endl ;
// cout << "GraphBase::ComputingNode::ComputingNode NO SetDebug" << endl ;
// }
cdebug << "GraphBase::ComputingNode::ComputingNode " << this
- << "' _Name "
- << (void *) _Name << " '" << _Name << " " << _FirstCreation
+ << " Name '" << Name() << "' " << _FirstCreation
<< " " << _LastModification << endl ;
}
const long Y ,
int * Graph_prof_debug ,
ofstream * Graph_fdebug ) :
- GraphBase::PortsOfNode::PortsOfNode() {
+// GraphBase::PortsOfNode::PortsOfNode() {
+ GraphBase::StreamNode::StreamNode( NodeName ) {
_ORB = CORBA::ORB::_duplicate( ORB ) ;
_NamingService = ptrNamingService ;
_InNode = NULL ;
_ThreadNo = pthread_self() ;
- _Kind = akind ;
+ Kind( akind ) ;
+// _Kind = akind ;
time_t T = time(NULL);
struct tm * Tm = localtime(&T);
_Comment = NULLSTRING ;
}
- _SubGraphNumber = 0 ;
- _HeadNode = false ;
+// _SubGraphNumber = 0 ;
+// _HeadNode = false ;
_GeneratedName = GeneratedName ;
- const char *aNodeName = NodeName ;
- _Name = new char[strlen(aNodeName)+1];
- strcpy(_Name , aNodeName);
+// const char *aNodeName = NodeName ;
+// _Name = new char[strlen(aNodeName)+1];
+// strcpy(_Name , aNodeName);
+
+// _DataStreamInPortsNumber = 0 ;
+// _DataStreamOutPortsNumber = 0 ;
_ConnectedInPortsNumber = 0 ;
_DecrConnectedInPortsNumber = 0 ;
- _LinkedNodesSize = 0 ;
+// _LinkedNodesSize = 0 ;
_X = X ;
_Y = Y ;
-// MESSAGE( "GraphBase::ComputingNode::ComputingNode --> SetDebug " << Graph_prof_debug << " Graph_fdebug "
-// << Graph_fdebug ) ;
-// cout << "GraphBase::ComputingNode::ComputingNode --> SetDebug " << Graph_prof_debug << " Graph_fdebug "
-// << Graph_fdebug << endl ;
_Graph_prof_debug = Graph_prof_debug ;
_Graph_fdebug = Graph_fdebug ;
+// MESSAGE( "GraphBase::ComputingNode::ComputingNode " << NodeName
+// << " _Graph_prof_debug " << _Graph_prof_debug ) ;
SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
-// MESSAGE( "GraphBase::ComputingNode::ComputingNode SetDebug Done " << Graph_prof_debug << " Graph_fdebug "
-// << Graph_fdebug << " aService.ServiceName " << aService.ServiceName ) ;
-// cout << "GraphBase::ComputingNode::ComputingNode SetDebug Done " << Graph_prof_debug << " Graph_fdebug "
-// << Graph_fdebug << endl ;
-// cout << "GraphBase::ComputingNode::ComputingNode(" << aService.ServiceName << "," << aNodeName << ","
-// << akind << ")" << endl;
- cdebug_in << "GraphBase::ComputingNode::ComputingNode(" << aService.ServiceName << "," << aNodeName << ","
+ cdebug_in << "GraphBase::ComputingNode::ComputingNode(" << aService.ServiceName << "," << NodeName << ","
<< akind << ")" << endl;
DefPortsOfNode( ORB , aService , NamePtr() , Kind() , Graph_prof_debug , Graph_fdebug ) ;
-
cdebug << "GraphBase::ComputingNode::ComputingNode " << this
- << " _Name " << (void *) _Name << " '" << _Name
- << " KindOfNode " << _Kind
- << " ServiceName " << ServiceName() << " In(" << ServiceInParameter().length()
+ << " Name '" << Name()
+ << "' KindOfNode " << Kind()
+ << " ServiceName '" << ServiceName() << "' In(" << ServiceInParameter().length()
<< ") Out(" << ServiceOutParameter().length() << ")" << endl ;
cdebug_out << "GraphBase::ComputingNode::ComputingNode" << endl;
GraphBase::ComputingNode::~ComputingNode() {
cdebug << "GraphBase::ComputingNode::~ComputingNode " << this
- << " _Name "
- << (void *) _Name << " " << _Name << " _Comment "
+ << " Name() "<< Name() << " _Comment "
<< (void *) _Comment << " " << _Comment << " " << endl ;
-// if ( _ComponentName != NULLSTRING )
-// delete [] _ComponentName ;
-// delete [] _Name ;
-// delete [] _EditorRelease ;
-// if ( _Author != NULLSTRING )
-// delete [] _Author ;
-// if ( _Computer != FACTORYSERVER )
-// delete [] _Computer;
-// if ( _Comment != NULLSTRING )
-// delete [] _Comment;
}
-bool GraphBase::ComputingNode::Name( const char * aName) {
- cdebug_in << "GraphBase::ComputingNode::Name " << _Name << endl;
- if ( _Name ) {
- cdebug << "GraphBase::ComputingNode::ReName " << _Name << " --> " << aName << endl ;
- delete [] _Name ;
- }
- _Name = new char[strlen(aName)+1] ;
- strcpy( _Name , aName ) ;
- cdebug_out << "GraphBase::ComputingNode::Name " << _Name << endl;
- return true ;
-}
+//->StreamNode bool GraphBase::ComputingNode::Name( const char * aName) {
+//->StreamNode cdebug_in << "GraphBase::ComputingNode::Name " << _Name << endl;
+//->StreamNode if ( _Name ) {
+//->StreamNode cdebug << "GraphBase::ComputingNode::ReName " << _Name << " --> " << aName << endl ;
+//->StreamNode delete [] _Name ;
+//->StreamNode }
+//->StreamNode _Name = new char[strlen(aName)+1] ;
+//->StreamNode strcpy( _Name , aName ) ;
+//->StreamNode cdebug_out << "GraphBase::ComputingNode::Name " << _Name << endl;
+//->StreamNode return true ;
+//->StreamNode }
SUPERV::SDate GraphBase::ComputingNode::FirstCreation () const {
// cdebug << "GraphBase::ComputingNode::FirstCreation "
-// << "' _Name " << _Name << " " << _FirstCreation << " "
+// << " Name '" << Name() << "' " << _FirstCreation << " "
// << _LastModification << endl ;
return _FirstCreation;
}
return _LastModification ;
}
-bool GraphBase::ComputingNode::Kind(const SUPERV::KindOfNode aKind) {
- _Kind = aKind ;
- return true ;
-}
-
void GraphBase::ComputingNode::FirstCreation(const SUPERV::SDate aDate ) {
_FirstCreation = aDate ;
}
// Info->theInterfaceName = InterfaceName() ;
Info->theName = Name() ;
Info->theKind = Kind() ;
+ if ( IsDataStreamNode() ) {
+ long Timeout ;
+ SUPERV::KindOfDataStreamTrace DataStreamTrace ;
+ double DeltaTime ;
+ ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
+ Info->theTimeout = Timeout ;
+ Info->theDataStreamTrace = DataStreamTrace ;
+ Info->theDeltaTime = DeltaTime ;
+ }
Info->theService = *GetService() ;
// Info->theListOfParameters = *GetListOfParameters() ;
Info->theFirstCreation = FirstCreation() ;
return Info ;
}
+void GraphBase::ComputingNode::DelInPort( const char * InputParameterName ) {
+ GraphBase::PortsOfNode::DelInPort( InputParameterName ) ;
+}
+void GraphBase::ComputingNode::DelOutPort( const char * OutputParameterName ) {
+ GraphBase::PortsOfNode::DelOutPort( OutputParameterName ) ;
+}
+
GraphBase::InPort * GraphBase::ComputingNode::AddInPort( const char * InputParameterName ,
- const char * InputParameterType ) {
+ const char * InputParameterType ,
+ const SUPERV::KindOfPort aKindOfPort ) {
+ cdebug << "AddInPort " << Name() << " ConnectedInPortsNumber " << ConnectedInPortsNumber() << endl ;
return GraphBase::PortsOfNode::AddInPort( _ORB , NamePtr() ,
Kind() ,
InputParameterName ,
InputParameterType ,
+ aKindOfPort ,
+// DataStreamInPortsNumber() ,
_Graph_prof_debug , _Graph_fdebug ) ;
}
GraphBase::OutPort * GraphBase::ComputingNode::AddOutPort( const char * OutputParameterName ,
- const char * OutputParameterType ) {
+ const char * OutputParameterType ,
+ const SUPERV::KindOfPort aKindOfPort ) {
+ cdebug << "AddOutPort " << Name() << " ConnectedInPortsNumber " << ConnectedInPortsNumber() << endl ;
return GraphBase::PortsOfNode::AddOutPort( _ORB , NamePtr() ,
Kind() ,
OutputParameterName ,
OutputParameterType ,
+ aKindOfPort ,
+// DataStreamOutPortsNumber() ,
_Graph_prof_debug , _Graph_fdebug ) ;
}
-void GraphBase::ComputingNode::AddLink( GraphBase::ComputingNode * ToNode ) {
- int index = GetLinkedNodeIndex( ToNode->Name() ) ;
- if ( index < 0 ) {
- cdebug << Name() << "->GraphBase::ComputingNode::AddLinkedNode( " << ToNode->Name()
- << " ) new LinkedNode " << endl ;
- _LinkedNodes.resize( _LinkedNodesSize+1 ) ;
- _LinkedInPortsNumber.resize( _LinkedNodesSize+1 ) ;
- _LinkedNodes[ _LinkedNodesSize ] = ToNode ;
- _LinkedInPortsNumber[ _LinkedNodesSize ] = 1 ;
- SetLinkedNodeIndex( ToNode->Name() , _LinkedNodesSize ) ;
- index = _LinkedNodesSize ;
- _LinkedNodesSize++ ;
- }
- else {
- cdebug << Name() << "->GraphBase::ComputingNode::AddLinkedNode( " << ToNode->Name()
- << " ) old LinkedNode " << _LinkedNodes[index ]->Name() << endl ;
- _LinkedInPortsNumber[ index ] += 1 ;
- }
- cdebug << Name() << "->GraphBase::ComputingNode::AddLinkedNode( " << ToNode->Name()
- << " ) LinkedNodesSize " << _LinkedNodesSize << " [ " << index
- << " ] _LinkedInPortsNumber " << _LinkedInPortsNumber[ index ]
- << " ConnectedInPortsNumber " << ToNode->ConnectedInPortsNumber()
- << " + 1 Service " << ServiceName() << endl ;
- ToNode->IncrConnectedInPortsNumber() ;
+void GraphBase::ComputingNode::DelInDataStreamPort( const char * InputParameterName ) {
+ GraphBase::PortsOfNode::DelInPort( InputParameterName ) ;
}
-
-void GraphBase::ComputingNode::RemoveLink( GraphBase::ComputingNode * ToNode ) {
- int index = GetLinkedNodeIndex( ToNode->Name() ) ;
- if ( index >= 0 ) {
- cdebug << "GraphBase::ComputingNode::RemoveLink( to " << ToNode->Name() << " from "
- << Name() << " index : " << index << " ConnectedInPortsNumber "
- << ToNode->ConnectedInPortsNumber() - 1 << " LinkedInPortsNumber "
- << _LinkedInPortsNumber[ index ] << " - 1" << endl ;
- ToNode->DecrConnectedInPortsNumber() ;
- _LinkedInPortsNumber[ index ] -= 1 ;
- if ( _LinkedInPortsNumber[ index ] == 0 ) {
- _LinkedNodesSize-- ;
- cdebug << "GraphBase::ComputingNode::RemoveLink new LinkedNodesSize "
- << _LinkedNodesSize << " " << ToNode->Name() << " removed from "
- << " linkednodes of " << Name() << endl ;
- int i ;
- for ( i = index ; i < _LinkedNodesSize ; i++ ) {
- _LinkedNodes[ i ] = _LinkedNodes[ i+1 ] ;
- _LinkedInPortsNumber[ i ] = _LinkedInPortsNumber[ i+1 ] ;
- SetLinkedNodeIndex( _LinkedNodes[ i ]->Name() , i ) ;
- }
- DelLinkedNodeIndex( ToNode->Name() ) ;
- _LinkedNodes.resize( _LinkedNodesSize+1 ) ;
- _LinkedInPortsNumber.resize( _LinkedNodesSize+1 ) ;
- }
- }
- else {
- cdebug << " Error index " << index << endl ;
- }
+void GraphBase::ComputingNode::DelOutDataStreamPort( const char * OutputParameterName ) {
+ GraphBase::PortsOfNode::DelOutPort( OutputParameterName ) ;
}
-void GraphBase::ComputingNode::ReNameLink( const char* OldNodeName ,
- const char* NewNodeName ) {
- cdebug_in << "GraphBase::ComputingNode::ReNameLink (" << OldNodeName << " , "
- << NewNodeName << ")" << endl;
- int index = GetLinkedNodeIndex( OldNodeName ) ;
- if ( index >= 0 ) {
- _MapOfLinkedNodes.erase( OldNodeName ) ;
- SetLinkedNodeIndex( NewNodeName , index ) ;
+GraphBase::InDataStreamPort * GraphBase::ComputingNode::AddInDataStreamPort( const char * InputParameterName ,
+ const SALOME_ModuleCatalog::DataStreamType InputParameterType ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
+ const SUPERV::KindOfPort aKindOfPort ) {
+// IncrDataStreamInPorts() ;
+ GraphBase::InDataStreamPort * aDataStreamPort ;
+ aDataStreamPort = (GraphBase::InDataStreamPort * ) GraphBase::PortsOfNode::AddInPort( _ORB , NamePtr() ,
+ Kind() ,
+ InputParameterName ,
+ DataStreamTypeToString( InputParameterType ).c_str() ,
+ aKindOfPort ,
+// DataStreamInPortsNumber() ,
+ _Graph_prof_debug , _Graph_fdebug ) ;
+ aDataStreamPort->Dependency( aDependency ) ;
+ if ( aDependency == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL ) {
+ aDataStreamPort->SetParams( SUPERV::TI , SUPERV::L1 , SUPERV::EXTRANULL ) ;
}
- cdebug_out << "GraphBase::ComputingNode::ReNameLink" << endl ;
+ return aDataStreamPort ;
}
+GraphBase::OutDataStreamPort * GraphBase::ComputingNode::AddOutDataStreamPort( const char * OutputParameterName ,
+ const SALOME_ModuleCatalog::DataStreamType OutputParameterType ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
+ const SUPERV::KindOfPort aKindOfPort ) {
+// IncrDataStreamOutPorts() ;
+ GraphBase::OutDataStreamPort * aDataStreamPort ;
+ aDataStreamPort = (GraphBase::OutDataStreamPort * ) GraphBase::PortsOfNode::AddOutPort( _ORB , NamePtr() ,
+ Kind() ,
+ OutputParameterName ,
+ DataStreamTypeToString( OutputParameterType ).c_str() ,
+ aKindOfPort ,
+// DataStreamOutPortsNumber() ,
+ _Graph_prof_debug , _Graph_fdebug ) ;
+ aDataStreamPort->Dependency( aDependency ) ;
+ return aDataStreamPort ;
+}
+
#include <sys/time.h>
#include <sys/resource.h>
const ListOfFuncName FuncNames ,
const ListOfPythonFunctions PythonFunctions ,
int XCoordinate , int YCoordinate ) const {
+ cdebug_in << "SaveXML Node " << Name() << endl ;
QDomElement node = Graph.createElement( "node" ) ;
info.appendChild( node ) ;
QDomElement componentname = Graph.createElement( "component-name" ) ;
// f << Tabs << "<kind>" << (int ) Kind() << "</kind>" << endl ;
QDomElement kind = Graph.createElement( "kind" ) ;
QString aKind ;
- aKind = aKind.setNum( Kind() ) ;
+ if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) {
+ aKind = aKind.setNum( SUPERV::DataFlowGraph ) ;
+ }
+ else {
+ aKind = aKind.setNum( Kind() ) ;
+ }
aField = Graph.createTextNode( aKind ) ;
node.appendChild( kind ) ;
kind.appendChild( aField ) ;
+ if ( IsDataStreamNode() ) {
+ long Timeout ;
+ SUPERV::KindOfDataStreamTrace DataStreamTrace ;
+ double DeltaTime ;
+ ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
+
+ QDomElement timeout = Graph.createElement("streamgraph-timeout") ;
+ QString aTimeout ;
+ aTimeout = aTimeout.setNum( Timeout ) ;
+ aField = Graph.createTextNode( aTimeout ) ;
+ node.appendChild( timeout ) ;
+ timeout.appendChild( aField ) ;
+
+ QDomElement datastreamtrace = Graph.createElement("streamgraph-datastreamtrace") ;
+ QString aDataStreamTrace ;
+ aDataStreamTrace = aDataStreamTrace.setNum( DataStreamTrace ) ;
+ aField = Graph.createTextNode( aDataStreamTrace ) ;
+ node.appendChild( datastreamtrace ) ;
+ datastreamtrace.appendChild( aField ) ;
+
+ QDomElement deltatime = Graph.createElement("streamgraph-deltatime") ;
+ QString aDeltaTime ;
+ aDeltaTime = aDeltaTime.setNum( DeltaTime ) ;
+ aField = Graph.createTextNode( aDeltaTime ) ;
+ node.appendChild( deltatime ) ;
+ deltatime.appendChild( aField ) ;
+ }
+
QDomElement couplednode = Graph.createElement("coupled-node") ;
if ( IsGOTONode() || IsLoopNode() || IsEndLoopNode() ||
IsSwitchNode() || IsEndSwitchNode() ) {
service.appendChild(servicename) ;
servicename.appendChild( aField ) ;
-// f << Tabs << " <inParameter-list>" << endl ;
QDomElement inParameterlist = Graph.createElement("inParameter-list") ;
service.appendChild(inParameterlist) ;
unsigned int i;
+ GraphBase::ComputingNode * aNode = (GraphBase::ComputingNode * ) this ;
for ( i = 0 ; i < ServiceInParameter().length() ; i++ ) {
-// f << Tabs << " <inParameter>" << endl ;
- QDomElement inParameter = Graph.createElement("inParameter") ;
- inParameterlist.appendChild(inParameter) ;
-// f << Tabs << " <inParameter-type>"
-// << ServiceInParameter()[i].Parametertype << "</inParameter-type>"
-// << endl ;
- QDomElement inParametertype = Graph.createElement("inParameter-type") ;
- // mpv: Linux 8.0 compiler compatibility
-// aField = Graph.createTextNode( (char *)ServiceInParameter()[i].Parametertype ) ;
- if ( strlen( ServiceInParameter()[i].Parametertype ) ) {
- aField = Graph.createTextNode( strdup( ServiceInParameter()[i].Parametertype ) ) ;
- }
- else {
- aField = Graph.createTextNode( "?" ) ;
- }
- inParameter.appendChild(inParametertype) ;
- inParametertype.appendChild( aField ) ;
-// f << Tabs << " <inParameter-name>"
-// << ServiceInParameter()[i].Parametername << "</inParameter-name>"
-// << endl ;
- QDomElement inParametername = Graph.createElement("inParameter-name") ;
- // mpv: Linux 8.0 compiler compatibility
-// aField = Graph.createTextNode( (char *) ServiceInParameter()[i].Parametername ) ;
- if ( strlen( ServiceInParameter()[i].Parametername ) ) {
- aField = Graph.createTextNode( strdup(ServiceInParameter()[i].Parametername) ) ;
- }
- else {
- aField = Graph.createTextNode( "?" ) ;
+ const GraphBase::InPort * anInPort ;
+ anInPort = aNode->GetInPort( ServiceInParameter()[i].Parametername ) ;
+ if ( !anInPort->IsDataStream() ) {
+ cdebug << "SaveXML " << i << ". " << ServiceInParameter()[i].Parametername
+ << " InParameterPort " << anInPort->Kind() << endl ;
+ QDomElement inParameter = Graph.createElement("inParameter") ;
+ inParameterlist.appendChild(inParameter) ;
+ QDomElement inParametertype = Graph.createElement("inParameter-type") ;
+ if ( strlen( ServiceInParameter()[i].Parametertype ) ) {
+ aField = Graph.createTextNode( strdup( ServiceInParameter()[i].Parametertype ) ) ;
+ }
+ else {
+ aField = Graph.createTextNode( "?" ) ;
+ }
+ inParameter.appendChild(inParametertype) ;
+ inParametertype.appendChild( aField ) ;
+ QDomElement inParametername = Graph.createElement("inParameter-name") ;
+ if ( strlen( ServiceInParameter()[i].Parametername ) ) {
+ aField = Graph.createTextNode( strdup(ServiceInParameter()[i].Parametername) ) ;
+ }
+ else {
+ aField = Graph.createTextNode( "?" ) ;
+ }
+ inParameter.appendChild(inParametername) ;
+ inParametername.appendChild( aField ) ;
}
- inParameter.appendChild(inParametername) ;
- inParametername.appendChild( aField ) ;
-// f << Tabs << " </inParameter>" << endl ;
}
-// f << Tabs << " </inParameter-list>" << endl ;
-// f << Tabs << " <outParameter-list>" << endl ;
QDomElement outParameterlist = Graph.createElement("outParameter-list") ;
service.appendChild(outParameterlist) ;
for ( i = 0 ; i < ServiceOutParameter().length() ; i++ ) {
-// f << Tabs << " <outParameter>" << endl ;
- QDomElement outParameter = Graph.createElement("outParameter") ;
- outParameterlist.appendChild(outParameter) ;
-// f << Tabs << " <outParameter-type>"
-// << ServiceOutParameter()[i].Parametertype << "</outParameter-type>"
-// << endl ;
- QDomElement outParametertype = Graph.createElement("outParameter-type") ;
- // mpv: Linux 8.0 compiler compatibility
-// aField = Graph.createTextNode( (char *) ServiceOutParameter()[i].Parametertype ) ;
- if ( strlen( ServiceOutParameter()[i].Parametertype ) ) {
- aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametertype) ) ;
- }
- else {
- aField = Graph.createTextNode( "?" ) ;
- }
- outParameter.appendChild(outParametertype) ;
- outParametertype.appendChild( aField ) ;
-// f << Tabs << " <outParameter-name>"
-// << ServiceOutParameter()[i].Parametername << "</outParameter-name>"
-// << endl ;
- QDomElement outParametername = Graph.createElement("outParameter-name") ;
- // mpv: Linux 8.0 compiler compatibility
-// aField = Graph.createTextNode( (char *) ServiceOutParameter()[i].Parametername ) ;
- if ( strlen( ServiceOutParameter()[i].Parametername ) ) {
- aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametername) ) ;
- }
- else {
- aField = Graph.createTextNode( "?" ) ;
+ const GraphBase::OutPort * anOutPort ;
+ anOutPort = aNode->GetOutPort( ServiceOutParameter()[i].Parametername ) ;
+ if ( !anOutPort->IsDataStream() ) {
+ cdebug << "SaveXML " << i << ". " << ServiceOutParameter()[i].Parametername
+ << " OutParameterPort " << anOutPort->Kind() << endl ;
+ QDomElement outParameter = Graph.createElement("outParameter") ;
+ outParameterlist.appendChild(outParameter) ;
+ QDomElement outParametertype = Graph.createElement("outParameter-type") ;
+ if ( strlen( ServiceOutParameter()[i].Parametertype ) ) {
+ aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametertype) ) ;
+ }
+ else {
+ aField = Graph.createTextNode( "?" ) ;
+ }
+ outParameter.appendChild(outParametertype) ;
+ outParametertype.appendChild( aField ) ;
+ QDomElement outParametername = Graph.createElement("outParameter-name") ;
+ if ( strlen( ServiceOutParameter()[i].Parametername ) ) {
+ aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametername) ) ;
+ }
+ else {
+ aField = Graph.createTextNode( "?" ) ;
+ }
+ outParameter.appendChild(outParametername) ;
+ outParametername.appendChild( aField ) ;
}
- outParameter.appendChild(outParametername) ;
- outParametername.appendChild( aField ) ;
-// f << Tabs << " </outParameter>" << endl ;
}
-// f << Tabs << " </outParameter-list>" << endl ;
-// f << Tabs << "</service>" << endl ;
-// f << Tabs << "<Parameter-list>" << endl ;
- QDomElement Parameterlist = Graph.createElement("Parameter-list") ;
- node.appendChild( Parameterlist ) ;
-#if 0
- if ( IsInLineNode() || IsGOTONode() ||
- IsLoopNode() || IsEndLoopNode() ||
- IsSwitchNode() || IsEndSwitchNode() ) {
- unsigned int i;
- for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
- const InPort * anInPort = GetNodeInPort( i ) ;
- if ( anInPort->IsBus() ) {
- f << Tabs << " <inParameter>" << endl ;
- f << Tabs << " <inParameter-type>"
- << anInPort->PortType() << "</inParameter-type>"
- << endl ;
- f << Tabs << " <inParameter-name>"
- << anInPort->PortName() << "</inParameter-name>"
- << endl ;
- f << Tabs << " </inParameter>" << endl ;
- const OutPort * anOutPort = GetNodeOutPort( anInPort->PortIndex() ) ;
- f << Tabs << " <outParameter>" << endl ;
- f << Tabs << " <outParameter-type>"
- << anOutPort->PortType() << "</outParameter-type>"
- << endl ;
- f << Tabs << " <outParameter-name>"
- << anOutPort->PortName() << "</outParameter-name>"
- << endl ;
- f << Tabs << " </outParameter>" << endl ;
+ QDomElement DataStreamlist = Graph.createElement("DataStream-list") ;
+ node.appendChild( DataStreamlist ) ;
+ for ( i = 0 ; i < (unsigned int ) GetNodeInPortsSize() ; i++ ) {
+ const GraphBase::InPort * anInPort ;
+ anInPort = aNode->GetNodeInPort( i ) ;
+ if ( anInPort->IsDataStream() ) {
+ cdebug << "SaveXML " << i << " " << Name() << " " << anInPort->PortName() << " " << anInPort->PortType()
+ << " InDataStreamPort " << anInPort->Kind() << endl ;
+ QDomElement inParameter = Graph.createElement("inParameter") ;
+ DataStreamlist.appendChild(inParameter) ;
+ QDomElement inParametertype = Graph.createElement("inParameter-type") ;
+ QString aType ;
+ aType = aType.setNum( StringToDataStreamType( anInPort->PortType() ) ) ;
+ cdebug << "SaveXML " << anInPort->PortType() << " --> " << StringToDataStreamType( anInPort->PortType() )
+ << " " << aType << endl ;
+ aField = Graph.createTextNode( aType ) ;
+ inParameter.appendChild(inParametertype) ;
+ inParametertype.appendChild( aField ) ;
+ QDomElement inParametername = Graph.createElement("inParameter-name") ;
+ if ( strlen( anInPort->PortName() ) ) {
+ aField = Graph.createTextNode( strdup(anInPort->PortName()) ) ;
+ }
+ else {
+ aField = Graph.createTextNode( "?" ) ;
}
+ inParameter.appendChild(inParametername) ;
+ inParametername.appendChild( aField ) ;
+ cdebug << "SaveXML " << anInPort->PortName() << endl ;
+ QDomElement inParameterdependency = Graph.createElement("inParameter-dependency") ;
+ QString aDependency ;
+ aDependency = aDependency.setNum( anInPort->Dependency() ) ;
+ aField = Graph.createTextNode( aDependency ) ;
+ inParameter.appendChild(inParameterdependency) ;
+ inParameterdependency.appendChild( aField ) ;
+ cdebug << "SaveXML Dependency " << anInPort->Dependency() << endl ;
+ SUPERV::KindOfSchema aKindOfSchema ;
+ SUPERV::KindOfInterpolation aKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+ ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+ QDomElement inParameterKindOfSchema = Graph.createElement("inParameter-schema") ;
+ QString aSchema ;
+ aSchema = aSchema.setNum( aKindOfSchema ) ;
+ aField = Graph.createTextNode( aSchema ) ;
+ inParameter.appendChild(inParameterKindOfSchema) ;
+ inParameterKindOfSchema.appendChild( aField ) ;
+ cdebug << "SaveXML aKindOfSchema " << aKindOfSchema << endl ;
+ QDomElement inParameterKindOfInterpolation = Graph.createElement("inParameter-interpolation") ;
+ QString anInterpolation ;
+ anInterpolation = anInterpolation.setNum( aKindOfInterpolation ) ;
+ aField = Graph.createTextNode( anInterpolation ) ;
+ inParameter.appendChild(inParameterKindOfInterpolation) ;
+ inParameterKindOfInterpolation.appendChild( aField ) ;
+ cdebug << "SaveXML aKindOfInterpolation " << aKindOfInterpolation << endl ;
+ QDomElement inParameterKindOfExtrapolation = Graph.createElement("inParameter-extrapolation") ;
+ QString anExtrapolation ;
+ anExtrapolation = anExtrapolation.setNum( aKindOfExtrapolation ) ;
+ aField = Graph.createTextNode( anExtrapolation ) ;
+ inParameter.appendChild(inParameterKindOfExtrapolation) ;
+ inParameterKindOfExtrapolation.appendChild( aField ) ;
+ cdebug << "SaveXML aKindOfExtrapolation " << aKindOfExtrapolation << endl ;
+ }
+ }
+ for ( i = 0 ; i < (unsigned int ) GetNodeOutPortsSize() ; i++ ) {
+ const GraphBase::OutPort * anOutPort ;
+ anOutPort = aNode->GetNodeOutPort( i ) ;
+ if ( anOutPort->IsDataStream() ) {
+ cdebug << "SaveXML " << i << " " << Name() << " " << anOutPort->PortName() << " " << anOutPort->PortType()
+ << " OutDataStreamPort " << anOutPort->Kind() << endl ;
+ QDomElement outParameter = Graph.createElement("outParameter") ;
+ DataStreamlist.appendChild(outParameter) ;
+ QDomElement outParametertype = Graph.createElement("outParameter-type") ;
+ QString aType ;
+ aType = aType.setNum( StringToDataStreamType( anOutPort->PortType() ) ) ;
+ cdebug << "SaveXML " << anOutPort->PortType() << " --> " << StringToDataStreamType( anOutPort->PortType() )
+ << " " << aType << endl ;
+ aField = Graph.createTextNode( aType ) ;
+ outParameter.appendChild(outParametertype) ;
+ outParametertype.appendChild( aField ) ;
+ QDomElement outParametername = Graph.createElement("outParameter-name") ;
+ if ( strlen( anOutPort->PortName() ) ) {
+ aField = Graph.createTextNode( strdup(anOutPort->PortName() ) ) ;
+ }
+ else {
+ aField = Graph.createTextNode( "?" ) ;
+ }
+ outParameter.appendChild(outParametername) ;
+ outParametername.appendChild( aField ) ;
+ cdebug << "SaveXML " << anOutPort->PortName() << endl ;
+ QDomElement outParameterdependency = Graph.createElement("outParameter-dependency") ;
+ QString aDependency ;
+ aDependency = aDependency.setNum( anOutPort->Dependency() ) ;
+ aField = Graph.createTextNode( aDependency ) ;
+ outParameter.appendChild(outParameterdependency) ;
+ outParameterdependency.appendChild( aField ) ;
+ cdebug << "SaveXML Dependency " << anOutPort->Dependency() << endl ;
+ long aNumberOfValues ;
+ aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
+ QDomElement outParameterNumberOfValues = Graph.createElement("outParameter-values") ;
+ QString aValues ;
+ aValues = aValues.setNum( aNumberOfValues ) ;
+ aField = Graph.createTextNode( aValues ) ;
+ outParameter.appendChild(outParameterNumberOfValues) ;
+ outParameterNumberOfValues.appendChild( aField ) ;
+ cdebug << "SaveXML NumberOfValues " << ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() << endl ;
}
}
-#endif
// f << Tabs << "</Parameter-list>" << endl ;
// f << Tabs << "<PyFunction-list>" << endl ;
aField = Graph.createTextNode( aYCoordinate ) ;
node.appendChild( yposition ) ;
yposition.appendChild( aField ) ;
+ cdebug_out << "SaveXML Node " << Name() << endl ;
return true ;
}
const ListOfFuncName FuncNames ,
const ListOfPythonFunctions PythonFunctions ,
int XCoordinate , int YCoordinate ) const {
- if ( IsDataFlowNode() ) {
+ if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) {
f << Name() << " = Graph( '" << Name() << "' )" << endl ;
}
+ else if ( IsDataStreamNode() ) {
+ f << Name() << " = StreamGraph( '" << Name() << "' )" << endl ;
+ long Timeout ;
+ SUPERV::KindOfDataStreamTrace DataStreamTrace ;
+ double DeltaTime ;
+ ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
+ f << aGraphName << ".SetStreamParams( " << Timeout << " , SUPERV." << DataStreamTrace
+ << " , " << DeltaTime << " )" << endl ;
+ }
else if ( IsComputingNode() ) {
int i ;
f << Name() << "_ServiceinParameter = []" << endl ;
<< ServiceOutParameter()[i].Parametertype << "' , '"
<< ServiceOutParameter()[i].Parametername << "' ) )" << endl ;
}
+ f << Name() << "_ServiceinStreamParameter = []" << endl ;
+ for ( i = 0 ; i < (int ) ServiceInStreamParameter().length() ; i++ ) {
+ f << Name() << "_ServiceinStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( SALOME_ModuleCatalog."
+ << ServiceInStreamParameter()[i].Parametertype << " , '"
+ << ServiceInStreamParameter()[i].Parametername << "' , SALOME_ModuleCatalog."
+ << ServiceInStreamParameter()[i].Parameterdependency << " ) )" << endl ;
+ }
+ f << Name() << "_ServiceoutStreamParameter = []" << endl ;
+ for ( i = 0 ; i < (int ) ServiceOutStreamParameter().length() ; i++ ) {
+ f << Name() << "_ServiceoutStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( SALOME_ModuleCatalog."
+ << ServiceOutStreamParameter()[i].Parametertype << " , '"
+ << ServiceOutStreamParameter()[i].Parametername << "' , SALOME_ModuleCatalog."
+ << ServiceOutStreamParameter()[i].Parameterdependency << " ) )" << endl ;
+ }
f << Name() << "_Service = SALOME_ModuleCatalog.Service( '" << ServiceName()
- << "' , " << Name() << "_ServiceinParameter" << " , "
- << Name() << "_ServiceoutParameter" << " , 0 )" << endl ;
+ << "' , " << Name() << "_ServiceinParameter"
+ << " , " << Name() << "_ServiceoutParameter"
+ << " , " << Name() << "_ServiceinStreamParameter"
+ << " , " << Name() << "_ServiceoutStreamParameter"
+ << " , 0 , 0 )" << endl ;
f << Name() << " = " << aGraphName << ".CNode( " << Name() << "_Service" << " )"
<< endl ;
}
<< "' , '" << InterfaceName << "' , '" << ServiceName() << "' )"
<< endl ;
}
+ else if ( IsEndLoopNode() || IsEndSwitchNode() ) {
+// It is done with LoopNode or SwitchNode with CoupledNode()
+ }
else {
f << "Py" << Name() << " = []" << endl ;
int i ;
// strcat( EndName , Name() ) ;
char * EndName = aCoupledNode->Name() ;
if ( IsLoopNode() ) {
+ int i ;
SUPERV::ListOfStrings aPyMore = *PythonFunctions[1] ;
SUPERV::ListOfStrings aPyNext = *PythonFunctions[2] ;
f << "PyMore" << Name() << " = []" << endl ;
f << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
<< endl ;
}
- f << EndName << ".SetPyFunction( 'End" << FuncNames[0].c_str() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
+ f << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
+ for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
+ const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
+ cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
+ << " " << anInPort->Kind() << endl ;
+ if ( anInPort->IsLoop() ) {
+ f << "I" << Name() << anInPort->PortName() << " = "
+ << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
+ }
+ else if ( anInPort->IsInLine() ) {
+ f << "I" << Name() << anInPort->PortName() << " = "
+ << Name() << ".InPort( '" << anInPort->PortName() << "' , '"
+ << anInPort->PortType() << "' )" << endl ;
+ }
+ else if ( anInPort->IsDataStream() ) {
+ f << "I" << Name() << anInPort->PortName() << " = " << Name()
+ << ".InStreamPort( '" << anInPort->PortName()
+ << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
+ << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
+ SUPERV::KindOfSchema aKindOfSchema ;
+ SUPERV::KindOfInterpolation aKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+ ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+ f << "I" << Name() << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
+ << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
+ }
+ else if ( anInPort->IsGate() ) {
+ f << "I" << Name() << anInPort->PortName() << " = "
+ << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
+ }
+ }
+ for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
+ const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
+ cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
+ << " " << anOutPort->Kind() << endl ;
+ if ( anOutPort->IsInLine() || anOutPort->IsLoop() ) {
+ f << "O" << Name() << anOutPort->PortName() << " = "
+ << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
+ }
+ else if ( anOutPort->IsDataStream() ) {
+ f << "O" << Name() << anOutPort->PortName() << " = " << Name()
+ << ".OutStreamPort( '" << anOutPort->PortName()
+ << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
+ << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
+ long aNumberOfValues ;
+ aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
+ f << "O" << Name() << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
+ << endl ;
+ }
+ }
+ for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
+ const GraphBase::InPort * anInPort = aCoupledNode->GetNodeInPort(i) ;
+ cdebug << "Node " << aCoupledNode->Name() << " InPort " << anInPort->PortName()
+ << " " << anInPort->Kind() << endl ;
+ if ( anInPort->IsInLine() || anInPort->IsLoop() || anInPort->IsGate() ) {
+ f << "I" << EndName << anInPort->PortName() << " = " << EndName
+ << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
+ }
+ else if ( anInPort->IsDataStream() ) {
+ f << "I" << EndName << anInPort->PortName() << " = " << EndName
+ << ".InStreamPort( '" << anInPort->PortName()
+ << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
+ << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
+ SUPERV::KindOfSchema aKindOfSchema ;
+ SUPERV::KindOfInterpolation aKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+ ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+ f << "I" << EndName << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
+ << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
+ }
+ }
+ for ( i = 0 ; i < aCoupledNode->GetNodeOutPortsSize() ; i++ ) {
+ const GraphBase::OutPort * anOutPort = aCoupledNode->GetNodeOutPort(i) ;
+ cdebug << "Node " << aCoupledNode->Name() << " OutPort " << anOutPort->PortName()
+ << " " << anOutPort->Kind() << endl ;
+ if ( anOutPort->IsInLine() || anOutPort->IsLoop() || anOutPort->IsGate() ) {
+ f << "O" << EndName << anOutPort->PortName() << " = " << EndName
+ << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
+ }
+ else if ( anOutPort->IsDataStream() ) {
+ f << "O" << EndName << anOutPort->PortName() << " = " << EndName
+ << ".OutStreamPort( '" << anOutPort->PortName()
+ << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
+ << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
+ long aNumberOfValues ;
+ aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
+ f << "O" << EndName << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
+ << endl ;
+ }
+ }
}
else if ( IsSwitchNode() ) {
f << Name() << "," << EndName << " = " << aGraphName << ".SNode( '"
f << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
<< endl ;
}
- f << EndName << ".SetPyFunction( 'End" << FuncNames[0].c_str() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
+ f << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
const GraphBase::InPort * anInPort = aCoupledNode->GetNodeInPort(i) ;
- if ( anInPort->IsInLine() || anInPort->IsEndSwitch() ) {
- f << EndName << ".InPort( '" << anInPort->PortName()
+ cdebug << "Node " << aCoupledNode->Name() << " InPort " << anInPort->PortName()
+ << " " << anInPort->Kind() << endl ;
+// if ( anInPort->IsGate() || anInPort->IsEndSwitch() ) {
+ if ( anInPort->IsGate() ) {
+ f << "I" << EndName << anInPort->PortName() << " = " << EndName
+ << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
+ }
+ else if ( anInPort->IsInLine() || anInPort->IsEndSwitch() ) {
+ f << "I" << EndName << anInPort->PortName() << " = " << EndName
+ << ".InPort( '" << anInPort->PortName()
<< "' , '" << anInPort->PortType() << "' )" << endl ;
}
+ else if ( anInPort->IsDataStream() ) {
+ f << "I" << EndName << anInPort->PortName() << " = " << EndName
+ << ".InStreamPort( '" << anInPort->PortName()
+ << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
+ << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
+ SUPERV::KindOfSchema aKindOfSchema ;
+ SUPERV::KindOfInterpolation aKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+ ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+ f << "I" << EndName << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
+ << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
+ }
}
for ( i = 0 ; i < aCoupledNode->GetNodeOutPortsSize() ; i++ ) {
const GraphBase::OutPort * anOutPort = aCoupledNode->GetNodeOutPort(i) ;
- if ( anOutPort->IsInLine() ) {
- f << EndName << ".OutPort( '" << anOutPort->PortName()
+ cdebug << "Node " << aCoupledNode->Name() << " OutPort " << anOutPort->PortName()
+ << " " << anOutPort->Kind() << endl ;
+// if ( anOutPort->IsGate() || anOutPort->IsEndSwitch() ) {
+ if ( anOutPort->IsGate() ) {
+ f << "O" << EndName << anOutPort->PortName() << " = " << EndName
+ << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
+ }
+ else if ( anOutPort->IsInLine() || anOutPort->IsSwitch() ) {
+ f << "O" << EndName << anOutPort->PortName() << " = " << EndName
+ << ".OutPort( '" << anOutPort->PortName()
<< "' , '" << anOutPort->PortType() << "' )" << endl ;
}
+ else if ( anOutPort->IsDataStream() ) {
+ f << "O" << EndName << anOutPort->PortName() << " = " << EndName
+ << ".OutStreamPort( '" << anOutPort->PortName()
+ << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
+ << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
+ long aNumberOfValues ;
+ aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
+ f << "O" << EndName << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
+ << endl ;
+ }
}
}
delete [] EndName ;
}
}
- f << Name() << ".SetName( '" << Name() << "' )" << endl ;
- f << Name() << ".SetAuthor( '" << Author() << "' )" << endl ;
- if ( IsFactoryNode() ) {
- f << Name() << ".SetContainer( '" << Computer << "' )" << endl ;
+ if ( IsEndLoopNode() || IsEndSwitchNode() ) {
+// It is done with LoopNode or SwitchNode with CoupledNode()
}
- f << Name() << ".SetComment( '" << Comment() << "' )" << endl ;
- f << Name() << ".Coords( " << XCoordinate << " , " << YCoordinate << " )" << endl ;
+ else {
+ f << Name() << ".SetName( '" << Name() << "' )" << endl ;
+ f << Name() << ".SetAuthor( '" << Author() << "' )" << endl ;
+ if ( IsFactoryNode() ) {
+ f << Name() << ".SetContainer( '" << Computer << "' )" << endl ;
+ }
+ f << Name() << ".SetComment( '" << Comment() << "' )" << endl ;
+ f << Name() << ".Coords( " << XCoordinate << " , " << YCoordinate << " )" << endl ;
- if ( IsOneOfInLineNodes() ) {
- int i ;
- for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
- const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
- if ( anInPort->IsInLine() ) {
- f << Name() << ".InPort( '" << anInPort->PortName() << "' , '"
- << anInPort->PortType() << "' )" << endl ;
+ if ( IsComputingNode() || IsFactoryNode() ) {
+ int i ;
+ for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
+ const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
+ if ( !anInPort->IsDataStream() ) {
+ cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
+ << " " << anInPort->Kind() << endl ;
+ f << "I" << Name() << anInPort->PortName() << " = "
+ << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
+ }
+ }
+ for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
+ const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
+ if ( !anOutPort->IsDataStream() ) {
+ cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
+ << " " << anOutPort->Kind() << endl ;
+ f << "O" << Name() << anOutPort->PortName() << " = "
+ << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
+ }
}
}
- for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
- const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
- if ( anOutPort->IsInLine() || anOutPort->IsSwitch() ) {
- f << Name() << ".OutPort( '" << anOutPort->PortName()
- << "' , '" << anOutPort->PortType() << "' )" << endl ;
+ else if ( IsOneOfInLineNodes() && !IsLoopNode() ) {
+ int i ;
+ for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
+ const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
+ cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
+ << " " << anInPort->Kind() << endl ;
+ if ( anInPort->IsInLine() || anInPort->IsEndSwitch() ) {
+ f << "I" << Name() << anInPort->PortName() << " = "
+ << Name() << ".InPort( '" << anInPort->PortName() << "' , '"
+ << anInPort->PortType() << "' )" << endl ;
+ }
+ else if ( anInPort->IsGate() ) {
+ f << "I" << Name() << anInPort->PortName() << " = "
+ << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
+ }
+ }
+ for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
+ const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
+ cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
+ << " " << anOutPort->Kind() << endl ;
+ if ( anOutPort->IsInLine() || anOutPort->IsSwitch() ) {
+ f << "O" << Name() << anOutPort->PortName() << " = "
+ << Name() << ".OutPort( '" << anOutPort->PortName()
+ << "' , '" << anOutPort->PortType() << "' )" << endl ;
+ }
+ else if ( anOutPort->IsGate() ) {
+ f << "O" << Name() << anOutPort->PortName() << " = "
+ << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
+ }
}
}
- }
-
-#if 0
- if ( IsLoopNode() || IsSwitchNode() ) {
- f << EndName << ".SetName( '" << CoupledNode
- << "' )" << endl ;
- f << EndName << ".SetAuthor( '" << CoupledNode->Author()
- << "' )" << endl ;
- f << EndName << ".SetComment( '" << CoupledNode->Comment()
- << "' )" << endl ;
- f << EndName << ".Coords( " << CoupledNode->XCoordinate() << " , "
- << CoupledNode->YCoordinate() << " )" << endl ;
- unsigned int i;
- for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
- const InPort * anInPort = GetNodeInPort( i ) ;
- if ( anInPort->IsBus() ) {
- const OutPort * anOutPort = GetNodeOutPort( anInPort->PortIndex() ) ;
- f << Name() << ".BusPorts( '" << anInPort->PortName() << "' , '"
- << anInPort->PortType() << "' , '" << anOutPort->PortName()
- << "' , '" << anOutPort->PortType() << "' )" << endl ;
+ if ( !IsDataFlowNode() && !IsDataStreamNode() ) {
+ int i ;
+ for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
+ const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
+ cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
+ << " " << anInPort->Kind() << endl ;
+ if ( anInPort->IsDataStream() ) {
+ if ( IsOneOfInLineNodes() ) {
+ f << "I" << Name() << anInPort->PortName() << " = "
+ << Name() << ".InStreamPort( '" << anInPort->PortName() << "' , SALOME_ModuleCatalog."
+ << StringToDataStreamType( anInPort->PortType() ) << " , SALOME_ModuleCatalog."
+ << anInPort->Dependency() << " )" << endl ;
+ }
+ else {
+ f << "I" << Name() << anInPort->PortName() << " = "
+ << Name() << ".GetInStreamPort( '" << anInPort->PortName() << "' )" << endl ;
+ }
+ SUPERV::KindOfSchema aKindOfSchema ;
+ SUPERV::KindOfInterpolation aKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+ ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+ f << "I" << Name() << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
+ << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
+ }
+ }
+ for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
+ const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
+ cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
+ << " " << anOutPort->Kind() << endl ;
+ if ( anOutPort->IsDataStream() ) {
+ if ( IsOneOfInLineNodes() ) {
+ f << "O" << Name() << anOutPort->PortName() << " = "
+ << Name() << ".OutStreamPort( '" << anOutPort->PortName() << "' , SALOME_ModuleCatalog."
+ << StringToDataStreamType( anOutPort->PortType() ) << " , SALOME_ModuleCatalog."
+ << anOutPort->Dependency() << " )" << endl ;
+ }
+ else {
+ f << "O" << Name() << anOutPort->PortName() << " = "
+ << Name() << ".GetOutStreamPort( '" << anOutPort->PortName() << "' )" << endl ;
+ }
+ long aNumberOfValues ;
+ aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
+ f << "O" << Name() << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )" << endl ;
+ }
}
}
}
-#endif
+
return true ;
}
ostream & operator<< (ostream & f,const GraphBase::ComputingNode & G) {
// f << "ComponentName " << G.ComponentName() << endl ;
- if ( G.IsComputingNode() )
+ if ( G.IsComputingNode() ) {
f << "NodeName " << G.Name() << endl ;
- else
+ }
+ else {
f << "DataFlowName " << G.Name() << endl ;
+ }
f << "Kind " << G.Kind() << endl ;
f << "Service " << *G.GetService() ;
f << "FirstCreation " << G.FirstCreation () << endl ;
if ( fromPort->IsPortConnected() ) {
int j ;
for ( j = 0 ; j < fromPort->InPortsSize() ; j++ ) {
- if ( j == 0 )
+ if ( j == 0 ) {
f << "FromNode " << Name() << endl ;
+ }
f << " FromServiceParameterName "
<< fromPort->GetServicesParameter().Parametername ;
const GraphBase::InPort* toPort = fromPort->InPorts( j ) ;
// Module : SUPERV
// $Header:
-#ifndef _DATAFLOWBASE_NODE_HXX
-#define _DATAFLOWBASE_NODE_HXX
+#ifndef _DATAFLOWBASE_COMPUTINGNODE_HXX
+#define _DATAFLOWBASE_COMPUTINGNODE_HXX
#include "SALOME_NamingService.hxx"
-#include "DataFlowBase_PortsOfNode.hxx"
+#include "DataFlowBase_StreamNode.hxx"
namespace GraphBase {
class InLineNode ;
- class ComputingNode : public PortsOfNode {
+ class ComputingNode : public StreamNode {
private:
CORBA::ORB_ptr _ORB ;
SALOME_NamingService * _NamingService ;
- int * _Graph_prof_debug ;
- ofstream * _Graph_fdebug ;
+//->StreamNode int * _Graph_prof_debug ;
+//->StreamNode ofstream * _Graph_fdebug ;
SUPERV::CNode_var _Node ;
void * _InNode ; // From GraphExecutor:: or GraphEditor::
bool _ObjInterface ;
pthread_t _ThreadNo ;
- char * _Name ;
- SUPERV::KindOfNode _Kind ;
+//->StreamNode char * _Name ;
+//->StreamNode SUPERV::KindOfNode _Kind ;
SUPERV::SDate _FirstCreation ;
SUPERV::SDate _LastModification ;
char * _EditorRelease ;
char * _Author ;
char * _Comment ;
- bool _HeadNode ;
- int _LevelNumber ;
- int _SubGraphNumber ;
+//->StreamNode bool _HeadNode ;
+//->StreamNode int _LevelNumber ;
+//->StreamNode int _SubGraphNumber ;
bool _GeneratedName ;
+//->StreamNode int _DataStreamInPortsNumber ;
+//->StreamNode int _DataStreamOutPortsNumber ;
+
int _ConnectedInPortsNumber ;
int _DecrConnectedInPortsNumber ;
// For generated NodeNames with ServiceName : number of Nodes using
// the same ServiceName. It is not the same Service if it belongs to
// a different Interface and/or a different Component ...
- map< string , int > _MapOfServiceNames ;
+//->StreamNode map< string , int > _MapOfServiceNames ;
// Nodes with LinkedInPortsNumber InPort(s) linked to Outport(s) of this node :
- map< string , int > _MapOfLinkedNodes ;
- int _LinkedNodesSize ;
- vector<ComputingNode * > _LinkedNodes ;
- vector<int > _LinkedInPortsNumber ;
+//->StreamNode map< string , int > _MapOfLinkedNodes ;
+//->StreamNode int _LinkedNodesSize ;
+//->StreamNode vector<ComputingNode * > _LinkedNodes ;
+//->StreamNode vector<int > _LinkedInPortsNumber ;
protected:
SALOME_NamingService * NamingService() const {
return _NamingService ; } ;
- SUPERV::CNode_var ObjRef() const { return _Node ; } ;
+ SUPERV::CNode_var ObjRef() const {
+// char * _NodeName ;
+// cdebug << "ComputingNode::ObjRef() " << _Node << " " << Name()
+// << " " << endl ;
+// SUPERV::CNode_var _NodeObjRef = SUPERV::CNode::_narrow( _Node ) ;
+// if ( CORBA::is_nil( _NodeObjRef ) ) {
+// _NodeName = "NilRef" ;
+// }
+// else {
+// try {
+// _NodeName = _NodeObjRef->Name() ;
+// }
+// catch ( ... ) {
+// _NodeName = "Catch Error" ;
+// }
+// }
+// cdebug << _NodeName << " " << Name() << endl ;
+ return _Node ; } ;
void SetObjRef(SUPERV::CNode_var aNode) {
- _Node = aNode ; } ;
+// char * _NodeName ;
+// if ( CORBA::is_nil( _Node ) ) {
+// _NodeName = "NilRef" ;
+// }
+// else {
+// _NodeName = _Node->Name() ;
+// }
+// cdebug << "ComputingNode::SetObjRef( " << _Node << " "
+// << _NodeName << " ) " << Name() << " --> " ;
+ _Node = aNode ;
+// cdebug << _Node << " " << _Node->Name() << " ) " << Name() << endl ;
+ } ;
void InNode( void * anInNode ) {
// cdebug << "GraphBase::ComputingNode::InNode " << Name() << endl ;
_InNode = anInNode ; } ;
pthread_t ThreadNo() { return _ThreadNo ; } ;
void ThreadNo( pthread_t aThread ) { _ThreadNo = aThread ; } ;
- char * Name() const { return my_strdup( _Name ) ; } ;
- const char *const * NamePtr() const { return &_Name ; } ;
- SUPERV::KindOfNode Kind() const {
- return _Kind; } ;
+//->StreamNode char * Name() const { return my_strdup( _Name ) ; } ;
+//->StreamNode const char *const * NamePtr() const { return &_Name ; } ;
// const SALOME_ModuleCatalog::Service * Service() const ;
SUPERV::SDate FirstCreation() const ;
SUPERV::SDate LastModification() const ;
int XCoordinate() const { return _X ; } ;
int YCoordinate() const { return _Y ; } ;
- bool Name( const char * aName ) ;
- bool Kind( SUPERV::KindOfNode aKind) ;
+//->StreamNode bool Name( const char * aName ) ;
// void Service( const SALOME_ModuleCatalog::Service aService ) ;
void FirstCreation( const SUPERV::SDate aFirstCreation ) ;
void LastModification( const SUPERV::SDate aLastModification ) ;
GraphBase::SNode * GetInfo() ;
- const bool IsComputingNode() const {
- return (_Kind == SUPERV::ComputingNode ) ; } ;
- const bool IsFactoryNode() const {
- return (_Kind == SUPERV::FactoryNode ) ; } ;
- const bool IsOneOfGOTONodes() const {
- return (_Kind == SUPERV::LoopNode ||
- _Kind == SUPERV::EndLoopNode ||
- _Kind == SUPERV::SwitchNode ||
- _Kind == SUPERV::EndSwitchNode ||
- _Kind == SUPERV::GOTONode ) ; } ;
- const bool IsOneOfInLineNodes() const {
- return (_Kind == SUPERV::InLineNode || IsOneOfGOTONodes() ) ; } ;
- const bool IsInLineNode() const {
- return (_Kind == SUPERV::InLineNode ) ; } ;
- const bool IsDataFlowNode() const {
- return (_Kind == SUPERV::DataFlowNode ) ; } ;
- const bool IsLoopNode() const {
- return (_Kind == SUPERV::LoopNode ) ; } ;
- const bool IsEndLoopNode() const {
- return (_Kind == SUPERV::EndLoopNode ) ; } ;
- const bool IsSwitchNode() const {
- return (_Kind == SUPERV::SwitchNode ) ; } ;
- const bool IsEndSwitchNode() const {
- return (_Kind == SUPERV::EndSwitchNode ) ; } ;
- const bool IsGOTONode() const {
- return (_Kind == SUPERV::GOTONode ) ; } ;
- void HeadNode( bool aHeadNode ) { _HeadNode = aHeadNode ; } ;
- const bool IsHeadNode() const { return _HeadNode ; } ;
+// void HeadNode( bool aHeadNode ) { _HeadNode = aHeadNode ; } ;
+// const bool IsHeadNode() const { return _HeadNode ; } ;
bool RemovePorts( const char* aNodeName ) ;
+ void DelInPort( const char * InputParameterName ) ;
+ void DelOutPort( const char * OutputParameterName ) ;
+
InPort * AddInPort( const char * InputParameterName ,
- const char * InputParameterType ) ;
+ const char * InputParameterType ,
+ const SUPERV::KindOfPort aKindOfPort ) ;
OutPort * AddOutPort( const char * OutputParameterName ,
- const char * OutputParameterType ) ;
+ const char * OutputParameterType ,
+ const SUPERV::KindOfPort aKindOfPort ) ;
+
+ void DelInDataStreamPort( const char * InputParameterName ) ;
+ void DelOutDataStreamPort( const char * OutputParameterName ) ;
+
+ InDataStreamPort * AddInDataStreamPort( const char * InputParameterName ,
+ const SALOME_ModuleCatalog::DataStreamType InputParameterType ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
+ const SUPERV::KindOfPort aKindOfPort ) ;
+ OutDataStreamPort * AddOutDataStreamPort( const char * OutputParameterName ,
+ const SALOME_ModuleCatalog::DataStreamType OutputParameterType ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
+ const SUPERV::KindOfPort aKindOfPort ) ;
+
+// ComputingNode * LinkedNodes( int i ) const { return (GraphBase::ComputingNode *) GraphBase::StreamNode::LinkedNodes( i ) ; } ;
+
+ void AddLink( GraphBase::ComputingNode * ToNode ) {
+ GraphBase::StreamNode::AddLink( ToNode ) ;
+ cdebug << Name() << "->GraphBase::ComputingNode::AddLinkedNode( " << ToNode->Name()
+ << ") ConnectedInPortsNumber " << ToNode->ConnectedInPortsNumber()
+ << " + 1 Service " << ServiceName() << endl ;
+ ToNode->IncrConnectedInPortsNumber() ; } ;
+
+ void RemoveLink( GraphBase::ComputingNode * ToNode ) {
+ if ( GraphBase::StreamNode::RemoveLink( ToNode ) ) {
+ cdebug << "GraphBase::StreamNode::RemoveLink to " << ToNode->Name() << " from "
+ << Name() << " ConnectedInPortsNumber "
+ << ToNode->ConnectedInPortsNumber() - 1 << endl ;
+ ToNode->DecrConnectedInPortsNumber() ; } } ;
- void AddLink( ComputingNode * aNode ) ;
- void RemoveLink( ComputingNode * aNode ) ;
void ReNameLink( const char* OldNodeName ,
- const char* NewNodeName ) ;
-
- int GetServiceNameNumber( const char * name ) {
- int num = _MapOfServiceNames[ name ] ;
- if ( num == 0 ) {
- _MapOfServiceNames[ name ] = 1 ;
- }
- else {
- _MapOfServiceNames[ name ] = num + 1 ;
- }
- return _MapOfServiceNames[ name ] ; } ;
+ const char* NewNodeName ) {
+ GraphBase::StreamNode::ReNameLink( OldNodeName , NewNodeName ) ; } ;
void IncrConnectedInPortsNumber() {
cdebug << "IncrConnectedInPortsNumber " << Name() << " -> "
}
return false ; } ;
- int GetLinkedNodeIndex( const char * name ) {
- int index = _MapOfLinkedNodes[ name ] -1 ;
- if ( index >= 0 ) {
- cdebug << "GetLinkedNodeIndex of " << name
- << " in _MapOfLinkedNodes : "
- << index << " Node " << hex << (void *) _LinkedNodes[ index ]
- << dec << " '" << _LinkedNodes[ index ]->Name() << "'"
- << endl ;
- }
- return index ; } ;
- void SetLinkedNodeIndex( const char * name , const int index ) {
- _MapOfLinkedNodes[ name ] = index +1 ;
- cdebug << "SetLinkedNodeIndex of " << name << " in _MapOfLinkedNodes : "
- << index << " Node " << hex << (void *) _LinkedNodes[ index ]
- << dec << " '" << _LinkedNodes[ index ]->Name() << "'"
- << " _MapOfLinkedNodes " << _MapOfLinkedNodes[ name ] - 1
- << endl ;
- } ;
- void DelLinkedNodeIndex( const char * name ) {
- _MapOfLinkedNodes.erase( name ) ; } ;
- int LinkedNodesSize() const { return _LinkedNodesSize ; } ;
- ComputingNode * LinkedNodes( int i ) const { return _LinkedNodes[ i ] ; } ;
- const int LinkedInPortsNumber( int i ) const { return _LinkedInPortsNumber[ i ] ; } ;
-
- int Level() { return _LevelNumber ; } ;
- void Level( int LevelNumber ) {
- _LevelNumber = LevelNumber ; } ;
- int SubGraph() { return _SubGraphNumber ; } ;
- void SubGraph( int SubGraphNumber ) {
- _SubGraphNumber = SubGraphNumber ; } ;
-
// const GraphBase::ListOfParameters * GetListOfParameters() const ;
const long CpuUsed() ;
SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ) :
InLineNode( ORB , ptrNamingService , DataFlowName ) {
- MESSAGE( "GraphBase::DataNode::DataNode" );
+// MESSAGE( "GraphBase::DataNode::DataNode" );
+ cdebug << "GraphBase::DataNode::DataNode" << endl ;
_Created = false ;
}
// MESSAGE( "GraphBase::DataNode::~DataNode" );
}
-void GraphBase::DataNode::DataService(
- CORBA::ORB_ptr ORB ,
- SALOME_ModuleCatalog::Service aService ,
- int * Graph_prof_debug ,
- ofstream * Graph_fdebug ) {
+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.ServiceName << endl ;
DefPortsOfNode( ORB , aService , NamePtr() , Kind() ,
_DataFlowDataPorts = new PortsOfNode() ;
cdebug << "GraphBase::DataNode::DataService : Mirrored DataFlowPortsOfNode of "
<< aReversedService.ServiceName << endl ;
- _DataFlowDataPorts->DefPortsOfNode( ORB , aReversedService , NamePtr() ,
- Kind() ,
+ _DataFlowDataPorts->DefPortsOfNode( ORB , aReversedService , NamePtr() , Kind() ,
Graph_prof_debug , Graph_fdebug ) ;
_Created = true ;
}
int i , ierr = 0 ;
for ( i = 0 ; i < _DataFlowDataPorts->GetNodeOutPortsSize() ; i++ ) {
- if ( !_DataFlowDataPorts->GetNodeOutPort(i)->IsDataConnected() ) {
- cdebug << "InPort " << _DataFlowDataPorts->GetNodeOutPort(i)->PortName()
+// 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() ) {
+ cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType()
<< " of DataFlow " << Name() << " has NO Data." << endl ;
ierr++ ;
}
else {
- cdebug << "InPort " << _DataFlowDataPorts->GetNodeOutPort(i)->PortName()
+ cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType()
<< " of DataFlow " << Name() << " has Data : "
// << _DataFlowDataPorts->GetNodeOutPort(i)->Value() << " kind "
// << _DataFlowDataPorts->GetNodeOutPort(i)->Kind()
private:
- GraphBase::PortsOfNode * _DataFlowDataPorts ;
bool _Created ;
+ protected :
+
+ GraphBase::PortsOfNode * _DataFlowDataPorts ;
+
public:
DataNode() ;
#include <stdio.h>
#include "DataFlowBase_DataPort.hxx"
+GraphBase::DataPort::DataPort() :
+ Port() {
+ pthread_mutex_init( &_MutexWait , NULL ) ;
+ InitialValues( CORBA::Any() ) ;
+}
+
GraphBase::DataPort::DataPort(
const char *const * NodeName ,
- const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ) :
- Port( NodeName , aserviceParameter ) {
+ const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
+ const SUPERV::KindOfPort aKind ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency ) :
+ Port( NodeName , aserviceParameter , aKind , aDependency ) {
pthread_mutex_init( &_MutexWait , NULL ) ;
InitialValues( CORBA::Any() ) ;
}
}
void GraphBase::DataPort::Value( const CORBA::Any & aDataValue ) {
- Value( new CORBA::Any( aDataValue ) ) ;
+ CORBA::Any * aValue = new CORBA::Any( aDataValue ) ;
+ Value( aValue ) ;
}
void GraphBase::DataPort::Value( const CORBA::Any * aDataValue ) {
class DataPort : public Port {
- CORBA::Any const * _InitialValue ;
- CORBA::Any const * _theValue ;
- CORBA::Any const * * _Value ;
- SUPERV::GraphState _State ;
- bool _Done ;
- pthread_mutex_t _MutexWait ;
+ private:
+
+ CORBA::Any const * _InitialValue ;
+ CORBA::Any const * _theValue ;
+ CORBA::Any const * * _Value ;
+ SUPERV::GraphState _State ;
+ bool _Done ;
+ pthread_mutex_t _MutexWait ;
public :
- DataPort( const char *const * NodeName ,
- const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ) ;
- virtual ~DataPort() ;
+ DataPort() ;
+ DataPort( const char *const * NodeName ,
+ const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
+ const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ) ;
+ virtual ~DataPort() ;
- void InitialValues(CORBA::Any aValue ) ;
- void Value (const CORBA::Any & aValue ) ;
- void Value( const CORBA::Any * aValue ) ;
- void Value( const CORBA::Any ** aValue ) ;
- CORBA::Any const * Value() const ;
- bool BoolValue() const ;
- const CORBA::Any ** ValuePtr() const ;
+ void InitialValues(CORBA::Any aValue ) ;
+ void Value (const CORBA::Any & aValue ) ;
+ void Value( const CORBA::Any * aValue ) ;
+ void Value( const CORBA::Any ** aValue ) ;
+ CORBA::Any const * Value() const ;
+ bool BoolValue() const ;
+ const CORBA::Any ** ValuePtr() const ;
- void State( SUPERV::GraphState aState ) {
- _State = aState ; } ;
- SUPERV::GraphState State() { return _State ; } ;
+ void State( SUPERV::GraphState aState ) {
+ _State = aState ; } ;
+ SUPERV::GraphState State() { return _State ; } ;
- void Done( bool aDone ) {
-// cdebug << "ChgDone(.) " << NodeName() << " " << PortName() << " "
-// << _Done << " -> " << aDone << endl ;
- _Done = aDone ; } ;
- const bool Done() const { return ( _Done ) ; } ;
+ void Done( bool aDone ) {
+// cdebug << "ChgDone(.) " << NodeName() << " " << PortName() << " "
+// << _Done << " -> " << aDone << endl ;
+ _Done = aDone ; } ;
+ const bool Done() const { return ( _Done ) ; } ;
- void StringValue(ostream & f) const ;
+ void StringValue(ostream & f) const ;
} ;
// $Header:
using namespace std;
-#include "DataFlowBase_Graph.hxx"
+#include "DataFlowBase_StreamGraph.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
GraphBase::Graph::Graph( CORBA::ORB_ptr ORB ,
SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ,
- const char * DebugFileName ) :
+ int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) :
+// const char * DebugFileName ) :
DataNode( ORB ,ptrNamingService , DataFlowName ) {
- Set_prof_debug( ORB , DebugFileName ) ;
- cdebug << "GraphBase::Graph::Graph( " << DataFlowName << ")" << endl ;
_Orb = CORBA::ORB::_duplicate( ORB ) ;
+ Set_prof_debug( Graph_prof_debug , Graph_fdebug ) ;
+ cdebug << "GraphBase::Graph::Graph( " << DataFlowName << ") GraphNodesSize() " << GraphNodesSize() << endl ;
_GraphNodesSize = 0 ;
}
const char * DataFlowAuthor ,
const char * DataFlowComputer ,
const char * DataFlowComment ,
- const char * DebugFileName ) :
+ int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) :
+// const char * DebugFileName ) :
DataNode( ORB , ptrNamingService , DataFlowService ,
DataFlowName , DataFlowkind ,
DataFlowFirstCreation , DataFlowLastModification ,
DataFlowEditorRelease , DataFlowAuthor , DataFlowComment ) {
_Orb = CORBA::ORB::_duplicate( ORB ) ;
_GraphNodesSize = 0 ;
- Set_prof_debug( ORB , DebugFileName ) ;
+ Set_prof_debug( Graph_prof_debug , Graph_fdebug ) ;
cdebug_in << "GraphBase::Graph::Graph" << endl ;
- DataService( ORB , DataFlowService , Graph_prof_debug() , Graph_fdebug() ) ;
+ DataService( ORB , DataFlowService , Graph_prof_debug , Graph_fdebug ) ;
cdebug_out << "GraphBase::Graph::Graph" << endl ;
}
cdebug << "GraphBase::Graph::~Graph" << endl ;
}
-void GraphBase::Graph::Set_prof_debug( CORBA::ORB_ptr ORB ,
- const char * DebugFileName ) {
- _Graph_prof_debug = 0 ;
- if ( DebugFileName ) {
- _Graph_fdebug = new ofstream( DebugFileName );
- MESSAGE( endl << "Trace redirected to file " << DebugFileName << endl)
- SetDebug( ORB , &_Graph_prof_debug , _Graph_fdebug ) ;
- }
- cdebug << "GraphBase::Graph::Set_prof_debug redirect Trace to file " << DebugFileName << endl ;
+void GraphBase::Graph::Set_prof_debug( int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) {
+ SetDebug( _Orb , Graph_prof_debug , Graph_fdebug ) ;
+ _Graph_prof_debug = Graph_prof_debug ;
+ _Graph_fdebug = Graph_fdebug ;
}
GraphBase::SNode * GraphBase::Graph::GetInfo() const {
Info->theInterfaceName = "" ;
Info->theName = Name() ;
Info->theKind = Kind() ;
+ if ( IsDataStreamNode() ) {
+ long Timeout ;
+ SUPERV::KindOfDataStreamTrace DataStreamTrace ;
+ double DeltaTime ;
+ ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
+ Info->theTimeout = Timeout ;
+ Info->theDataStreamTrace = DataStreamTrace ;
+ Info->theDeltaTime = DeltaTime ;
+ }
Info->theService = *GetService() ;
Info->theFirstCreation = FirstCreation() ;
Info->theLastModification = LastModification() ;
GraphBase::ListOfNodes * _list_nodes =
new GraphBase::ListOfNodes;
+ cdebug_in << "GraphBase::Graph::GetNodes" << endl ;
// All the nodes from _InNodes are taken
// vector< InNode *> Nodes = InNodes() ;
else {
(*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( "" ) ;
}
+// (*_list_nodes)[ind].theDataStreamInArgsNumber = aCNode->DataStreamInPortsNumber() ;
+// (*_list_nodes)[ind].theDataStreamOutArgsNumber = aCNode->DataStreamOutPortsNumber() ;
+
+ (*_list_nodes)[ind].theListOfInDataStreams.resize( aCNode->DataStreamInPortsNumber() ) ;
+ cdebug << "GraphBase::Graph::GetNodes " << aCNode->Name() << " " << aCNode->DataStreamInPortsNumber() << " DataStreamInPortsNumber" << endl ;
+ int iostream ;
+ int streamind = 0 ;
+ for ( iostream = 0 ; iostream < aCNode->GetNodeInPortsSize() ; iostream++ ) {
+ const GraphBase::InPort * anInPort ;
+ anInPort = aCNode->GetNodeInPort( iostream ) ;
+ if ( anInPort->IsDataStream() ) {
+ cdebug << "GraphBase::Graph::GetNodes In" << iostream << " " << aCNode->Name() << " " << anInPort->NodeName() << " " << anInPort->PortName()
+ << endl ;
+ (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametertype = StringToDataStreamType( anInPort->PortType() ) ;
+ (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametername = CORBA::string_dup( anInPort->PortName() ) ;
+ (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parameterdependency = anInPort->Dependency() ;
+ SUPERV::KindOfSchema aKindOfSchema ;
+ SUPERV::KindOfInterpolation aKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+ ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+ (*_list_nodes)[ind].theListOfInDataStreams[streamind].theKindOfSchema = aKindOfSchema ;
+ (*_list_nodes)[ind].theListOfInDataStreams[streamind].theKindOfInterpolation = aKindOfInterpolation ;
+ (*_list_nodes)[ind].theListOfInDataStreams[streamind].theKindOfExtrapolation = aKindOfExtrapolation ;
+ cdebug << "GraphBase::Graph::GetNodes " << aCNode->Name() << " " << anInPort->NodeName() << " " << anInPort->PortName() << " "
+ << anInPort->Dependency() << " " << aKindOfSchema << " " << aKindOfInterpolation << " " << aKindOfExtrapolation << " list_nodes "
+ << (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametername << " "
+ << (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametertype << " "
+ << (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parameterdependency << " "
+ << (*_list_nodes)[ind].theListOfInDataStreams[streamind].theKindOfSchema << " "
+ << (*_list_nodes)[ind].theListOfInDataStreams[streamind].theKindOfInterpolation << " "
+ << (*_list_nodes)[ind].theListOfInDataStreams[streamind].theKindOfExtrapolation << " " << endl ;
+ streamind += 1 ;
+ }
+ else {
+ cdebug << "GraphBase::Graph::GetNodes " << aCNode->Name() << " " << anInPort->NodeName() << " " << anInPort->PortName() << " "
+ << anInPort->Kind() << " IsDataStream " << anInPort->IsDataStream() << endl ;
+ }
+ }
+
+ (*_list_nodes)[ind].theListOfOutDataStreams.resize( aCNode->DataStreamOutPortsNumber() ) ;
+ cdebug << "GraphBase::Graph::GetNodes " << aCNode->Name() << " " << aCNode->DataStreamOutPortsNumber() << " DataStreamOutPortsNumber" << endl ;
+ streamind = 0 ;
+ for ( iostream = 0 ; iostream < aCNode->GetNodeOutPortsSize() ; iostream++ ) {
+ const GraphBase::OutPort * anOutPort ;
+ anOutPort = aCNode->GetNodeOutPort( iostream ) ;
+ if ( anOutPort->IsDataStream() ) {
+ cdebug << "GraphBase::Graph::GetNodes Out" << iostream << " " << aCNode->Name() << " " << anOutPort->NodeName() << " " << anOutPort->PortName() << " "
+ << endl ;
+ (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametertype = StringToDataStreamType( anOutPort->PortType() ) ;
+ (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametername = CORBA::string_dup( anOutPort->PortName() ) ;
+ (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parameterdependency = anOutPort->Dependency() ;
+ long aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
+ (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theNumberOfValues = aNumberOfValues ;
+ cdebug << "GraphBase::Graph::GetNodes " << aCNode->Name() << " " << anOutPort->NodeName() << " " << anOutPort->PortName() << " "
+ << anOutPort->Dependency() << " " << aNumberOfValues << " list_nodes "
+ << (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametername << " "
+ << (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametertype << " "
+ << (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parameterdependency << " "
+ << (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theNumberOfValues << endl ;
+ streamind += 1 ;
+ }
+ else {
+ cdebug << "GraphBase::Graph::GetNodes " << aCNode->Name() << " " << anOutPort->NodeName() << " " << anOutPort->PortName() << " "
+ << anOutPort->Kind() << " IsDataStream " << anOutPort->IsDataStream() << endl ;
+ }
+ }
+
(*_list_nodes)[ind].theService = *aCNode->GetService();
-// (*_list_nodes)[ind].theListOfParameters = *aCNode->GetListOfParameters() ;
+ cdebug << "GraphBase::Graph::GetNodes theService " << &(*_list_nodes)[ind].theService.ServiceName << endl ;
+ unsigned int i ;
+ for ( i = 0 ; i < (*_list_nodes)[ind].theService.ServiceinParameter.length() ; i++ ) {
+ cdebug << " In" << i << " " << &(*_list_nodes)[ind].theService.ServiceinParameter[i].Parametername
+ << " " << (*_list_nodes)[ind].theService.ServiceinParameter[i].Parametername
+ << " " << &(*_list_nodes)[ind].theService.ServiceinParameter[i].Parametertype
+ << " " << (*_list_nodes)[ind].theService.ServiceinParameter[i].Parametertype << endl ;
+ }
+ for ( i = 0 ; i < (*_list_nodes)[ind].theService.ServiceoutParameter.length() ; i++ ) {
+ cdebug << " Out" << i << " " << &(*_list_nodes)[ind].theService.ServiceoutParameter[i].Parametername
+ << " " << (*_list_nodes)[ind].theService.ServiceoutParameter[i].Parametername
+ << " " << &(*_list_nodes)[ind].theService.ServiceoutParameter[i].Parametertype
+ << " " << (*_list_nodes)[ind].theService.ServiceoutParameter[i].Parametertype << endl ;
+ }
+ for ( i = 0 ; i < (*_list_nodes)[ind].theService.ServiceinDataStreamParameter.length() ; i++ ) {
+ cdebug << " InDataStream" << i << " " << &(*_list_nodes)[ind].theService.ServiceinDataStreamParameter[i].Parametername
+ << " " << (*_list_nodes)[ind].theService.ServiceinDataStreamParameter[i].Parametername
+ << " " << &(*_list_nodes)[ind].theService.ServiceinDataStreamParameter[i].Parametertype
+ << " " << (*_list_nodes)[ind].theService.ServiceinDataStreamParameter[i].Parametertype << endl ;
+ }
+ for ( i = 0 ; i < (*_list_nodes)[ind].theService.ServiceoutDataStreamParameter.length() ; i++ ) {
+ cdebug << " OutDataStream" << i << " " << &(*_list_nodes)[ind].theService.ServiceoutDataStreamParameter[i].Parametername
+ << " " << (*_list_nodes)[ind].theService.ServiceoutDataStreamParameter[i].Parametername
+ << " " << &(*_list_nodes)[ind].theService.ServiceoutDataStreamParameter[i].Parametertype
+ << " " << (*_list_nodes)[ind].theService.ServiceoutDataStreamParameter[i].Parametertype << endl ;
+ }
if ( aCNode->IsOneOfInLineNodes() ) {
GraphBase::InLineNode * aINode = (GraphBase::InLineNode * ) aCNode ;
GraphBase::LoopNode * aLNode = NULL ;
}
}
}
+ cdebug_out << "GraphBase::Graph::GetNodes" << endl ;
return _list_nodes ;
}
}
bool GraphBase::Graph::AddNode( GraphBase::ComputingNode * aNode ) {
- cdebug_in << "GraphBase::Graph::AddNode " << (void *) aNode << " "
- << aNode->Name() << " " << aNode->ServiceName() << endl;
+ cdebug_in << "GraphBase::Graph::AddNode " << (void *) aNode << " " << aNode->Name() << " " << aNode->ServiceName() << endl;
bool RetVal = false ;
int index = GetGraphNodeIndex( aNode->Name() ) ;
if ( index < 0 ) {
+ cdebug << "GraphBase::Graph::AddNode " << _GraphNodesSize << " nodes + 1" << endl ;
_GraphNodes.resize( _GraphNodesSize+1 ) ;
_GraphNodes[ _GraphNodesSize ] = aNode ;
SetGraphNodeIndex( aNode->Name() , _GraphNodesSize ) ;
_GraphNodesSize += 1 ;
+ if ( SetServiceOfMap( (GraphBase::Service * ) aNode ) ) {
+ cdebug << "Graph::AddNode SetServiceOfMap " << aNode->ServiceName() << " in MapOfServices" << endl ;
+ }
+ else {
+ cdebug << "Graph::AddNode SetServiceOfMap " << aNode->ServiceName()
+ << " was already in MapOfServices" << endl ;
+ }
+
RetVal = true ;
- }
-// cout << "GraphBase::Graph::AddNode(" << aNode->ComponentName() << " , "
-// << aNode->Name() << ")" << endl;
- int i ;
- cdebug << "GraphBase::Graph::AddNode Known nodes :" << endl ;
- for ( i = 0 ; i < _GraphNodesSize ; i++ ) {
- cdebug << i << ". " << GetGraphNode( i )->Name() << " "
- << _MapOfGraphNodes[ GetGraphNode( i )->Name() ] - 1 << endl ;
+ int i ;
+ cdebug << "GraphBase::Graph::AddNode " << _GraphNodesSize << " Known nodes :" << endl ;
+ for ( i = 0 ; i < _GraphNodesSize ; i++ ) {
+ const GraphBase::ComputingNode * aKnownNode = GetGraphNode( i ) ;
+ if ( aKnownNode ) {
+ cdebug << i << ". " << aKnownNode->Name() << " " << _MapOfGraphNodes[ GetGraphNode( i )->Name() ] - 1 << endl ;
+ }
+ else {
+ cdebug << i << ". ERROR" << endl ;
+ }
+ }
}
cdebug_out << "GraphBase::Graph::AddNode " << _GraphNodesSize << " Nodes. "
<< aNode->ServiceName() << endl;
else {
GraphBase::ComputingNode * FromNode = GetChangeGraphNode( anOutPort->NodeName() ) ;
cdebug << " fromConnected " << FromNode->Name() << endl ;
- FromNode->ReNameLink( OldNodeName , NewNodeName ) ;
+ if ( anInPort->IsDataStream() ) {
+ FromNode->ReNameStreamLink( OldNodeName , NewNodeName ) ;
+ }
+ else {
+ FromNode->ReNameLink( OldNodeName , NewNodeName ) ;
+ }
}
char* OldNodePortName = new char[ strlen( OldNodeName ) +
strlen( aNode->GetChangeNodeInPort( i )->PortName() ) + 2 ] ;
else {
GraphBase::ComputingNode * FromNode = GetChangeGraphNode( anOutPort->NodeName() ) ;
cdebug << " fromConnected " << FromNode->Name() << endl ;
- FromNode->RemoveLink( aNode ) ;
+ if ( anInPort->IsDataStream() ) {
+ FromNode->RemoveStreamLink( aNode ) ;
+ }
+ else {
+ FromNode->RemoveLink( aNode ) ;
+ }
}
RetVal = anOutPort->RemoveInPort( anInPort ) ;
if ( !RetVal )
if ( !RetVal )
break ;
GraphBase::ComputingNode * ToNode = GetChangeGraphNode( anOutPort->InPorts( j )->NodeName() ) ;
- aNode->RemoveLink( ToNode ) ;
+ if ( anOutPort->IsDataStream() ) {
+ aNode->RemoveStreamLink( ToNode ) ;
+ }
+ else {
+ aNode->RemoveLink( ToNode ) ;
+ }
RetVal = anOutPort->RemoveInPort( anOutPort->ChangeInPorts( j ) ) ;
if ( !RetVal )
break ;
cdebug << "AddLink toPort not found." << endl ;
return false ;
}
+ if ( ( fromPort->IsDataStream() && !toPort->IsDataStream() ) ||
+ ( !fromPort->IsDataStream() && toPort->IsDataStream() ) ) {
+ cdebug << "AddLink fromPort/toPort Stream/Flow. ERROR" << endl ;
+ return false ;
+ }
+ if ( fromPort->IsDataStream() && fromPort->Dependency() == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL &&
+ toPort->Dependency() == SALOME_ModuleCatalog::DATASTREAM_ITERATIVE ) {
+ cdebug << "AddLink fromPort/toPort Stream DATASTREAM_TEMPORAL --> DATASTREAM_ITERATIVE. ERROR" << endl ;
+ return false ;
+ }
cdebug_in << "GraphBase::Graph::AddLink(" << fromNode->Name() << "("
<< fromPort->PortName() << ") ---> " << toNode->Name() << "("
<< toPort->PortName() << ") )" << endl;
- if ( !fromNode->IsDataFlowNode() && !toNode->IsDataFlowNode() &&
+ if ( !fromNode->IsDataFlowNode() && !fromNode->IsDataStreamNode() &&
+ !toNode->IsDataFlowNode() && !toNode->IsDataStreamNode() &&
toPort->GetOutPort() ) {
if ( !strcmp( toPort->GetOutPort()->NodePortName() ,
fromPort->NodePortName() ) ) {
cdebug << "Link already exists" << endl ;
- cdebug_out << "GraphBase::Graph::AddLink" << endl;
+ cdebug_out << "GraphBase::Graph::AddLink 1" << endl;
return true ;
}
else if ( toPort->IsDataConnected() ) {
cdebug_out << "GraphBase::Graph::AddLink" << endl;
return false ;
}
- toPort->Kind( SUPERV::EndSwitchParameter ) ;
+ if ( !toPort->IsDataStream() ) {
+ toPort->Kind( SUPERV::EndSwitchParameter ) ;
+ }
}
else if ( !fromPort->AddInPort( toPort ) ) { // --> MapOfInports in the OutPort
cdebug << "!fromPort->AddLink Error." << endl ;
return false ;
}
- if ( fromNode->IsDataFlowNode() && toPort->IsDataConnected() ) {
+ if ( ( fromNode->IsDataFlowNode() || fromNode->IsDataStreamNode() ) &&
+ toPort->IsDataConnected() ) {
toPort->RemoveOutPort() ;
}
}
fromPort->PortStatus( PortConnected ); // GOTO - Loop
}
- else if ( fromNode->IsDataFlowNode() || toNode->IsDataFlowNode() ) {
+ else if ( fromNode->IsDataFlowNode() || fromNode->IsDataStreamNode() ||
+ toNode->IsDataFlowNode() || toNode->IsDataStreamNode() ) {
cdebug << "AddLink IsDataFlowNode fromPort->PortStatus( DataConnected ) "
<< fromNode->Name() << " " << fromPort->PortName() << endl ;
fromPort->PortStatus( DataConnected );
}
else {
cdebug << "AddLink fromPort->PortStatus( PortConnected ) & fromNode->toNode "
- << fromNode->Name() << " " << fromPort->PortName() << endl;
+ << fromNode->Name() << " " << fromPort->PortName() << " "
+ << fromPort->Kind() << " -> " << toNode->Name() << " " << " "
+ << toPort->PortName() << " " << toPort->Kind() << endl;
fromPort->PortStatus( PortConnected );
- fromNode->AddLink( toNode ) ;
+ if ( fromPort->IsDataStream() && toPort->IsDataStream() ) {
+ fromNode->AddStreamLink( toNode ) ;
+ }
+ else {
+ fromNode->AddLink( toNode ) ;
+ }
}
if ( fromNode->IsSwitchNode() ) {
- if ( fromPort->IsInLine() && toPort->IsGate() && !toNode->IsEndSwitchNode() ) {
- fromPort->Kind( SUPERV::SwitchParameter ) ;
- }
- else if ( !fromPort->IsGate() && !toPort->IsGate() ){
- fromPort->Kind( SUPERV::InLineParameter ) ;
+ if ( !fromPort->IsDataStream() ) {
+ if ( fromPort->IsInLine() && toPort->IsGate() && !toNode->IsEndSwitchNode() ) {
+ fromPort->Kind( SUPERV::SwitchParameter ) ;
+ }
+ else if ( !fromPort->IsGate() && !toPort->IsGate() ){
+ fromPort->Kind( SUPERV::InLineParameter ) ;
+ }
}
if ( fromPort->IsGate() && !toNode->IsEndSwitchNode() ) {
GraphBase::InLineNode * anEndSwitchNode ;
}
}
// cdebug << fromNode->ServiceName() << " " << toNode->ServiceName() << endl ;
- cdebug_out << "GraphBase::Graph::AddLink" << endl;
+ cdebug_out << "GraphBase::Graph::AddLink 1" << endl;
return true ;
}
GraphBase::ComputingNode * fromNode = GetChangeGraphNode( FromNodeName ) ;
if ( RetVal ) {
if ( fromNode ) {
- fromNode->RemoveLink( toNode ) ;
+ if ( anInPort->IsDataStream() ) {
+ fromNode->RemoveStreamLink( toNode ) ;
+ }
+ else {
+ fromNode->RemoveLink( toNode ) ;
+ }
}
if ( fromNode->IsSwitchNode() && !anOutPort->IsGate() && !toNode->IsEndSwitchNode() ) {
anOutPort->Kind( SUPERV::InLineParameter ) ;
}
-#if 0
- if ( fromNode->IsEndLoopNode() ) {
- toNode = ((GraphBase::EndOfLoopNode * ) fromNode)->CoupledNode() ;
- if ( toNode ) {
- anInPort = toNode->GetChangeInPort( ToServiceParameterName ) ;
- RetVal = AddLink( fromNode , anOutPort , toNode , anInPort ) ;
- }
- else {
- RetVal = false ;
- }
- }
- if ( toNode->IsLoopNode() ) {
- fromNode = ((GraphBase::LoopNode * ) toNode)->CoupledNode() ;
- if ( fromNode ) {
- anOutPort = fromNode->GetChangeOutPort( FromServiceParameterName ) ;
- RetVal = AddLink( fromNode , anOutPort , toNode , toNode->GetChangeInPort( ToServiceParameterName ) ) ;
- }
- else {
- RetVal = false ;
- }
- }
-#endif
}
}
}
return RetVal ;
}
+map< string , GraphBase::Service * > GraphBase::Graph::MapOfServiceNames() {
+ return _MapOfServiceNames ; }
+
+GraphBase::Service * GraphBase::Graph::GetServiceOfMap( char * name ) {
+ return _MapOfServiceNames[ name ] ;
+}
+
+bool GraphBase::Graph::SetServiceOfMap( GraphBase::Service * aService ) {
+ GraphBase::Service * theService = _MapOfServiceNames[ aService->ServiceName() ] ;
+ if ( theService ) {
+ cdebug << "SetServiceOfMap of " << aService->ServiceName()
+ << " already in MapOfServiceNames : erase" << endl ;
+ _MapOfServiceNames.erase( aService->ServiceName() ) ;
+ }
+ _MapOfServiceNames[ (char * ) aService->ServiceName() ] = aService ;
+ cdebug << "SetServiceOfMap of " << aService->ServiceName() << " done" << endl ;
+ return true ;
+}
+
+int GraphBase::Graph::GetServiceNameNumber( SALOME_ModuleCatalog::Service aService ) {
+ GraphBase::Service * theService = _MapOfServiceNames[ (char * ) aService.ServiceName ] ;
+ if ( theService == NULL ) {
+ return 1 ;
+ }
+ return theService->NewInstance() ;
+}
+
bool GraphBase::Graph::CreateService() {
cdebug_in << "GraphBase::Graph::CreateService" << endl;
bool RetVal = true ;
GraphBase::ComputingNode * aToNode ;
int dostore ;
int innbr ;
+ int instreamnbr ;
int outnbr ;
- for ( dostore = 0 ; dostore <= 1 ; dostore++ ) {
+ int outstreamnbr ;
+ vector< SUPERV::KindOfPort > InPortsKind ;
+ vector< SALOME_ModuleCatalog::DataStreamDependency > InDataStreamDependency ;
+ vector< SUPERV::KindOfSchema > InKindOfSchema ;
+ vector< SUPERV::KindOfInterpolation > InKindOfInterpolation ;
+ vector< SUPERV::KindOfExtrapolation > InKindOfExtrapolation ;
+ vector< SUPERV::KindOfPort > OutPortsKind ;
+ vector< SALOME_ModuleCatalog::DataStreamDependency > OutDataStreamDependency ;
+ vector< long > OutNumberOfValues ;
+ for ( dostore = 0 ; dostore <= 2 ; dostore++ ) {
if ( dostore == 1 ) {
aService.ServiceName = Name() ;
aService.ServiceinParameter.length( 0 ) ;
aService.ServiceinParameter.length( innbr ) ;
aService.ServiceoutParameter.length( 0 ) ;
aService.ServiceoutParameter.length( outnbr ) ;
+ InPortsKind.resize( innbr ) ;
+ InDataStreamDependency.resize( innbr ) ;
+ InKindOfSchema.resize( innbr ) ;
+ InKindOfInterpolation.resize( innbr ) ;
+ InKindOfExtrapolation.resize( innbr ) ;
+ OutPortsKind.resize( outnbr ) ;
+ OutDataStreamDependency.resize( outnbr ) ;
+ OutNumberOfValues.resize( outnbr ) ;
+ }
+ else if ( dostore == 2 ) {
+ cdebug << "GraphBase::Graph::CreateService ->DataService innbr " << innbr << " instreamnbr " << instreamnbr << " outnbr " << outnbr
+ << " outstreamnbr " << outstreamnbr << endl ;
+ DataService( _Orb , aService , Graph_prof_debug() , Graph_fdebug() ) ;
+ aService.ServiceinParameter.length( innbr + instreamnbr ) ;
+ aService.ServiceoutParameter.length( outnbr + outstreamnbr ) ;
+ InPortsKind.resize( innbr + instreamnbr ) ;
+ InDataStreamDependency.resize( innbr + instreamnbr ) ;
+ InKindOfSchema.resize( innbr + instreamnbr ) ;
+ InKindOfInterpolation.resize( innbr + instreamnbr ) ;
+ InKindOfExtrapolation.resize( innbr + instreamnbr ) ;
+ OutPortsKind.resize( outnbr + outstreamnbr ) ;
+ OutDataStreamDependency.resize( outnbr + outstreamnbr ) ;
+ OutNumberOfValues.resize( outnbr + outstreamnbr ) ;
+ }
+ if ( dostore == 0 ) {
+ innbr = 0 ;
+ instreamnbr = 0 ;
+ outnbr = 0 ;
+ outstreamnbr = 0 ;
+ }
+ if ( dostore == 1 ) {
+ innbr = 0 ;
+ outnbr = 0 ;
}
- innbr = 0 ;
- outnbr = 0 ;
for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
aToNode = GraphNodes( i ) ;
for ( j = 0 ; j < aToNode->GetNodeInPortsSize() ; j++ ) {
GraphBase::InPort *anInPort = aToNode->GetChangeNodeInPort(j) ;
-#if 0
- if ( dostore == 0 &&
- strcmp( anInPort->ServicesParameterType() , "string" ) &&
- strcmp( anInPort->ServicesParameterType() , "long" ) &&
- strcmp( anInPort->ServicesParameterType() , "double" ) &&
- strcmp( anInPort->ServicesParameterType() , "objref" ) ) {
- cdebug << "CreateService Node " << aToNode->Name() << ". Input port " << anInPort->PortName()
- << " has illegal type " << anInPort->ServicesParameterType() << endl ;
- RetVal = false ;
- }
-#endif
bool isfromcouplednode = false ;
+ cdebug << "GraphBase::Graph::CreateService aToNode " << aToNode->Name() << " InPort" << j << endl ;
if ( anInPort->IsConnected() && anInPort->GetOutPort() ) {
GraphBase::ComputingNode * aFromNode = GetChangeGraphNode( anInPort->GetOutPort()->NodeName() ) ;
if ( aFromNode->IsEndLoopNode() && ((GraphBase::EndOfLoopNode * ) aFromNode)->CoupledNode() == aToNode ) {
cdebug << "DataConnected from " << *(anInPort->GetOutPort() ) ;
}
cdebug << endl ;
- innbr += 1 ;
+ if ( anInPort->IsDataStream() ) {
+ instreamnbr += 1 ;
+ }
+ else {
+ innbr += 1 ;
+ }
}
- else {
+ else if ( ( dostore == 1 && !anInPort->IsDataStream() ) ||
+ ( dostore == 2 && anInPort->IsDataStream() ) ) {
aService.ServiceinParameter[innbr].Parametertype = CORBA::string_dup( anInPort->PortType() ) ;
- aService.ServiceinParameter[innbr++].Parametername = CORBA::string_dup( anInPort->NodePortName() ) ;
+ aService.ServiceinParameter[innbr].Parametername = CORBA::string_dup( anInPort->NodePortName() ) ;
+ InPortsKind[ innbr ] = anInPort->Kind() ;
+ InDataStreamDependency[ innbr ] = anInPort->Dependency() ;
+ if ( dostore == 2 && anInPort->IsDataStream() ) {
+ ((GraphBase::InDataStreamPort * ) anInPort)->Params( InKindOfSchema[ innbr ] ,
+ InKindOfInterpolation[ innbr ] ,
+ InKindOfExtrapolation[ innbr ] ) ;
+ }
+ cdebug << "In" << innbr << " " << aService.ServiceinParameter[ innbr ].Parametername << " "
+ << anInPort->Kind() << endl ;
+ innbr += 1 ;
}
}
- else {
+ else if ( dostore == 0 ) {
cdebug << "CreateService " << aToNode->Name() << " Input port " << anInPort->PortName() ;
if ( anInPort->IsConnected() ) {
cdebug << " is connected " ;
GraphBase::ComputingNode * aFromNode = aToNode ;
for ( j = 0 ; j < aFromNode->GetNodeOutPortsSize() ; j++ ) {
GraphBase::OutPort *anOutPort = aFromNode->GetChangeNodeOutPort(j) ;
- cdebug << "CreateService Node " << aFromNode->Name() << ". Output port[" << j << "] ";
- if ( anOutPort ) {
- cdebug << anOutPort->PortName() << " " << anOutPort->ServicesParameterType() << endl ;
- }
- else {
- cdebug << " NULL" << endl ;
- }
-#if 0
- if ( dostore == 0 &&
- strcmp( anOutPort->ServicesParameterType() , "string" ) &&
- strcmp( anOutPort->ServicesParameterType() , "long" ) &&
- strcmp( anOutPort->ServicesParameterType() , "double" ) &&
- strcmp( anOutPort->ServicesParameterType() , "objref" ) ) {
- cdebug << "CreateService Node " << aFromNode->Name() << ". Output port " << anOutPort->PortName()
- << " has illegal type " << anOutPort->ServicesParameterType() << endl ;
- RetVal = false ;
- }
-#endif
+// cdebug << "CreateService Node " << aFromNode->Name() << ". Output port[" << j << "] ";
+// if ( anOutPort ) {
+// cdebug << anOutPort->PortName() << " " << anOutPort->ServicesParameterType() << endl ;
+// }
+// else {
+// cdebug << " NULL" << endl ;
+// }
if ( !aFromNode->IsGOTONode() ) {
if ( !anOutPort->IsGate() &&
( anOutPort->IsNotConnected() || anOutPort->IsDataConnected() ) ) {
if ( dostore == 0 ) {
- cdebug << "CreateService " << aFromNode->Name() << " Output port "
- << anOutPort->PortName() << endl ;
- outnbr += 1 ;
+// cdebug << "CreateService " << aFromNode->Name() << " Output port "
+// << anOutPort->PortName() << endl ;
+ if ( anOutPort->IsDataStream() ) {
+ outstreamnbr += 1 ;
+ }
+ else {
+ outnbr += 1 ;
+ }
}
- else {
+ else if ( ( dostore == 1 && !anOutPort->IsDataStream() ) ||
+ ( dostore == 2 && anOutPort->IsDataStream() ) ) {
aService.ServiceoutParameter[outnbr].Parametertype = CORBA::string_dup( anOutPort->PortType() ) ;
- aService.ServiceoutParameter[outnbr++].Parametername = CORBA::string_dup( anOutPort->NodePortName() ) ;
+ aService.ServiceoutParameter[outnbr].Parametername = CORBA::string_dup( anOutPort->NodePortName() ) ;
+ OutPortsKind[ outnbr ] = anOutPort->Kind() ;
+ OutDataStreamDependency[ outnbr ] = anOutPort->Dependency() ;
+ if ( dostore == 2 && anOutPort->IsDataStream() ) {
+ OutNumberOfValues[ outnbr ] = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
+ }
+ cdebug << "Out" << outnbr << " " << aService.ServiceoutParameter[ outnbr ].Parametername << " "
+ << anOutPort->Kind() << endl ;
+ outnbr += 1 ;
}
}
}
}
}
-// MESSAGE( "DataFlowNode ServiceName " << aService.ServiceName );
-// for ( i = 0 ; i < innbr ; i++ ) {
-// cout << "aService.ServiceinParameter[" << i << "].Parametertype "
-// << aService.ServiceinParameter[i].Parametertype << endl ;
-// cout << "aService.ServiceinParameter[" << i << "].Parametername "
-// << aService.ServiceinParameter[i].Parametername << endl ;
-// }
-// for ( i = 0 ; i < outnbr ; i++ ) {
-// cout << "aService.ServiceoutParameter[" << i << "].Parametertype "
-// << aService.ServiceoutParameter[i].Parametertype << endl ;
-// cout << "aService.ServiceoutParameter[" << i << "].Parametername "
-// << aService.ServiceoutParameter[i].Parametername << endl ;
-// }
-
- DataService( _Orb , aService , Graph_prof_debug() , Graph_fdebug() ) ;
-
+ MESSAGE( "DataFlowNode ServiceName " << aService.ServiceName );
+ for ( i = 0 ; i < innbr ; i++ ) {
+ cdebug << "aService.ServiceinParameter[" << i << "].Parametertype "
+ << aService.ServiceinParameter[i].Parametertype << " Parametername "
+ << aService.ServiceinParameter[i].Parametername << " " << InPortsKind[ i ] << endl ;
+ if ( InPortsKind[ i ] != SUPERV::DataStreamParameter ) {
+ cdebug << "NodeInPort[" << i << "] " << *GetChangeNodeInPort( i ) << endl ;
+ }
+ }
+ for ( i = 0 ; i < outnbr ; i++ ) {
+ cdebug << "aService.ServiceoutParameter[" << i << "].Parametertype "
+ << aService.ServiceoutParameter[i].Parametertype << " Parametername "
+ << aService.ServiceoutParameter[i].Parametername << " " << OutPortsKind[ i ] << endl ;
+ if ( OutPortsKind[ i ] != SUPERV::DataStreamParameter ) {
+ cdebug << "NodeOutPort[" << i << "] " << *GetChangeNodeOutPort( i ) << endl ;
+ }
+ }
+
+// DataService( _Orb , aService , InPortsKind , OutPortsKind , Graph_prof_debug() , Graph_fdebug() ) ;
+ for ( i = 0 ; i < innbr ; i++ ) {
+ if ( InPortsKind[ i ] == SUPERV::DataStreamParameter ) {
+ GraphBase::InDataStreamPort * anInPort = AddInDataStreamPort( aService.ServiceinParameter[ i ].Parametername ,
+ StringToDataStreamType( aService.ServiceinParameter[ i ].Parametertype ) ,
+ InDataStreamDependency[ i ] ,
+ SUPERV::DataStreamParameter ) ;
+ anInPort->SetParams( InKindOfSchema[ i ] ,
+ InKindOfInterpolation[ i ] ,
+ InKindOfExtrapolation[ i ] ) ;
+// NOT A BUG : AddOutPort for an inport (Reversed service)
+ anInPort = (GraphBase::InDataStreamPort * ) _DataFlowDataPorts->AddOutPort( _Orb , NamePtr() ,
+ Kind() ,
+ aService.ServiceinParameter[ i ].Parametername ,
+ aService.ServiceinParameter[ i ].Parametertype ,
+ SUPERV::DataStreamParameter ,
+// _DataFlowDataPorts->DataStreamOutPortsNumber() ,
+ _Graph_prof_debug , _Graph_fdebug ) ;
+ anInPort->Dependency( InDataStreamDependency[ i ] ) ;
+// Attention : revoir les reversed DataStreamPorts
+// anInPort->SetParams( InKindOfSchema[ i ] ,
+// InKindOfInterpolation[ i ] ,
+// InKindOfExtrapolation[ i ] ) ;
+ cdebug << "InStreamPort " << GetChangeNodeInPort( i )->PortName() << " " << GetChangeNodeInPort( i )->Kind() << endl ;
+ cdebug << "ReversedInStreamPort " << _DataFlowDataPorts->GetChangeNodeOutPort( i )->PortName() << " " << _DataFlowDataPorts->GetChangeNodeOutPort( i )->Kind()
+ << endl ;
+ }
+ else {
+ GetChangeNodeInPort( i )->Kind( InPortsKind[ i ] ) ;
+ _DataFlowDataPorts->GetChangeNodeOutPort( i )->Kind( InPortsKind[ i ] ) ;
+ GetChangeNodeInPort( i )->Dependency( InDataStreamDependency[ i ] ) ;
+ _DataFlowDataPorts->GetChangeNodeOutPort( i )->Dependency( InDataStreamDependency[ i ] ) ;
+ cdebug << "InPort " << GetChangeNodeInPort( i )->PortName() << " " << GetChangeNodeInPort( i )->Kind() << endl ;
+ cdebug << "ReversedInPort " << _DataFlowDataPorts->GetChangeNodeOutPort( i )->PortName() << " " << _DataFlowDataPorts->GetChangeNodeOutPort( i )->Kind()
+ << endl ;
+ }
+ }
+ for ( i = 0 ; i < outnbr ; i++ ) {
+ if ( OutPortsKind[ i ] == SUPERV::DataStreamParameter ) {
+ GraphBase::OutDataStreamPort * anOutPort = AddOutDataStreamPort( aService.ServiceoutParameter[ i ].Parametername ,
+ StringToDataStreamType( aService.ServiceoutParameter[ i ].Parametertype ) ,
+ OutDataStreamDependency[ i ] ,
+ SUPERV::DataStreamParameter ) ;
+ anOutPort->NumberOfValues( OutNumberOfValues[ i ] ) ;
+// NOT A BUG : AddInPort for an outport (Reversed service)
+ anOutPort = (GraphBase::OutDataStreamPort * ) _DataFlowDataPorts->AddInPort( _Orb , NamePtr() ,
+ Kind() ,
+ aService.ServiceoutParameter[ i ].Parametername ,
+ aService.ServiceoutParameter[ i ].Parametertype ,
+ SUPERV::DataStreamParameter ,
+// _DataFlowDataPorts->DataStreamInPortsNumber() ,
+ _Graph_prof_debug , _Graph_fdebug ) ;
+ anOutPort->Dependency( OutDataStreamDependency[ i ] ) ;
+// Attention : revoir les reversed DataStreamPorts
+// anOutPort->NumberOfValues( OutNumberOfValues[ i ] ) ;
+ cdebug << "OutStreamPort " << GetChangeNodeOutPort( i )->PortName() << " " << GetChangeNodeOutPort( i )->Kind() << endl ;
+ cdebug << "ReversedOutStreamPort " << _DataFlowDataPorts->GetChangeNodeInPort( i )->PortName() << " " << _DataFlowDataPorts->GetChangeNodeInPort( i )->Kind()
+ << endl ;
+ }
+ else {
+ GetChangeNodeOutPort( i )->Kind( OutPortsKind[ i ] ) ;
+ _DataFlowDataPorts->GetChangeNodeInPort( i )->Kind( OutPortsKind[ i ] ) ;
+ GetChangeNodeOutPort( i )->Dependency( OutDataStreamDependency[ i ] ) ;
+ _DataFlowDataPorts->GetChangeNodeInPort( i )->Dependency( OutDataStreamDependency[ i ] ) ;
+ GetChangeNodeOutPort( i )->Dependency( OutDataStreamDependency[ i ] ) ;
+ _DataFlowDataPorts->GetChangeNodeInPort( i )->Dependency( OutDataStreamDependency[ i ] ) ;
+ cdebug << "OutPort " << GetChangeNodeOutPort( i )->PortName() << " " << GetChangeNodeOutPort( i )->Kind() << endl ;
+ cdebug << "ReversedOutPort " << _DataFlowDataPorts->GetChangeNodeInPort( i )->PortName() << " " << _DataFlowDataPorts->GetChangeNodeInPort( i )->Kind()
+ << endl ;
+ }
+ }
// Restore input datas :
+ DataStreamInPortsNumber( 0 ) ;
+ DataStreamOutPortsNumber( 0 ) ;
for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
aToNode = GraphNodes( i ) ;
+ DataStreamInPortsNumber( DataStreamInPortsNumber() + aToNode->DataStreamInPortsNumber() ) ;
+ DataStreamOutPortsNumber( DataStreamOutPortsNumber() + aToNode->DataStreamOutPortsNumber() ) ;
for ( j = 0 ; j < aToNode->GetNodeInPortsSize() ; j++ ) {
GraphBase::InPort *anInPort = aToNode->GetChangeNodeInPort(j) ;
if ( anInPort->IsDataConnected() ) {
cdebug_in << "GraphBase::Graph::InLineServices" << endl;
int i , j ;
+ ListPorts( *_Graph_fdebug , 0 ) ;
GraphBase::InLineNode * aINode ;
SALOME_ModuleCatalog::Service aService ;
for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
aINode = (GraphBase::InLineNode * ) GraphNodes( i ) ;
+// if ( aINode->IsOneOfInLineNodes() || aINode->HasDataStream() ) {
if ( aINode->IsOneOfInLineNodes() ) {
cdebug << "GraphBase::Graph::InLineServices " << aINode->Name() << endl;
aService.ServiceName = aINode->ServiceName() ;
aService.ServiceinParameter.length( 0 ) ;
aService.ServiceoutParameter.length( 0 ) ;
+ aINode->DataStreamInPortsNumber( 0 ) ;
+ aINode->DataStreamOutPortsNumber( 0 ) ;
int InService = 0 ;
+ int InStreamService = 0 ;
for ( j = 0 ; j < aINode->GetNodeInPortsSize() ; j++ ) {
- if ( aINode->GetChangeNodeInPort(j)->IsGate() ||
- aINode->GetChangeNodeInPort(j)->IsLoop() ) {
-// cdebug << "GraphBase::Graph::InLineServices In" << j << " "
-// << aINode->GetChangeNodeInPort(j)->Kind() << " "
-// << aINode->GetChangeNodeInPort(j)->PortType() << " "
-// << aINode->GetChangeNodeInPort(j)->PortName() << " ignored "
-// << aINode->GetChangeNodeInPort(j)->IsGate() << " "
-// << aINode->GetChangeNodeInPort(j)->IsLoop() << endl;
+// if ( aINode->GetChangeNodeInPort(j)->IsGate() || aINode->GetChangeNodeInPort(j)->IsLoop() || aINode->GetChangeNodeInPort(j)->IsDataStream() ) {
+ if ( aINode->GetChangeNodeInPort(j)->IsGate() || aINode->GetChangeNodeInPort(j)->IsLoop() ) {
+ cdebug << "GraphBase::Graph::InLineServices In" << j << " "
+ << aINode->GetChangeNodeInPort(j)->Kind() << " "
+ << aINode->GetChangeNodeInPort(j)->PortType() << " "
+ << aINode->GetChangeNodeInPort(j)->PortName() << " ignored "
+ << aINode->GetChangeNodeInPort(j)->IsGate() << " "
+ << aINode->GetChangeNodeInPort(j)->IsLoop() << endl;
+ }
+ else if ( aINode->GetChangeNodeInPort(j)->IsDataStream() ) {
+ aService.ServiceinDataStreamParameter.length( InStreamService+1 ) ;
+ aService.ServiceinDataStreamParameter[InStreamService].Parametertype = StringToDataStreamType( aINode->GetChangeNodeInPort(j)->PortType() ) ;
+ aService.ServiceinDataStreamParameter[InStreamService].Parametername = CORBA::string_dup( aINode->GetChangeNodeInPort(j)->PortName() ) ;
+ aService.ServiceinDataStreamParameter[InStreamService++].Parameterdependency = aINode->GetChangeNodeInPort(j)->Dependency() ;
+ aINode->IncrDataStreamInPorts() ;
+ cdebug << "GraphBase::Graph::InLineServices In" << j << " "
+ << aINode->GetChangeNodeInPort(j)->Kind() << " "
+ << aINode->GetChangeNodeInPort(j)->PortType() << " "
+ << aINode->GetChangeNodeInPort(j)->PortName() << " "
+ << aINode->GetChangeNodeInPort(j)->IsGate() << " "
+ << aINode->GetChangeNodeInPort(j)->IsLoop() << endl;
}
else {
aService.ServiceinParameter.length( InService+1 ) ;
aService.ServiceinParameter[InService].Parametertype = CORBA::string_dup( aINode->GetChangeNodeInPort(j)->PortType() ) ;
aService.ServiceinParameter[InService++].Parametername = CORBA::string_dup( aINode->GetChangeNodeInPort(j)->PortName() ) ;
-// cdebug << "GraphBase::Graph::InLineServices In" << j << " "
-// << aINode->GetChangeNodeInPort(j)->Kind() << " "
-// << aINode->GetChangeNodeInPort(j)->PortType() << " "
-// << aINode->GetChangeNodeInPort(j)->PortName() << " "
-// << aINode->GetChangeNodeInPort(j)->IsGate() << " "
-// << aINode->GetChangeNodeInPort(j)->IsLoop() << endl;
+ cdebug << "GraphBase::Graph::InLineServices In" << j << " "
+ << aINode->GetChangeNodeInPort(j)->Kind() << " "
+ << aINode->GetChangeNodeInPort(j)->PortType() << " "
+ << aINode->GetChangeNodeInPort(j)->PortName() << " "
+ << aINode->GetChangeNodeInPort(j)->IsGate() << " "
+ << aINode->GetChangeNodeInPort(j)->IsLoop() << endl;
}
}
int OutService = 0 ;
+ int OutStreamService = 0 ;
for ( j = 0 ; j < aINode->GetNodeOutPortsSize() ; j++ ) {
- if ( aINode->GetChangeNodeOutPort(j)->IsGate() ||
- aINode->GetChangeNodeOutPort(j)->IsLoop() ) {
-// cdebug << "GraphBase::Graph::InLineServices Out" << j << " "
-// << aINode->GetChangeNodeOutPort(j)->Kind() << " "
-// << aINode->GetChangeNodeOutPort(j)->PortType() << " "
-// << aINode->GetChangeNodeOutPort(j)->PortName() << " ignored "
-// << aINode->GetChangeNodeOutPort(j)->IsGate() << " "
-// << aINode->GetChangeNodeOutPort(j)->IsLoop() << endl;
+// if ( aINode->GetChangeNodeOutPort(j)->IsGate() || aINode->GetChangeNodeOutPort(j)->IsLoop() || aINode->GetChangeNodeOutPort(j)->IsDataStream() ) {
+ if ( aINode->GetChangeNodeOutPort(j)->IsGate() || aINode->GetChangeNodeOutPort(j)->IsLoop() ) {
+ cdebug << "GraphBase::Graph::InLineServices Out" << j << " "
+ << aINode->GetChangeNodeOutPort(j)->Kind() << " "
+ << aINode->GetChangeNodeOutPort(j)->PortType() << " "
+ << aINode->GetChangeNodeOutPort(j)->PortName() << " ignored "
+ << aINode->GetChangeNodeOutPort(j)->IsGate() << " "
+ << aINode->GetChangeNodeOutPort(j)->IsLoop() << endl;
+ }
+ else if ( aINode->GetChangeNodeOutPort(j)->IsDataStream() ) {
+ aService.ServiceoutDataStreamParameter.length( OutStreamService+1 ) ;
+ aService.ServiceoutDataStreamParameter[OutStreamService].Parametertype = StringToDataStreamType( aINode->GetChangeNodeOutPort(j)->PortType() ) ;
+ aService.ServiceoutDataStreamParameter[OutStreamService].Parametername = CORBA::string_dup( aINode->GetChangeNodeOutPort(j)->PortName() ) ;
+ aService.ServiceoutDataStreamParameter[OutStreamService++].Parameterdependency = aINode->GetChangeNodeOutPort(j)->Dependency() ;
+ aINode->IncrDataStreamOutPorts() ;
+ cdebug << "GraphBase::Graph::InLineServices Out" << j << " "
+ << aINode->GetChangeNodeOutPort(j)->Kind() << " "
+ << aINode->GetChangeNodeOutPort(j)->PortType() << " "
+ << aINode->GetChangeNodeOutPort(j)->PortName() << " "
+ << aINode->GetChangeNodeOutPort(j)->IsGate() << " "
+ << aINode->GetChangeNodeOutPort(j)->IsLoop() << endl;
}
else {
aService.ServiceoutParameter.length( OutService+1 ) ;
aService.ServiceoutParameter[OutService].Parametertype = CORBA::string_dup( aINode->GetChangeNodeOutPort(j)->PortType() ) ;
aService.ServiceoutParameter[OutService++].Parametername = CORBA::string_dup( aINode->GetChangeNodeOutPort(j)->PortName() ) ;
-// cdebug << "GraphBase::Graph::InLineServices Out" << j << " "
-// << aINode->GetChangeNodeOutPort(j)->Kind() << " "
-// << aINode->GetChangeNodeOutPort(j)->PortType() << " "
-// << aINode->GetChangeNodeOutPort(j)->PortName() << " "
-// << aINode->GetChangeNodeOutPort(j)->IsGate() << " "
-// << aINode->GetChangeNodeOutPort(j)->IsLoop() << endl;
+ cdebug << "GraphBase::Graph::InLineServices Out" << j << " "
+ << aINode->GetChangeNodeOutPort(j)->Kind() << " "
+ << aINode->GetChangeNodeOutPort(j)->PortType() << " "
+ << aINode->GetChangeNodeOutPort(j)->PortName() << " "
+ << aINode->GetChangeNodeOutPort(j)->IsGate() << " "
+ << aINode->GetChangeNodeOutPort(j)->IsLoop() << endl;
}
}
aINode->SetService( aService ) ;
+ if ( SetServiceOfMap( (GraphBase::Service * ) aINode ) ) {
+ cdebug << "InLineServices SetServiceOfMap " << aINode->ServiceName() << " in MapOfServices"
+ << " InStreamPort(" << aINode->DataStreamInPortsNumber()
+ << ") OutStreamPort(" << aINode->DataStreamOutPortsNumber() << ")" << endl ;
+ }
// cdebug << "GraphBase::Graph::InLineServices" << *aINode->GetService() << endl;
}
}
return true ;
}
-bool GraphBase::Graph::Sort() {
+bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) {
int i ;
int j ;
int NotSortedNumber = GraphNodesSize() ;
bool NewSorted ;
+ cdebug_in << "GraphBase::Graph::Sort" << endl;
if ( NotSortedNumber ) {
_LevelsNumber = 0 ;
_ParallelExecutionNodes = false ;
_Sorted.resize( GraphNodesSize() ) ;
_CnxInPortsNumber.resize( GraphNodesSize() ) ;
_DecrInPortsNumber.resize( GraphNodesSize() ) ;
- if ( _NodesNumber.size() )
+ if ( _NodesNumber.size() ) {
_NodesNumber.resize( 0 ) ;
_SortedNodes.resize( 0 ) ;
+ }
+// This is a simulation of the computation of the graph :
+// The initial state of nodes is :
+// - Sorted = false : the node is not sorted
+// - CnxInPortsNumber = ConnectedInPortsNumber : the number of ports that wait for a value from a link
+// - DecrInPortsNumber = 0 : there is no value available.
+ cdebug << "GraphBase::Graph::Sort initial values :" << endl ;
+ for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+ GraphBase::ComputingNode * aNode = GraphNodes( i ) ;
+ cdebug << aNode->Name() << " --> " << aNode->LinkedNodesSize() << " LinkedNodes :" << endl ;
+ for ( j = 0 ; j < aNode->LinkedNodesSize() ; j++ ) {
+ cdebug << " " << aNode->LinkedNodes( j )->Name() << endl ;
+ }
+ }
for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
_Sorted[ i ] = false ;
_CnxInPortsNumber[ i ] = GraphNodes( i )->ConnectedInPortsNumber() ;
_DecrInPortsNumber[ i ] = 0 ;
+ cdebug << "Sort Node [" << i << "] " << GraphNodes( i )->Name() << " initial count " << _CnxInPortsNumber[ i ] << endl ;
}
+// Nodes are linked ONLY if Ports are NOT DataStream for topological sort of node
+// ==============================================================================
while ( NotSortedNumber ) {
NewSorted = false ;
<< GraphNodes( i )->Name() << " count "
<< _CnxInPortsNumber[ i ] << endl ;
if ( !_Sorted[ i ] && _CnxInPortsNumber[ i ] == 0 ) {
-// All inputs of GraphNodes( i ) are available
+// All inputs of GraphNodes( i ) are available : "AllDataReady"
if ( (int ) _NodesNumber.size() != _LevelsNumber+1 ) {
_NodesNumber.resize( _LevelsNumber+1 ) ;
_SortedNodes.resize( _LevelsNumber+1 ) ;
_NodesNumber[ _LevelsNumber ] = -1 ;
}
+// There is one more node at that level
_NodesNumber[ _LevelsNumber ]++ ;
(_SortedNodes[ _LevelsNumber ]).resize( _NodesNumber[ _LevelsNumber ]+1 ) ;
(_SortedNodes[ _LevelsNumber ])[ _NodesNumber[ _LevelsNumber ] ] = GraphNodes( i ) ;
_Sorted[ i ] = true ;
NewSorted = true ;
+ NotSortedNumber -= 1 ;
cdebug << GraphNodes( i )->Name() << " belongs to level "
<< _LevelsNumber << "." << endl ;
+// GraphNodes( i ) has the state "AllDataReady". We simulate the end of its execution :
+// So we loop over all nodes that have a link from that node
+// And we increment the number of input ports of GraphNodes( i )->LinkedNodes( j ) that this
+// execution will give a value in DecrInPortsNumber : "SomeDataReady"
for ( j = 0 ; j < GraphNodes( i )->LinkedNodesSize() ; j++ ) {
-// Outputs of GraphNodes( i ) will satisfy
+// OutputPorts of GraphNodes( i ) will satisfy
// GraphNodes( i )->LinkedInPortsNumber( j ) InPorts of
// GraphNodes( i )->LinkedNodes( j )
- GraphBase::ComputingNode * aLinkedNode = GraphNodes( i )->LinkedNodes( j ) ;
+ GraphBase::StreamNode * aLinkedNode = GraphNodes( i )->LinkedNodes( j ) ;
int aLinkedInPortsNumber = GraphNodes( i )->LinkedInPortsNumber( j ) ;
cdebug << j << ". LinkedNode " << aLinkedNode->Name() ;
- if ( !aLinkedNode->IsDataFlowNode() ) {
+ if ( !aLinkedNode->IsDataFlowNode() && !aLinkedNode->IsDataStreamNode() ) {
cdebug << " _DecrInPortsNumber[ "
<< GetGraphNodeIndex( aLinkedNode->Name() )
<< " ] = "
}
}
}
+// If no node was found, that FlowGraph is not valid : if we try to execute it, that FlowGraph
+// will wait for data(s) from node(s) not executed or not executing for ever
if ( !NewSorted ) {
cdebug << "Loop detected level " << _LevelsNumber << endl ;
return false ; // Loop in the Graph
}
cdebug << "Bilan level " << _LevelsNumber << " : " << endl ;
bool ChangeCount = false ;
+// We update now the number of InPorts with a link that are waiting for a value
for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
-// if ( GraphNodes( i )->DecrIncrDecrConnectedInPortsNumber() ) {
if ( _DecrInPortsNumber[ i ] ) {
int prevcount = _CnxInPortsNumber[ i ] ;
_CnxInPortsNumber[ i ] -= _DecrInPortsNumber[ i ] ;
<< " --> new count " << _CnxInPortsNumber[ i ] << endl ;
}
}
-
- if ( !ChangeCount )
- break ;
- _LevelsNumber += 1 ;
+// If there is no loop and if the number of InPorts with a link that are waiting for a value
+// does not change, the sort is finished. But there is also NotSortedNumber ...
+// if ( !ChangeCount )
+// break ;
+ if ( NotSortedNumber ) {
+ _LevelsNumber += 1 ;
+ }
}
_ThreadsMax = 0 ;
int AllSortedNodes = 0 ;
_HeadNodes = _SortedNodes[ 0 ] ;
_HeadNodesSize = _SortedNodes[ 0 ].size() ;
+// QueueNodes was used in the past in order to know if the execution of a graph is finished
+// But because of loop nodes that was changed. So that part of code is a "clutter"
+// Now a graph has finished its execution when the number of executing threads is zero
_QueueNodes = _SortedNodes[ _LevelsNumber ] ;
_QueueNodesSize = _SortedNodes[ _LevelsNumber ].size() ;
for ( i = 0 ; i < _QueueNodesSize ; i++ ) {
_QueueNodes = _SortedNodes[ _LevelsNumber - 1 ] ;
_QueueNodesSize = _SortedNodes[ _LevelsNumber - 1 ].size() ;
}
+// Computation of the maximum number of threads == the maximum number of nodes of all levels
for ( i = 0 ; i <= _LevelsNumber ; i++ ) {
AllSortedNodes += _NodesNumber[ i ]+1 ;
- if ( _NodesNumber[ i ] + 1 > _ThreadsMax )
+ if ( _NodesNumber[ i ] + 1 > _ThreadsMax ) {
_ThreadsMax = _NodesNumber[ i ] + 1 ;
+ }
cdebug << _NodesNumber[ i ]+1 << " Nodes of level " << i << " : "
<< (_SortedNodes[ i ])[ 0 ]->Name() << endl ;
for ( j = 1 ; j <= _NodesNumber[ i ] ; j++ ) {
(_SortedNodes[ 0 ])[ i ]->HeadNode( true ) ;
}
- for ( i = 0 ; i <= _NodesNumber[ 0 ] ; i++ ) {
- (_SortedNodes[ 0 ])[ i ]->Level( 0 ) ;
- (_SortedNodes[ 0 ])[ i ]->SubGraph( i + 1 ) ;
+// Give a subgraph/substreamgraph number > 0 to HeadNodes (level 0)
+// There is no substreamgraph for nodes without StreamPorts
+ for ( j = 0 ; j <= _NodesNumber[ 0 ] ; j++ ) {
+ (_SortedNodes[ 0 ])[ j ]->Level( 0 ) ;
+ (_SortedNodes[ 0 ])[ j ]->SortedIndex( j ) ;
+ (_SortedNodes[ 0 ])[ j ]->SubGraph( j + 1 ) ;
+ if ( (_SortedNodes[ 0 ])[ j ]->HasDataStream() ) {
+ (_SortedNodes[ 0 ])[ j ]->SubStreamGraph( j + 1 ) ;
+ }
+ else {
+ (_SortedNodes[ 0 ])[ j ]->SubStreamGraph( -1 ) ;
+ }
}
+// Give a subgraph/substreamgraph number = 0 to all other nodes :
+// the SubGraph of that nodes is unknown
+// There is no substreamgraph for nodes without StreamPorts
for ( i = 1 ; i <= _LevelsNumber ; i++ ) {
for ( j = 0 ; j <= _NodesNumber[ i ] ; j++ ) {
(_SortedNodes[ i ])[ j ]->Level( i ) ;
+ (_SortedNodes[ i ])[ j ]->SortedIndex( j ) ;
(_SortedNodes[ i ])[ j ]->SubGraph( 0 ) ;
+ if ( (_SortedNodes[ i ])[ j ]->HasDataStream() ) {
+ (_SortedNodes[ i ])[ j ]->SubStreamGraph( 0 ) ;
+ }
+ else {
+ (_SortedNodes[ i ])[ j ]->SubStreamGraph( -1 ) ;
+ }
}
}
+// Computation of independent SubGraphs which have NO link between them
+ cdebug << endl << "Computation of SubGraphs" << endl ;
bool Graphs = true ;
while ( Graphs ) {
for ( i = 0 ; i <= _LevelsNumber ; i++ ) {
for ( j = 0 ; j <= _NodesNumber[ i ] ; j++ ) {
GraphBase::ComputingNode * aNode = (_SortedNodes[ i ])[ j ] ;
- cdebug << "Graph " << aNode->SubGraph() << " " << aNode->Name()
+ cdebug << "SubGraph " << aNode->SubGraph() << " " << aNode->Name()
<< endl ;
int k ;
for ( k = 0 ; k < aNode->LinkedNodesSize() ; k++ ) {
aNode->LinkedNodes( k )->Level() == aNode->Level()+1 ) {
aNode->SubGraph( aNode->LinkedNodes( k )->SubGraph() ) ;
cdebug << " Linked " << aNode->LinkedNodes( k )->Name()
- << " Graph(" << aNode->LinkedNodes( k )->SubGraph()
+ << " SubGraph(" << aNode->LinkedNodes( k )->SubGraph()
<< ") ==>" << endl ;
- cdebug << " Graph " << aNode->SubGraph() << " for "
+ cdebug << " SubGraph " << aNode->SubGraph() << " for "
<< aNode->Name() << " ==> again" << endl ;
int l ;
for ( l = 0 ; l < aNode->LinkedNodesSize() ; l++ ) {
}
else {
cdebug << " Linked " << aNode->LinkedNodes( k )->Name()
- << " Graph(" << aNode->LinkedNodes( k )->SubGraph()
+ << " SubGraph(" << aNode->LinkedNodes( k )->SubGraph()
<< ") distance > 1 ignored" << endl ;
}
}
break ;
}
if ( Graphs ) {
- cdebug << endl << "Graphs result : " << endl ;
+ cdebug << endl << "SubGraphs result : " << endl ;
break ;
}
cdebug << endl << "One more time" << endl ;
Graphs = true ;
}
- _GraphsNumber = 0 ;
+// Make a sequential renumbering of SubGraphs :
+ _SubGraphsNumber = 0 ;
int CurrGraphsNumber = 0;
int k ;
for ( k = 0 ; k <= _NodesNumber[ 0 ] ; k++ ) {
if ( (_SortedNodes[ 0 ])[ k ]->SubGraph() > CurrGraphsNumber ) {
CurrGraphsNumber = (_SortedNodes[ 0 ])[ k ]->SubGraph() ;
- _GraphsNumber += 1 ;
+ _SubGraphsNumber += 1 ;
for ( i = 0 ; i <= _LevelsNumber ; i++ ) {
for ( j = 0 ; j <= _NodesNumber[ i ] ; j++ ) {
if ( (_SortedNodes[ i ])[ j ]->SubGraph() == CurrGraphsNumber ) {
- (_SortedNodes[ i ])[ j ]->SubGraph( _GraphsNumber ) ;
- cdebug << "GraphsNumber " << _GraphsNumber << " " << " Level "
+ (_SortedNodes[ i ])[ j ]->SubGraph( _SubGraphsNumber ) ;
+ cdebug << "SubGraphsNumber " << _SubGraphsNumber << " " << " Level "
<< i << " : " << (_SortedNodes[ i ])[ j ]->Name()
<< endl ;
}
}
}
}
+
+ cdebug << endl << "Computation of SubStreamGraphs" << endl ;
+ for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+ GraphBase::ComputingNode * aNode = GraphNodes( i ) ;
+ if ( aNode->SubStreamGraph() < 0 ) {
+ cdebug << "Graph " << aNode->SubStreamGraph() << " " << aNode->Name()
+ << " has NO streamport" << endl ;
+ }
+ else {
+ cdebug << aNode->Name() << " SubGraph " << aNode->SubGraph() << " --> "
+ << aNode->LinkedStreamNodesSize() << " LinkedStreamNodes :" << endl ;
+ for ( j = 0 ; j < aNode->LinkedStreamNodesSize() ; j++ ) {
+ cdebug << " " << aNode->LinkedStreamNodes( j )->Name() << endl ;
+ }
+ }
+ }
+
+// Computation of independent SubStreamGraphs which have NO StreamLink between them
+ SubStreamGraphsNumber = 0 ;
+ int ilevel ;
+ for ( ilevel = 0 ; ilevel <= _LevelsNumber ; ilevel++ ) {
+// Loop for _NodesNumber[ ilevel ] nodes of the level ilevel
+ int jnode ;
+ for ( jnode = 0 ; jnode <= _NodesNumber[ ilevel ] ; jnode++ ) {
+ GraphBase::ComputingNode * aNode = (_SortedNodes[ ilevel ])[ jnode ] ;
+ if ( aNode->SubStreamGraph() < 0 ) {
+ cdebug << "Graph " << aNode->SubStreamGraph() << " " << aNode->Name()
+ << " has NO streamport" << endl ;
+ }
+ else {
+ int CurStreamGraphsNumber ;
+ if ( aNode->SubStreamGraph() > 0 ) {
+ cdebug << "SubStreamGraph " << aNode->SubStreamGraph() << " " << aNode->Name()
+ << " has streamport LinkedStreamNodesSize already in a SubStreamGraph" << endl ;
+ CurStreamGraphsNumber = aNode->SubStreamGraph() ;
+ }
+ else {
+ CurStreamGraphsNumber = SubStreamGraphsNumber+1 ;
+ }
+ int RetVal = 0 ;
+ while ( RetVal != CurStreamGraphsNumber ) {
+ RetVal = CurStreamGraphsNumber ;
+ aNode->SetSubStreamGraph( CurStreamGraphsNumber , RetVal ) ;
+ if ( RetVal != CurStreamGraphsNumber ) {
+ for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+ GraphBase::ComputingNode * aNode = GraphNodes( i ) ;
+ if ( aNode->SubStreamGraph() == CurStreamGraphsNumber ) {
+ aNode->SubStreamGraph( RetVal ) ;
+ }
+ }
+ CurStreamGraphsNumber = RetVal ;
+ RetVal = 0 ;
+ }
+ if ( CurStreamGraphsNumber > SubStreamGraphsNumber ) {
+ SubStreamGraphsNumber = CurStreamGraphsNumber ;
+ }
+ }
+ }
+ }
+ }
+// Make a sequential renumbering of SubGraphs :
+ cdebug << endl << "Last SubStreamGraphsNumber : " << SubStreamGraphsNumber << endl ;
+ int CurrStreamGraphsNumber = 0 ;
+ int count = 0 ;
+ for ( CurrStreamGraphsNumber = 0 ; CurrStreamGraphsNumber <= SubStreamGraphsNumber ; CurrStreamGraphsNumber++ ) {
+ bool SearchCurrStreamGraphsNumber = true ;
+ for ( k = 0 ; k <= _LevelsNumber && SearchCurrStreamGraphsNumber ; k++ ) {
+ int l ;
+ for ( l = 0 ; l <= _NodesNumber[ k ] && SearchCurrStreamGraphsNumber ; l++ ) {
+ if ( (_SortedNodes[ k ])[ l ]->SubStreamGraph() == CurrStreamGraphsNumber ) {
+ SearchCurrStreamGraphsNumber = false ;
+ count = count + 1 ;
+ if ( CurrStreamGraphsNumber != count ) {
+ cdebug << "CurrStreamGraphsNumber " << CurrStreamGraphsNumber << " count " << count
+ << " Level " << k << " n " << l << endl ;
+ for ( i = k ; i <= _LevelsNumber ; i++ ) {
+ for ( j = 0 ; j <= _NodesNumber[ i ] ; j++ ) {
+ if ( (_SortedNodes[ i ])[ j ]->SubStreamGraph() == CurrStreamGraphsNumber ) {
+ (_SortedNodes[ i ])[ j ]->SubStreamGraph( count ) ;
+ cdebug << "SubStreamGraphsNumber " << CurrStreamGraphsNumber << " --> " << count << " "
+ << " Level " << i << " : " << (_SortedNodes[ i ])[ j ]->Name() << endl ;
+ }
+ else if ( (_SortedNodes[ i ])[ j ]->SubStreamGraph() > 0 ) {
+ cdebug << "SubStreamGraphsNumber " << (_SortedNodes[ i ])[ j ]->SubStreamGraph()
+ << " != " << CurrStreamGraphsNumber << " Level " << i << " : "
+ << (_SortedNodes[ i ])[ j ]->Name() << endl ;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ SubStreamGraphsNumber = count ;
+ cdebug << endl << "SubStreamGraphs result : " << SubStreamGraphsNumber << " SubStreamGraphs" << endl ;
+// int CurrStreamGraphsNumber ;
+// for ( CurrStreamGraphsNumber = 1 ; CurrStreamGraphsNumber <= SubStreamGraphsNumber ; CurrStreamGraphsNumber++ ) {
+// for ( ilevel = 0 ; ilevel <= _LevelsNumber ; ilevel++ ) {
+// for ( k = 0 ; k <= _NodesNumber[ ilevel ] ; k++ ) {
+// if ( (_SortedNodes[ ilevel ])[ k ]->SubStreamGraph() == CurrStreamGraphsNumber ) {
+// cdebug << "SubStreamGraphsNumber " << CurrStreamGraphsNumber << " : "
+// << (_SortedNodes[ ilevel ])[ k ]->Name() << endl ;
+// }
+// }
+// }
+// }
}
+ ListPorts( *_Graph_fdebug , 0 ) ;
+
+ cdebug_out << "GraphBase::Graph::Sort" << endl;
return true ;
}
}
for ( j = 0 ; j < aLoopNode->CoupledNode()->GetNodeInPortsSize() ; j++ ) {
GraphBase::InPort *anInPort = aLoopNode->CoupledNode()->GetChangeNodeInPort( j ) ;
- if ( !anInPort->IsConnected() ) {
+ if ( !anInPort->IsConnected() && !anInPort->IsGate() ) {
if ( !AddLink( aLoopNode , aLoopNode->GetChangeNodeOutPort( j ) ,
aLoopNode->CoupledNode() , anInPort ) ) {
cdebug << "GraphBase::Graph::CreateService AddLink ERROR " << aLoopNode->Name() << "( "
aNode = GraphNodes( i ) ;
// while ( aNode != aComputingNodesList.end() ) {
if ( aNode->IsFactoryNode() ) {
- GraphBase::FactoryNode * FaNode = (GraphBase::FactoryNode * ) aNode ;
+ GraphBase::FactoryNode * FaNode = (GraphBase::FactoryNode * ) aNode ;
if ( !strlen( FaNode->Computer() ) ) {
cdebug << "ComputerName missing for node " << FaNode->Name() ;
if ( !strlen( FaNode->Computer() ) ) {
// For Outputs of the DataFlow :
for ( j = 0 ; j < aNode->GetNodeOutPortsSize() ; j++ ) {
if ( !aNode->GetNodeOutPort(j)->IsConnected() ) {
- aNode->AddLink( (GraphBase::ComputingNode *) this ) ;
+ if ( aNode->GetNodeOutPort(j)->IsDataStream() ) {
+ aNode->AddStreamLink( (GraphBase::ComputingNode *) this ) ;
+ }
+ else {
+ aNode->AddLink( (GraphBase::ComputingNode *) this ) ;
+ }
}
}
}
private:
- int _Graph_prof_debug;
- ofstream * _Graph_fdebug;
+// int _Graph_prof_debug;
+// ofstream * _Graph_fdebug;
CORBA::ORB_ptr _Orb ;
SUPERV::Graph_var _Graph ;
Graph_Impl * _GraphImpl ;
-// Map of InNodes of the OutNode
+// Map of Nodes of the Graph
map< string , int > _MapOfGraphNodes ;
long _GraphNodesSize ;
vector<bool > _Sorted ;
vector<ComputingNode *> _GraphNodes ;
// _SortedNodes[ _LevelsNumber ] : topological sort from 0 to _LevelsNumber
-// _SortedNodes[ _level ][ _NodesNumber[ _level ] ] : _NodesNumber[ _level ] Nodes
+// _SortedNodes[ _level ][ _NodesNumber[ _level ] ] : _NodesNumber[ _level ] Nodes in the level
int _LevelsNumber ;
int _ThreadsMax ;
- int _GraphsNumber ;
vector<int > _NodesNumber ;
vector<vector<ComputingNode *> > _SortedNodes ;
vector<ComputingNode *> _QueueNodes ;
bool _ParallelExecutionNodes ;
+// For generated NodeNames with ServiceName : number of Nodes using
+// the same ServiceName. It is not the same Service if it belongs to
+// a different Interface and/or a different Component ...
+ map< string , GraphBase::Service * > _MapOfServiceNames ;
+
+// Total number of SubGraphs
+ int _SubGraphsNumber ;
+// _SubGraphs[ SubGraphNumero ] [ NodeNumero ]
+// SubGraphNumero : [ 0 , _SubGraphsSize [ ; NodeNumero : [ 0 , _SubGraphs[ SubGraphNumero ].size() [
+ int _SubGraphsSize ;
+ vector<vector<ComputingNode *> > _SubGraphs ;
+
+// _SubStreamGraphs[ SubStreamGraphNumero ] [ NodeNumero ]
+// SubStreamGraphNumero : [ 0 , _SubStreamGraphsSize [
+// NodeNumero : [ 0 , _SubStreamGraphs[ SubStreamGraphNumero ].size() [
+// int _SubStreamGraphsSize ;
+// vector<vector<ComputingNode *> > _SubStreamGraphs ;
+
bool AddLink( GraphBase::ComputingNode *fromNode ,
GraphBase::OutPort *fromPort ,
GraphBase::ComputingNode *toNode ,
Graph( CORBA::ORB_ptr ORB ,
SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ,
- const char * DebugFileName ) ;
+ int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) ;
+// const char * DebugFileName ) ;
Graph( CORBA::ORB_ptr ORB ,
SALOME_NamingService* ptrNamingService ,
const SALOME_ModuleCatalog::Service& DataFlowService ,
const char * DataFlowAuthor ,
const char * DataFlowComputer ,
const char * DataFlowComment ,
- const char * DebugFileName ) ;
+ int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) ;
+// const char * DebugFileName ) ;
virtual ~Graph() ;
- void Set_prof_debug( CORBA::ORB_ptr ORB ,
- const char * DebugFileName ) ;
+// void Set_prof_debug( CORBA::ORB_ptr ORB ,
+// const char * DebugFileName ) ;
+ void Set_prof_debug( int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) ;
int * Graph_prof_debug() {
-// MESSAGE( "Graph_prof_debug _Graph_prof_debug " << &_Graph_prof_debug << " _Graph_fdebug "
-// << _Graph_fdebug ) ;
- return &_Graph_prof_debug ; } ;
- ofstream * Graph_fdebug() { return _Graph_fdebug ; } ;
+ return _prof_debug ; } ;
+ ofstream * Graph_fdebug() { return _fdebug ; } ;
SUPERV::Graph_var ObjRef() const { return _Graph ; } ;
void SetObjRef( SUPERV::Graph_var aGraph ) {
} ;
void DelGraphNodeIndex( const char *name ) {
_MapOfGraphNodes.erase( name ) ; } ;
+
const GraphBase::ComputingNode * GetGraphNode( const int index ) const {
const ComputingNode * aNode = GetChangeGraphNode( index ) ;
return aNode ; } ;
ComputingNode * QueueNodes( int i ) const {
return _QueueNodes[ i ] ; } ;
- const GraphBase::InPort *GetInPort( const char* ToNodeName ,
- const char* ToServiceParameterName ) {
+ const GraphBase::InPort * GetInPort( const char * ToServiceParameterName ) {
+ return GetInPort( ToServiceParameterName ) ; } ;
+ GraphBase::InPort * GetChangeInPort( const char * ToServiceParameterName ) {
+ return GetChangeInPort( ToServiceParameterName ) ; } ;
+ const GraphBase::OutPort * GetOutPort( const char * FromServiceParameterName ) {
+ return GetOutPort( FromServiceParameterName ) ; } ;
+ GraphBase::OutPort * GetChangeOutPort( const char * FromServiceParameterName ) {
+ return GetChangeOutPort( FromServiceParameterName ); } ;
+
+ const GraphBase::InPort * GetInPort( const char * ToNodeName ,
+ const char * ToServiceParameterName ) {
ComputingNode * aNode = GetChangeGraphNode( ToNodeName ) ;
if ( aNode ) {
return aNode->GetInPort(ToServiceParameterName);
}
else
return NULL ; } ;
- GraphBase::InPort *GetChangeInPort( const char* ToNodeName ,
- const char* ToServiceParameterName ) {
+ GraphBase::InPort * GetChangeInPort( const char * ToNodeName ,
+ const char * ToServiceParameterName ) {
ComputingNode * aNode = GetChangeGraphNode( ToNodeName ) ;
if ( aNode ) {
- return aNode->GetChangeInPort(ToServiceParameterName);
+ return aNode->GetChangeInPort( ToServiceParameterName ) ;
+ }
+ else
+ return NULL ; } ;
+ const GraphBase::OutPort * GetOutPort( const char * FromNodeName ,
+ const char * FromServiceParameterName ) {
+ ComputingNode * aNode = GetChangeGraphNode( FromNodeName ) ;
+ if ( aNode ) {
+ return aNode->GetOutPort( FromServiceParameterName ) ;
}
else
return NULL ; } ;
- GraphBase::OutPort *GetChangeOutPort(
- const char* FromNodeName ,
- const char* FromServiceParameterName ) {
+ GraphBase::OutPort * GetChangeOutPort( const char * FromNodeName ,
+ const char * FromServiceParameterName ) {
ComputingNode * aNode = GetChangeGraphNode( FromNodeName ) ;
if ( aNode ) {
return aNode->GetChangeOutPort( FromServiceParameterName );
GraphBase::ListOfLinks * GetLinks(bool AllLinks = false ) const ;
GraphBase::ListOfGraphs * GetGraphs() const ;
GraphBase::ListOfLinks * GetDatas() const ;
-// SALOME_ModuleCatalog::Service * GetService() const ;
bool AddNode( ComputingNode * aNode ) ;
bool RemoveNode( const char* NodeName ) ;
bool CreateService() ;
bool InLineServices() ;
- bool Sort() ;
+ bool Sort( int & SubStreamGraphsNumber ) ;
bool ComputingNodes() const ;
bool LinkLoopNodes(bool & NewLink ) ;
bool DataServerNodes() const ;
long LevelMax() {
return _LevelsNumber + 1 ; } ;
+
+ map< string , GraphBase::Service * > MapOfServiceNames() ;
+ GraphBase::Service * GetServiceOfMap( char * name ) ;
+ bool SetServiceOfMap( GraphBase::Service * aService ) ;
+ int GetServiceNameNumber( SALOME_ModuleCatalog::Service aService ) ;
+
SUPERV::ListOfStrings * LevelNodes(long aLevel ) ;
long ThreadsMax() {
return _ThreadsMax ; } ;
- long GraphsNumber() {
- return _GraphsNumber ; } ;
+
+ long SubGraphsNumber() {
+ return _SubGraphsNumber ; } ;
int NodesNumber(const int aLevel ) {
return _NodesNumber[ aLevel ] ; } ;
--- /dev/null
+// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : DataFlowBase_InDataStreamPort.cxx
+// Author : Jean Rahuel
+// Module : SUPERV
+// $Header:
+
+using namespace std;
+
+#include "DataFlowBase_InDataStreamPort.hxx"
+
+GraphBase::InDataStreamPort::InDataStreamPort() :
+ GraphBase::InPort::InPort() {
+ _KindOfSchema = SUPERV::SCHENULL ;
+ _KindOfInterpolation = SUPERV::INTERNULL ;
+ _KindOfExtrapolation = SUPERV::EXTRANULL ;
+ cdebug << "GraphBase::InDataStreamPort::InDataStreamPort " << this << " " << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation
+ << " " << _KindOfExtrapolation << endl ;
+}
+
+GraphBase::InDataStreamPort::InDataStreamPort(
+ const char *const * NodeName ,
+ const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
+ const SUPERV::KindOfSchema aKindOfSchema ,
+ const SUPERV::KindOfInterpolation aKindOfInterpolation ,
+ const SUPERV::KindOfExtrapolation aKindOfExtrapolation ) :
+ InPort( NodeName , aserviceParameter , SUPERV::DataStreamParameter , aDependency ) {
+ if ( aDependency == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL ) {
+ _KindOfSchema = aKindOfSchema ;
+ _KindOfInterpolation = aKindOfInterpolation ;
+ _KindOfExtrapolation = aKindOfExtrapolation ;
+ }
+ else {
+ _KindOfSchema = SUPERV::SCHENULL ;
+ _KindOfInterpolation = SUPERV::INTERNULL ;
+ _KindOfExtrapolation = SUPERV::EXTRANULL ;
+ }
+ cdebug << "GraphBase::InDataStreamPort::InDataStreamPort " << this << " " << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation
+ << " " << _KindOfExtrapolation << endl ;
+}
+
+GraphBase::InDataStreamPort::~InDataStreamPort() {
+ cdebug << "GraphBase::InDataStreamPort::~InDataStreamPort " << this << endl ;
+}
+
+bool GraphBase::InDataStreamPort::SetParams( const SUPERV::KindOfSchema aKindOfSchema ,
+ const SUPERV::KindOfInterpolation aKindOfInterpolation ,
+ const SUPERV::KindOfExtrapolation aKindOfExtrapolation ) {
+ bool RetVal = true ;
+ if ( Dependency() == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL ) {
+ _KindOfSchema = aKindOfSchema ;
+ _KindOfInterpolation = aKindOfInterpolation ;
+ _KindOfExtrapolation = aKindOfExtrapolation ;
+ }
+ else {
+ _KindOfSchema = SUPERV::SCHENULL ;
+ _KindOfInterpolation = SUPERV::INTERNULL ;
+ _KindOfExtrapolation = SUPERV::EXTRANULL ;
+ RetVal = false ;
+ }
+ cdebug << "GraphBase::InDataStreamPort::SetParams RetVal " << RetVal << " " << PortName() << " " << _KindOfSchema << " "
+ << _KindOfInterpolation << " " << _KindOfExtrapolation << endl ;
+ return RetVal ;
+}
+
+void GraphBase::InDataStreamPort::Params( SUPERV::KindOfSchema & aKindOfSchema ,
+ SUPERV::KindOfInterpolation & aKindOfInterpolation ,
+ SUPERV::KindOfExtrapolation & aKindOfExtrapolation ) const {
+ aKindOfSchema = _KindOfSchema ;
+ aKindOfInterpolation = _KindOfInterpolation ;
+ aKindOfExtrapolation = _KindOfExtrapolation ;
+ cdebug << "GraphBase::InDataStreamPort::Params " << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation << " "
+ << _KindOfExtrapolation << endl ;
+}
+
+ostream & operator<< (ostream & f ,const SUPERV::KindOfSchema & s ) {
+ switch (s) {
+ case SUPERV::SCHENULL :
+ f << "SCHENULL";
+ break;
+ case SUPERV::TI :
+ f << "TI";
+ break;
+ case SUPERV::TF :
+ f << "TF";
+ break;
+ case SUPERV::DELTA :
+ f << "DELTA";
+ break;
+ default :
+ f << "UndefinedKindOfSchema";
+ break;
+ }
+
+ return f;
+}
+
+ostream & operator<< (ostream & f ,const SUPERV::KindOfInterpolation & s ) {
+ switch (s) {
+ case SUPERV::INTERNULL :
+ f << "INTERNULL";
+ break;
+ case SUPERV::L0 :
+ f << "L0";
+ break;
+ case SUPERV::L1 :
+ f << "L1";
+ break;
+ default :
+ f << "UndefinedKindOfInterpolation";
+ break;
+ }
+
+ return f;
+}
+
+ostream & operator<< (ostream & f ,const SUPERV::KindOfExtrapolation & s ) {
+ switch (s) {
+ case SUPERV::EXTRANULL :
+ f << "EXTRANULL";
+ break;
+ case SUPERV::E0 :
+ f << "E0";
+ break;
+ case SUPERV::E1 :
+ f << "E1";
+ break;
+ default :
+ f << "UndefinedKindOfExtrapolation";
+ break;
+ }
+
+ return f;
+}
+
--- /dev/null
+// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : DataFlowBase_InDataStreamPort.hxx
+// Author : Jean Rahuel
+// Module : SUPERV
+// $Header:
+
+#ifndef _DATAFLOWBASE_INDATASTREAMPORT_HXX
+#define _DATAFLOWBASE_INDATASTREAMPORT_HXX
+
+#include "DataFlowBase_OutPort.hxx"
+
+namespace GraphBase {
+
+ class InDataStreamPort : public InPort {
+
+ private:
+
+// if TimeDependency :
+ SUPERV::KindOfSchema _KindOfSchema ;
+ SUPERV::KindOfInterpolation _KindOfInterpolation ;
+ SUPERV::KindOfExtrapolation _KindOfExtrapolation ;
+
+ protected:
+
+ public:
+
+ InDataStreamPort() ;
+
+ InDataStreamPort( const char *const * NodeName ,
+ const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ,
+ const SUPERV::KindOfSchema aKindOfSchema = SUPERV::SCHENULL ,
+ const SUPERV::KindOfInterpolation aKindOfInterpolation = SUPERV::INTERNULL ,
+ const SUPERV::KindOfExtrapolation aKindOfExtrapolation = SUPERV::EXTRANULL ) ;
+
+ virtual ~InDataStreamPort() ;
+
+ bool SetParams( const SUPERV::KindOfSchema aKindOfSchema ,
+ const SUPERV::KindOfInterpolation aKindOfInterpolation ,
+ const SUPERV::KindOfExtrapolation aKindOfExtrapolation ) ;
+
+ void Params( SUPERV::KindOfSchema & aKindOfSchema ,
+ SUPERV::KindOfInterpolation & aKindOfInterpolation ,
+ SUPERV::KindOfExtrapolation & aKindOfExtrapolation ) const ;
+
+ };
+
+};
+
+ostream & operator<< (ostream &,const SUPERV::KindOfSchema &);
+
+ostream & operator<< (ostream &,const SUPERV::KindOfInterpolation &);
+
+ostream & operator<< (ostream &,const SUPERV::KindOfExtrapolation &);
+
+#endif
+
+
+
+
cdebug << "GraphBase::InLineNode::Node " << this
<< "' _Name "
<< (void *) Name() << " '" << Name() << " _Comment "
- << (void *) Comment() << " " << Comment() << " " << endl ;
+ << (void *) Comment() << " " << Comment() << endl ;
}
GraphBase::InLineNode::InLineNode( CORBA::ORB_ptr ORB ,
char ** _PortStateName ;
+GraphBase::InPort::InPort() :
+ Port() {
+ _State = SUPERV::UndefinedState ;
+ _OutPort = NULL ;
+ _InitialOutPort = NULL ;
+}
+
GraphBase::InPort::InPort(
const char *const * Name ,
const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
- const SUPERV::KindOfPort aKind) :
- Port( Name , aserviceParameter ) {
+ const SUPERV::KindOfPort aKind ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency ) :
+ Port( Name , aserviceParameter , aKind , aDependency ) {
+ _State = SUPERV::UndefinedState ;
_OutPort = NULL ;
_InitialOutPort = NULL ;
- Kind( aKind ) ;
}
//GraphBase::InPort::~InPort() {
<< "type : " << P.PortType() << ", " ;
f << "from "
<< P.NodeName() << ", ";
+ f << "kind "
+ << P.Kind() << ", ";
return f;
}
class InPort : public Port {
- SUPERV::GraphState _State ;
- OutPort * _OutPort ;
- OutPort * _InitialOutPort ;
+ private:
+
+ SUPERV::GraphState _State ;
+ OutPort * _OutPort ;
+ OutPort * _InitialOutPort ;
public:
- InPort() {
-// cout << "InPort()" << endl ;
- _State = SUPERV::UndefinedState ;
- _OutPort = NULL ;
- _InitialOutPort = NULL ;
- } ;
+ InPort() ;
InPort( const char *const * NodeName ,
const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
- const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ) ;
+ const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ) ;
virtual ~InPort() {
cdebug << "GraphBase::InPort::~InPort " << PortName() << endl ; } ;
virtual void destroy() {
--- /dev/null
+// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : DataFlowBase_OutDataStreamPort.cxx
+// Author : Jean Rahuel
+// Module : SUPERV
+// $Header:
+
+using namespace std;
+
+#include "DataFlowBase_OutDataStreamPort.hxx"
+
+GraphBase::OutDataStreamPort::OutDataStreamPort() :
+ OutPort() {
+ _NumberOfValues = 0 ;
+ cdebug << "GraphBase::OutDataStreamPort::OutDataStreamPort " << this << " " << endl ;
+}
+
+GraphBase::OutDataStreamPort::OutDataStreamPort(
+ const char *const * NodeName ,
+ const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
+ const long aNumberOfValues ) :
+ OutPort( NodeName , aserviceParameter , SUPERV::DataStreamParameter , aDependency ) {
+ _NumberOfValues = aNumberOfValues ;
+ cdebug << "GraphBase::OutDataStreamPort::OutDataStreamPort " << this << " " << endl ;
+}
+
+GraphBase::OutDataStreamPort::~OutDataStreamPort() {
+ cdebug << "GraphBase::OutDataStreamPort::~OutDataStreamPort " << this << endl ;
+}
+
--- /dev/null
+// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : DataFlowBase_OutDataStreamPort.hxx
+// Author : Jean Rahuel
+// Module : SUPERV
+// $Header:
+
+#ifndef _DATAFLOWBASE_OUTDATASTREAMPORT_HXX
+#define _DATAFLOWBASE_OUTDATASTREAMPORT_HXX
+
+#include "DataFlowBase_OutPort.hxx"
+
+namespace GraphBase {
+
+ class OutDataStreamPort : public OutPort {
+
+ private:
+
+ long _NumberOfValues ; // Values Keeped in links ("Niveau")
+
+ protected:
+
+ public:
+
+ OutDataStreamPort() ;
+ OutDataStreamPort( const char *const * NodeName ,
+ const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ,
+ const long aNumberOfValues = 0 ) ;
+
+ virtual ~OutDataStreamPort() ;
+
+ void NumberOfValues( const long aNumberOfValues ) {
+ _NumberOfValues = aNumberOfValues ; } ;
+ long NumberOfValues() const {
+ return _NumberOfValues ; } ;
+
+ };
+
+};
+
+#endif
+
+
+
+
public:
+ OutPort() {
+ };
OutPort( const char *const * NodeName ,
const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
- const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ) :
- DataPort( NodeName , aserviceParameter ) {
+ const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ) :
+ DataPort( NodeName , aserviceParameter , aKind , aDependency) {
_Connected = NotConnected ;
- _InPortsSize = 0 ;
- Kind( aKind ) ; } ;
+ _InPortsSize = 0 ; } ;
virtual ~OutPort() {
cdebug << "GraphBase::OutPort::~OutPort " << PortName() << endl ; } ;
virtual void destroy() {
case SUPERV::GOTOParameter :
f << "GOTOParameter";
break;
+ case SUPERV::DataStreamParameter :
+ f << "DataStreamParameter";
+ break;
default :
f << "UnknownKindOfPort";
break;
return f;
}
+ostream & operator<< (ostream & f ,const SALOME_ModuleCatalog::DataStreamDependency & s ) {
+ switch (s) {
+ case SALOME_ModuleCatalog::DATASTREAM_UNDEFINED :
+ f << "DATASTREAM_UNDEFINED";
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_TEMPORAL :
+ f << "DATASTREAM_TEMPORAL";
+ break;
+ case SALOME_ModuleCatalog::DATASTREAM_ITERATIVE :
+ f << "DATASTREAM_ITERATIVE";
+ break;
+ default :
+ f << "DATASTREAM_?";
+ break;
+ }
+
+ return f;
+}
+
class Port : public ServicesParameter {
- const char *const * _NodeName ;
- SUPERV::Port_var _Port ;
- SUPERV::KindOfPort _KindOfPort ;
+ private:
- vector<long > _X ;
- vector<long > _Y ;
+ const char *const * _NodeName ;
+ SUPERV::Port_var _Port ;
+ SUPERV::KindOfPort _KindOfPort ;
+
+ vector<long > _X ;
+ vector<long > _Y ;
+
+ SALOME_ModuleCatalog::DataStreamDependency _Dependency ; // Time or Iteration only for DataStreamPorts
public:
- Port() {
-// cout << "Port()" << endl ;
- _NodeName = NULL ;
- _Port = SUPERV::Port::_nil() ;
- _KindOfPort = SUPERV::UndefinedParameter ;
- } ;
- Port( const char *const * NodeName ,
- const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
- const SUPERV::KindOfPort aKindOfPort = SUPERV::ServiceParameter ) :
- ServicesParameter( aserviceParameter ) {
- _NodeName = NodeName ;
- _Port = SUPERV::Port::_nil() ;
- _KindOfPort = aKindOfPort ;
- } ;
- virtual ~Port() {
+ Port() {
+ _NodeName = NULL ;
+ _Port = SUPERV::Port::_nil() ;
+ _KindOfPort = SUPERV::UndefinedParameter ;
+ _Dependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ; } ;
+ Port( const char *const * NodeName ,
+ const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
+ const SUPERV::KindOfPort aKindOfPort = SUPERV::ServiceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ) :
+ ServicesParameter( aserviceParameter ) {
+ _NodeName = NodeName ;
+ _Port = SUPERV::Port::_nil() ;
+ _KindOfPort = aKindOfPort ;
+ if ( IsDataStream() ) {
+ _Dependency = aDependency ;
+ }
+ else {
+ _Dependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ;
+ } } ;
+ virtual ~Port() {
cdebug << "~Port" << endl ; } ;
- SUPERV::Port_var ObjRef() const { return _Port ; } ;
- void ObjRef(SUPERV::Port_var aPort) {
- _Port = aPort ; } ;
-
- const char * NodeName() const { return *_NodeName ; } ;
- const char * NodePortName() const {
-// cout << "NodePortName " << hex << (void *) _NodeName << " "
-// << dec << _NodeName << endl ;
- char * _NodePortName = new char [ strlen( *_NodeName ) +
- strlen( ServicesParameterName() ) + 3 ] ;
- strcpy( _NodePortName , *_NodeName ) ;
- strcat( _NodePortName , "\\" ) ;
- strcat( _NodePortName , ServicesParameterName() ) ;
-// strcat( _NodePortName , "\\" ) ;
- return _NodePortName ; } ;
-
- const char * PortName() const {
- if ( this == NULL )
- return NULLSTRING ;
- return ServicesParameterName() ; } ;
- const char * PortType() const { return ServicesParameterType() ; } ;
-
- void Kind( SUPERV::KindOfPort aKindOfPort ) {
- if ( _KindOfPort == SUPERV::GateParameter && aKindOfPort == SUPERV::InLineParameter ) {
- cdebug << "GraphBase::Port::Kind " << _KindOfPort << " --> " << aKindOfPort
- << endl ;
- }
- _KindOfPort = aKindOfPort ; } ;
- const SUPERV::KindOfPort Kind() const { return _KindOfPort ; } ;
- bool IsParam() const {
- return _KindOfPort == SUPERV::ServiceParameter ; } ;
- bool IsGate() const {
- return _KindOfPort == SUPERV::GateParameter ||
- _KindOfPort == SUPERV::GOTOParameter ; } ;
- bool IsInLine() const {
- return _KindOfPort == SUPERV::InLineParameter ; } ;
- bool IsLoop() const {
- return _KindOfPort == SUPERV::LoopParameter ; } ;
- bool IsSwitch() const {
- return _KindOfPort == SUPERV::SwitchParameter ; } ;
- bool IsEndSwitch() const {
- return _KindOfPort == SUPERV::EndSwitchParameter ; } ;
- bool IsGOTO() const {
- return _KindOfPort == SUPERV::GOTOParameter ; } ;
-// bool IsBus() const { return ( ( _KindOfPort == SUPERV::InLineParameter ) ||
-// ( _PortIndex != -1 ) ) ; } ;
-
-// void PortIndex( const int anIndex ) {
-// _PortIndex = anIndex ; } ;
-// const int PortIndex() const {
-// return _PortIndex ; } ;
-
-
- bool AddCoord( const int nxy , const int *x , const int *y ) ;
- bool AddCoord( const int index , const int x , const int y ) ;
- bool ChangeCoord( const int index ,
- const int x ,
- const int y ) ;
- bool RemoveCoord( const int index ) ;
- bool RemoveCoords() ;
- int GetCoord() const ;
- bool GetCoord( int *x , int *y ) const ;
- const GraphBase::ListOfCoords * Coords() const ;
- bool GetCoord( const int index , long &x , long &y ) const ;
+ SUPERV::Port_var ObjRef() const { return _Port ; } ;
+ void ObjRef(SUPERV::Port_var aPort) {
+ _Port = aPort ; } ;
+
+ const char * NodeName() const { return *_NodeName ; } ;
+ const char * NodePortName() const {
+// cout << "NodePortName " << hex << (void *) _NodeName << " "
+// << dec << _NodeName << endl ;
+ char * _NodePortName = new char [ strlen( *_NodeName ) +
+ strlen( ServicesParameterName() ) + 3 ] ;
+ strcpy( _NodePortName , *_NodeName ) ;
+ strcat( _NodePortName , "\\" ) ;
+ strcat( _NodePortName , ServicesParameterName() ) ;
+ return _NodePortName ; } ;
+
+ const char * PortName() const {
+ if ( this == NULL )
+ return NULLSTRING ;
+ return ServicesParameterName() ; } ;
+ const char * PortType() const { return ServicesParameterType() ; } ;
+
+ void Kind( SUPERV::KindOfPort aKindOfPort ) {
+ if ( _KindOfPort == SUPERV::GateParameter && aKindOfPort == SUPERV::InLineParameter ) {
+ cdebug << "GraphBase::Port::Kind " << _KindOfPort << " --> " << aKindOfPort
+ << endl ;
+ }
+ _KindOfPort = aKindOfPort ; } ;
+ const SUPERV::KindOfPort Kind() const {
+ return _KindOfPort ; } ;
+ bool IsParam() const {
+ return _KindOfPort == SUPERV::ServiceParameter ; } ;
+ bool IsGate() const {
+ return _KindOfPort == SUPERV::GateParameter ||
+ _KindOfPort == SUPERV::GOTOParameter ; } ;
+ bool IsInLine() const {
+ return _KindOfPort == SUPERV::InLineParameter ; } ;
+ bool IsLoop() const {
+ return _KindOfPort == SUPERV::LoopParameter ; } ;
+ bool IsSwitch() const {
+ return _KindOfPort == SUPERV::SwitchParameter ; } ;
+ bool IsEndSwitch() const {
+ return _KindOfPort == SUPERV::EndSwitchParameter ; } ;
+ bool IsGOTO() const {
+ return _KindOfPort == SUPERV::GOTOParameter ; } ;
+ bool IsDataStream() const {
+ return _KindOfPort == SUPERV::DataStreamParameter ; } ;
+
+ const SALOME_ModuleCatalog::DataStreamDependency Dependency() const {
+ return _Dependency ; } ;
+ bool Dependency( SALOME_ModuleCatalog::DataStreamDependency aDependency ) {
+ if ( IsDataStream() ) {
+ _Dependency = aDependency ;
+ return true ;
+ }
+ return false ; } ;
+
+ bool AddCoord( const int nxy , const int *x , const int *y ) ;
+ bool AddCoord( const int index , const int x , const int y ) ;
+ bool ChangeCoord( const int index ,
+ const int x ,
+ const int y ) ;
+ bool RemoveCoord( const int index ) ;
+ bool RemoveCoords() ;
+ int GetCoord() const ;
+ bool GetCoord( int *x , int *y ) const ;
+ const GraphBase::ListOfCoords * Coords() const ;
+ bool GetCoord( const int index , long &x , long &y ) const ;
} ;
ostream & operator<< (ostream &,const SUPERV::KindOfPort &);
+ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamDependency &);
+
#endif
// cdebug << "GraphBase::PortsOfNode::PortsOfNode " << this << endl ;
_NodeInPortsSize = 0 ;
_NodeOutPortsSize = 0 ;
+ _DataStreamInPortsNumber = 0 ;
+ _DataStreamOutPortsNumber = 0 ;
}
GraphBase::PortsOfNode::PortsOfNode( const char *DataFlowName ) :
// cdebug << "GraphBase::PortsOfNode::PortsOfNode " << this << endl ;
_NodeInPortsSize = 0 ;
_NodeOutPortsSize = 0 ;
+ _DataStreamInPortsNumber = 0 ;
+ _DataStreamOutPortsNumber = 0 ;
}
GraphBase::PortsOfNode::~PortsOfNode() {
int * Graph_prof_debug ,
ofstream * Graph_fdebug ) {
int i ;
- cdebug_in << "DefPortsOfNode : " << *NodeName << endl ;
- const bool DataFlowOrComputing = (aKind == SUPERV::DataFlowNode) ||
+ SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
+// MESSAGE( "DefPortsOfNode " << NodeName << " Graph_prof_debug "
+// << Graph_prof_debug << " _prof_debug " << _prof_debug ) ;
+ cdebug_in << "DefPortsOfNode : " << *NodeName << " ServiceName " << aService.ServiceName << endl ;
+ const bool DataFlowOrComputing = (aKind == SUPERV::DataFlowGraph) ||
(aKind == SUPERV::ComputingNode) ||
(aKind == SUPERV::FactoryNode) ;
// WithInLoop : InitLoop or DoLoop
const bool WithInLoop = (aKind == SUPERV::LoopNode) || (aKind == SUPERV::EndLoopNode) ;
// WithInGate : InGate or Default
- const bool WithInGate = (aKind == SUPERV::ComputingNode) || (aKind == SUPERV::FactoryNode) ||
- (aKind == SUPERV::InLineNode) || (aKind == SUPERV::LoopNode) ||
- (aKind == SUPERV::SwitchNode) || (aKind == SUPERV::EndSwitchNode) ||
- (aKind == SUPERV::GOTONode) ;
+ const bool WithInGate = (aKind == SUPERV::DataFlowGraph) || (aKind == SUPERV::DataStreamGraph) ||
+ (aKind == SUPERV::ComputingNode) || (aKind == SUPERV::FactoryNode) ||
+ (aKind == SUPERV::InLineNode) || (aKind == SUPERV::GOTONode) ||
+ (aKind == SUPERV::LoopNode) || (aKind == SUPERV::EndLoopNode) ||
+ (aKind == SUPERV::SwitchNode) || (aKind == SUPERV::EndSwitchNode) ;
// WithOutGate : OutGate or Default
- const bool WithOutGate = (aKind == SUPERV::ComputingNode) || (aKind == SUPERV::FactoryNode) ||
- (aKind == SUPERV::InLineNode) || (aKind == SUPERV::SwitchNode) ||
- (aKind == SUPERV::GOTONode) ;
+ const bool WithOutGate = (aKind == SUPERV::DataFlowGraph) || (aKind == SUPERV::DataStreamGraph) ||
+ (aKind == SUPERV::ComputingNode) || (aKind == SUPERV::FactoryNode) ||
+ (aKind == SUPERV::InLineNode) || (aKind == SUPERV::GOTONode) ||
+ (aKind == SUPERV::SwitchNode) || (aKind == SUPERV::EndSwitchNode) ;
SUPERV::KindOfPort aPortKind = SUPERV::ServiceParameter ;
if ( aKind == SUPERV::InLineNode ) {
aPortKind = SUPERV::InLineParameter ;
const char *aParametername = _aParametername.c_str() ;
if ( _MapOfNodeInPorts[ aParametername ] ) {
if ( !DataFlowOrComputing &&
- !strcmp( aParametername , "InGate" ) ) {
+ !strcmp( aParametername , "Gate" ) ) {
}
else {
cdebug << "Error, Parametername duplicated : " << aParametername
SALOME_ModuleCatalog::ServicesParameter anInGateParameter ;
_NodeInPortsSize = _NodeInPortsSize + 1 ;
iVec += 1 ;
- char *aParametername = "InGate" ;
+ char *aParametername = "Gate" ;
if ( aKind == SUPERV::EndSwitchNode ) {
aParametername = "Default" ;
}
const char *aParametername = _aParametername.c_str() ;
if ( _MapOfNodeOutPorts[ aParametername ] ) {
if ( !DataFlowOrComputing &&
- !strcmp( aParametername , "OutGate" ) ) {
+ !strcmp( aParametername , "Gate" ) ) {
}
else {
cdebug << "Error, Parametername duplicated : " << aParametername
}
}
else {
- _MapOfNodeOutPorts[ aParametername ] = i+1 ;
cdebug << "DefPortsOfNode : " << "_MapOfNodeOutPorts[ " << aParametername
<< " ] = " << i+1 << endl ;
+ _MapOfNodeOutPorts[ aParametername ] = i+1 ;
const SALOME_ModuleCatalog::ServicesParameter aServiceParameter = aService.ServiceoutParameter[i-iVec] ;
_NodeOutPorts[i] = new GraphBase::OutPort( NodeName , aServiceParameter ,
aPortKind );
SALOME_ModuleCatalog::ServicesParameter anOutGateParameter ;
_NodeOutPortsSize = _NodeOutPortsSize + 1 ;
iVec += 1 ;
- char *aParametername = "OutGate" ;
+ char *aParametername = "Gate" ;
if ( aKind == SUPERV::SwitchNode ) {
aParametername = "Default" ;
}
GraphBase::InPort * GraphBase::PortsOfNode::AddInPort( CORBA::ORB_ptr ORB ,
const char *const * NodeName ,
- const SUPERV::KindOfNode aKind ,
+ const SUPERV::KindOfNode aKindOfNode ,
const char * InputParameterName ,
const char * InputParameterType ,
+ SUPERV::KindOfPort aKindOfPort ,
+// const int DataStreamInPortsNumber ,
int * Graph_prof_debug ,
ofstream * Graph_fdebug ) {
- cdebug_in << "DefPortsOfNode::AddInPort : " << *NodeName << " " << aKind << " "
- << InputParameterName << " " << InputParameterType << endl ;
+// MESSAGE( "DefPortsOfNode " << *NodeName << " Graph_prof_debug "
+// << Graph_prof_debug << " _prof_debug " << _prof_debug ) ;
+ cdebug_in << "PortsOfNode::AddInPort : " << *NodeName << " " << aKindOfNode << " InputParameterName " << InputParameterName << " InputParameterType "
+ << InputParameterType << " aKindOfPort " << aKindOfPort << " DataStreamInPortsNumber " << DataStreamInPortsNumber() << " _NodeInPortsSize "
+ << _NodeInPortsSize << endl ;
GraphBase::InPort * anInPort = NULL ;
- if ( aKind == SUPERV::InLineNode || aKind == SUPERV::LoopNode ||
- aKind == SUPERV::EndLoopNode || aKind == SUPERV::SwitchNode ||
- aKind == SUPERV::EndSwitchNode || aKind == SUPERV::GOTONode ) {
- SUPERV::KindOfPort aPortKind = SUPERV::InLineParameter ;
- if ( aKind == SUPERV::EndSwitchNode ) {
- aPortKind = SUPERV::EndSwitchParameter ;
- }
- anInPort = GetChangeInPort( InputParameterName ) ;
- if ( anInPort == NULL ) {
- _NodeInPortsSize = _NodeInPortsSize + 1 ;
- _NodeInPorts.resize(_NodeInPortsSize);
- SALOME_ModuleCatalog::ServicesParameter aServiceParameter ;
- aServiceParameter.Parametername = InputParameterName ;
- aServiceParameter.Parametertype = InputParameterType ;
- SUPERV::KindOfPort aPortKind = SUPERV::ServiceParameter ;
- if ( aKind != SUPERV::EndLoopNode ) {
- _NodeInPorts[ _NodeInPortsSize-1 ] = _NodeInPorts[ _NodeInPortsSize-2 ] ; // Gate - Default
- _MapOfNodeInPorts.erase( _NodeInPorts[ _NodeInPortsSize-1 ]->PortName() ) ;
- _MapOfNodeInPorts[ _NodeInPorts[ _NodeInPortsSize-1 ]->PortName() ] = _NodeInPortsSize-1 + 1 ;
- _MapOfNodeInPorts[ InputParameterName ] = _NodeInPortsSize-2 + 1 ;
- _NodeInPorts[_NodeInPortsSize-2] = new GraphBase::InPort( NodeName ,
- aServiceParameter ,
- aPortKind ) ;
- _NodeInPorts[_NodeInPortsSize-2]->Kind( SUPERV::InLineParameter ) ;
-// MESSAGE( "GraphBase::PortsOfNode::DefPortsOfNode " << InputParameterName << " --> SetDebug" ) ;
- _NodeInPorts[_NodeInPortsSize-2]->SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
- anInPort = _NodeInPorts[_NodeInPortsSize-2] ;
- cdebug << "NodeInPorts[ " << _NodeInPortsSize-2 << " ]" << endl ;
+ int index = 0 ;
+ anInPort = GetChangeInPort( InputParameterName ) ;
+ if ( anInPort == NULL ) {
+ _NodeInPortsSize = _NodeInPortsSize + 1 ;
+ _NodeInPorts.resize(_NodeInPortsSize);
+ SALOME_ModuleCatalog::ServicesParameter aServiceParameter ;
+ aServiceParameter.Parametername = CORBA::string_dup( InputParameterName ) ;
+ aServiceParameter.Parametertype = CORBA::string_dup( InputParameterType ) ;
+ if ( aKindOfPort == SUPERV::DataStreamParameter ) {
+ index = _NodeInPortsSize-2 ;
+ IncrDataStreamInPorts() ;
+ }
+ else {
+ index = _NodeInPortsSize-2 - DataStreamInPortsNumber() ;
+ }
+// if ( aKindOfNode != SUPERV::EndLoopNode ) {
+ int i ;
+ for ( i = _NodeInPortsSize - 2 ; i >= index ; i-- ) {
+ _NodeInPorts[ i + 1 ] = _NodeInPorts[ i ] ; // Gate - Default
+ _MapOfNodeInPorts.erase( _NodeInPorts[ i + 1 ]->PortName() ) ;
+ _MapOfNodeInPorts[ _NodeInPorts[ i + 1 ]->PortName() ] = i + 2 ;
+ }
+ _MapOfNodeInPorts[ InputParameterName ] = index + 1 ;
+ if ( aKindOfPort == SUPERV::DataStreamParameter ) {
+ _NodeInPorts[index] = new GraphBase::InDataStreamPort( NodeName ,
+ aServiceParameter ) ;
}
else {
- _MapOfNodeInPorts[ InputParameterName ] = _NodeInPortsSize-1 + 1 ;
- _NodeInPorts[_NodeInPortsSize-1] = new GraphBase::InPort( NodeName ,
- aServiceParameter ,
- aPortKind ) ;
- _NodeInPorts[_NodeInPortsSize-1]->Kind( SUPERV::InLineParameter ) ;
-// MESSAGE( "GraphBase::PortsOfNode::DefPortsOfNode " << InputParameterName << " --> SetDebug" ) ;
- _NodeInPorts[_NodeInPortsSize-1]->SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
- anInPort = _NodeInPorts[_NodeInPortsSize-1] ;
- cdebug << "NodeInPorts[ " << _NodeInPortsSize-1 << " ]" << endl ;
+ _NodeInPorts[index] = new GraphBase::InPort( NodeName ,
+ aServiceParameter ,
+ aKindOfPort ) ;
}
+ _NodeInPorts[index]->SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
+ anInPort = _NodeInPorts[index] ;
+ cdebug << "NodeInPorts[ " << index << " ]" << endl ;
}
- else {
- cdebug << "InPort already exists" << endl ;
+// else { // EndLoopNode
+// _MapOfNodeInPorts[ InputParameterName ] = _NodeInPortsSize-1 + 1 ;
+// _NodeInPorts[_NodeInPortsSize-1] = new GraphBase::InPort( NodeName ,
+// aServiceParameter ,//
+// aKindOfPort ) ;
+// MESSAGE( "GraphBase::PortsOfNode::AddInPort " << InputParameterName << " --> SetDebug" ) ;
+// _NodeInPorts[_NodeInPortsSize-1]->SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
+// anInPort = _NodeInPorts[_NodeInPortsSize-1] ;
+// cdebug << "NodeInPorts[ " << _NodeInPortsSize-1 << " ]" << endl ;
+// }
+// }
+ else {
+ cdebug << "GraphBase::PortsOfNode::AddInPort InPort already exists" << endl ;
+ anInPort->Kind( aKindOfPort ) ;
+ }
+ cdebug << "GraphBase::PortsOfNode::AddInPort index " << index << " _NodeInPortsSize " << _NodeInPortsSize << endl ;
+ int i ;
+ for ( i = 0 ; i < _NodeInPortsSize ; i++ ) {
+ cdebug << *NodeName << " _NodeInPorts[ " << i << " ] = " << _NodeInPorts[ i ]->PortName()
+ << " _MapOfNodeInPorts[ " << _NodeInPorts[ i ]->PortName() << " ] = "
+ << _MapOfNodeInPorts[ _NodeInPorts[ i ]->PortName() ] - 1 << " "
+ << _NodeInPorts[ i ]->Kind() << " Dependency " << _NodeInPorts[ i ]->Dependency() ;
+ if ( _NodeInPorts[ i ]->IsDataStream() ) {
+ SUPERV::KindOfSchema aKindOfSchema ;
+ SUPERV::KindOfInterpolation aKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+ ((GraphBase::InDataStreamPort * ) _NodeInPorts[ i ])->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+ cdebug << " " << aKindOfSchema << " " << aKindOfInterpolation << " " << aKindOfExtrapolation ;
}
+ cdebug << endl ;
}
- cdebug_out << "DefPortsOfNode::AddInPort _NodeInPortsSize " << _NodeInPortsSize
+ cdebug_out << "GraphBase::PortsOfNode::AddInPort _NodeInPortsSize " << _NodeInPortsSize
<< " " << anInPort->Kind() << endl ;
return anInPort ;
}
GraphBase::OutPort * GraphBase::PortsOfNode::AddOutPort( CORBA::ORB_ptr ORB ,
const char * const * NodeName ,
- const SUPERV::KindOfNode aKind ,
+ const SUPERV::KindOfNode aKindOfNode ,
const char * OutputParameterName ,
const char * OutputParameterType ,
+ SUPERV::KindOfPort aKindOfPort ,
+// const int DataStreamOutPortsNumber ,
int * Graph_prof_debug ,
ofstream * Graph_fdebug ) {
- cdebug_in << "DefPortsOfNode::AddOutPort : " << *NodeName << " " << aKind << " "
- << OutputParameterName << " " << OutputParameterType << endl ;
+ cdebug_in << "GraphBase::PortsOfNode::AddOutPort : " << *NodeName << " " << aKindOfNode << " OutputParameterName " << OutputParameterName
+ << " OutputParameterType " << OutputParameterType << " aKindOfPort " << aKindOfPort << " DataStreamOutPortsNumber " << DataStreamOutPortsNumber()
+ << " _NodeOutPortsSize " << _NodeOutPortsSize << endl ;
GraphBase::OutPort * anOutPort = NULL ;
- if ( aKind == SUPERV::InLineNode || aKind == SUPERV::LoopNode ||
- aKind == SUPERV::EndLoopNode || aKind == SUPERV::SwitchNode ||
- aKind == SUPERV::EndSwitchNode || aKind == SUPERV::GOTONode ) {
- SUPERV::KindOfPort aPortKind = SUPERV::InLineParameter ;
- anOutPort = GetChangeOutPort( OutputParameterName ) ;
- if ( anOutPort == NULL ) {
- _NodeOutPortsSize = _NodeOutPortsSize + 1 ;
- _NodeOutPorts.resize(_NodeOutPortsSize);
- SALOME_ModuleCatalog::ServicesParameter aServiceParameter ;
- aServiceParameter.Parametername = OutputParameterName ;
- aServiceParameter.Parametertype = OutputParameterType ;
- if ( aKind == SUPERV::SwitchNode ) {
- _NodeOutPorts[ _NodeOutPortsSize-1 ] = _NodeOutPorts[ _NodeOutPortsSize-2 ] ; // Default
- _MapOfNodeOutPorts.erase( _NodeOutPorts[ _NodeOutPortsSize-1 ]->PortName() ) ;
- _MapOfNodeOutPorts[ _NodeOutPorts[ _NodeOutPortsSize-1 ]->PortName() ] = _NodeOutPortsSize-1 + 1 ;
- _MapOfNodeOutPorts[ OutputParameterName ] = _NodeOutPortsSize - 1 ;
- _NodeOutPorts[_NodeOutPortsSize-2] = new GraphBase::OutPort( NodeName ,
- aServiceParameter ,
- aPortKind );
- _NodeOutPorts[_NodeOutPortsSize-2]->Kind( SUPERV::InLineParameter ) ;
-// MESSAGE( "GraphBase::PortsOfNode::DefPortsOfNode " << OutputParameterName << " --> SetDebug" ) ;
- _NodeOutPorts[_NodeOutPortsSize-2]->SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
- anOutPort = _NodeOutPorts[_NodeOutPortsSize-2] ;
- cdebug << "NodeInPorts[ " << _NodeInPortsSize-2 << " ]" << endl ;
- }
- else {
- _MapOfNodeOutPorts[ OutputParameterName ] = _NodeOutPortsSize ;
- _NodeOutPorts[_NodeOutPortsSize-1] = new GraphBase::OutPort( NodeName ,
- aServiceParameter ,
- aPortKind );
- _NodeOutPorts[_NodeOutPortsSize-1]->Kind( SUPERV::InLineParameter ) ;
-// MESSAGE( "GraphBase::PortsOfNode::DefPortsOfNode " << OutputParameterName << " --> SetDebug" ) ;
- _NodeOutPorts[_NodeOutPortsSize-1]->SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
- anOutPort = _NodeOutPorts[_NodeOutPortsSize-1] ;
- cdebug << "NodeInPorts[ " << _NodeInPortsSize-1 << " ]" << endl ;
- }
+ int index = 0 ;
+ anOutPort = GetChangeOutPort( OutputParameterName ) ;
+ if ( anOutPort == NULL ) {
+ _NodeOutPortsSize = _NodeOutPortsSize + 1 ;
+ _NodeOutPorts.resize(_NodeOutPortsSize);
+ SALOME_ModuleCatalog::ServicesParameter aServiceParameter ;
+ aServiceParameter.Parametername = CORBA::string_dup( OutputParameterName ) ;
+ aServiceParameter.Parametertype = CORBA::string_dup( OutputParameterType ) ;
+ if ( aKindOfPort == SUPERV::DataStreamParameter ) {
+ index = _NodeOutPortsSize-2 ;
+ IncrDataStreamOutPorts() ;
+ }
+ else {
+ index = _NodeOutPortsSize-2 - DataStreamOutPortsNumber() ;
+ }
+ if ( aKindOfNode == SUPERV::LoopNode || aKindOfNode == SUPERV::EndLoopNode ) {
+ index += 1 ;
+ }
+// if ( aKindOfNode != SUPERV::LoopNode && aKindOfNode != SUPERV::EndLoopNode ) {
+ int i ;
+ for ( i = _NodeOutPortsSize - 2 ; i >= index ; i-- ) {
+ _NodeOutPorts[ i + 1 ] = _NodeOutPorts[ i ] ; // Gate - Default
+ _MapOfNodeOutPorts.erase( _NodeOutPorts[ i + 1 ]->PortName() ) ;
+ _MapOfNodeOutPorts[ _NodeOutPorts[ i + 1 ]->PortName() ] = i + 2 ;
+ }
+ _MapOfNodeOutPorts[ OutputParameterName ] = index + 1 ;
+ if ( aKindOfPort == SUPERV::DataStreamParameter ) {
+ _NodeOutPorts[index] = new GraphBase::OutDataStreamPort( NodeName ,
+ aServiceParameter ) ;
}
else {
- cdebug << "OutPort already exists" << endl ;
+ _NodeOutPorts[index] = new GraphBase::OutPort( NodeName ,
+ aServiceParameter ,
+ aKindOfPort );
}
+// MESSAGE( "GraphBase::PortsOfNode::AddOutPort " << OutputParameterName << " --> SetDebug" ) ;
+ _NodeOutPorts[index]->SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
+ anOutPort = _NodeOutPorts[index] ;
+ cdebug << "NodeOutPorts[ " << index << " ]" << endl ;
+ }
+// else { // LoopNode || EndLoopNode
+// _MapOfNodeOutPorts[ OutputParameterName ] = index + 2 ;
+// _NodeOutPorts[index + 1] = new GraphBase::OutPort( NodeName ,
+// aServiceParameter ,
+// aKindOfPort );
+// MESSAGE( "GraphBase::PortsOfNode::AddOutPort " << OutputParameterName << " --> SetDebug" ) ;
+// _NodeOutPorts[index + 1]->SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
+// anOutPort = _NodeOutPorts[index + 1] ;
+// cdebug << "NodeOutPorts[ " << index + 1 << " ]" << endl ;
+// }
+// }
+ else {
+ cdebug << "GraphBase::PortsOfNode::AddOutPort OutPort already exists" << endl ;
+ anOutPort->Kind( aKindOfPort ) ;
}
- cdebug_out << "DefPortsOfNode::AddOutPort _NodeOutPortsSize "
+ cdebug << "GraphBase::PortsOfNode::AddOutPort index " << index << " _NodeOutPortsSize " << _NodeOutPortsSize << endl ;
+ int i ;
+ for ( i = 0 ; i < _NodeOutPortsSize ; i++ ) {
+ cdebug << *NodeName << " _NodeOutPorts[ " << i << " ] = " << _NodeOutPorts[ i ]->PortName()
+ << " _MapOfNodeOutPorts[ " << _NodeOutPorts[ i ]->PortName() << " ] = "
+ << _MapOfNodeOutPorts[ _NodeOutPorts[ i ]->PortName() ] - 1 << " "
+ << _NodeOutPorts[ i ]->Kind() << " Dependency " << _NodeOutPorts[ i ]->Dependency() ;
+ if ( _NodeOutPorts[ i ]->IsDataStream() ) {
+ cdebug << " NumberOfValues " << ((GraphBase::OutDataStreamPort * ) _NodeOutPorts[ i ])->NumberOfValues() ;
+ }
+ cdebug << endl ;
+ }
+ cdebug_out << "GraphBase::PortsOfNode::AddOutPort _NodeOutPortsSize "
<< _NodeOutPortsSize << " " << anOutPort->Kind() << endl ;
return anOutPort ;
}
cdebug << "DefPortsOfNode::DelInPort : _NodeInPorts[" << index << "] "
<< _NodeInPorts[ index ]->PortName() << " "
<< _NodeInPorts[ index ]->NodeName() << endl ;
+ if ( _NodeInPorts[ index ]->IsDataStream() ) {
+ DecrDataStreamInPorts() ;
+ }
_MapOfNodeInPorts.erase( InputParameterName ) ;
_NodeInPorts[ index ]->destroy() ;
int i ;
cdebug << "DefPortsOfNode::DelOutPort : _NodeOutPorts[" << index << "] "
<< _NodeOutPorts[ index ]->PortName() << " "
<< _NodeOutPorts[ index ]->NodeName() << endl ;
+ if ( _NodeOutPorts[ index ]->IsDataStream() ) {
+ DecrDataStreamOutPorts() ;
+ }
_MapOfNodeOutPorts.erase( OutputParameterName ) ;
_NodeOutPorts[ index ]->destroy() ;
int i ;
}
GraphBase::InPort *GraphBase::PortsOfNode::GetChangeInPort( const char * name) {
-// cdebug_in << "GraphBase::PortsOfNode::GetChangePort " << name <<" " << way
-// << endl;
+// cdebug_in << "GraphBase::PortsOfNode::GetChangeInPort " << name << endl;
GraphBase::InPort * pP = NULL;
if ( !_MapOfNodeInPorts.empty() ) {
- int i = _MapOfNodeInPorts[ name ] ;
-// cout << "GraphBase::PortsOfNode::GetChangeInPort _MapOfNodeInPorts[ "
-// << name << " ] : " << i-1 << " " << _NodeInPorts[ i-1 ]->NodeName()
-// << endl ;
- if ( i > 0 )
+ int i = 0 ;
+ if ( !strcmp( name , "InGate" ) ) {
+ i = _MapOfNodeInPorts[ "Gate" ] ;
+ }
+ else {
+ i = _MapOfNodeInPorts[ name ] ;
+ }
+ if ( i > 0 ) {
+// cdebug << "GraphBase::PortsOfNode::GetChangeInPort _MapOfNodeInPorts[ "
+// << name << " ] : " << i-1 << " " << _NodeInPorts[ i-1 ]->NodeName()
+// << endl ;
pP = _NodeInPorts[ i-1 ] ;
+ }
}
+// if ( pP == NULL ) {
+// int i ;
+// for ( i = 0 ; i < _NodeInPortsSize ; i++ ) {
+// cdebug << " _NodeInPorts[ " << i << " ] = " << _NodeInPorts[ i ]->PortName()
+// << " _MapOfNodeInPorts[ " << _NodeInPorts[ i ]->PortName() << " ] = "
+// << _MapOfNodeInPorts[ _NodeInPorts[ i ]->PortName() ] - 1 << " "
+// << _NodeInPorts[ i ]->Kind() << " Dependency " << _NodeInPorts[ i ]->Dependency() ;
+// if ( _NodeInPorts[ i ]->IsDataStream() ) {
+// SUPERV::KindOfSchema aKindOfSchema ;
+// SUPERV::KindOfInterpolation aKindOfInterpolation ;
+// SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+// ((GraphBase::InDataStreamPort * ) _NodeInPorts[ i ])->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+// cdebug << " " << aKindOfSchema << " " << aKindOfInterpolation << " " << aKindOfExtrapolation ;
+// }
+// if ( !strcmp( _NodeInPorts[ i ]->PortName() , name ) ) {
+// cdebug << " ERROR" ;
+// }
+// cdebug << endl ;
+// }
+// }
// cdebug_out << "GraphBase::PortsOfNode::GetChangeInPort " << endl;
return pP;
}
GraphBase::OutPort *GraphBase::PortsOfNode::GetChangeOutPort( const char * name ) {
-// cdebug_in << "GraphBase::PortsOfNode::GetChangePort " << name <<" " << way
-// << endl;
+// cdebug_in << "GraphBase::PortsOfNode::GetChangeOutPort " << name << endl;
GraphBase::OutPort * pP = NULL;
if ( !_MapOfNodeOutPorts.empty() ) {
- int i = _MapOfNodeOutPorts[ name ] ;
-// cout << "GraphBase::PortsOfNode::GetChangeOutPort _MapOfNodeOutPorts[ "
-// << name << " ] : " << i-1 << " " << _NodeOutPorts[ i-1 ]->NodeName()
-// << endl ;
- if ( i > 0 )
+ int i = 0 ;
+ if ( !strcmp( name , "OutGate" ) ) {
+ i = _MapOfNodeOutPorts[ "Gate" ] ;
+ }
+ else {
+ i = _MapOfNodeOutPorts[ name ] ;
+ }
+ if ( i > 0 ) {
+// cdebug << "GraphBase::PortsOfNode::GetChangeOutPort _MapOfNodeOutPorts[ "
+// << name << " ] : " << i-1 << " " << _NodeOutPorts[ i-1 ]->NodeName() << endl ;
pP = _NodeOutPorts[ i-1 ] ;
+ }
}
// cdebug_out << "GraphBase::PortsOfNode::GetChangeOutPort " << endl;
+// if ( pP == NULL ) {
+// int i ;
+// for ( i = 0 ; i < _NodeOutPortsSize ; i++ ) {
+// cdebug << " _NodeOutPorts[ " << i << " ] = " << _NodeOutPorts[ i ]->PortName()
+// << " _MapOfNodeOutPorts[ " << _NodeOutPorts[ i ]->PortName() << " ] = "
+// << _MapOfNodeOutPorts[ _NodeOutPorts[ i ]->PortName() ] - 1 << " "
+// << _NodeOutPorts[ i ]->Kind() << " Dependency " << _NodeOutPorts[ i ]->Dependency() ;
+// if ( _NodeOutPorts[ i ]->IsDataStream() ) {
+// cdebug << " NumberOfValues " << ((GraphBase::OutDataStreamPort * ) _NodeOutPorts[ i ])->NumberOfValues() ;
+// }
+// if ( !strcmp( _NodeOutPorts[ i ]->PortName() , name ) ) {
+// cdebug << " ERROR" ;
+// }
+// cdebug << endl ;
+// }
+// }
return pP;
}
case SUPERV::InLineNode :
f << "InLineNode";
break;
- case SUPERV::DataFlowNode :
- f << "DataFlowNode";
+ case SUPERV::DataFlowGraph :
+ f << "DataFlowGraph";
+ break;
+ case SUPERV::DataStreamGraph :
+ f << "DataStreamGraph";
break;
case SUPERV::LoopNode :
f << "LoopNode";
#include "DataFlowBase_Service.hxx"
-#include "DataFlowBase_InPort.hxx"
-#include "DataFlowBase_OutPort.hxx"
+#include "DataFlowBase_InDataStreamPort.hxx"
+#include "DataFlowBase_OutDataStreamPort.hxx"
namespace GraphBase {
int _NodeOutPortsSize ;
vector<OutPort *> _NodeOutPorts;
+ int _DataStreamInPortsNumber ;
+ int _DataStreamOutPortsNumber ;
+
public:
PortsOfNode() ;
const SALOME_ModuleCatalog::Service& NodeService ,
const char *const * NodeName ,
const SUPERV::KindOfNode aKind ,
-// const bool DataFlowOrComputing ,
-// const bool WithGateArg ,
-// const bool WithInGate ,
-// const bool WithOutGate ,
int * Graph_prof_debug ,
ofstream * Graph_fdebug ) ;
const SUPERV::KindOfNode aKind ,
const char * InputParameterName ,
const char * InputParameterType ,
+ SUPERV::KindOfPort aKindOfPort ,
+// const int DataStreamInPortsNumber ,
int * Graph_prof_debug ,
ofstream * Graph_fdebug ) ;
OutPort * AddOutPort( CORBA::ORB_ptr ORB ,
const SUPERV::KindOfNode aKind ,
const char * OutputParameterName ,
const char * InputParameterType ,
+ SUPERV::KindOfPort aKindOfPort ,
+// const int DataStreamOutPortsNumber ,
int * Graph_prof_debug ,
ofstream * Graph_fdebug ) ;
-// void InOutPort( InPort * InputPort , OutPort * OutputPort ) ;
void DelInPort( const char * InputParameterName ) ;
void DelOutPort( const char * OutputParameterName ) ;
+ int IncrDataStreamInPorts() {
+ _DataStreamInPortsNumber++ ;
+ return _DataStreamInPortsNumber ;
+ } ;
+ int DecrDataStreamInPorts() {
+ _DataStreamInPortsNumber-- ;
+ return _DataStreamInPortsNumber ;
+ } ;
+ int IncrDataStreamOutPorts() {
+ _DataStreamOutPortsNumber++ ;
+ return _DataStreamOutPortsNumber ;
+ } ;
+ int DecrDataStreamOutPorts() {
+ _DataStreamOutPortsNumber-- ;
+ return _DataStreamOutPortsNumber ;
+ } ;
+ int DataStreamInPortsNumber() {
+ return _DataStreamInPortsNumber ;
+ } ;
+ int DataStreamOutPortsNumber() {
+ return _DataStreamOutPortsNumber ;
+ } ;
+ void DataStreamInPortsNumber( int aDataStreamInPortsNumber ) {
+ _DataStreamInPortsNumber = aDataStreamInPortsNumber ;
+ } ;
+ void DataStreamOutPortsNumber(int aDataStreamOutPortsNumber ) {
+ _DataStreamOutPortsNumber = aDataStreamOutPortsNumber ;
+ } ;
+ int HasDataStream() const {
+ return _DataStreamInPortsNumber + _DataStreamOutPortsNumber ;
+ } ;
+
const int GetNodeInPortsSize() const { return _NodeInPortsSize ; } ;
const InPort * GetNodeInLoop() const {
return _NodeInPorts[0] ; } ;
InPort * GetChangeInPort( const char *name ) ;
OutPort * GetChangeOutPort( const char *name ) ;
-// void ListPorts( ostream & , const bool klink = true ) const ;
void ListPorts( ostream & , const bool klink = true ) const ;
};
#include "DataFlowBase_Service.hxx"
void GraphBase::Service::SetService( const SALOME_ModuleCatalog::Service aService ) {
+
_Service.ServiceName = CORBA::string_dup( aService.ServiceName ) ;
_Service.ServiceinParameter.length( aService.ServiceinParameter.length() ) ;
_Service.ServiceoutParameter.length( aService.ServiceoutParameter.length() ) ;
_Service.ServiceoutParameter[ i ].Parametertype = CORBA::string_dup( aService.ServiceoutParameter[ i ].Parametertype ) ;
_Service.ServiceoutParameter[ i ].Parametername = CORBA::string_dup( aService.ServiceoutParameter[ i ].Parametername ) ;
}
+
+ _Service.ServiceinDataStreamParameter.length( aService.ServiceinDataStreamParameter.length() ) ;
+ _Service.ServiceoutDataStreamParameter.length( aService.ServiceoutDataStreamParameter.length() ) ;
+ for ( i = 0 ; i < (int ) _Service.ServiceinDataStreamParameter.length() ; i++ ) {
+ _Service.ServiceinDataStreamParameter[ i ].Parametertype = aService.ServiceinDataStreamParameter[ i ].Parametertype ;
+ _Service.ServiceinDataStreamParameter[ i ].Parametername = CORBA::string_dup( aService.ServiceinDataStreamParameter[ i ].Parametername ) ;
+ _Service.ServiceinDataStreamParameter[ i ].Parameterdependency = aService.ServiceinDataStreamParameter[ i ].Parameterdependency ;
+ }
+ for ( i = 0 ; i < (int ) _Service.ServiceoutDataStreamParameter.length() ; i++ ) {
+ _Service.ServiceoutDataStreamParameter[ i ].Parametertype = aService.ServiceoutDataStreamParameter[ i ].Parametertype ;
+ _Service.ServiceoutDataStreamParameter[ i ].Parametername = CORBA::string_dup( aService.ServiceoutDataStreamParameter[ i ].Parametername ) ;
+ _Service.ServiceoutDataStreamParameter[ i ].Parameterdependency = aService.ServiceoutDataStreamParameter[ i ].Parameterdependency ;
+ }
cdebug << "GraphBase::Service::SetService : " << _Service << endl ;
_Instance = 0 ;
}
f << ". " << s.ServiceoutParameter[i].Parametername
<< ". " << s.ServiceoutParameter[i].Parametertype << endl ;
}
+ for ( i = 0 ; i < (int ) s.ServiceinDataStreamParameter.length() ; i++ ) {
+ if ( i == 0 )
+ f << " InStreamparameters " << i ;
+ else
+ f << " " << i ;
+ f << ". " << s.ServiceinDataStreamParameter[i].Parametername
+ << ". " << s.ServiceinDataStreamParameter[i].Parametertype
+ << ". " << s.ServiceinDataStreamParameter[i].Parameterdependency << endl ;
+ }
+ for ( i = 0 ; i < (int ) s.ServiceoutDataStreamParameter.length() ; i++ ) {
+ if ( i == 0 )
+ f << " OutStreamparameters " << i ;
+ else
+ f << " " << i ;
+ f << ". " << s.ServiceoutDataStreamParameter[i].Parametername
+ << ". " << s.ServiceoutDataStreamParameter[i].Parametertype
+ << ". " << s.ServiceoutDataStreamParameter[i].Parameterdependency << endl ;
+ }
return f;
}
class Service : public Base {
- SALOME_ModuleCatalog::Service _Service ;
- int _Instance ;
+ private:
+
+ SALOME_ModuleCatalog::Service _Service ;
+ int _Instance ;
public:
- Service( const SALOME_ModuleCatalog::Service aService ) {
+ Service( const SALOME_ModuleCatalog::Service aService ) {
SetService( aService ) ;
// MESSAGE( "GraphBase::Service::Service : " << _Service ) ;
// cout << "GraphBase::Service::Service : " << _Service << endl ;
cdebug << "GraphBase::Service::Service : " << _Service << endl ;
} ;
- Service( const char * aServiceName ) {
- _Service.ServiceName = CORBA::string_dup( aServiceName ) ;
- cdebug << "GraphBase::Service::Service : " << _Service << endl ;
- _Instance = 0 ; } ;
- virtual ~Service() {
- cdebug << "GraphBase::Service::~Service" << endl ;
- } ;
-
- void SetService( const SALOME_ModuleCatalog::Service aService ) ;
+ Service( const char * aServiceName ) {
+ _Service.ServiceName = CORBA::string_dup( aServiceName ) ;
+ cdebug << "GraphBase::Service::Service : " << _Service << endl ;
+ _Instance = 0 ; } ;
+ virtual ~Service() {
+ cdebug << "GraphBase::Service::~Service" << endl ; } ;
- const SALOME_ModuleCatalog::Service * GetService() const {
- cdebug << "GraphBase::Service::GetService : " << _Service << endl ;
- return &_Service ; } ;
- const char * ServiceName() const {
-// cdebug << "ServiceName " << hex << (void *) _Service.ServiceName
-// << dec << " = " << _Service.ServiceName << endl ;
- return _Service.ServiceName ; } ;
- const SALOME_ModuleCatalog::ListOfServicesParameter ServiceInParameter() const {
- return _Service.ServiceinParameter ; } ;
- const SALOME_ModuleCatalog::ListOfServicesParameter ServiceOutParameter() const {
- return _Service.ServiceoutParameter ; } ;
+ void SetService( const SALOME_ModuleCatalog::Service aService ) ;
- const int Instances() const { return _Instance ; } ;
- int NewInstance() { _Instance += 1 ;
- return _Instance ; } ;
- void Instance( int AddInst = 1 ) { if ( AddInst == 1 )
- _Instance += 1 ;
- else
- _Instance = AddInst ; } ;
+ const SALOME_ModuleCatalog::Service * GetService() const {
+ cdebug << "GraphBase::Service::GetService : " << _Service << endl ;
+ return &_Service ; } ;
+ const char * ServiceName() const {
+// cdebug << "ServiceName " << hex << (void *) _Service.ServiceName
+// << dec << " = " << _Service.ServiceName << endl ;
+ return _Service.ServiceName ; } ;
+ const SALOME_ModuleCatalog::ListOfServicesParameter ServiceInParameter() const {
+ return _Service.ServiceinParameter ; } ;
+ const SALOME_ModuleCatalog::ListOfServicesParameter ServiceOutParameter() const {
+ return _Service.ServiceoutParameter ; } ;
+ const SALOME_ModuleCatalog::ListOfServicesDataStreamParameter ServiceInStreamParameter() const {
+ return _Service.ServiceinDataStreamParameter ; } ;
+ const SALOME_ModuleCatalog::ListOfServicesDataStreamParameter ServiceOutStreamParameter() const {
+ return _Service.ServiceoutDataStreamParameter ; } ;
- } ;
+ const int Instances() const { return _Instance ; } ;
+ int NewInstance() { _Instance += 1 ;
+ return _Instance ; } ;
+ void Instance( int Inst = 1 ) { if ( Inst == 1 )
+ _Instance += 1 ;
+ else
+ _Instance = Inst ; } ; } ;
} ;
class ServicesParameter : public Base {
- SALOME_ModuleCatalog::ServicesParameter _ServicesParameter ;
+ private:
+
+ SALOME_ModuleCatalog::ServicesParameter _ServicesParameter ;
public:
- ServicesParameter() {
+ ServicesParameter() {
//cout << "ServicesParameter()" << endl ;
_ServicesParameter.Parametername = (char *) NULL ;
_ServicesParameter.Parametertype = (char *) NULL ;
} ;
- ServicesParameter( const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ) {
- _ServicesParameter = aserviceParameter ; } ;
- virtual ~ServicesParameter() {
+ ServicesParameter( const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ) {
+ _ServicesParameter.Parametertype = CORBA::string_dup( aserviceParameter.Parametertype ) ;
+ _ServicesParameter.Parametername = CORBA::string_dup( aserviceParameter.Parametername ) ; } ;
+ virtual ~ServicesParameter() {
// cout << "ServicesParameter::~ServicesParameter()" << endl ;
} ;
- const SALOME_ModuleCatalog::ServicesParameter & GetServicesParameter() const {
- return _ServicesParameter ; } ;
- const char * ServicesParameterName() const {
- return _ServicesParameter.Parametername ; } ;
- const char * ServicesParameterType() const {
- return _ServicesParameter.Parametertype ; } ;
+ const SALOME_ModuleCatalog::ServicesParameter & GetServicesParameter() const {
+ return _ServicesParameter ; } ;
+ const char * ServicesParameterName() const {
+ return _ServicesParameter.Parametername ; } ;
+ const char * ServicesParameterType() const {
+ return _ServicesParameter.Parametertype ; } ;
} ;
--- /dev/null
+// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : DataFlowBase_StreamGraph.cxx
+// Author : Jean Rahuel
+// Module : SUPERV
+// $Header:
+
+using namespace std;
+#include "DataFlowBase_StreamGraph.hxx"
+
+#include "SALOME_LifeCycleCORBA.hxx"
+
+GraphBase::StreamGraph::StreamGraph() :
+ Graph() {
+ cdebug << "GraphBase::StreamGraph::StreamGraph" << endl ;
+}
+
+GraphBase::StreamGraph::StreamGraph( CORBA::ORB_ptr ORB ,
+ SALOME_NamingService* ptrNamingService ,
+ const char *DataFlowName ,
+ int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) :
+// const char * DebugFileName ) :
+// Graph( ORB ,ptrNamingService , DataFlowName , DebugFileName ) {
+ Graph( ORB ,ptrNamingService , DataFlowName , Graph_prof_debug , Graph_fdebug ) {
+ _Timeout = 300 ;
+ _DataStreamTrace = SUPERV::WithoutTrace ;
+ _DeltaTime = 0 ;
+ Kind( SUPERV::DataStreamGraph ) ;
+ cdebug << "GraphBase::StreamGraph::StreamGraph" << endl ;
+}
+
+GraphBase::StreamGraph::StreamGraph( CORBA::ORB_ptr ORB ,
+ SALOME_NamingService* ptrNamingService ,
+ const SALOME_ModuleCatalog::Service& DataFlowService ,
+ const char *DataFlowComponentName ,
+ const char *DataFlowInterfaceName ,
+ const char *DataFlowName ,
+ const SUPERV::KindOfNode DataFlowkind ,
+ const SUPERV::SDate DataFlowFirstCreation ,
+ const SUPERV::SDate DataFlowLastModification ,
+ const char * DataFlowEditorRelease ,
+ const char * DataFlowAuthor ,
+ const char * DataFlowComputer ,
+ const char * DataFlowComment ,
+ int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) :
+// const char * DebugFileName ) :
+ Graph( ORB ,ptrNamingService , DataFlowService , DataFlowComponentName ,
+ DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+ DataFlowFirstCreation , DataFlowLastModification ,
+ DataFlowEditorRelease , DataFlowAuthor , DataFlowComputer ,
+ DataFlowComment , Graph_prof_debug , Graph_fdebug ) {
+// DataFlowComment , DebugFileName ) {
+ _Timeout = 300 ;
+ _DataStreamTrace = SUPERV::WithoutTrace ;
+ _DeltaTime = 0 ;
+ cdebug << "GraphBase::StreamGraph::StreamGraph" << endl ;
+}
+
+GraphBase::StreamGraph::~StreamGraph() {
+ cdebug << "GraphBase::StreamGraph::~StreamGraph" << endl ;
+}
+
+bool GraphBase::StreamGraph::SetStreamParams( const long Timeout ,
+ const SUPERV::KindOfDataStreamTrace DataStreamTrace ,
+ const double DeltaTime ) {
+ _Timeout = Timeout ;
+ _DataStreamTrace = DataStreamTrace ;
+ _DeltaTime = DeltaTime ;
+ cdebug << "GraphBase::StreamGraph:::SetStreamGraph _Timeout " << _Timeout << " _DataStreamTrace " << _DataStreamTrace << " _DeltaTime " << _DeltaTime
+ << endl ;
+ return true ;
+}
+
+void GraphBase::StreamGraph::StreamParams( long & Timeout ,
+ SUPERV::KindOfDataStreamTrace & DataStreamTrace ,
+ double & DeltaTime ) const {
+ Timeout = _Timeout ;
+ DataStreamTrace = _DataStreamTrace ;
+ DeltaTime = _DeltaTime ;
+ cdebug << "GraphBase::StreamGraph:::StreamGraph _Timeout " << _Timeout << " _DataStreamTrace " << _DataStreamTrace << " _DeltaTime " << _DeltaTime
+ << endl ;
+}
+
+bool GraphBase::StreamGraph::CreateStreamTopology( const char * aDirectory ) {
+ cdebug_in << "GraphBase::StreamGraph::CreateStreamTopology()" << endl;
+ int istream ;
+ for ( istream = 1 ; istream <= SubStreamGraphsNumber() ; istream++ ) {
+ ostringstream astr ;
+ astr << istream << ends ;
+ string filename = string( Name() ) + string( "_" ) + astr.str().c_str() ;
+ string fullfilename = aDirectory + filename + ".cpl" ;
+ ofstream f( fullfilename.c_str() ) ;
+ f << "DEBUT " << filename << endl ;
+ f << " TIMEOUT " << _Timeout << endl ;
+ f << " TRACE " << KindOfDataStreamTraceToString( _DataStreamTrace ) << endl ;
+ f << " DELTA_T " << _DeltaTime << endl ;
+ f << endl ;
+ f << endl ;
+ f << "# Liste des codes" << endl ;
+ f << endl ;
+ map< string , GraphBase::Service * > aMapOfServiceNames = MapOfServiceNames() ;
+ map< string , GraphBase::Service * >::iterator aMapOfServiceNamesIterator ;
+ for ( aMapOfServiceNamesIterator = aMapOfServiceNames.begin() ;
+ aMapOfServiceNamesIterator != aMapOfServiceNames.end() ; aMapOfServiceNamesIterator++ ) {
+ GraphBase::Service * aService = aMapOfServiceNamesIterator->second ;
+ int n ;
+ for ( n = 0 ; n < GraphNodesSize() ; n++ ) {
+ if ( GetGraphNode( n )->HasDataStream() && GetChangeGraphNode( n )->SubStreamGraph() == istream ) {
+ if ( !strcmp( aService->ServiceName() , GetGraphNode( n )->ServiceName() ) ) {
+ f << " CODE " << aService->ServiceName() << endl ;
+ unsigned int j ;
+ cdebug << "CreateStreamTopology " << aService->ServiceName() << " InStreamParameter("
+ << aService->ServiceInStreamParameter().length() << ") OutStreamParameter("
+ << aService->ServiceOutStreamParameter().length() << ")" << endl ;
+ cdebug << aService->GetService() << endl ;
+ for ( j = 0 ; j < aService->ServiceInStreamParameter().length() ; j++ ) {
+ f << " " << aService->ServiceInStreamParameter()[ j ].Parametername << " "
+ << DataStreamDependencyToString( aService->ServiceInStreamParameter()[ j ].Parameterdependency ) << " IN "
+ << DataStreamToString( aService->ServiceInStreamParameter()[ j ].Parametertype ) << endl ;
+ }
+ for ( j = 0 ; j < aService->ServiceOutStreamParameter().length() ; j++ ) {
+ f << " " << aService->ServiceOutStreamParameter()[ j ].Parametername << " "
+ << DataStreamDependencyToString( aService->ServiceOutStreamParameter()[ j ].Parameterdependency ) << " OUT "
+ << DataStreamToString( aService->ServiceOutStreamParameter()[ j ].Parametertype ) << endl ;
+ }
+ f << " FIN #" << aService->ServiceName() << endl ;
+ f << endl ;
+ f << endl ;
+ break ;
+ }
+ }
+ }
+ }
+ f << endl ;
+ f << endl ;
+ f << "# Liste des instances" << endl ;
+ int j ;
+ for ( j = 0 ; j < GraphNodesSize() ; j++ ) {
+ if ( GetGraphNode( j )->HasDataStream() && GetChangeGraphNode( j )->SubStreamGraph() == istream ) {
+ f << endl ;
+ f << " INSTANCE " << GetGraphNode( j )->Name() << endl ;
+ f << " CODE " << GetGraphNode( j )->ServiceName() << endl ;
+ f << " FIN" << endl ;
+ }
+ }
+ f << endl ;
+ f << endl ;
+ f << endl ;
+ f << endl ;
+ f << endl ;
+ f << "# Liste des liens" << endl ;
+ f << endl ;
+ f << " LIEN" << endl ;
+ for ( j = 0 ; j < GraphNodesSize() ; j++ ) {
+ if ( GetGraphNode( j )->HasDataStream() && GetChangeGraphNode( j )->SubStreamGraph() == istream ) {
+ int k ;
+ for ( k = 0 ; k < GetGraphNode( j )->GetNodeOutPortsSize() ; k++ ) {
+ if ( GetGraphNode( j )->GetNodeOutPort( k )->IsDataStream() ) {
+ long aNumberOfValues = ((GraphBase::OutDataStreamPort *) GetGraphNode( j )->GetNodeOutPort( k ))->NumberOfValues() ;
+ int n ;
+ for ( n = 0 ; n < GetGraphNode( j )->GetNodeOutPort( k )->InPortsSize() ; n++ ) {
+ SUPERV::KindOfSchema aKindOfSchema ;
+ SUPERV::KindOfInterpolation aKindOfInterpolation ;
+ SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
+ ((GraphBase::InDataStreamPort *) GetGraphNode( j )->GetNodeOutPort( k )->InPorts( n ))->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
+ f << " " << GetGraphNode( j )->Name() << "."
+ << GetGraphNode( j )->GetNodeOutPort( k )->PortName()
+ << " " << aNumberOfValues
+ << " => "
+ << GetGraphNode( j )->GetNodeOutPort( k )->InPorts( n )->NodeName() << "."
+ << GetGraphNode( j )->GetNodeOutPort( k )->InPorts( n )->PortName()
+ << " " << aKindOfSchema << " " << aKindOfInterpolation << " " << aKindOfExtrapolation
+ << " ;" << endl ;
+ }
+ }
+ }
+ }
+ }
+ f << " FIN" << endl ;
+ f << endl ;
+ f << "FIN" << endl ;
+ }
+ cdebug_out << "GraphBase::StreamGraph::CreateStreamTopology()" << endl;
+ return true ;
+}
+
+ostream & operator<< (ostream & f ,const SUPERV::KindOfDataStreamTrace & s ) {
+ switch (s) {
+ case SUPERV::WithoutTrace :
+ f << "WithoutTrace";
+ break;
+ case SUPERV::SummaryTrace :
+ f << "SummaryTrace";
+ break;
+ case SUPERV::DetailedTrace :
+ f << "DetailedTrace";
+ break;
+ default :
+ f << "UndefinedKindOfDataStreamTrace";
+ break;
+ }
+
+ return f;
+}
+
+
--- /dev/null
+// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : DataFlowBase_StreamGraph.hxx
+// Author : Jean Rahuel
+// Module : SUPERV
+// $Header:
+
+#ifndef _DATAFLOWBASE_STREAMGRAPH_HXX
+#define _DATAFLOWBASE_STREAMGRAPH_HXX
+
+#include "DataFlowBase_Graph.hxx"
+
+namespace GraphBase {
+
+ class StreamGraph : public Graph {
+
+ private:
+
+// Configuration :
+// The name is the name of the graph
+ long _Timeout ;
+ SUPERV::KindOfDataStreamTrace _DataStreamTrace ;
+ double _DeltaTime ;
+
+// Total number of SubStreamGraphs
+ int _SubStreamGraphsNumber ;
+
+ protected:
+
+ public:
+
+ StreamGraph() ;
+
+ StreamGraph( CORBA::ORB_ptr ORB ,
+ SALOME_NamingService* ptrNamingService ,
+ const char * DataFlowName ,
+ int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) ;
+
+ StreamGraph( CORBA::ORB_ptr ORB ,
+ SALOME_NamingService * ptrNamingService ,
+ const SALOME_ModuleCatalog::Service & DataFlowService ,
+ const char * DataFlowComponentName ,
+ const char * DataFlowInterfaceName ,
+ const char * DataFlowName ,
+ const SUPERV::KindOfNode DataFlowkind ,
+ const SUPERV::SDate DataFlowFirstCreation ,
+ const SUPERV::SDate DataFlowLastModification ,
+ const char * DataFlowEditorRelease ,
+ const char * DataFlowAuthor ,
+ const char * DataFlowComputer ,
+ const char * DataFlowComment ,
+ int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) ;
+
+ ~StreamGraph() ;
+
+ bool SetStreamParams( const long Timeout ,
+ const SUPERV::KindOfDataStreamTrace DataStreamTrace ,
+ const double DeltaTime ) ;
+ void StreamParams( long & Timeout ,
+ SUPERV::KindOfDataStreamTrace & DataStreamTrace ,
+ double & DeltaTime ) const ;
+
+ bool CreateStreamTopology( const char * aDirectory ) ;
+
+ void SubStreamGraphsNumber( int SubStreamGraphsNumber ) {
+ _SubStreamGraphsNumber = SubStreamGraphsNumber ; } ;
+ long SubStreamGraphsNumber() const {
+ return _SubStreamGraphsNumber ; } ;
+
+ };
+
+};
+
+ostream & operator<< (ostream &,const SUPERV::KindOfDataStreamTrace &);
+
+#endif
--- /dev/null
+// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : DataFlowBase_StreamNode.cxx
+// Author : Jean Rahuel
+// Module : SUPERV
+// $Header:
+
+using namespace std;
+
+#include "DataFlowBase_StreamNode.hxx"
+
+GraphBase::StreamNode::StreamNode() :
+ GraphBase::PortsOfNode::PortsOfNode() {
+ _Name = NULL ;
+ _LinkedNodesSize = 0 ;
+ _LinkedStreamNodesSize = 0 ;
+ _HeadNode = false ;
+ _SubGraphNumber = 0 ;
+ _SubStreamGraphNumber = 0 ;
+ cdebug << "GraphBase::StreamNode::StreamNode " << this << " " << endl ;
+}
+
+GraphBase::StreamNode::StreamNode( const char * NodeName ) :
+ GraphBase::PortsOfNode::PortsOfNode( NodeName ) {
+ if ( NodeName != NULLSTRING && strlen( NodeName ) ) {
+ _Name = new char[ strlen( NodeName )+1 ] ;
+ strcpy( _Name , NodeName ) ;
+ }
+ else {
+ _Name = NULLSTRING ;
+ }
+ _LinkedNodesSize = 0 ;
+ _LinkedStreamNodesSize = 0 ;
+ _HeadNode = false ;
+ _SubGraphNumber = 0 ;
+ _SubStreamGraphNumber = 0 ;
+ cdebug << "GraphBase::StreamNode::StreamNode " << NodeName << " "
+ << this << " " << endl ;
+}
+
+GraphBase::StreamNode::~StreamNode() {
+ cdebug << "GraphBase::StreamNode::~StreamNode " << this << endl ;
+}
+
+bool GraphBase::StreamNode::Name( const char * aName) {
+ cdebug_in << "GraphBase::StreamNode::Name " << _Name << endl;
+ if ( _Name ) {
+ cdebug << "GraphBase::StreamNode::ReName " << _Name << " --> " << aName << endl ;
+ delete [] _Name ;
+ }
+ _Name = new char[strlen(aName)+1] ;
+ strcpy( _Name , aName ) ;
+ cdebug_out << "GraphBase::StreamNode::Name " << _Name << endl;
+ return true ;
+}
+
+void GraphBase::StreamNode::SetSubStreamGraph( int SubStreamGraphsNumber , int & RetVal ) {
+ int jnode ;
+ cdebug_in << Name() << " GraphBase::StreamNode::SetSubStreamGraph Level "<< Level() << " SortedIndex "
+ << SortedIndex() << " SubStreamGraphsNumber " << SubStreamGraphsNumber << " RetVal " << RetVal
+ << endl ;
+ if ( SubStreamGraph() == 0 || SubStreamGraph() == SubStreamGraphsNumber ) {
+ SubStreamGraph( SubStreamGraphsNumber ) ;
+ cdebug << Name() << " SubStreamGraph " << SubStreamGraph() << " SetSubStreamGraph LinkedStreamNodesSize "
+ << LinkedStreamNodesSize() << endl ;
+ for ( jnode = 0 ; jnode < LinkedStreamNodesSize() ; jnode++ ) {
+ if ( LinkedStreamNodes( jnode )->Level() > Level() ||
+ ( LinkedStreamNodes( jnode )->Level() == Level() &&
+ LinkedStreamNodes( jnode )->SortedIndex() > SortedIndex() ) ) {
+ LinkedStreamNodes( jnode )->SetSubStreamGraph( SubStreamGraphsNumber , RetVal ) ;
+ if ( RetVal != SubStreamGraphsNumber ) {
+ break ;
+ }
+ }
+ else if ( LinkedStreamNodes( jnode )->SubStreamGraph() == 0 ) {
+ LinkedStreamNodes( jnode )->SubStreamGraph( SubStreamGraphsNumber ) ;
+ cdebug << LinkedStreamNodes( jnode )->Name() << " SubStreamGraph "
+ << LinkedStreamNodes( jnode )->SubStreamGraph() << endl ;
+ }
+ else if ( LinkedStreamNodes( jnode )->SubStreamGraph() != SubStreamGraphsNumber ) {
+ cdebug << LinkedStreamNodes( jnode )->Name() << " SubStreamGraph "
+ << LinkedStreamNodes( jnode )->SubStreamGraph() << " != " << SubStreamGraphsNumber << endl ;
+ RetVal = LinkedStreamNodes( jnode )->SubStreamGraph() ;
+ break ;
+ }
+ }
+ }
+ else {
+ cdebug << Name() << " SubStreamGraph " << SubStreamGraph() << " != " << SubStreamGraphsNumber << endl ;
+ RetVal = SubStreamGraph() ;
+ }
+
+ cdebug_out << Name() << "->GraphBase::StreamNode::SetSubStreamGraph RetVal " << RetVal << endl ;
+ return ;
+}
+
+void GraphBase::StreamNode::AddLink( GraphBase::StreamNode * ToNode ) {
+ int index = GetLinkedNodeIndex( ToNode->Name() ) ;
+ if ( index < 0 ) {
+ cdebug << Name() << "->GraphBase::StreamNode::AddLinkedNode( " << ToNode->Name()
+ << " ) new LinkedNode " << endl ;
+ _LinkedNodes.resize( _LinkedNodesSize+1 ) ;
+ _LinkedInPortsNumber.resize( _LinkedNodesSize+1 ) ;
+ _LinkedNodes[ _LinkedNodesSize ] = ToNode ;
+ _LinkedInPortsNumber[ _LinkedNodesSize ] = 1 ;
+ SetLinkedNodeIndex( ToNode->Name() , _LinkedNodesSize ) ;
+ index = _LinkedNodesSize ;
+ _LinkedNodesSize++ ;
+ }
+ else {
+ cdebug << Name() << "->GraphBase::StreamNode::AddLinkedNode( " << ToNode->Name()
+ << " ) old LinkedNode " << _LinkedNodes[index ]->Name() << endl ;
+ _LinkedInPortsNumber[ index ] += 1 ;
+ }
+ cdebug << Name() << "->GraphBase::StreamNode::AddLinkedNode( " << ToNode->Name()
+ << " ) LinkedNodesSize " << _LinkedNodesSize << " [ " << index
+ << " ] _LinkedInPortsNumber " << _LinkedInPortsNumber[ index ] << endl ;
+}
+
+bool GraphBase::StreamNode::RemoveLink( GraphBase::StreamNode * ToNode ) {
+ int index = GetLinkedNodeIndex( ToNode->Name() ) ;
+ if ( index >= 0 ) {
+ cdebug << "GraphBase::StreamNode::RemoveLink( to " << ToNode->Name() << " from "
+ << Name() << " index : " << index << " LinkedInPortsNumber "
+ << _LinkedInPortsNumber[ index ] << " - 1" << endl ;
+ _LinkedInPortsNumber[ index ] -= 1 ;
+ if ( _LinkedInPortsNumber[ index ] == 0 ) {
+ _LinkedNodesSize-- ;
+ cdebug << "GraphBase::StreamNode::RemoveLink new LinkedNodesSize "
+ << _LinkedNodesSize << " " << ToNode->Name() << " removed from "
+ << " linkednodes of " << Name() << endl ;
+ int i ;
+ for ( i = index ; i < _LinkedNodesSize ; i++ ) {
+ _LinkedNodes[ i ] = _LinkedNodes[ i+1 ] ;
+ _LinkedInPortsNumber[ i ] = _LinkedInPortsNumber[ i+1 ] ;
+ SetLinkedNodeIndex( _LinkedNodes[ i ]->Name() , i ) ;
+ }
+ DelLinkedNodeIndex( ToNode->Name() ) ;
+ _LinkedNodes.resize( _LinkedNodesSize+1 ) ;
+ _LinkedInPortsNumber.resize( _LinkedNodesSize+1 ) ;
+ }
+ }
+ else {
+ cdebug << " Error index " << index << endl ;
+ }
+ return (index >= 0 ) ;
+}
+
+void GraphBase::StreamNode::ReNameLink( const char* OldNodeName ,
+ const char* NewNodeName ) {
+ cdebug_in << "GraphBase::StreamNode::ReNameLink (" << OldNodeName << " , "
+ << NewNodeName << ")" << endl;
+ int index = GetLinkedNodeIndex( OldNodeName ) ;
+ if ( index >= 0 ) {
+// _MapOfLinkedNodes.erase( OldNodeName ) ;
+ DelLinkedNodeIndex( OldNodeName ) ;
+ SetLinkedNodeIndex( NewNodeName , index ) ;
+ }
+ cdebug_out << "GraphBase::StreamNode::ReNameLink" << endl ;
+}
+
+void GraphBase::StreamNode::AddStreamLink( GraphBase::StreamNode * ToNode ) {
+ int index = GetLinkedStreamNodeIndex( ToNode->Name() ) ;
+ if ( index < 0 ) {
+ cdebug_in << Name() << "->GraphBase::StreamNode::AddStreamLink( " << ToNode->Name()
+ << " ) new LinkedNode " << endl ;
+ _LinkedStreamNodes.resize( _LinkedStreamNodesSize+1 ) ;
+ _LinkedInStreamPortsNumber.resize( _LinkedStreamNodesSize+1 ) ;
+ _LinkedStreamNodes[ _LinkedStreamNodesSize ] = ToNode ;
+ _LinkedInStreamPortsNumber[ _LinkedStreamNodesSize ] = 1 ;
+ SetLinkedStreamNodeIndex( ToNode->Name() , _LinkedStreamNodesSize ) ;
+ index = _LinkedStreamNodesSize ;
+ _LinkedStreamNodesSize++ ;
+ }
+ else {
+ cdebug_in << Name() << "->GraphBase::StreamNode::AddStreamLink( " << ToNode->Name()
+ << " ) old LinkedNode " << _LinkedStreamNodes[index ]->Name() << endl ;
+ _LinkedInStreamPortsNumber[ index ] += 1 ;
+ }
+ cdebug_out << Name() << "->GraphBase::StreamNode::AddStreamLinkedNode( " << ToNode->Name()
+ << " ) LinkedStreamNodesSize " << _LinkedStreamNodesSize << " [ " << index
+ << " ] _LinkedInStreamPortsNumber " << _LinkedInStreamPortsNumber[ index ] << endl ;
+}
+
+bool GraphBase::StreamNode::RemoveStreamLink( GraphBase::StreamNode * ToNode ) {
+ int index = GetLinkedStreamNodeIndex( ToNode->Name() ) ;
+ if ( index >= 0 ) {
+ cdebug << "GraphBase::StreamNode::RemoveStreamLink( to " << ToNode->Name() << " from "
+ << Name() << " index : " << index << " LinkedInStreamPortsNumber "
+ << _LinkedInStreamPortsNumber[ index ] << " - 1" << endl ;
+ _LinkedInStreamPortsNumber[ index ] -= 1 ;
+ if ( _LinkedInStreamPortsNumber[ index ] == 0 ) {
+ _LinkedStreamNodesSize-- ;
+ cdebug << "GraphBase::StreamNode::RemoveStreamLink new LinkedNodesSize "
+ << _LinkedStreamNodesSize << " " << ToNode->Name() << " removed from "
+ << " linkednodes of " << Name() << endl ;
+ int i ;
+ for ( i = index ; i < _LinkedStreamNodesSize ; i++ ) {
+ _LinkedStreamNodes[ i ] = _LinkedStreamNodes[ i+1 ] ;
+ _LinkedInStreamPortsNumber[ i ] = _LinkedInStreamPortsNumber[ i+1 ] ;
+ SetLinkedStreamNodeIndex( _LinkedStreamNodes[ i ]->Name() , i ) ;
+ }
+ DelLinkedStreamNodeIndex( ToNode->Name() ) ;
+ _LinkedStreamNodes.resize( _LinkedStreamNodesSize+1 ) ;
+ _LinkedInStreamPortsNumber.resize( _LinkedStreamNodesSize+1 ) ;
+ }
+ }
+ else {
+ cdebug << " Error index " << index << endl ;
+ }
+ return (index >= 0 ) ;
+}
+
+void GraphBase::StreamNode::ReNameStreamLink( const char* OldNodeName ,
+ const char* NewNodeName ) {
+ cdebug_in << "GraphBase::StreamNode::ReNameStreamLink (" << OldNodeName << " , "
+ << NewNodeName << ")" << endl;
+ int index = GetLinkedStreamNodeIndex( OldNodeName ) ;
+ if ( index >= 0 ) {
+// _MapOfLinkedNodes.erase( OldNodeName ) ;
+ DelLinkedStreamNodeIndex( OldNodeName ) ;
+ SetLinkedStreamNodeIndex( NewNodeName , index ) ;
+ }
+ cdebug_out << "GraphBase::StreamNode::ReNameStreamLink" << endl ;
+}
+
--- /dev/null
+// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : DataFlowBase_StreamNode.hxx
+// Author : Jean Rahuel
+// Module : SUPERV
+// $Header:
+
+#ifndef _DATAFLOWBASE_STREAMNODE_HXX
+#define _DATAFLOWBASE_STREAMNODE_HXX
+
+#include "DataFlowBase_PortsOfNode.hxx"
+
+namespace GraphBase {
+
+ class StreamNode : public PortsOfNode {
+
+ private:
+
+ char * _Name ;
+ SUPERV::KindOfNode _Kind ;
+
+// Nodes with LinkedInPortsNumber InPort(s) linked to Outport(s) of this node :
+ map< string , int > _MapOfLinkedNodes ;
+ int _LinkedNodesSize ;
+ vector<StreamNode * > _LinkedNodes ;
+ vector<int > _LinkedInPortsNumber ;
+
+// Nodes with InStreamPort(s) linked to OutStreamport(s) of this node :
+// NodeName <--> index of that linked node in _LinkedNodes
+ map< string , int > _MapOfLinkedStreamNodes ;
+ int _LinkedStreamNodesSize ;
+ vector<StreamNode * > _LinkedStreamNodes ;
+ vector<int > _LinkedInStreamPortsNumber ;
+
+ bool _HeadNode ;
+ int _LevelNumber ;
+ int _SortedIndex ;
+
+ int _SubGraphNumber ;
+ int _SubStreamGraphNumber ;
+
+ protected:
+
+ int * _Graph_prof_debug ;
+ ofstream * _Graph_fdebug ;
+
+ StreamNode() ;
+
+ StreamNode( const char * NodeName ) ;
+
+ StreamNode( int * Graph_prof_debug ,
+ ofstream * Graph_fdebug ) ;
+
+ virtual ~StreamNode() ;
+
+ public:
+
+ char * Name() const { return my_strdup( _Name ) ; } ;
+ const char *const * NamePtr() const { return &_Name ; } ;
+ bool Name( const char * aName ) ;
+
+ SUPERV::KindOfNode Kind() const {
+ return _Kind; } ;
+ bool Kind( SUPERV::KindOfNode aKind) {
+ _Kind = aKind ;
+ return true ; } ;
+ const bool IsComputingNode() const {
+ return (Kind() == SUPERV::ComputingNode ) ; } ;
+ const bool IsFactoryNode() const {
+ return (Kind() == SUPERV::FactoryNode ) ; } ;
+ const bool IsOneOfGOTONodes() const {
+ return (Kind() == SUPERV::LoopNode ||
+ Kind() == SUPERV::EndLoopNode ||
+ Kind() == SUPERV::SwitchNode ||
+ Kind() == SUPERV::EndSwitchNode ||
+ Kind() == SUPERV::GOTONode ) ; } ;
+ const bool IsOneOfInLineNodes() const {
+ return (Kind() == SUPERV::InLineNode || IsOneOfGOTONodes() ) ; } ;
+ const bool IsInLineNode() const {
+ return (Kind() == SUPERV::InLineNode ) ; } ;
+ const bool IsDataFlowNode() const {
+ return (Kind() == SUPERV::DataFlowGraph ) ; } ;
+ const bool IsDataStreamNode() const {
+ return (Kind() == SUPERV::DataStreamGraph ) ; } ;
+ const bool IsLoopNode() const {
+ return (Kind() == SUPERV::LoopNode ) ; } ;
+ const bool IsEndLoopNode() const {
+ return (Kind() == SUPERV::EndLoopNode ) ; } ;
+ const bool IsSwitchNode() const {
+ return (Kind() == SUPERV::SwitchNode ) ; } ;
+ const bool IsEndSwitchNode() const {
+ return (Kind() == SUPERV::EndSwitchNode ) ; } ;
+ const bool IsGOTONode() const {
+ return (Kind() == SUPERV::GOTONode ) ; } ;
+
+ int GetLinkedNodeIndex( const char * name ) {
+ int index = _MapOfLinkedNodes[ name ] -1 ;
+ if ( index >= 0 ) {
+ cdebug << "GetLinkedNodeIndex of " << name
+ << " in _MapOfLinkedNodes : "
+ << index << " Node " << hex << (void *) _LinkedNodes[ index ]
+ << dec << " '" << _LinkedNodes[ index ]->Name() << "'"
+ << endl ;
+ }
+ return index ; } ;
+ void SetLinkedNodeIndex( const char * name , const int index ) {
+ _MapOfLinkedNodes[ name ] = index +1 ;
+ cdebug << "SetLinkedNodeIndex of " << name << " in _MapOfLinkedNodes : "
+ << index << " Node " << hex << (void *) _LinkedNodes[ index ]
+ << dec << " '" << _LinkedNodes[ index ]->Name() << "'"
+ << " _MapOfLinkedNodes " << _MapOfLinkedNodes[ name ] - 1
+ << endl ;
+ } ;
+ void DelLinkedNodeIndex( const char * name ) {
+ _MapOfLinkedNodes.erase( name ) ; } ;
+
+ int LinkedNodesSize() const { return _LinkedNodesSize ; } ;
+
+ const int LinkedInPortsNumber( int i ) const { return _LinkedInPortsNumber[ i ] ; } ;
+
+ StreamNode * LinkedNodes( int i ) const { return _LinkedNodes[ i ] ; } ;
+
+ int GetLinkedStreamNodeIndex( const char * name ) {
+ int index = _MapOfLinkedStreamNodes[ name ] -1 ;
+ if ( index >= 0 ) {
+ cdebug << "GetLinkedStreamNodeIndex of " << name
+ << " in _MapOfLinkedStreamNodes : "
+ << index << " Node " << hex << (void *) _LinkedStreamNodes[ index ]
+ << dec << " '" << _LinkedStreamNodes[ index ]->Name() << "'"
+ << endl ;
+ }
+ return index ; } ;
+ void SetLinkedStreamNodeIndex( const char * name , const int index ) {
+ _MapOfLinkedStreamNodes[ name ] = index +1 ;
+ cdebug << "SetLinkedStreamNodeIndex of " << name << " in _MapOfLinkedStreamNodes : "
+ << index << " Node " << hex << (void *) _LinkedStreamNodes[ index ]
+ << dec << " '" << _LinkedStreamNodes[ index ]->Name() << "'"
+ << " _MapOfLinkedStreamNodes " << _MapOfLinkedStreamNodes[ name ] - 1
+ << endl ;
+ } ;
+ void DelLinkedStreamNodeIndex( const char * name ) {
+ _MapOfLinkedStreamNodes.erase( name ) ; } ;
+
+ int LinkedStreamNodesSize() const { return _LinkedStreamNodesSize ; } ;
+
+ const int LinkedInStreamPortsNumber( int i ) const { return _LinkedInStreamPortsNumber[ i ] ; } ;
+
+ StreamNode * LinkedStreamNodes( int i ) const { return _LinkedStreamNodes[ i ] ; } ;
+
+ void HeadNode( bool aHeadNode ) { _HeadNode = aHeadNode ; } ;
+ const bool IsHeadNode() const { return _HeadNode ; } ;
+
+ int Level() { return _LevelNumber ; } ;
+ void Level( int LevelNumber ) {
+ _LevelNumber = LevelNumber ; } ;
+
+ void SortedIndex( int aSortedIndex ) {
+ _SortedIndex = aSortedIndex ; } ;
+ int SortedIndex() const {
+ return _SortedIndex ; } ;
+
+ void SetSubStreamGraph( int SubStreamGraphsNumber , int & RetVal ) ;
+
+ int SubGraph() { return _SubGraphNumber ; } ;
+ void SubGraph( int SubGraphNumber ) {
+ _SubGraphNumber = SubGraphNumber ; } ;
+
+ int SubStreamGraph() { return _SubStreamGraphNumber ; } ;
+ void SubStreamGraph( int SubStreamGraphNumber ) {
+ _SubStreamGraphNumber = SubStreamGraphNumber ; } ;
+
+ void AddLink( StreamNode * aNode ) ;
+ bool RemoveLink( StreamNode * aNode ) ;
+ void ReNameLink( const char* OldNodeName ,
+ const char* NewNodeName ) ;
+
+ void AddStreamLink( StreamNode * aNode ) ;
+ bool RemoveStreamLink( StreamNode * aNode ) ;
+ void ReNameStreamLink( const char* OldNodeName ,
+ const char* NewNodeName ) ;
+
+ };
+
+};
+
+#endif
depth -= 1 ;
#if TRACE
- MESSAGE( " ==========endElement step[" << depth << "]="
+ MESSAGE( " ====================endElement step[" << depth << "]="
<< step[depth] << " qName " << qName << " fieldvalue '"
<< fieldvalue[depth] << "'")
#endif
step[3] = 0 ;
aNode.theService.ServiceinParameter.length( 0 ) ;
aNode.theService.ServiceoutParameter.length( 0 ) ;
- aNode.theListOfParameters.resize( 0 ) ;
+ aNode.theListOfInDataStreams.resize( 0 ) ;
+ aNode.theListOfOutDataStreams.resize( 0 ) ;
aNode.theListOfFuncName.resize( 0 ) ;
aNode.theListOfPythonFunctions.resize( 0 ) ;
break ;
// kind ok
sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theKind ) ;
fieldvalue[depth] = NULLSTRING ;
+ if ( aNode.theKind != SUPERV::DataStreamGraph ) {
+ step[depth]++ ;
+ step[4] = 0 ;
+ }
+ break ;
+ }
+ else if ( qName == "streamgraph-timeout" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth3-3" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theTimeout ) ;
+ fieldvalue[depth] = NULLSTRING ;
+// step[depth]++ ;
+// step[4] = 0 ;
+ break ;
+ }
+ else if ( qName == "streamgraph-datastreamtrace" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth3-3" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theDataStreamTrace ) ;
+ fieldvalue[depth] = NULLSTRING ;
+// step[depth]++ ;
+// step[4] = 0 ;
+ break ;
+ }
+ else if ( qName == "streamgraph-deltatime" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth3-3" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() ,"%lf" , (int * ) &aNode.theDeltaTime ) ;
+ fieldvalue[depth] = NULLSTRING ;
step[depth]++ ;
step[4] = 0 ;
+ break ;
}
- else
- return returnfalse( this , "depth3-3" , qName ) ;
- break ;
+ else {
+ step[depth]++ ;
+ step[4] = 0 ;
+ }
+// return returnfalse( this , "depth3-3" , qName ) ;
+// break ;
case 4 :
if ( qName == "coupled-node" ) {
if ( fieldvalue[depth] == NULLSTRING )
return returnfalse( this , "depth3-5" , qName ) ;
break ;
case 6 :
- if ( qName == "Parameter-list" ) {
+ if ( qName == "DataStream-list" || qName == "Parameter-list" ) {
if ( fieldvalue[depth] != NULLSTRING )
return returnfalse( this , "depth3-6" , qName ) ;
fieldvalue[depth] = NULLSTRING ;
if ( qName == "inParameter" ) {
if ( fieldvalue[depth] != NULLSTRING )
return returnfalse( this , "depth4-6" , qName ) ;
- int size = aNode.theListOfParameters.size() ;
- aNode.theListOfParameters.resize( size+1 ) ;
- aNode.theListOfParameters[size].theInParameter = aParameter ;
- step[depth]++ ;
+ int size = aNode.theListOfInDataStreams.size() ;
+ aNode.theListOfInDataStreams.resize( size+1 ) ;
+ aNode.theListOfInDataStreams[ size ] = anInDataStreamParameter ;
+ break ;
// One more aParameter input
}
else
- return returnfalse( this , "depth4-6" , qName ) ;
- break ;
+ step[depth]++ ;
+// return returnfalse( this , "depth4-6" , qName ) ;
+// break ;
case 7 :
if ( qName == "outParameter" ) {
if ( fieldvalue[depth] != NULLSTRING )
return returnfalse( this , "depth4-7" , qName ) ;
- int size = aNode.theListOfParameters.size() ;
- aNode.theListOfParameters[size-1].theOutParameter = aParameter ;
+ int size = aNode.theListOfOutDataStreams.size() ;
+ aNode.theListOfOutDataStreams.resize( size+1 ) ;
+ aNode.theListOfOutDataStreams[ size ] = anOutDataStreamParameter ;
// One more aParameter output
step[4] = 6 ;
step[5] = 4 ;
if ( qName == "inParameter-type" ) {
if ( fieldvalue[depth] == NULLSTRING )
return returnfalse( this , "depth5-4" , qName ) ;
- if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
- aParameter.Parametertype = fieldvalue[depth].c_str() ;
- }
- else {
- aParameter.Parametertype = "" ;
- }
+ sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theDataStreamParameter.Parametertype ) ;
fieldvalue[depth] = NULLSTRING ;
step[depth]++ ;
+#if TRACE
+ cout << "InDataStreamParameter.inParameter-type " << anInDataStreamParameter.theDataStreamParameter.Parametertype << " step[" << depth << "]" << step[depth] << endl ;
+#endif
+ break ;
}
else
- return returnfalse( this , "depth5-4" , qName ) ;
- break ;
+ step[depth] = 6 ;
+// return returnfalse( this , "depth5-4" , qName ) ;
+// break ;
case 5 :
if ( qName == "inParameter-name" ) {
if ( fieldvalue[depth] == NULLSTRING )
return returnfalse( this , "depth5-5" , qName ) ;
if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
- aParameter.Parametername = fieldvalue[depth].c_str() ;
+ anInDataStreamParameter.theDataStreamParameter.Parametername = fieldvalue[depth].c_str() ;
}
else {
- aParameter.Parametername = "" ;
+ anInDataStreamParameter.theDataStreamParameter.Parametername = "" ;
}
fieldvalue[depth] = NULLSTRING ;
- step[depth]++ ;
+#if TRACE
+ cout << "InDataStreamParameter.inParameter-name " << anInDataStreamParameter.theDataStreamParameter.Parametername << " step[" << depth << "]" << step[depth] << endl ;
+#endif
+// step[depth]++ ;
+// step[depth] = 4 ;
+ break ;
}
- else
- return returnfalse( this , "depth5-5" , qName ) ;
- break ;
+ else if ( qName == "inParameter-dependency" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth5-5" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theDataStreamParameter.Parameterdependency ) ;
+ fieldvalue[depth] = NULLSTRING ;
+#if TRACE
+ cout << "InDataStreamParameter.inParameter-dependency " << anInDataStreamParameter.theDataStreamParameter.Parameterdependency << " step[" << depth << "]"
+ << step[depth] << endl ;
+#endif
+// step[depth]++ ;
+// step[depth] = 4 ;
+ break ;
+ }
+ else if ( qName == "inParameter-schema" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth5-5" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfSchema ) ;
+ fieldvalue[depth] = NULLSTRING ;
+#if TRACE
+ cout << "InDataStreamParameter.inParameter-schema " << anInDataStreamParameter.theKindOfSchema << " step[" << depth << "]"
+ << step[depth] << endl ;
+#endif
+// step[depth]++ ;
+// step[depth] = 4 ;
+ break ;
+ }
+ else if ( qName == "inParameter-interpolation" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth5-5" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfInterpolation ) ;
+ fieldvalue[depth] = NULLSTRING ;
+#if TRACE
+ cout << "InDataStreamParameter.inParameter-interpolation " << anInDataStreamParameter.theKindOfInterpolation << " step[" << depth << "]"
+ << step[depth] << endl ;
+#endif
+// step[depth]++ ;
+// step[depth] = 4 ;
+ break ;
+ }
+ else if ( qName == "inParameter-extrapolation" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth5-5" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfExtrapolation ) ;
+ fieldvalue[depth] = NULLSTRING ;
+// step[depth]++ ;
+ step[depth] = 4 ;
+#if TRACE
+ cout << "InDataStreamParameter.inParameter-extrapolation " << anInDataStreamParameter.theKindOfExtrapolation << " step[" << depth << "]"
+ << step[depth] << endl ;
+#endif
+ break ;
+ }
+// else
+// return returnfalse( this , "depth5-5" , qName ) ;
+// break ;
case 6 :
if ( qName == "outParameter-type" ) {
if ( fieldvalue[depth] == NULLSTRING )
return returnfalse( this , "depth5-6" , qName ) ;
- if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
- aParameter.Parametertype = fieldvalue[depth].c_str() ;
- }
- else {
- aParameter.Parametertype = "" ;
- }
+ sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theDataStreamParameter.Parametertype ) ;
fieldvalue[depth] = NULLSTRING ;
- step[depth]++ ;
+// step[depth]++ ;
+ step[depth] = 7 ;
+#if TRACE
+ cout << "OutDataStreamParameter.outParameter-type " << anOutDataStreamParameter.theDataStreamParameter.Parametertype << " step[" << depth << "]"
+ << step[depth] << endl ;
+#endif
}
else
return returnfalse( this , "depth5-6" , qName ) ;
if ( fieldvalue[depth] == NULLSTRING )
return returnfalse( this , "depth5-7" , qName ) ;
if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
- aParameter.Parametername = fieldvalue[depth].c_str() ;
+ anOutDataStreamParameter.theDataStreamParameter.Parametername = fieldvalue[depth].c_str() ;
}
else {
- aParameter.Parametername = "" ;
+ anOutDataStreamParameter.theDataStreamParameter.Parametername = "" ;
}
fieldvalue[depth] = NULLSTRING ;
- step[depth]++ ;
+#if TRACE
+ cout << "OutDataStreamParameter.outParameter-name " << anOutDataStreamParameter.theDataStreamParameter.Parametername << " step[" << depth << "]"
+ << step[depth] << endl ;
+#endif
+// step[depth]++ ;
+// step[depth] = 6 ;
+ }
+ else if ( qName == "outParameter-dependency" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth5-7" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theDataStreamParameter.Parameterdependency ) ;
+ fieldvalue[depth] = NULLSTRING ;
+#if TRACE
+ cout << "OutDataStreamParameter.outParameter-dependency " << anOutDataStreamParameter.theDataStreamParameter.Parameterdependency << " step[" << depth << "]"
+ << step[depth] << endl ;
+#endif
+// step[depth]++ ;
+// step[depth] = 6 ;
+ }
+ else if ( qName == "outParameter-values" ) {
+ if ( fieldvalue[depth] == NULLSTRING )
+ return returnfalse( this , "depth5-7" , qName ) ;
+ sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theNumberOfValues ) ;
+ fieldvalue[depth] = NULLSTRING ;
+// step[depth]++ ;
+ step[depth] = 6 ;
+#if TRACE
+ cout << "OutDataStreamParameter.outParameter-values " << anOutDataStreamParameter.theNumberOfValues << " step[" << depth << "]"
+ << step[depth] << endl ;
+#endif
}
else
return returnfalse( this , "depth5-7" , qName ) ;
}
}
+#if TRACE
+ cout << "return from endElement " << qName << " step[" << depth << "]" << step[depth] << endl ;
+#endif
return TRUE;
}
bool constructor ;
GraphBase::SNode aNode ;
SALOME_ModuleCatalog::ServicesParameter aParameter ;
+ GraphBase::InDataStreamParameter anInDataStreamParameter ;
+ GraphBase::OutDataStreamParameter anOutDataStreamParameter ;
+// SALOME_ModuleCatalog::ServicesDataStreamParameter aDataStreamParameter ;
SUPERV::ListOfStrings aPythonFunction ;
GraphBase::SLink aLink ;
// SALOME_SuperVisionBase::ServicesParameterValue aLinkValue ;
DataFlowBase_Port.hxx \
DataFlowBase_DataPort.hxx \
DataFlowBase_InPort.hxx \
+ DataFlowBase_InDataStreamPort.hxx \
DataFlowBase_OutPort.hxx \
+ DataFlowBase_OutDataStreamPort.hxx \
DataFlowBase_Service.hxx \
DataFlowBase_PortsOfNode.hxx \
+ DataFlowBase_StreamNode.hxx \
DataFlowBase_ComputingNode.hxx \
DataFlowBase_FactoryNode.hxx \
DataFlowBase_InLineNode.hxx \
DataFlowBase_EndOfSwitchNode.hxx \
DataFlowBase_DataNode.hxx \
DataFlowBase_XmlHandler.hxx \
+ DataFlowBase_StreamGraph.hxx \
DataFlowBase_Graph.hxx
# Libraries targets
DataFlowBase_Port.cxx \
DataFlowBase_DataPort.cxx \
DataFlowBase_InPort.cxx \
+ DataFlowBase_InDataStreamPort.cxx \
DataFlowBase_OutPort.cxx \
+ DataFlowBase_OutDataStreamPort.cxx \
DataFlowBase_Service.cxx \
DataFlowBase_PortsOfNode.cxx \
+ DataFlowBase_StreamNode.cxx \
DataFlowBase_ComputingNode.cxx \
DataFlowBase_FactoryNode.cxx \
DataFlowBase_InLineNode.cxx \
DataFlowBase_DataNode.cxx \
DataFlowBase_XmlHandler.cxx \
DataFlowBase_LoadXml.cxx \
+ DataFlowBase_StreamGraph.cxx \
DataFlowBase_Graph.cxx
LIB_CLIENT_IDL = Logger.idl \
CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \
-I${KERNEL_ROOT_DIR}/include/salome
-#CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42
CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
-I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS= -L../../lib/salome $(CORBA_LIBS) -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace \
-lc $(PYTHON_LIBS) $(QT_MT_LIBS) $(OGL_LIBS) \
-L${KERNEL_ROOT_DIR}/lib/salome
-#LDFLAGS= -L../../../lib $(CORBA_LIBS) -lomniORB4 -lomniDynamic4 -lomnithread -lCOS4 -lCOSDynamic4 -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSalomeLoggerServer -lc $(QT_MT_LIBS)
+//LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
@CONCLUDE@
GraphEditor::DataFlow::DataFlow( CORBA::ORB_ptr ORB,
SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ,
- const char * DebugFileName ) :
- OutNode( ORB, ptrNamingService , DataFlowName , DebugFileName ) {
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode ) :
+ OutNode( ORB, ptrNamingService , DataFlowName , DebugFileName , aKindOfNode ) {
// cout << "GraphEditor::DataFlow::DataFlow(" ;
cdebug_in << "GraphEditor::DataFlow::DataFlow(" ;
if ( DataFlowName ) {
DataFlow();
DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService * ptrNamingService ,
const char * DataFlowName ,
- const char * DebugFileName );
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode );
DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService * ptrNamingService ,
const SALOME_ModuleCatalog::Service& DataFlowService ,
const char * DataFlowComponentName ,
long LevelMax() ;
SUPERV::ListOfStrings * LevelNodes(long aLevel ) ;
long ThreadsMax() ;
- long GraphsNumber() ;
+ long SubGraphsNumber() ;
+ long SubStreamGraphsNumber() ;
void Executor(GraphExecutor::DataFlow * DataFlowExecutor ) ;
GraphExecutor::DataFlow * GraphEditor::DataFlow::Executor() const ;
inline char * GraphEditor::DataFlow::DataNodeInfo() {
ostringstream s;
IsValid() ;
- GraphBase::DataNode::DataNodeInfo( s ) ;
+ Graph()->DataNodeInfo( s ) ;
return CORBA::string_dup( s.str().c_str() );
}
inline char * GraphEditor::DataFlow::NodeInfo( const char * aNodeName ) {
ostringstream s;
- if ( GetGraphNode( aNodeName ) )
- GetGraphNode( aNodeName )->NodeInfo( s ) ;
+ if ( Graph()->GetGraphNode( aNodeName ) )
+ Graph()->GetGraphNode( aNodeName )->NodeInfo( s ) ;
else
s << aNodeName << " not found" << ends ;
return CORBA::string_dup( s.str().c_str() );
// void DateModification() ;
-inline GraphBase::SNode * GraphEditor::DataFlow::GetInfo() const {
- return GraphEditor::OutNode::GetInfo() ;
-} ;
+//inline GraphBase::SNode * GraphEditor::DataFlow::GetInfo() const {
+// return GraphEditor::OutNode::GetInfo() ;
+//} ;
inline GraphBase::ListOfNodes * GraphEditor::DataFlow::GetNodes() const {
- return GraphEditor::OutNode::GetNodes() ;
+ return Graph()->GetNodes() ;
} ;
inline GraphBase::ListOfLinks * GraphEditor::DataFlow::GetLinks() const {
- return GraphEditor::OutNode::GetLinks() ;
+ return Graph()->GetLinks() ;
} ;
inline GraphBase::ListOfGraphs * GraphEditor::DataFlow::GetGraphs() const {
- return GraphEditor::OutNode::GetGraphs() ;
+ return Graph()->GetGraphs() ;
} ;
inline GraphBase::ListOfLinks * GraphEditor::DataFlow::GetDatas() const {
- return GraphEditor::OutNode::GetDatas() ;
+ return Graph()->GetDatas() ;
} ;
inline const SALOME_ModuleCatalog::Service * GraphEditor::DataFlow::GetService() {
IsValid() ;
- return GraphEditor::OutNode::GetService() ;
+ return Graph()->GetService() ;
} ;
inline GraphEditor::InNode * GraphEditor::DataFlow::AddNode(
inline const SALOME_ModuleCatalog::Service * GraphEditor::DataFlow::NodeService(
const char * aNodeName ) {
- if ( GetGraphNode( aNodeName ) ) {
- return GetGraphNode( aNodeName )->GetService() ;
+ if ( Graph()->GetGraphNode( aNodeName ) ) {
+ return Graph()->GetGraphNode( aNodeName )->GetService() ;
}
return NULL ;
}
const char* ToNodeName ,
const char* ToServiceParameterName ,
const CORBA::Any aValue ) {
- if ( _ReadOnly ) {
- return false ;
+ if ( !_ReadOnly ) {
+ GraphEditor::InNode * aFromNode = GetNode( FromNodeName ) ;
+ if ( aFromNode ) {
+ GraphBase::OutPort * anOutPort = aFromNode->GetChangeOutPort( FromServiceParameterName ) ;
+ if ( anOutPort ) {
+ CORBA::Any const * theValue = anOutPort->Value() ; // Keep the type !
+ _EditedAfterExecution = true ;
+ return GraphEditor::OutNode::AddLink( FromNodeName ,
+ FromServiceParameterName ,
+ ToNodeName ,
+ ToServiceParameterName ,
+ *theValue ) ;
+ }
+ }
}
- CORBA::Any const * theValue = GetNode( FromNodeName )->GetOutPort( FromServiceParameterName )->Value() ; // Keep the type !
- _EditedAfterExecution = true ;
- return GraphEditor::OutNode::AddLink( FromNodeName ,
- FromServiceParameterName ,
- ToNodeName ,
- ToServiceParameterName ,
- *theValue ) ;
+ return false ;
} ;
inline bool GraphEditor::DataFlow::GetLink(const char* ToNodeName ,
inline GraphBase::SLink * GraphEditor::DataFlow::GetLink(
GraphBase::ComputingNode * aNode ,
const char* ToServiceParameterName ) {
- return GraphBase::Graph::GetLink( aNode ,
- aNode->GetChangeInPort( ToServiceParameterName ) ) ;
+ return Graph()->GetLink( aNode , aNode->GetChangeInPort( ToServiceParameterName ) ) ;
}
inline bool GraphEditor::DataFlow::AddLinkCoord(
if ( !IsValid() ) {
return false ;
}
- return GraphBase::Graph::AddInputData( ToNodeName , ToParameterName ,
- aValue ) ;
+ return Graph()->AddInputData( ToNodeName , ToParameterName , aValue ) ;
} ;
inline bool GraphEditor::DataFlow::AddInputSharedData(const char* ToNodeName1 ,
if ( !IsValid() ) {
return 0 ;
}
- return GraphBase::Graph::LevelMax() ;
+ return Graph()->LevelMax() ;
}
inline SUPERV::ListOfStrings * GraphEditor::DataFlow::LevelNodes(long aLevel ) {
if ( !IsValid() ) {
return ((SUPERV::ListOfStrings * ) NULL ) ;
}
- return GraphBase::Graph::LevelNodes( aLevel ) ;
+ return Graph()->LevelNodes( aLevel ) ;
}
inline long GraphEditor::DataFlow::ThreadsMax() {
if ( !IsValid() ) {
return 0 ;
}
- return GraphBase::Graph::ThreadsMax() ;
+ return Graph()->ThreadsMax() ;
+}
+
+inline long GraphEditor::DataFlow::SubGraphsNumber() {
+ if ( !IsValid() ) {
+ return 0 ;
+ }
+ return Graph()->SubGraphsNumber() ;
}
-inline long GraphEditor::DataFlow::GraphsNumber() {
+inline long GraphEditor::DataFlow::SubStreamGraphsNumber() {
if ( !IsValid() ) {
return 0 ;
}
- return GraphBase::Graph::GraphsNumber() ;
+ return StreamGraph()->SubStreamGraphsNumber() ;
}
inline void GraphEditor::DataFlow::Executor(
_InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
break ;
}
- case SUPERV::DataFlowNode : {
- cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::DataFlowNode : " << NodeName << endl ;
+ case SUPERV::DataFlowGraph : {
+ cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::DataFlowGraph : " << NodeName << endl ;
+ }
+ case SUPERV::DataStreamGraph : {
+ cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::DataStreamGraph : " << NodeName << endl ;
}
case SUPERV::UnknownNode : {
cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::UnknownNode : " << NodeName << endl ;
return _ComputingNode->IsOneOfGOTONodes() ; } ;
const bool IsDataFlowNode() const {
return _ComputingNode->IsDataFlowNode() ; } ;
+ const bool IsDataStreamNode() const {
+ return _ComputingNode->IsDataStreamNode() ; } ;
const bool IsGOTONode() const {
return _ComputingNode->IsGOTONode() ; } ;
const bool IsLoopNode() const {
return _ComputingNode->GetInfo() ; } ;
GraphBase::InPort * AddInPort( const char * InputParameterName ,
- const char * InputParameterType ) {
- return _InLineNode->AddInPort( InputParameterName ,
- InputParameterType ) ; } ;
+ const char * InputParameterType ,
+ const SUPERV::KindOfPort aKindOfPort ) {
+ return _ComputingNode->AddInPort( InputParameterName ,
+ InputParameterType ,
+ aKindOfPort ) ; } ;
GraphBase::OutPort * AddOutPort( const char * OutputParameterName ,
- const char * OutputParameterType ) {
- return _InLineNode->AddOutPort( OutputParameterName ,
- OutputParameterType ) ; } ;
+ const char * OutputParameterType ,
+ const SUPERV::KindOfPort aKindOfPort ) {
+ return _ComputingNode->AddOutPort( OutputParameterName ,
+ OutputParameterType ,
+ aKindOfPort ) ; } ;
+ int IncrDataStreamInPorts() {
+ return _ComputingNode->IncrDataStreamInPorts() ;
+ } ;
+ int IncrDataStreamOutPorts() {
+ return _ComputingNode->IncrDataStreamOutPorts() ;
+ } ;
void DelInPort( const char * InputParameterName ) {
- _InLineNode->DelInPort( InputParameterName ) ; } ;
+ _ComputingNode->DelInPort( InputParameterName ) ; } ;
void DelOutPort( const char * OutputParameterName ) {
- _InLineNode->DelOutPort( OutputParameterName ) ; } ;
+ _ComputingNode->DelOutPort( OutputParameterName ) ; } ;
bool IsLinked(const char * ToServiceParameterName ) {
return _ComputingNode->IsLinked( ToServiceParameterName ) ; } ;
int SubGraph() {
return _ComputingNode->SubGraph() ; } ;
+ int SubStreamGraph() {
+ return _ComputingNode->SubStreamGraph() ; } ;
char * ComponentName() const {
return _FactoryNode->ComponentName() ; } ;
// Implementation de la classe GraphEditor::Graph
-GraphEditor::OutNode::OutNode() :
- Graph() {
+GraphEditor::OutNode::OutNode() {
+// Graph() {
cdebug_in << "GraphEditor::OutNode::OutNode()" << endl;
_Imported = false ;
GraphEditor::OutNode::OutNode( CORBA::ORB_ptr ORB ,
SALOME_NamingService * ptrNamingService ,
const char * DataFlowName ,
- const char * DebugFileName ) :
- Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) {
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode ) {
+// Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) {
+ Set_prof_debug( ORB , DebugFileName ) ;
cdebug_in << "GraphEditor::OutNode::OutNode(" ;
if ( DataFlowName ) {
cdebug << DataFlowName ;
}
cdebug << ")" << endl;
+ if ( aKindOfNode == SUPERV::DataFlowGraph ) {
+ _StreamGraph = NULL ;
+// _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;
+ _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName ,
+ _prof_debug , _fdebug ) ;
+ }
+ else if ( aKindOfNode == SUPERV::DataStreamGraph ) {
+// _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;;
+ _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName ,
+ _prof_debug , _fdebug ) ;
+ _Graph = _StreamGraph ;
+ }
_Orb = CORBA::ORB::_duplicate( ORB ) ;
_Imported = false ;
_Valid = false ;
const char * DataFlowAuthor ,
const char * DataFlowComputer ,
const char * DataFlowComment ,
- const char * DebugFileName ) :
- Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
- DataFlowInterfaceName , DataFlowName , DataFlowkind ,
- DataFlowFirstCreation , DataFlowLastModification ,
- DataFlowEditorRelease , DataFlowAuthor ,
- DataFlowComputer , DataFlowComment , DebugFileName ) {
-
+ const char * DebugFileName ) {
+// Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
+// DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+// DataFlowFirstCreation , DataFlowLastModification ,
+// DataFlowEditorRelease , DataFlowAuthor ,
+// DataFlowComputer , DataFlowComment , DebugFileName ) {
+ Set_prof_debug( ORB , DebugFileName ) ;
+
+ if ( DataFlowkind == SUPERV::DataFlowGraph ) {
+ _StreamGraph = NULL ;
+ _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
+ DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+ DataFlowFirstCreation , DataFlowLastModification ,
+ DataFlowEditorRelease , DataFlowAuthor ,
+ DataFlowComputer , DataFlowComment ,
+ _prof_debug , _fdebug ) ;
+// DataFlowComputer , DataFlowComment , DebugFileName ) ;
+ }
+ else if ( DataFlowkind == SUPERV::DataStreamGraph ) {
+ _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
+ DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+ DataFlowFirstCreation , DataFlowLastModification ,
+ DataFlowEditorRelease , DataFlowAuthor ,
+ DataFlowComputer , DataFlowComment ,
+ _prof_debug , _fdebug ) ;
+// DataFlowComputer , DataFlowComment , DebugFileName ) ;
+ _Graph = _StreamGraph ;
+ }
_Orb = CORBA::ORB::_duplicate( ORB ) ;
_Imported = false ;
_Valid = false ;
// delete _GT ;
}
+void GraphEditor::OutNode::Set_prof_debug( CORBA::ORB_ptr ORB ,
+ const char * DebugFileName ) {
+ _Graph_prof_debug = 0 ;
+ _prof_debug = 0 ;
+ if ( DebugFileName ) {
+ _fdebug = new ofstream( DebugFileName );
+ SetDebug( ORB , &_Graph_prof_debug , _fdebug ) ;
+ MESSAGE( endl << "Trace redirected to file " << DebugFileName << endl)
+ }
+}
+
bool GraphEditor::OutNode::LoadDataFlow( const GraphBase::SGraph *aDataFlow ) {
bool RetVal = false ;
cdebug_in << "GraphEditor::OutNode::LoadDataFlow() " << aDataFlow->Info.theName.c_str()
- << endl;
+ << " GraphNodesSize " << Graph()->GraphNodesSize() << endl;
if ( !_Imported ) {
RetVal = LoadInfo( aDataFlow->Info ) ;
_Imported = true ;
}
- else {
+ else if ( aDataFlow->Info.theKind == Graph()->Kind() ) {
RetVal = true ;
}
+ cdebug << "GraphEditor::OutNode::LoadDataFlow() _Imported " << _Imported << " RetVal " << RetVal << endl;
map< string , int > aMapOfNodes ;
- if ( RetVal )
+ if ( RetVal ) {
+ cdebug << "GraphEditor::OutNode::LoadDataFlow() LoadNodes GraphNodesSize " << Graph()->GraphNodesSize() << endl;
RetVal = LoadNodes( aMapOfNodes , aDataFlow->Nodes ) ;
- if ( RetVal )
+ }
+ if ( RetVal ) {
+ cdebug << "GraphEditor::OutNode::LoadDataFlow() LoadLinks GraphNodesSize " << Graph()->GraphNodesSize() << endl;
RetVal = LoadLinks( aMapOfNodes , aDataFlow->Links ) ;
+ }
if ( RetVal ) {
Valid() ;
+ cdebug << "GraphEditor::OutNode::LoadDataFlow() LoadDatas GraphNodesSize " << Graph()->GraphNodesSize() << endl;
RetVal = LoadDatas( aMapOfNodes , aDataFlow->Datas ) ;
}
- cdebug_out << "GraphEditor::OutNode::LoadDataFlow" << endl;
+ cdebug_out << "GraphEditor::OutNode::LoadDataFlow done GraphNodesSize " << Graph()->GraphNodesSize() << endl;
return RetVal ;
}
_Imported = true ;
RetVal = true ;
}
- else if ( GraphBase::Graph::LoadXml( _Orb , myFileName , aDataFlow ) ) {
+ else if ( Graph()->LoadXml( _Orb , myFileName , aDataFlow ) ) {
cdebug_in << "GraphEditor::OutNode::LoadXml() " << endl;
RetVal = LoadDataFlow( &aDataFlow ) ;
cdebug_out << "GraphEditor::OutNode::LoadXml " << RetVal << endl;
}
bool GraphEditor::OutNode::LoadInfo(const GraphBase::SNode &aDataFlowInfo ) {
+ bool RetVal = false ;
cdebug_in << "GraphEditor::OutNode::LoadInfo " << aDataFlowInfo.theName.c_str()
<< endl ;
// MESSAGE( "GraphEditor::OutNode::LoadDataFlow" );
// ComponentName( aDataFlowInfo.theComponentName.c_str() ) ;
// InterfaceName( aDataFlowInfo.theInterfaceName.c_str() ) ;
- Name( aDataFlowInfo.theName.c_str() ) ;
- Kind( aDataFlowInfo.theKind ) ;
- Service( aDataFlowInfo.theService ) ;
- FirstCreation( aDataFlowInfo.theFirstCreation ) ;
- LastModification( aDataFlowInfo.theLastModification ) ;
- EditorRelease( aDataFlowInfo.theEditorRelease.c_str() ) ;
- Author( aDataFlowInfo.theAuthor.c_str() ) ;
-// Computer( aDataFlowInfo.theContainer.c_str() ) ;
- Comment( aDataFlowInfo.theComment.c_str() ) ;
+ if ( Graph()->IsDataStreamNode() || aDataFlowInfo.theKind == SUPERV::DataFlowGraph ) {
+ Graph()->Name( aDataFlowInfo.theName.c_str() ) ;
+// Graph()->Kind( aDataFlowInfo.theKind ) ;
+ cdebug << "GraphEditor::OutNode::LoadInfo aDataFlowInfo.Kind " << aDataFlowInfo.theKind
+ << " Kind() " << Graph()->Kind() << endl ;
+ if ( Graph()->IsDataStreamNode() ) {
+ Graph()->Kind( SUPERV::DataStreamGraph ) ;
+ StreamGraph()->SetStreamParams( aDataFlowInfo.theTimeout , aDataFlowInfo.theDataStreamTrace , aDataFlowInfo.theDeltaTime ) ;
+ }
+ else {
+ Graph()->Kind( SUPERV::DataFlowGraph ) ;
+ }
+ Graph()->SetService( aDataFlowInfo.theService ) ;
+ Graph()->FirstCreation( aDataFlowInfo.theFirstCreation ) ;
+ Graph()->LastModification( aDataFlowInfo.theLastModification ) ;
+ Graph()->EditorRelease( aDataFlowInfo.theEditorRelease.c_str() ) ;
+ Graph()->Author( aDataFlowInfo.theAuthor.c_str() ) ;
+// Graph()->Computer( aDataFlowInfo.theContainer.c_str() ) ;
+ Graph()->Comment( aDataFlowInfo.theComment.c_str() ) ;
// Not in OutNode/DataFlow but in InNode/DataFlow_in_an_other_DataFlow
-// Coordinates( aDataFlowInfo.theX , aDataFlowInfo.theY ) ;
- cdebug_out << "GraphEditor::OutNode::LoadInfo" << endl ;
- return true ;
+// Graph()->Coordinates( aDataFlowInfo.theX , aDataFlowInfo.theY ) ;
+ RetVal = true ;
+ }
+ else {
+ Graph()->Kind( aDataFlowInfo.theKind ) ;
+ cdebug << "GraphEditor::OutNode::LoadInfo aDataFlowInfo.Kind " << aDataFlowInfo.theKind
+ << " != IsDataStreamNode() " << Graph()->IsDataStreamNode() << endl ;
+ }
+ cdebug_out << "GraphEditor::OutNode::LoadInfo " << RetVal << endl ;
+ return RetVal ;
}
bool GraphEditor::OutNode::LoadNodes(map< string , int > & aMapOfNodes ,
const GraphBase::ListOfNodes &aListOfNodes ) {
GraphEditor::InNode * anInNode ;
- cdebug_in << "GraphEditor::OutNode::LoadNodes" << endl ;
+ cdebug_in << "GraphEditor::OutNode::LoadNodes " << endl ;
int i ;
for ( i = 0 ; i < (int ) aListOfNodes.size() ; i++ ) {
GraphBase::SNode aNode = aListOfNodes[ i ] ;
const char * aNodeName = aNode.theName.c_str() ;
+ cout << "GraphEditor::OutNode::LoadNodes " << aNodeName << " "
+ << aNode.theListOfInDataStreams.size() << " InDataStreams "
+ << aNode.theListOfOutDataStreams.size() << " OutDataStreams "
+ << " _prof_debug " << _prof_debug << endl ;
+ cdebug << "GraphEditor::OutNode::LoadNodes " << aNodeName << " "
+ << aNode.theListOfInDataStreams.size() << " InDataStreams "
+ << aNode.theListOfOutDataStreams.size() << " OutDataStreams "
+ << endl ;
if ( aNode.theListOfFuncName.size() == 0 ) {
aNode.theListOfFuncName.resize( 1 ) ;
aNode.theListOfFuncName[ 0 ] = "" ;
aNode.theListOfPythonFunctions.resize( 1 ) ;
aNode.theListOfPythonFunctions[ 0 ] = new SUPERV::ListOfStrings() ;
}
- if ( GetGraphNode( aNode.theName.c_str() ) ) {
+ if ( Graph()->GetGraphNode( aNode.theName.c_str() ) ) {
aNodeName = NULL ;
}
+
+ aNode.theService.ServiceinDataStreamParameter.length( aNode.theListOfInDataStreams.size() ) ;
+ aNode.theService.ServiceoutDataStreamParameter.length( aNode.theListOfOutDataStreams.size() ) ;
+ unsigned int j ;
+ for ( j = 0 ; j < aNode.theListOfInDataStreams.size() ; j++ ) {
+ aNode.theService.ServiceinDataStreamParameter[ j ].Parametername = aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parametername ,
+ aNode.theService.ServiceinDataStreamParameter[ j ].Parametertype = aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parametertype ,
+ aNode.theService.ServiceinDataStreamParameter[ j ].Parameterdependency = aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parameterdependency ;
+ }
+ for ( j = 0 ; j < aNode.theListOfOutDataStreams.size() ; j++ ) {
+ aNode.theService.ServiceoutDataStreamParameter[ j ].Parametername = aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parametername ,
+ aNode.theService.ServiceoutDataStreamParameter[ j ].Parametertype = aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parametertype ,
+ aNode.theService.ServiceoutDataStreamParameter[ j ].Parameterdependency = aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parameterdependency ;
+ }
+
anInNode = AddNode( aNode.theService ,
aNode.theListOfFuncName ,
aNode.theListOfPythonFunctions ,
aNode.theComment.c_str() ,
aNode.theCoords.theX , aNode.theCoords.theY ) ;
string * aNodetheName = new string( aNode.theName ) ;
- aMapOfNodes[ *aNodetheName ] = GetGraphNodeIndex( anInNode->Name() ) ;
+ aMapOfNodes[ *aNodetheName ] = Graph()->GetGraphNodeIndex( anInNode->Name() ) ;
if ( anInNode->IsOneOfInLineNodes() ) {
anInNode->GraphEditor::InNode::InLineNode()->DefPortsOfNode(
_Orb , aNode.theService , anInNode->NamePtr() ,
anInNode->Kind() ,
- Graph_prof_debug() , Graph_fdebug() ) ;
+ _prof_debug , _fdebug ) ;
GraphBase::InLineNode * aINode = anInNode->InLineNode() ;
GraphBase::LoopNode * aLNode = NULL ;
if ( aINode->IsLoopNode() ) {
*aNode.theListOfPythonFunctions[ 0 ] ) ;
}
}
+
+ for ( j = 0 ; j < aNode.theListOfInDataStreams.size() ; j++ ) {
+ GraphBase::InPort * anInPort ;
+ if ( anInNode->IsOneOfInLineNodes() ) {
+ anInPort = anInNode->ComputingNode()->AddInDataStreamPort( aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parametername ,
+ aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parametertype ,
+ aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parameterdependency ,
+ SUPERV::DataStreamParameter ) ;
+ }
+ else {
+ anInPort = anInNode->ComputingNode()->GetChangeInPort( aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parametername ) ;
+ }
+ ((GraphBase::InDataStreamPort * ) anInPort)->SetParams( aNode.theListOfInDataStreams[ j ].theKindOfSchema ,
+ aNode.theListOfInDataStreams[ j ].theKindOfInterpolation ,
+ aNode.theListOfInDataStreams[ j ].theKindOfExtrapolation ) ;
+ }
+ for ( j = 0 ; j < aNode.theListOfOutDataStreams.size() ; j++ ) {
+ GraphBase::OutPort * anOutPort ;
+ if ( anInNode->IsOneOfInLineNodes() ) {
+ anOutPort = anInNode->ComputingNode()->AddOutDataStreamPort( aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parametername ,
+ aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parametertype ,
+ aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parameterdependency ,
+ SUPERV::DataStreamParameter ) ;
+ }
+ else {
+ anOutPort = anInNode->ComputingNode()->GetChangeOutPort( aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parametername ) ;
+ }
+ ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues( aNode.theListOfOutDataStreams[ j ].theNumberOfValues ) ;
+ }
delete aNodetheName ;
if ( !anInNode ) {
return false ;
GraphBase::SNode aNode = aListOfNodes[ i ] ;
cdebug << "GraphEditor::OutNode::LoadNodes " << aNode.theName.c_str() << " Coupled to "
<< aNode.theCoupledNode.c_str() << endl ;
- anInNode = (GraphEditor::InNode * ) GetChangeGraphNode( aNode.theName.c_str() )->GetInNode() ;
+ anInNode = (GraphEditor::InNode * ) Graph()->GetChangeGraphNode( aNode.theName.c_str() )->GetInNode() ;
if ( anInNode->IsOneOfGOTONodes() && strlen( aNode.theCoupledNode.c_str() ) ) {
GraphBase::GOTONode * aCoupledNode ;
- aCoupledNode = (GraphBase::GOTONode * ) GetGraphNode( aNode.theName.c_str() ) ;
- aCoupledNode->CoupledNode( (GraphBase::GOTONode * ) GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ) ;
+ aCoupledNode = (GraphBase::GOTONode * ) Graph()->GetGraphNode( aNode.theName.c_str() ) ;
+ aCoupledNode->CoupledNode( (GraphBase::GOTONode * ) Graph()->GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ) ;
}
}
cdebug_out << "GraphEditor::OutNode::LoadNodes" << endl ;
cdebug << "LoadLinks " << aLinkFromNodeName->c_str() << "( "
<< aLink.FromServiceParameterName.c_str() << " ) --> "
<< aLinkToNodeName->c_str() << "( "
- << aLink.FromServiceParameterName.c_str() << " )" << endl ;
- if ( GetGraphNode( aMapOfNodes[ aLinkFromNodeName->c_str() ] ) &&
- GetGraphNode( aMapOfNodes[ aLinkToNodeName->c_str() ] ) ) {
- RetVal = AddLink( GetGraphNode( aMapOfNodes[ aLinkFromNodeName->c_str() ] )->Name() ,
- aLink.FromServiceParameterName.c_str() ,
- GetGraphNode( aMapOfNodes[ aLinkToNodeName->c_str() ] )->Name() ,
- aLink.ToServiceParameterName.c_str() ,
- *((GraphBase::ComputingNode *) GetGraphNode( aMapOfNodes[ aLinkFromNodeName->c_str() ] ))->GetOutPort( aLink.FromServiceParameterName.c_str() )->Value() ) ;
+ << aLink.ToServiceParameterName.c_str() << " )" << endl ;
+ if ( Graph()->GetGraphNode( aMapOfNodes[ aLinkFromNodeName->c_str() ] ) &&
+ Graph()->GetGraphNode( aMapOfNodes[ aLinkToNodeName->c_str() ] ) ) {
+ GraphBase::ComputingNode * aFromNode = (GraphBase::ComputingNode * ) Graph()->GetGraphNode( aMapOfNodes[ aLinkFromNodeName->c_str() ] ) ;
+ const GraphBase::OutPort * anOutPort = aFromNode->GetOutPort( aLink.FromServiceParameterName.c_str() ) ;
+ RetVal = AddLink( Graph()->GetGraphNode( aMapOfNodes[ aLinkFromNodeName->c_str() ] )->Name() ,
+ aLink.FromServiceParameterName.c_str() ,
+ Graph()->GetGraphNode( aMapOfNodes[ aLinkToNodeName->c_str() ] )->Name() ,
+ aLink.ToServiceParameterName.c_str() ,
+ *anOutPort->Value() ) ;
}
else {
RetVal = false ;
break ;
else {
for ( j = 0 ; j < (int ) aLink.aListOfCoords.size() ; j++ ) {
- RetVal = AddLinkCoord( GetGraphNode( aMapOfNodes[ aLinkFromNodeName->c_str() ] )->Name() ,
- aLink.FromServiceParameterName.c_str() ,
- GetGraphNode( aMapOfNodes[ aLink.ToNodeName.c_str() ] )->Name() ,
- aLink.ToServiceParameterName.c_str() ,
- j + 1 ,
- aLink.aListOfCoords[j].theX ,
- aLink.aListOfCoords[j].theY ) ;
+ RetVal = AddLinkCoord( Graph()->GetGraphNode( aMapOfNodes[ aLinkFromNodeName->c_str() ] )->Name() ,
+ aLink.FromServiceParameterName.c_str() ,
+ Graph()->GetGraphNode( aMapOfNodes[ aLink.ToNodeName.c_str() ] )->Name() ,
+ aLink.ToServiceParameterName.c_str() ,
+ j + 1 ,
+ aLink.aListOfCoords[j].theX ,
+ aLink.aListOfCoords[j].theY ) ;
if ( !RetVal )
break ;
}
int i ;
for ( i = 0 ; i < (int ) aListOfDatas.size() ; i++ ) {
GraphBase::SLink aLink = aListOfDatas[ i ] ;
- if ( !strcmp( aLink.FromNodeName.c_str() , Name() ) ) {
+ if ( !strcmp( aLink.FromNodeName.c_str() , Graph()->Name() ) ) {
cdebug << "GraphEditor::OutNode::LoadDatas Warning "
<< aLink.FromNodeName.c_str()
- << " and " << aLink.ToNodeName.c_str() << " differents from " << Name()
+ << " and " << aLink.ToNodeName.c_str() << " differents from " << Graph()->Name()
<< endl ;
}
string * aLinkFromNodeName = new string( aLink.FromNodeName.c_str() ) ;
// << aMapOfNodes[ aLinkFromNodeName->c_str() ] << endl ;
// cout << " " << aLink.ToNodeName.c_str() << " "
// << aMapOfNodes[ aLinkToNodeName->c_str() ] << endl ;
- RetVal = GraphBase::Graph::AddInputData( GetGraphNode( aMapOfNodes[ aLinkToNodeName->c_str() ] )->Name() ,
- aLink.ToServiceParameterName.c_str() ,
- aLink.aLinkValue ) ;
+ RetVal = Graph()->AddInputData( Graph()->GetGraphNode( aMapOfNodes[ aLinkToNodeName->c_str() ] )->Name() ,
+ aLink.ToServiceParameterName.c_str() ,
+ aLink.aLinkValue ) ;
delete aLinkFromNodeName ;
delete aLinkToNodeName ;
if ( !RetVal )
GraphBase::SGraph * GraphEditor::OutNode::GetDataFlow() {
GraphBase::SGraph * aDataFlow = new GraphBase::SGraph;
- aDataFlow->Info = *GetInfo() ;
- aDataFlow->Nodes = *GetNodes() ;
- aDataFlow->Links = *GetLinks( true ) ;
- aDataFlow->Datas = *GetDatas() ;
+ if ( Graph()->IsDataFlowNode() ) {
+ aDataFlow->Info = *Graph()->GetInfo() ;
+ aDataFlow->Nodes = *Graph()->GetNodes() ;
+ aDataFlow->Links = *Graph()->GetLinks( true ) ;
+ aDataFlow->Datas = *Graph()->GetDatas() ;
+ }
+ else {
+ aDataFlow->Info = *StreamGraph()->GetInfo() ;
+ aDataFlow->Nodes = *StreamGraph()->GetNodes() ;
+ aDataFlow->Links = *StreamGraph()->GetLinks( true ) ;
+ aDataFlow->Datas = *StreamGraph()->GetDatas() ;
+ }
return aDataFlow ;
}
aLastModificationDate.Day = Tm->tm_mday;
aLastModificationDate.Month = Tm->tm_mon + 1;
aLastModificationDate.Year = Tm->tm_year + 1900;
- LastModification( aLastModificationDate ) ;
+ Graph()->LastModification( aLastModificationDate ) ;
}
void GraphEditor::OutNode::Coordinates( const char* NodeName ,
const int X ,
const int Y ) {
- ((GraphEditor::InNode * ) GetChangeGraphNode( NodeName ))->Coordinates( X , Y ) ;
+ ((GraphEditor::InNode * ) Graph()->GetChangeGraphNode( NodeName ))->Coordinates( X , Y ) ;
}
const int GraphEditor::OutNode::XCoordinate( const char* NodeName ) {
- return ((GraphEditor::InNode * ) GetChangeGraphNode( NodeName ))->XCoordinate() ;
+ return ((GraphEditor::InNode * ) Graph()->GetChangeGraphNode( NodeName ))->XCoordinate() ;
}
const int GraphEditor::OutNode::YCoordinate( const char* NodeName ) {
- return ((GraphEditor::InNode * ) GetChangeGraphNode( NodeName ))->YCoordinate() ;
+ return ((GraphEditor::InNode * ) Graph()->GetChangeGraphNode( NodeName ))->YCoordinate() ;
}
GraphEditor::InNode * GraphEditor::OutNode::AddNode(
const int NodeY ) {
cdebug_in << "GraphEditor::OutNode::AddNode( " ;
if ( NodeComponentName != NULLSTRING && strlen( NodeComponentName ) ) {
- cdebug << NodeComponentName << " , " ;
+ cdebug << "Component('" << NodeComponentName << "') , Node('" ;
}
else {
cdebug << "NodeComponentName[NULL] )" << endl;
}
if ( theNodeName != NULLSTRING && strlen( theNodeName ) ) {
- cdebug << theNodeName << " )" << endl;
+ cdebug << theNodeName << "' )" ;
}
else {
- cdebug << "NodeName[NULL] )" << endl;
+ cdebug << "NodeName[NULL]' )" ;
}
+ cdebug << " " << NodeKindOfNode << endl ;
char * RetVal = NULLSTRING ;
GraphEditor::InNode *Nd = NULL ;
char * aNodeName = NULL ;
if ( theNodeName == NULLSTRING || strlen( theNodeName ) == 0 ) {
aNodeName = new char[ strlen( NodeService.ServiceName )+1 ] ;
strcpy( aNodeName , NodeService.ServiceName ) ;
- if ( GetGraphNode( NodeService.ServiceName ) ) {
+ if ( Graph()->GetGraphNode( NodeService.ServiceName ) ) {
GeneratedName = true ;
- while ( GetGraphNode( aNodeName ) ) {
+ while ( Graph()->GetGraphNode( aNodeName ) ) {
if ( aNodeName ) {
delete [] aNodeName ;
}
- int num = GetServiceNameNumber( NodeService.ServiceName ) ;
+ int num = Graph()->GetServiceNameNumber( NodeService ) ;
ostringstream astr ;
astr << num << ends ;
const char * n_instance = astr.str().c_str() ;
}
}
else {
- if ( GetGraphNode( theNodeName ) == NULL ) {
+ if ( Graph()->GetGraphNode( theNodeName ) == NULL ) {
aNodeName = new char[ strlen( theNodeName )+1 ] ;
strcpy( aNodeName , theNodeName ) ;
}
}
if ( aNodeName != NULLSTRING ) {
- Nd = new GraphEditor::InNode( _Orb , NamingService() ,
+ Nd = new GraphEditor::InNode( _Orb , Graph()->NamingService() ,
aFuncName , aPythonFunction , NodeService ,
NodeComponentName , NodeInterfaceName ,
aNodeName , NodeKindOfNode ,
NodeEditorRelease , NodeAuthor ,
NodeComputer , NodeComment , GeneratedName ,
NodeX , NodeY ,
- Graph_prof_debug() , Graph_fdebug() ) ;
+ _prof_debug , _fdebug ) ;
// MESSAGE( "GraphEditor::OutNode::AddNode " << hex << (void *) Nd << dec );
// if ( GraphBase::Graph::AddNode( Nd ) ) {
- if ( GraphBase::Graph::AddNode( Nd->ComputingNode() ) ) {
+
+ if ( Graph()->IsDataStreamNode() && ( Nd->IsComputingNode() || Nd->IsFactoryNode() ) ) {
+ unsigned int i ;
+ for ( i = 0 ; i < NodeService.ServiceinDataStreamParameter.length() ; i++ ) {
+ GraphBase::InDataStreamPort * aDataStreamPort ;
+ aDataStreamPort = Nd->ComputingNode()->AddInDataStreamPort(
+ my_strdup( NodeService.ServiceinDataStreamParameter[i].Parametername ) ,
+ NodeService.ServiceinDataStreamParameter[i].Parametertype ,
+ NodeService.ServiceinDataStreamParameter[i].Parameterdependency ,
+ SUPERV::DataStreamParameter ) ;
+ }
+ for ( i = 0 ; i < NodeService.ServiceoutDataStreamParameter.length() ; i++ ) {
+ GraphBase::OutDataStreamPort * aDataStreamPort ;
+ aDataStreamPort = Nd->ComputingNode()->AddOutDataStreamPort(
+ my_strdup( NodeService.ServiceoutDataStreamParameter[i].Parametername ) ,
+ NodeService.ServiceoutDataStreamParameter[i].Parametertype ,
+ NodeService.ServiceoutDataStreamParameter[i].Parameterdependency ,
+ SUPERV::DataStreamParameter ) ;
+ }
+ }
+
+ if ( Graph()->AddNode( Nd->ComputingNode() ) ) {
DateModification() ;
RetVal = Nd->Name() ;
}
}
}
else {
- cdebug << "NodeName is NULL or already exists." << endl ;
+ cdebug << "ERROR NodeName is NULL or already exists." << endl ;
}
// delete [] aNodeName ;
cdebug_out << "GraphEditor::OutNode::AddNode" << endl;
const int nXY ,
const int* X ,
const int* Y ) {
- GraphBase::InPort * anInPort = GraphBase::Graph::GetChangeInPort( ToNodeName ,
- ToServiceParameterName ) ;
+ GraphBase::InPort * anInPort = Graph()->GetChangeInPort( ToNodeName ,
+ ToServiceParameterName ) ;
// cdebug << "GraphEditor::OutNode::AddLinkCoord " << ToNodeName << "( " << ToServiceParameterName
// << " ) " << anInPort << " IsEndSwitch " << anInPort->IsEndSwitch() << endl ;
if ( anInPort ) {
if ( anInPort->IsEndSwitch() ) {
// cdebug << "GraphEditor::OutNode::AddLinkCoord " << FromNodeName << "( " << FromServiceParameterName
// << " )" << endl ;
- return GraphBase::Graph::GetChangeOutPort( FromNodeName , FromServiceParameterName )->AddCoord( nXY , X , Y ) ;
+ return Graph()->GetChangeOutPort( FromNodeName , FromServiceParameterName )->AddCoord( nXY , X , Y ) ;
}
else {
return anInPort->AddCoord( nXY , X , Y ) ;
const int index ,
const int X ,
const int Y ) {
- GraphBase::InPort * anInPort = GraphBase::Graph::GetChangeInPort( ToNodeName ,
- ToServiceParameterName ) ;
+ GraphBase::InPort * anInPort = Graph()->GetChangeInPort( ToNodeName ,
+ ToServiceParameterName ) ;
// cdebug << "GraphEditor::OutNode::AddLinkCoord " << ToNodeName << "( " << ToServiceParameterName
// << " ) " << anInPort << " IsEndSwitch " << anInPort->IsEndSwitch() << endl ;
if ( anInPort ) {
if ( anInPort->IsEndSwitch() ) {
// cdebug << "GraphEditor::OutNode::AddLinkCoord " << FromNodeName << "( " << FromServiceParameterName
// << " )" << endl ;
- return GraphBase::Graph::GetChangeOutPort( FromNodeName , FromServiceParameterName )->AddCoord( index , X , Y ) ;
+ return Graph()->GetChangeOutPort( FromNodeName , FromServiceParameterName )->AddCoord( index , X , Y ) ;
}
else {
return anInPort->AddCoord( index , X , Y ) ;
const int index ,
const int X ,
const int Y ) {
- GraphBase::InPort * anInPort = GraphBase::Graph::GetChangeInPort( ToNodeName ,
- ToServiceParameterName ) ;
+ GraphBase::InPort * anInPort = Graph()->GetChangeInPort( ToNodeName ,
+ ToServiceParameterName ) ;
// cdebug << "GraphEditor::OutNode::ChangeLinkCoord " << ToNodeName << "( " << ToServiceParameterName
// << " ) " << anInPort << " IsEndSwitch " << anInPort->IsEndSwitch() << endl ;
if ( anInPort ) {
if ( anInPort->IsEndSwitch() ) {
// cdebug << "GraphEditor::OutNode::ChangeLinkCoord " << FromNodeName << "( " << FromServiceParameterName
// << " )" << endl ;
- return GraphBase::Graph::GetChangeOutPort( FromNodeName , FromServiceParameterName )->ChangeCoord( index , X , Y ) ;
+ return Graph()->GetChangeOutPort( FromNodeName , FromServiceParameterName )->ChangeCoord( index , X , Y ) ;
}
else {
return anInPort->ChangeCoord( index , X , Y ) ;
const char* ToNodeName ,
const char* ToServiceParameterName ,
const int index ) {
- GraphBase::InPort * anInPort = GraphBase::Graph::GetChangeInPort( ToNodeName ,
- ToServiceParameterName ) ;
+ GraphBase::InPort * anInPort = Graph()->GetChangeInPort( ToNodeName ,
+ ToServiceParameterName ) ;
// cdebug << "GraphEditor::OutNode::RemoveLinkCoord " << ToNodeName << "( " << ToServiceParameterName
// << " ) " << anInPort << " IsEndSwitch " << anInPort->IsEndSwitch() << endl ;
if ( anInPort ) {
if ( anInPort->IsEndSwitch() ) {
// cdebug << "GraphEditor::OutNode::RemoveLinkCoord " << FromNodeName << "( " << FromServiceParameterName
// << " )" << endl ;
- return GraphBase::Graph::GetChangeOutPort( FromNodeName , FromServiceParameterName )->RemoveCoord( index ) ;
+ return Graph()->GetChangeOutPort( FromNodeName , FromServiceParameterName )->RemoveCoord( index ) ;
}
else {
return anInPort->RemoveCoord( index ) ;
const char* FromServiceParameterName ,
const char* ToNodeName ,
const char* ToServiceParameterName ) {
- const GraphBase::InPort * anInPort = GraphBase::Graph::GetInPort( ToNodeName , ToServiceParameterName ) ;
+ const GraphBase::InPort * anInPort = Graph()->GetInPort( ToNodeName , ToServiceParameterName ) ;
// cdebug << "GraphEditor::OutNode::GetLinkCoordSize " << ToNodeName << "( " << ToServiceParameterName
// << " ) " << anInPort << " IsEndSwitch " << anInPort->IsEndSwitch() << endl ;
if ( anInPort ) {
if ( anInPort->IsEndSwitch() ) {
// cdebug << "GraphEditor::OutNode::GetLinkCoordSize " << FromNodeName << "( " << FromServiceParameterName
// << " )" << endl ;
- return GraphBase::Graph::GetChangeOutPort( FromNodeName , FromServiceParameterName )->GetCoord() ;
+ return Graph()->GetChangeOutPort( FromNodeName , FromServiceParameterName )->GetCoord() ;
}
else {
return anInPort->GetCoord() ;
const char* ToNodeName ,
const char* ToServiceParameterName ,
int *X , int *Y ) {
- const GraphBase::InPort * anInPort = GraphBase::Graph::GetInPort( ToNodeName , ToServiceParameterName ) ;
+ const GraphBase::InPort * anInPort = Graph()->GetInPort( ToNodeName , ToServiceParameterName ) ;
// cdebug << "GraphEditor::OutNode::GetLinkCoord " << ToNodeName << "( " << ToServiceParameterName
// << " ) " << anInPort << " IsEndSwitch " << anInPort->IsEndSwitch() << endl ;
if ( anInPort ) {
if ( anInPort->IsEndSwitch() ) {
// cdebug << "GraphEditor::OutNode::GetLinkCoord " << FromNodeName << "( " << FromServiceParameterName
// << " )" << endl ;
- return GraphBase::Graph::GetChangeOutPort( FromNodeName , FromServiceParameterName )->GetCoord( X , Y ) ;
+ return Graph()->GetChangeOutPort( FromNodeName , FromServiceParameterName )->GetCoord( X , Y ) ;
}
else {
return anInPort->GetCoord( X , Y ) ;
const char* ToNodeName ,
const char* ToServiceParameterName ,
const int index , long &X , long &Y ) {
- GraphBase::InPort * anInPort = GraphBase::Graph::GetChangeInPort( ToNodeName ,
- ToServiceParameterName ) ;
+ GraphBase::InPort * anInPort = Graph()->GetChangeInPort( ToNodeName ,
+ ToServiceParameterName ) ;
// cdebug << "GraphEditor::OutNode::GetLinkCoord " << ToNodeName << "( " << ToServiceParameterName
// << " ) " << anInPort << " IsEndSwitch " << anInPort->IsEndSwitch() << endl ;
if ( anInPort ) {
if ( anInPort->IsEndSwitch() ) {
// cdebug << "GraphEditor::OutNode::GetLinkCoord " << FromNodeName << "( " << FromServiceParameterName
// << " )" << endl ;
- return GraphBase::Graph::GetChangeOutPort( FromNodeName , FromServiceParameterName )->GetCoord( index , X , Y ) ;
+ return Graph()->GetChangeOutPort( FromNodeName , FromServiceParameterName )->GetCoord( index , X , Y ) ;
}
else {
return anInPort->GetCoord( index , X , Y ) ;
const char* ToNodeName2 ,
const char* ToParameterName2 ) {
cdebug_in << "GraphEditor::OutNode::AddInputData" << endl;
- bool RetVal = GraphBase::Graph::AddInputData( ToNodeName1 ,
+ bool RetVal = Graph()->AddInputData( ToNodeName1 ,
ToParameterName1 ,
ToNodeName2 ,
ToParameterName2 ) ;
cdebug_in << "GraphEditor::OutNode::Valid" << endl;
_Executable = false ;
- CreateService() ;
+ Graph()->CreateService() ;
- if ( !Sort() ) {
+ int SubStreamGraphsNumber = 0 ;
+ if ( !Graph()->Sort( SubStreamGraphsNumber ) ) {
cdebug << "This DataFlow is not valid." << endl ;
return false ;
}
-
+ if ( Graph()->IsDataStreamNode() ) {
+ StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
+ }
// CreateService() ;
- InLineServices() ;
+ Graph()->InLineServices() ;
- ComputingNodes() ;
+ Graph()->ComputingNodes() ;
_Valid = true ;
bool GraphEditor::OutNode::Executable() {
cdebug_in << "GraphEditor::OutNode::Executable" << endl;
bool NewLink ;
- if ( LinkLoopNodes( NewLink ) ) {
+ if ( Graph()->LinkLoopNodes( NewLink ) ) {
if ( NewLink ) {
_Valid = false ;
}
if ( !IsValid() ) {
return false ;
}
- if ( DataServerNodes() )
+ if ( Graph()->DataServerNodes() )
_Executable = true ;
else {
cdebug << "This DataFlow is not executable." << endl ;
_Executable = false ;
}
+ if ( _Executable && Graph()->IsDataStreamNode() ) {
+ StreamGraph()->CreateStreamTopology( "/tmp/" ) ;
+ }
+
cdebug_out << "GraphEditor::OutNode::Executable" << endl;
return _Executable ;
}
const char * ToParameterName ) {
// cdebug_in << "GraphEditor::OutNode::GetInData " << ToNodeName
// << " " << ToParameterName << endl ;
- const CORBA::Any * retdata = PortInData( ToNodeName , ToParameterName ) ;
+ const CORBA::Any * retdata = Graph()->PortInData( ToNodeName , ToParameterName ) ;
// cdebug_out << "GraphEditor::OutNode::GetInData" << endl ;
return retdata ;
}
const char * FromParameterName ) {
// cdebug_in << "GraphEditor::OutNode::GetOutData " << FromNodeName
// << " " << FromParameterName << endl ;
- const CORBA::Any * retdata = PortOutData( FromNodeName , FromParameterName ) ;
+ const CORBA::Any * retdata = Graph()->PortOutData( FromNodeName , FromParameterName ) ;
// cdebug_out << "GraphEditor::OutNode::GetOutData" << endl ;
return retdata ;
}
bool GraphEditor::OutNode::LinkSaveXML( QDomDocument & Graph , QDomElement & link ,
GraphBase::SLink aLink ,
bool wdata ) const {
+ cdebug_in << "GraphEditor::OutNode::LinkSaveXML " << aLink.FromNodeName
+ << "(" << aLink.FromServiceParameterName << ") --> "
+ << aLink.ToNodeName << "(" << aLink.ToServiceParameterName << ")" << endl ;
QDomElement fromnodename = Graph.createElement( "fromnode-name" ) ;
QDomText aField ;
if ( strlen( aLink.FromNodeName.c_str() ) ) {
// f << Tabs << " </coord>" << endl ;
}
// f << Tabs << "</coord-list>" << endl ;
+ cdebug_out << "GraphEditor::OutNode::LinkSaveXML " << aLink.FromNodeName
+ << "(" << aLink.FromServiceParameterName << ") --> "
+ << aLink.ToNodeName << "(" << aLink.ToServiceParameterName << ")"
+ << endl ;
return true ;
}
bool GraphEditor::OutNode::LinkSavePY( ostream &f , const char * aGraphName ,
GraphBase::SLink aLink ,
- bool intervar , bool wdata ) const {
+ bool fromparam , bool toparam ,
+ bool wdata ) const {
if ( !wdata ) {
- if ( intervar ) {
- f << aLink.FromNodeName.c_str() << aLink.FromServiceParameterName.c_str()
- << " = "
- << aLink.FromNodeName.c_str() << ".Port( '"
- << aLink.FromServiceParameterName.c_str()
- << "' )" << endl ;
+// if ( intervar ) {
+// f << "O" << aLink.FromNodeName.c_str() << aLink.FromServiceParameterName.c_str()
+// << " = "
+// << aLink.FromNodeName.c_str() << ".GetOutPort( '"
+// << aLink.FromServiceParameterName.c_str()
+// << "' )" << endl ;
+// }
+ f << "L" << aLink.FromNodeName.c_str() << aLink.FromServiceParameterName.c_str()
+ << aLink.ToNodeName.c_str() << aLink.ToServiceParameterName.c_str() ;
+ if ( ((GraphBase::Graph *) Graph())->GetChangeGraphNode( aLink.FromNodeName.c_str() )->GetChangeOutPort( aLink.FromServiceParameterName.c_str() )->IsDataStream() ) {
+ f << " = " << aGraphName << ".StreamLink( " ;
+ }
+ else {
+ f << " = " << aGraphName << ".Link( " ;
}
- f << aLink.ToNodeName.c_str() << aLink.ToServiceParameterName.c_str()
- << " = " << aGraphName << ".Link( " << aLink.FromNodeName.c_str()
- << aLink.FromServiceParameterName.c_str() << " , "
- << aLink.ToNodeName.c_str() << ".Port( '"
- << aLink.ToServiceParameterName.c_str() << "' ) )" << endl ;
+// if ( !fromparam ) {
+ f << "O" ;
+// }
+ f << aLink.FromNodeName.c_str() << aLink.FromServiceParameterName.c_str() << " , " ;
+// if ( !toparam ) {
+ f << "I" ;
+// }
+ f << aLink.ToNodeName.c_str() << aLink.ToServiceParameterName.c_str() << " )" << endl ;
}
else {
- f << aLink.ToNodeName.c_str() << aLink.ToServiceParameterName.c_str()
- << " = " << aLink.ToNodeName.c_str() << ".Input( '"
- << aLink.ToServiceParameterName.c_str() << "' , " ;
+ f << "I"<< aLink.ToNodeName.c_str() << aLink.ToServiceParameterName.c_str()
+// << " = " << aLink.ToNodeName.c_str() << ".Input( '"
+// << aLink.ToServiceParameterName.c_str() << "' , " ;
+ << ".Input( " ;
switch (aLink.aLinkValue.type()->kind()) {
case CORBA::tk_string: {
char* retstr ;
break ;
}
}
- f << ")" << endl ;
+ f << " )" << endl ;
}
int i ;
for ( i = 0 ; i < (int ) aLink.aListOfCoords.size() ; i++ ) {
- f << aLink.ToNodeName.c_str()
- << aLink.ToServiceParameterName.c_str() << ".AddCoord( " << i+1 << " , "
+ f << "L" << aLink.FromNodeName.c_str() << aLink.FromServiceParameterName.c_str()
+ << aLink.ToNodeName.c_str() << aLink.ToServiceParameterName.c_str() << ".AddCoord( " << i+1 << " , "
<< aLink.aListOfCoords[ i ].theX << " , "
<< aLink.aListOfCoords[ i ].theY << " )" << endl ;
}
}
//bool GraphEditor::OutNode::SaveXML(ostream & f ) {
-bool GraphEditor::OutNode::SaveXML(QDomDocument & Graph ) {
+bool GraphEditor::OutNode::SaveXML(QDomDocument & GraphQDom ) {
int i ;
// f << "<?xml version='1.0' encoding='us-ascii' ?>" << endl << endl ;
// f << "<!-- XML Dataflow -->" << endl << endl ;
// f << "<!-- Dataflow information -->" << endl ;
QString Dataflow("Dataflow") ;
- Graph = QDomDocument(Dataflow) ;
+ GraphQDom = QDomDocument(Dataflow) ;
// f << "<dataflow>" << endl ;
- QDomElement dataflow = Graph.createElement( "dataflow" ) ;
- Graph.appendChild( dataflow ) ;
+ QDomElement dataflow = GraphQDom.createElement( "dataflow" ) ;
+ GraphQDom.appendChild( dataflow ) ;
// f << " <info-list>" << endl ;
- QDomElement info = Graph.createElement( "info-list" ) ;
+ QDomElement info = GraphQDom.createElement( "info-list" ) ;
dataflow.appendChild( info ) ;
// f << " <node>" << endl ;
// GraphBase::DataNode::SaveXML( f , " " , 0 , 0 ) ;
- GraphBase::DataNode::SaveXML( Graph , info , 0 , 0 ) ;
+ Graph()->SaveXML( GraphQDom , info , 0 , 0 ) ;
// f << " </node>" << endl ;
// f << " </info-list>" << endl << endl ;
// f << " <node-list>" << endl ;
- QDomElement nodelist = Graph.createElement( "node-list" ) ;
+ QDomElement nodelist = GraphQDom.createElement( "node-list" ) ;
dataflow.appendChild( nodelist ) ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
// f << " <node>" << endl ;
- if ( GraphNodes( i )->IsComputingNode() ) {
+ if ( Graph()->GraphNodes( i )->IsComputingNode() ) {
// ((GraphBase::ComputingNode *)GraphNodes( i ))->SaveXML( f ,
// " " ,
- ((GraphBase::ComputingNode *)GraphNodes( i ))->SaveXML( Graph , nodelist ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::ComputingNode *) Graph()->GraphNodes( i ))->SaveXML( GraphQDom , nodelist ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
- else if ( GraphNodes( i )->IsFactoryNode() ) {
+ else if ( Graph()->GraphNodes( i )->IsFactoryNode() ) {
// ((GraphBase::FactoryNode * ) GraphNodes( i ))->SaveXML( f ,
// " " ,
- ((GraphBase::FactoryNode * ) GraphNodes( i ))->SaveXML( Graph , nodelist ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::FactoryNode * ) Graph()->GraphNodes( i ))->SaveXML( GraphQDom , nodelist ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
- else if ( GraphNodes( i )->IsInLineNode() ) {
+ else if ( Graph()->GraphNodes( i )->IsInLineNode() ) {
// ((GraphBase::InLineNode * ) GraphNodes( i ))->SaveXML( f ,
// " " ,
- ((GraphBase::InLineNode * ) GraphNodes( i ))->SaveXML( Graph , nodelist ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::InLineNode * ) Graph()->GraphNodes( i ))->SaveXML( GraphQDom , nodelist ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
- else if ( GraphNodes( i )->IsGOTONode() ) {
+ else if ( Graph()->GraphNodes( i )->IsGOTONode() ) {
// ((GraphBase::GOTONode * ) GraphNodes( i ))->SaveXML( f ,
// " " ,
- ((GraphBase::GOTONode * ) GraphNodes( i ))->SaveXML( Graph , nodelist ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::GOTONode * ) Graph()->GraphNodes( i ))->SaveXML( GraphQDom , nodelist ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
- else if ( GraphNodes( i )->IsLoopNode() ) {
+ else if ( Graph()->GraphNodes( i )->IsLoopNode() ) {
// ((GraphBase::LoopNode * ) GraphNodes( i ))->SaveXML( f ,
// " " ,
- ((GraphBase::LoopNode * ) GraphNodes( i ))->SaveXML( Graph , nodelist ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::LoopNode * ) Graph()->GraphNodes( i ))->SaveXML( GraphQDom , nodelist ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
- else if ( GraphNodes( i )->IsEndLoopNode() ) {
+ else if ( Graph()->GraphNodes( i )->IsEndLoopNode() ) {
// ((GraphBase::EndOfLoopNode * ) GraphNodes( i ))->SaveXML( f ,
// " " ,
- ((GraphBase::EndOfLoopNode * ) GraphNodes( i ))->SaveXML( Graph , nodelist ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::EndOfLoopNode * ) Graph()->GraphNodes( i ))->SaveXML( GraphQDom , nodelist ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
- else if ( GraphNodes( i )->IsSwitchNode() ) {
+ else if ( Graph()->GraphNodes( i )->IsSwitchNode() ) {
// ((GraphBase::SwitchNode * ) GraphNodes( i ))->SaveXML( f ,
// " " ,
- ((GraphBase::SwitchNode * ) GraphNodes( i ))->SaveXML( Graph , nodelist ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::SwitchNode * ) Graph()->GraphNodes( i ))->SaveXML( GraphQDom , nodelist ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
- else if ( GraphNodes( i )->IsEndSwitchNode() ) {
+ else if ( Graph()->GraphNodes( i )->IsEndSwitchNode() ) {
// ((GraphBase::EndOfSwitchNode * ) GraphNodes( i ))->SaveXML( f ,
// " " ,
- ((GraphBase::EndOfSwitchNode * ) GraphNodes( i ))->SaveXML( Graph , nodelist ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::EndOfSwitchNode * ) Graph()->GraphNodes( i ))->SaveXML( GraphQDom , nodelist ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
// f << " </node>" << endl ;
// }
// f << " </node-list>" << endl << endl ;
// f << " <link-list>" << endl ;
- QDomElement linklist = Graph.createElement( "link-list" ) ;
+ QDomElement linklist = GraphQDom.createElement( "link-list" ) ;
dataflow.appendChild( linklist ) ;
- const GraphBase::ListOfLinks * Links = GetLinks( true ) ;
+ const GraphBase::ListOfLinks * Links = Graph()->GetLinks( true ) ;
for ( i = 0 ; i < (int ) Links->size() ; i++ ) {
// f << " <link>" << endl ;
- QDomElement link = Graph.createElement( "link" ) ;
+ QDomElement link = GraphQDom.createElement( "link" ) ;
linklist.appendChild( link ) ;
// LinkSaveXML( f , " " , (*Links)[ i ] , false ) ;
- LinkSaveXML( Graph , link , (*Links)[ i ] , false ) ;
+ LinkSaveXML( GraphQDom , link , (*Links)[ i ] , false ) ;
// f << " </link>" << endl ;
}
// f << " </link-list>" << endl << endl ;
// f << " <data-list>" << endl ;
- QDomElement datalist = Graph.createElement( "data-list" ) ;
+ QDomElement datalist = GraphQDom.createElement( "data-list" ) ;
dataflow.appendChild( datalist ) ;
- const GraphBase::ListOfLinks * Datas = GetDatas() ;
+ const GraphBase::ListOfLinks * Datas = Graph()->GetDatas() ;
for ( i = 0 ; i < (int ) Datas->size() ; i++ ) {
// f << " <data>" << endl ;
- QDomElement data = Graph.createElement( "data" ) ;
+ QDomElement data = GraphQDom.createElement( "data" ) ;
datalist.appendChild( data ) ;
// LinkSaveXML( f , " " , (*Datas)[ i ] , true ) ;
- LinkSaveXML( Graph , data , (*Datas)[ i ] , true ) ;
+ LinkSaveXML( GraphQDom , data , (*Datas)[ i ] , true ) ;
// f << " </data>" << endl ;
}
//#if 0
bool GraphEditor::OutNode::SavePY( ostream & f ) {
int i ;
int j ;
- f << endl << "# Generated python file of Graph " << Name() << endl << endl ;
+ f << endl << "# Generated python file of Graph " << Graph()->Name() << endl << endl ;
f << "from SuperV import *" << endl ;
f << "# Graph creation " << endl ;
- GraphBase::DataNode::SavePY( f , Name() , 0 , 0 ) ;
+ Graph()->SavePY( f , Graph()->Name() , 0 , 0 ) ;
f << endl << "# Creation of Factory Nodes" << endl ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- if ( GraphNodes( i )->IsFactoryNode() ) {
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ if ( Graph()->GraphNodes( i )->IsFactoryNode() ) {
f << endl ;
- ((GraphBase::FactoryNode * ) GraphNodes( i ))->SavePY( f , Name() ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::FactoryNode * ) Graph()->GraphNodes( i ))->SavePY( f , Graph()->Name() ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
}
bool first = true ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- if ( GraphNodes( i )->IsComputingNode() ) {
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ if ( Graph()->GraphNodes( i )->IsComputingNode() ) {
if ( first ) {
f << endl << "# Creation of Computing Nodes" << endl ;
first = false ;
else {
f << endl ;
}
- ((GraphBase::ComputingNode * ) GraphNodes( i ))->SavePY( f , Name() ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::ComputingNode * ) Graph()->GraphNodes( i ))->SavePY( f , Graph()->Name() ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
}
first = true ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- if ( GraphNodes( i )->IsInLineNode() ) {
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ if ( Graph()->GraphNodes( i )->IsInLineNode() ) {
if ( first ) {
f << endl << "# Creation of InLine Nodes" << endl ;
first = false ;
else {
f << endl ;
}
- ((GraphBase::InLineNode * ) GraphNodes( i ))->SavePY( f , Name() ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::InLineNode * ) Graph()->GraphNodes( i ))->SavePY( f , Graph()->Name() ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
}
first = true ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- if ( GraphNodes( i )->IsLoopNode() ) {
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ if ( Graph()->GraphNodes( i )->IsLoopNode() ) {
if ( first ) {
f << endl << "# Creation of Loop Nodes" << endl ;
first = false ;
else {
f << endl ;
}
- ((GraphBase::LoopNode * ) GraphNodes( i ))->SavePY( f , Name() ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::LoopNode * ) Graph()->GraphNodes( i ))->SavePY( f , Graph()->Name() ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
}
first = true ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- if ( GraphNodes( i )->IsSwitchNode() ) {
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ if ( Graph()->GraphNodes( i )->IsSwitchNode() ) {
if ( first ) {
f << endl << "# Creation of Switch Nodes" << endl ;
first = false ;
else {
f << endl ;
}
- ((GraphBase::SwitchNode * ) GraphNodes( i ))->SavePY( f , Name() ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::SwitchNode * ) Graph()->GraphNodes( i ))->SavePY( f , Graph()->Name() ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
}
first = true ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- if ( GraphNodes( i )->IsGOTONode() ) {
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ if ( Graph()->GraphNodes( i )->IsGOTONode() ) {
if ( first ) {
f << endl << "# Creation of GOTO Nodes" << endl ;
first = false ;
else {
f << endl ;
}
- ((GraphBase::GOTONode * ) GraphNodes( i ))->SavePY( f , Name() ,
- GraphNodes( i )->XCoordinate() ,
- GraphNodes( i )->YCoordinate() ) ;
+ ((GraphBase::GOTONode * ) Graph()->GraphNodes( i ))->SavePY( f , Graph()->Name() ,
+ Graph()->GraphNodes( i )->XCoordinate() ,
+ Graph()->GraphNodes( i )->YCoordinate() ) ;
}
}
- const GraphBase::ListOfLinks * Links = GetLinks() ;
- bool intervar ;
- map< string , int > aMapOfOutPorts ;
+ const GraphBase::ListOfLinks * Links = Graph()->GetLinks() ;
+// bool intervar ;
+// map< string , int > aMapOfOutPorts ;
first = true ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
for ( j = 0 ; j < (int ) Links->size() ; j++ ) {
- if ( !strcmp( GraphNodes( i )->Name() , (*Links)[ j ].FromNodeName.c_str() ) ) {
+ if ( !strcmp( Graph()->GraphNodes( i )->Name() , (*Links)[ j ].FromNodeName.c_str() ) ) {
if ( first ) {
f << endl
<< "# Creation of Links"
else {
f << endl ;
}
- char * NodePort = new char [ strlen( (*Links)[ j ].FromNodeName.c_str() ) +
- strlen( (*Links)[ j ].FromServiceParameterName.c_str() ) + 1 ] ;
- strcpy( NodePort , (*Links)[ j ].FromNodeName.c_str() ) ;
- strcat( NodePort , (*Links)[ j ].FromServiceParameterName.c_str() ) ;
- if ( aMapOfOutPorts[ NodePort ] == 0 ) {
- aMapOfOutPorts[ NodePort ] = j + 1 ;
- intervar = true ;
- }
- else {
- intervar = false ;
- }
- LinkSavePY( f , Name() , (*Links)[ j ] , intervar , false ) ;
- delete [] NodePort ;
- }
- }
- }
-
-#if 0
- first = true ;
- for ( i = 0 ; i < Links->size() ; i++ ) {
- if ( GetGraphNode( (*Links)[ i ].FromNodeName.c_str() )->IsSwitchNode() ||
- GetGraphNode( (*Links)[ i ].ToNodeName.c_str() )->IsSwitchNode() ||
- GetGraphNode( (*Links)[ i ].FromNodeName.c_str() )->IsEndSwitchNode() ||
- GetGraphNode( (*Links)[ i ].ToNodeName.c_str() )->IsEndSwitchNode() ) {
- if ( first ) {
- f << endl
- << "# Creation of Switch Links"
- << endl ;
- first = false ;
- }
- char * NodePort = new char [ strlen( (*Links)[ i ].FromNodeName.c_str() ) +
- strlen( (*Links)[ i ].FromServiceParameterName.c_str() ) + 1 ] ;
- strcpy( NodePort , (*Links)[ i ].FromNodeName.c_str() ) ;
- strcat( NodePort , (*Links)[ i ].FromServiceParameterName.c_str() ) ;
- if ( aMapOfOutPorts[ NodePort ] == 0 ) {
- aMapOfOutPorts[ NodePort ] = i + 1 ;
- intervar = true ;
- }
- else {
- intervar = false ;
- }
- LinkSavePY( f , Name() , (*Links)[ i ] , intervar , false ) ;
- delete [] NodePort ;
- }
- }
-
- first = true ;
- for ( i = 0 ; i < Links->size() ; i++ ) {
- if ( GetGraphNode( (*Links)[ i ].FromNodeName.c_str() )->IsGOTONode() &&
- GetGraphNode( (*Links)[ i ].ToNodeName.c_str() )->IsInLineNode() ) {
- if ( first ) {
- f << endl
- << "# Creation of intermediate Output variables and of Loop Links"
- << endl ;
- first = false ;
- }
- char * NodePort = new char [ strlen( (*Links)[ i ].FromNodeName.c_str() ) +
- strlen( (*Links)[ i ].FromServiceParameterName.c_str() ) + 1 ] ;
- strcpy( NodePort , (*Links)[ i ].FromNodeName.c_str() ) ;
- strcat( NodePort , (*Links)[ i ].FromServiceParameterName.c_str() ) ;
- if ( aMapOfOutPorts[ NodePort ] == 0 ) {
- aMapOfOutPorts[ NodePort ] = i + 1 ;
- intervar = true ;
- }
- else {
- intervar = false ;
+// char * NodePort = new char [ strlen( (*Links)[ j ].FromNodeName.c_str() ) +
+// strlen( (*Links)[ j ].FromServiceParameterName.c_str() ) + 1 ] ;
+// strcpy( NodePort , (*Links)[ j ].FromNodeName.c_str() ) ;
+// strcat( NodePort , (*Links)[ j ].FromServiceParameterName.c_str() ) ;
+// if ( aMapOfOutPorts[ NodePort ] == 0 ) {
+// aMapOfOutPorts[ NodePort ] = j + 1 ;
+// intervar = true ;
+// }
+// else {
+// intervar = false ;
+// }
+ bool fromparam = false ;
+ if ( Graph()->GraphNodes( i )->GetOutPort( (*Links)[ j ].FromServiceParameterName.c_str() )->IsParam() ) {
+ fromparam = true ;
+ }
+ bool toparam = false ;
+ if ( Graph()->GetChangeGraphNode( (*Links)[ j ].ToNodeName.c_str() )->GetInPort( (*Links)[ j ].ToServiceParameterName.c_str() )->IsParam() ) {
+ toparam = true ;
+ }
+ LinkSavePY( f , Graph()->Name() , (*Links)[ j ] , fromparam , toparam , false ) ;
+// delete [] NodePort ;
}
- LinkSavePY( f , Name() , (*Links)[ i ] , intervar , false ) ;
- delete [] NodePort ;
}
}
-#endif
- const GraphBase::ListOfLinks * Datas = GetDatas() ;
+ const GraphBase::ListOfLinks * Datas = Graph()->GetDatas() ;
first = true ;
for ( i = 0 ; i < (int ) Datas->size() ; i++ ) {
if ( first ) {
- f << endl << "# Creation of Input datas" << endl ;
+ f << endl << "# Input datas" << endl ;
first = false ;
}
- LinkSavePY( f , Name() , (*Datas)[ i ] , false , true ) ;
+ bool fromparam = true ;
+ bool toparam = true ;
+ LinkSavePY( f , Graph()->Name() , (*Datas)[ i ] , fromparam , toparam , true ) ;
}
first = true ;
- const SALOME_ModuleCatalog::ListOfServicesParameter ListOfInParam = ServiceInParameter() ;
+ const SALOME_ModuleCatalog::ListOfServicesParameter ListOfInParam = Graph()->ServiceInParameter() ;
for ( i = 0 ; i < (int ) ListOfInParam.length() ; i++ ) {
string _aParam = CORBA::string_dup(ListOfInParam[ i ].Parametername) ;
const char * aParam = _aParam.c_str() ;
break ;
}
}
- if ( !GetChangeGraphNode( aNodeName )->GetInPort( aPortName )->IsDataConnected() ) {
+ const GraphBase::InPort * anInPort = Graph()->GetChangeGraphNode( aNodeName )->GetInPort( aPortName ) ;
+ if ( !anInPort->IsDataConnected() ) {
if ( first ) {
- f << endl << "# Missing Input datas" << endl ;
+ f << endl << "# Input Ports of the graph" << endl ;
first = false ;
}
- f << aNodeName << aPortName << " = " << aNodeName << ".Port( '"
+ f << "#I" << aNodeName << aPortName << " = " << aNodeName << ".GetInPort( '"
<< aPortName << "' )" << endl ;
}
delete [] aNodeName ;
delete [] aPortName ;
}
- f << endl << "# Creation of Output variables" << endl ;
- const SALOME_ModuleCatalog::ListOfServicesParameter ListOfOutParam = ServiceOutParameter() ;
+ f << endl << "# Output Ports of the graph" << endl ;
+ const SALOME_ModuleCatalog::ListOfServicesParameter ListOfOutParam = Graph()->ServiceOutParameter() ;
for ( i = 0 ; i < (int ) ListOfOutParam.length() ; i++ ) {
string _aParam = CORBA::string_dup(ListOfOutParam[ i ].Parametername) ;
const char * aParam = _aParam.c_str() ;
break ;
}
}
- f << aNodeName << aPortName << " = " << aNodeName << ".Port( '"
+ f << "#O" << aNodeName << aPortName << " = " << aNodeName << ".GetOutPort( '"
<< aPortName << "' )" << endl ;
delete [] aNodeName ;
delete [] aPortName ;
ostream & operator<< (ostream & f,const GraphEditor::OutNode & G) {
- f << (GraphBase::ComputingNode ) G ;
+ f << (GraphBase::ComputingNode ) *(G.Graph()) ;
f << endl ;
- f << " Nodes : " << G.GraphNodesSize() << " node"
- << (G.GraphNodesSize() > 1 ? "s" : "") << endl;
+ f << " Nodes : " << (G.Graph())->GraphNodesSize() << " node"
+ << ((G.Graph())->GraphNodesSize() > 1 ? "s" : "") << endl;
int i ;
- for ( i = 0 ; i < G.GraphNodesSize() ; i++ ) {
+ for ( i = 0 ; i < (G.Graph())->GraphNodesSize() ; i++ ) {
f
-// << hex << (void *) G.GraphNodes( i ) << dec << " "
- << *G.GraphNodes( i ) << endl;
+// << hex << (void *) G.Graph().GraphNodes( i ) << dec << " "
+ << (G.Graph())->GraphNodes( i ) << endl;
}
f << " Links : " << endl ;
- for ( i = 0 ; i < G.GraphNodesSize() ; i++ ) {
- G.GraphNodes( i )->ListLinks( f ) ;
+ for ( i = 0 ; i < (G.Graph())->GraphNodesSize() ; i++ ) {
+ (G.Graph())->GraphNodes( i )->ListLinks( f ) ;
}
f << " Datas : " << endl ;
- G.ListDatas( f ) ;
+ (G.Graph())->ListDatas( f ) ;
- f << "DataFlow " << G.Name() << " is " ;
+ f << "DataFlow " << (G.Graph())->Name() << " is " ;
if ( G.IsNotValid() )
f << "not " ;
f << "valid and is " ;
#ifndef _DATAFLOWEDITOR_OUTNODE_HXX
#define _DATAFLOWEDITOR_OUTNODE_HXX
-#include "DataFlowBase_Graph.hxx"
+#include "DataFlowBase_StreamGraph.hxx"
#include "DataFlowEditor_InNode.hxx"
namespace GraphEditor {
- class OutNode : public GraphBase::Graph {
+// class OutNode : public GraphBase::Graph {
+ class OutNode : public GraphBase::Base {
private :
+ GraphBase::StreamGraph * _StreamGraph ;
+ GraphBase::Graph * _Graph ;
+
+ int _Graph_prof_debug ;
+
bool _Imported ;
bool _Valid ;
bool GraphEditor::OutNode::LinkSavePY( ostream &f ,
const char *aGraphName ,
GraphBase::SLink aLink ,
- bool intervar ,
+ bool fromparam ,
+ bool toparam ,
bool wdata ) const;
bool SavePY(ostream &f ) ;
OutNode( CORBA::ORB_ptr ORB,
SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ,
- const char * DebugFileName );
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode );
OutNode( CORBA::ORB_ptr ORB,
SALOME_NamingService* ptrNamingService ,
const SALOME_ModuleCatalog::Service& DataFlowService ,
const char * DebugFileName ) ;
virtual ~OutNode();
-// SALOME_NamingService* NamingService() const {
-// return _theNamingService ; } ;
+ void Set_prof_debug( CORBA::ORB_ptr ORB , const char * DebugFileName ) ;
+ GraphBase::StreamGraph * StreamGraph() {
+ return _StreamGraph ; } ;
+ GraphBase::StreamGraph * StreamGraph() const {
+ return _StreamGraph ; } ;
+ GraphBase::Graph * Graph() {
+ return _Graph ; } ;
+ const GraphBase::Graph * Graph() const {
+ return _Graph ; } ;
bool LoadDataFlow( const GraphBase::SGraph *aDataFlow ) ;
bool LoadXml( const char* myFileName ) ;
const int NodeX ,
const int NodeY ) ;
GraphEditor::InNode * GetNode( const char* NodeName ) {
- const GraphBase::Graph::ComputingNode * aNode = GraphBase::Graph::GetGraphNode( NodeName ) ;
+ const GraphBase::Graph::ComputingNode * aNode = _Graph->GetGraphNode( NodeName ) ;
if ( aNode ) {
return (GraphEditor::InNode * ) (aNode->GetInNode()) ;
}
bool RemoveNode( const char* NodeName ) {
DateModification() ;
_Valid = false ;
- return GraphBase::Graph::RemoveNode( NodeName ) ; } ;
+ return _Graph->RemoveNode( NodeName ) ; } ;
bool ReNameNode( const char* OldNodeName ,
const char* NewNodeName ) {
DateModification() ;
_Valid = false ;
- return GraphBase::Graph::ReNameNode( OldNodeName , NewNodeName ) ; } ;
+ return _Graph->ReNameNode( OldNodeName , NewNodeName ) ; } ;
void Coordinates( const int X , const int Y ) {
- return GraphBase::Graph::Coordinates( X , Y ) ; } ;
+ return _Graph->Coordinates( X , Y ) ; } ;
const int XCoordinate() {
- return GraphBase::Graph::XCoordinate() ; } ;
+ return _Graph->XCoordinate() ; } ;
const int YCoordinate() {
- return GraphBase::Graph::YCoordinate() ; } ;
+ return _Graph->YCoordinate() ; } ;
void Coordinates( const char* NodeName , const int X , const int Y ) ;
const int XCoordinate( const char* NodeName ) ;
const int YCoordinate( const char* NodeName ) ;
- const GraphBase::InPort *GetInPort( const char *name ) {
- return GraphBase::PortsOfNode::GetInPort( name ) ; } ;
- const GraphBase::OutPort *GetOutPort( const char *name ) {
- return GraphBase::PortsOfNode::GetOutPort( name ) ; } ;
- GraphBase::InPort *GetChangeInPort( const char *name ) {
- return GraphBase::PortsOfNode::GetChangeInPort( name ) ; } ;
- GraphBase::OutPort *GetChangeOutPort( const char *name ) {
- return GraphBase::PortsOfNode::GetChangeOutPort( name ) ; } ;
+ const GraphBase::InPort *GetInPort( const char * InPortName ) {
+ return _Graph->GetInPort( InPortName ) ; } ;
+ const GraphBase::OutPort *GetOutPort( const char * OutPortName ) {
+ return _Graph->GetOutPort( OutPortName ) ; } ;
+ GraphBase::InPort *GetChangeInPort( const char * InPortName ) {
+ return _Graph->GetChangeInPort( InPortName ) ; } ;
+ GraphBase::OutPort *GetChangeOutPort( const char * OutPortName ) {
+ return _Graph->GetChangeOutPort( OutPortName ) ; } ;
bool HasInput(const char * ToServiceParameterName ) {
- return GraphBase::ComputingNode::HasInput( ToServiceParameterName ) ;
+ return _Graph->HasInput( ToServiceParameterName ) ;
}
bool AddLink( const char* FromNodeName ,
const CORBA::Any aValue ) {
DateModification() ;
_Valid = false ;
- return GraphBase::Graph::AddLink(
- FromNodeName , FromServiceParameterName ,
- ToNodeName , ToServiceParameterName ,
- aValue ) ; } ;
+ return _Graph->AddLink( FromNodeName , FromServiceParameterName ,
+ ToNodeName , ToServiceParameterName ,
+ aValue ) ; } ;
bool RemoveLink( const char* FromNodeName ,
const char* FromServiceParameterName ,
const char* ToNodeName ,
const char* ToServiceParameterName ) {
- bool RetVal = GraphBase::Graph::RemoveLink(
- FromNodeName ,
- FromServiceParameterName ,
- ToNodeName ,
- ToServiceParameterName ) ;
+ bool RetVal = _Graph->RemoveLink( FromNodeName ,
+ FromServiceParameterName ,
+ ToNodeName ,
+ ToServiceParameterName ) ;
if ( RetVal )
DateModification() ;
_Valid = false ;
const char* ToServiceParameterName ,
char** FromNodeName ,
char** FromServiceParameterName ) {
- return GraphBase::Graph::GetLink( ToNodeName ,
- ToServiceParameterName ,
- FromNodeName ,
- FromServiceParameterName ) ; } ;
+ return _Graph->GetLink( ToNodeName ,
+ ToServiceParameterName ,
+ FromNodeName ,
+ FromServiceParameterName ) ; } ;
bool AddLinkCoord( const char* FromNodeName ,
const char* FromServiceParameterName ,
CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \
-I${KERNEL_ROOT_DIR}/include/salome
-#CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wno-deprecated
CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
-I${KERNEL_ROOT_DIR}/include/salome
-#LDFLAGS+= -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionExecutor -lOpUtil -lSalomeLoggerServer -lc $(PYTHON_LIBS) $(QT_MT_LIBS) $(OGL_LIBS)
LDFLAGS+= -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionExecutor -lOpUtil -lSALOMELocalTrace \
-lc $(QT_MT_LIBS) $(OGL_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
+#LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
@CONCLUDE@
GraphExecutor::DataFlow::DataFlow( CORBA::ORB_ptr ORB,
SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ,
- const char * DebugFileName ) :
- OutNode( ORB, ptrNamingService , DataFlowName , DebugFileName ) {
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode ) :
+ OutNode( ORB, ptrNamingService , DataFlowName , DebugFileName , aKindOfNode ) {
cdebug_in << "GraphExecutor::DataFlow::DataFlow(" ;
if ( DataFlowName ) {
cdebug << DataFlowName ;
bool GraphExecutor::DataFlow::Ping( const char *aNodeName ) {
cdebug_in << "GraphExecutor::DataFlow::Ping" << aNodeName << " )" << endl;
bool RetVal = false ;
- if ( GetGraphNode( aNodeName ) )
- RetVal = ((GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode())->Ping() ;
+ if ( Graph()->GetGraphNode( aNodeName ) )
+ RetVal = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode())->Ping() ;
cdebug_out << "GraphExecutor::DataFlow::Ping" << endl;
return RetVal ;
}
bool GraphExecutor::DataFlow::ContainerKill( const char *aNodeName ) {
// cdebug_in << "GraphExecutor::DataFlow::ContainerKill( " << aNodeName << " )"<< endl;
bool RetVal = false ;
- GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode()) ;
+ GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
if ( aNode ) {
RetVal = aNode->ContainerKill() ;
}
bool GraphExecutor::DataFlow::Kill( const char *aNodeName ) {
// cdebug_in << "GraphExecutor::DataFlow::Kill( " << aNodeName << " )"<< endl;
bool RetVal = false ;
- GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode()) ;
+ GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
if ( aNode ) {
RetVal = aNode->Kill() ;
}
bool GraphExecutor::DataFlow::KillDone( const char *aNodeName ) {
// cdebug_in << "GraphExecutor::DataFlow::KillDone( " << aNodeName << " )"<< endl;
bool RetVal = false ;
- GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode()) ;
+ GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
if ( aNode ) {
RetVal = aNode->KillDone() ;
}
bool GraphExecutor::DataFlow::Suspend( const char *aNodeName ) {
// cdebug_in << "GraphExecutor::DataFlow::Suspend( " << aNodeName << " )"<< endl;
bool RetVal = false ;
- GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode()) ;
+ GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
if ( aNode ) {
RetVal = aNode->Suspend() ;
}
bool GraphExecutor::DataFlow::SuspendDone( const char *aNodeName ) {
// cdebug_in << "GraphExecutor::DataFlow::SuspendDone( " << aNodeName << " )"<< endl;
bool RetVal = false ;
- GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode()) ;
+ GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
if ( aNode ) {
RetVal = aNode->SuspendDone() ;
}
bool GraphExecutor::DataFlow::Resume( const char *aNodeName ) {
// cdebug_in << "GraphExecutor::DataFlow::Resume( " << aNodeName << " )"<< endl;
bool RetVal = false ;
- GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode()) ;
+ GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
if ( aNode ) {
RetVal = aNode->Resume() ;
}
bool GraphExecutor::DataFlow::Stop( const char *aNodeName ) {
// cdebug_in << "GraphExecutor::DataFlow::Stop( " << aNodeName << " )"<< endl;
bool RetVal = false ;
- GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode()) ;
+ GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
if ( aNode ) {
RetVal = aNode->Stop() ;
}
DataFlow();
DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
const char * DataFlowName ,
- const char * DebugFileName );
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode );
DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
const SALOME_ModuleCatalog::Service& DataFlowService ,
const char *DataFlowComponentName ,
inline const SALOME_ModuleCatalog::Service * GraphExecutor::DataFlow::NodeService(
const char * aNodeName ) {
- if ( GetGraphNode( aNodeName ) )
- return GetGraphNode( aNodeName )->GetService() ;
+ if ( Graph()->GetGraphNode( aNodeName ) )
+ return Graph()->GetGraphNode( aNodeName )->GetService() ;
return NULL ;
}
const CORBA::Any aValue ) {
if ( !IsValid() )
return false ;
- return GraphBase::Graph::ChangeInputData( ToNodeName , ToParameterName ,
- aValue ) ;
+ return Graph()->ChangeInputData( ToNodeName , ToParameterName , aValue ) ;
} ;
inline bool GraphExecutor::DataFlow::AddInputSharedData(const char* ToNodeName1 ,
bool RetVal = false ;
if ( _MapOfPyFunctions[ aPyFuncName ] != NULL ) {
- PyObject * aPyFunc = _MapOfPyFunctions[ aPyFuncName ] ;
+ //PyObject * aPyFunc = _MapOfPyFunctions[ aPyFuncName ] ;
//cout << "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' , " << aPyFunction
// << " ) ob_refcnt " << aPyFunction->ob_refcnt << " already mapped : " << aPyFunc << " ob_refcnt "
// << aPyFunc->ob_refcnt << endl ;
_InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
break ;
}
- case SUPERV::DataFlowNode : {
- cdebug << "GraphEditor::InNode::InNode SUPERV::DataFlowNode ERROR : " << NodeName ;
+ case SUPERV::DataFlowGraph : {
+ cdebug << "GraphEditor::InNode::InNode SUPERV::DataFlowGraph ERROR : " << NodeName ;
+ }
+ case SUPERV::DataStreamGraph : {
+ cdebug << "GraphEditor::InNode::InNode SUPERV::DataStreamGraph ERROR : " << NodeName ;
}
case SUPERV::UnknownNode : {
cdebug << "GraphEditor::InNode::InNode SUPERV::UnknownNode ERROR : " << NodeName ;
bool GraphExecutor::InNode::ReStart( const char * AtNodeName ,
const bool AndSuspend ) {
bool RetVal = false ;
- GraphExecutor::InNode * aRestartNode = (GraphExecutor::InNode *) _OutNode->GetGraphNode( AtNodeName )->GetInNode() ;
+ GraphExecutor::InNode * aRestartNode = (GraphExecutor::InNode *) _OutNode->Graph()->GetGraphNode( AtNodeName )->GetInNode() ;
cdebug_in << pthread_self() << "/" << ThreadNo()
<< " --> GraphExecutor::InNode::ReStartAt( "
<< AtNodeName << " , " << AndSuspend << ") " << endl
ThreadNo( 0 ) ;
for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
- if ( i != 0 || !IsGOTONode() ) {
+ if ( GetNodeOutPort(i)->IsDataStream() ) {
+ GetChangeNodeOutPort(i)->State( SUPERV::ReadyState ) ;
+ GetChangeNodeOutPort(i)->Done( true ) ;
+ }
+ else if ( i != 0 || !IsGOTONode() ) {
GetChangeNodeOutPort(i)->State( SUPERV::WaitingState ) ;
GetChangeNodeOutPort(i)->Done( false ) ;
}
if ( anInPort->IsGate() && anOutPort == NULL ) {
Pc-- ;
}
- else {
- if ( anOutPort->IsDataConnected() ) {
+ else if ( anOutPort ) {
+ if ( anOutPort->IsDataConnected() || anOutPort->IsDataStream() ) {
Pc-- ;
}
- if ( anOutPort->IsPortConnected() ) {
- anOutPort->State( SUPERV::WaitingState ) ;
- anOutPort->Done( false ) ;
- }
- else if ( anOutPort->IsDataConnected() ) {
+ if ( anOutPort->IsDataConnected() || anOutPort->IsDataStream() ) {
anOutPort->State( SUPERV::ReadyState ) ;
anOutPort->Done( true ) ;
}
+ else if ( anOutPort->IsPortConnected() ) {
+ anOutPort->State( SUPERV::WaitingState ) ;
+ anOutPort->Done( false ) ;
+ }
}
if ( anOutPort ) {
- GetChangeNodeInPort(i)->State( anOutPort->State() ) ;
+ if ( !anOutPort->IsDataStream() || anInPort->IsDataStream() ) {
+ cdebug << "InPort" << i << " state change : " << anInPort->PortName() << " from OutPort "
+ << anOutPort->PortName() << " from Node " << anOutPort->NodeName()
+ << " with state " << theAutomaton->StateName( anOutPort->State() ) << endl ;
+ GetChangeNodeInPort(i)->State( anOutPort->State() ) ;
+ }
+ else {
+ cdebug << "InPort" << i << " state change : " << anInPort->PortName() << " from OutPort "
+ << anOutPort->PortName() << " from Node " << anOutPort->NodeName()
+ << " with state ReadyState" << endl ;
+ GetChangeNodeInPort(i)->State( SUPERV::ReadyState ) ;
+ }
}
if ( anOutPort ) {
cdebug << "InPort" << i << " : " << anInPort->PortName() << " from OutPort "
_OutNode->PushEvent( this , GraphExecutor::AllDataReadyEvent ,
_currentState ) ;
}
+
+ for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
+ cdebug << "OutPort" << i << " : " << GetNodeOutPort(i)->PortName() << " "
+ << theAutomaton->StateName( GetChangeNodeOutPort(i)->State() )
+ << " " << GetNodeOutPort(i)->Kind() << endl ;
+ }
+
cdebug << "CurrentState = " << theAutomaton->StateName( _currentState )
<< endl;
if ( !PyFuncRunned() && IsOneOfInLineNodes() ) {
if ( IsLoopNode() ) {
PyObject * PyRunMethod = InLineNode()->PyRunMethod() ;
+ PyObject * PyMoreMethod = NULL ;
+ PyObject * PyNextMethod = NULL ;
if ( PyRunMethod ) {
}
else {
- PyObject * PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
- InLineNode()->PythonFunction() ) ;
+ PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
+ InLineNode()->PythonFunction() ,
+ Err ) ;
InLineNode()->PyRunMethod( PyRunMethod ) ;
}
- PyObject * PyMoreMethod = LoopNode()->PyMoreMethod() ;
- if ( PyMoreMethod ) {
- }
- else {
- PyMoreMethod = InitPyDynInvoke( LoopNode()->PyMoreName() ,
- LoopNode()->MorePythonFunction() ) ;
- LoopNode()->PyMoreMethod( PyMoreMethod ) ;
- }
- PyObject * PyNextMethod = LoopNode()->PyNextMethod() ;
- if ( PyNextMethod ) {
+ if ( !Err ) {
+ PyMoreMethod = LoopNode()->PyMoreMethod() ;
+ if ( PyMoreMethod ) {
+ }
+ else {
+ PyMoreMethod = InitPyDynInvoke( LoopNode()->PyMoreName() ,
+ LoopNode()->MorePythonFunction() ,
+ Err ) ;
+ LoopNode()->PyMoreMethod( PyMoreMethod ) ;
+ }
}
- else {
- PyNextMethod = InitPyDynInvoke( LoopNode()->PyNextName() ,
- LoopNode()->NextPythonFunction() ) ;
- LoopNode()->PyNextMethod( PyNextMethod ) ;
+ if ( !Err ) {
+ PyNextMethod = LoopNode()->PyNextMethod() ;
+ if ( PyNextMethod ) {
+ }
+ else {
+ PyNextMethod = InitPyDynInvoke( LoopNode()->PyNextName() ,
+ LoopNode()->NextPythonFunction() ,
+ Err ) ;
+ LoopNode()->PyNextMethod( PyNextMethod ) ;
+ }
}
cdebug << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " PyRunMethod(Init) " << PyRunMethod
<< " PyMoreMethod " << PyMoreMethod << " PyNextMethod " << PyNextMethod << endl;
- Err = !PyRunMethod || !PyMoreMethod || !PyNextMethod ;
}
else if ( IsInLineNode() || IsSwitchNode() ) {
PyObject * PyRunMethod = InLineNode()->PyRunMethod() ;
}
else {
PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
- InLineNode()->PythonFunction() ) ;
+ InLineNode()->PythonFunction() ,
+ Err ) ;
InLineNode()->PyRunMethod( PyRunMethod ) ;
}
cdebug << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " PyRunMethod " << PyRunMethod << endl;
- Err = !PyRunMethod ;
}
else if ( ( IsEndLoopNode() || IsEndSwitchNode() || IsGOTONode() ) &&
(*InLineNode()->PythonFunction()).length() ) {
}
else {
PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
- InLineNode()->PythonFunction() ) ;
+ InLineNode()->PythonFunction() ,
+ Err ) ;
InLineNode()->PyRunMethod( PyRunMethod ) ;
}
cdebug << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " PyRunMethod " << PyRunMethod << endl;
- Err = !PyRunMethod ;
}
}
Err = WithErr && Err ;
cdebug << " Error " << Err ;
}
cdebug << endl;
- return Err ;
+ return !Err ;
}
const long GraphExecutor::InNode::CpuUsed( bool tot ) {
return GOTONode()->CoupledNode() ; } ;
GraphBase::InPort * AddInPort( const char * InputParameterName ,
- const char * InputParameterType ) {
+ const char * InputParameterType ,
+ const SUPERV::KindOfPort aKindOfPort ) {
return _ComputingNode->AddInPort( InputParameterName ,
- InputParameterType ) ; } ;
+ InputParameterType ,
+ aKindOfPort ) ; } ;
GraphBase::OutPort * AddOutPort( const char * OutputParameterName ,
- const char * OutputParameterType ) {
+ const char * OutputParameterType ,
+ const SUPERV::KindOfPort aKindOfPort ) {
return _ComputingNode->AddOutPort( OutputParameterName ,
- OutputParameterType ) ; } ;
+ OutputParameterType ,
+ aKindOfPort ) ; } ;
// void InOutPort( GraphBase::InPort * InputPort ,
// GraphBase::OutPort * OutputPort ) {
// return _ComputingNode->InOutPort( InputPort , OutputPort ) ; } ;
int LinkedNodesSize() const {
return _ComputingNode->LinkedNodesSize() ; } ;
- GraphBase::ComputingNode * LinkedNodes( int i ) const {
- return _ComputingNode->LinkedNodes( i ) ; } ;
+// GraphBase::ComputingNode * LinkedNodes( int i ) const {
+ GraphBase::StreamNode * LinkedNodes( int i ) const {
+ return _ComputingNode->LinkedNodes( i ) ; } ;
const int LinkedInPortsNumber( int i ) const {
return _ComputingNode->LinkedInPortsNumber( i ) ; } ;
bool InitPython() ;
PyObject * InitPyDynInvoke( char * PyFuncName ,
- const SUPERV::ListOfStrings * aPythonFunction ) ;
+ const SUPERV::ListOfStrings * aPythonFunction ,
+ bool & Err ) ;
void LockDataWait() ;
void UnLockDataWait() ;
#include "DataFlowExecutor_OutNode.hxx"
+#include "Graph_Impl.hxx"
+
//static char *containerName = "FactoryServer" ;
int GraphExecutor::InNode::SendEvent( const GraphExecutor::NodeEvent anEvent ) {
int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
-// cdebug << pthread_self() << "/" << ThreadNo()
-// << " --> DataWaiting_SomeDataReadyAction from " << DataFromNode()
-// << " to " << Name() << endl;
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << " --> DataWaiting_SomeDataReadyAction from " << DataFromNode()
+ << " to " << Name() << endl;
unsigned int k;
int InReady = 0 ;
int res = 1;
for ( k = 0 ; k < (unsigned int ) GetNodeInPortsSize() ; k++ ) {
GraphBase::InPort * anInPort = GetChangeNodeInPort(k) ;
GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
+ cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort " << anInPort->PortName() << endl ;
if ( anInPort->IsGate() && anOutPort == NULL ) {
InReady += 1 ;
anInPort->State( SUPERV::ReadyState ) ;
}
}
else if ( CORBA::is_nil( Component() ) ) {
- Err = !_OutNode->StartComponent( ThreadNo() , Computer() ,
- my_strdup( ComponentName() ) ,
- myContainer , myObjComponent ) ;
+ ostringstream astr ;
+ astr << "Graph " << _OutNode->Graph()->Name() << " Node " << Name()
+ << " : load of component " << ComponentName() << " in container "
+ << Computer() ;
+ _OutNode->Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
+ Err = !_OutNode->Graph()->StartComponent( ThreadNo() , Computer() ,
+ my_strdup( ComponentName() ) ,
+ myContainer , myObjComponent ) ;
ObjInterface( false ) ;
SetContainer( myContainer ) ;
SetComponent( myObjComponent ) ;
}
else {
if ( !Err ) {
+ ostringstream astr ;
+ astr << "Graph " << _OutNode->Graph()->Name() << " Run of Node " << Name() ;
+ _OutNode->Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
cdebug << ThreadNo() << " Run( '" << ServiceName() << "'" ;
for ( i = 0 ; i < (int ) ServiceInParameter().length() ; i++ ) {
cdebug << " , " << InParametersList[ i ].Name << "[kind"
else {
try {
try {
- cdebug << "DynInvoke -> Names " << _OutNode->Name() << " " << Name() << endl ;
+ cdebug << "DynInvoke -> Names " << _OutNode->Graph()->Name() << " " << Name() << endl ;
DynInvoke( myObjComponent, "Names" ,
- _OutNode->Name() , Name() ) ;
+ _OutNode->Graph()->Name() , Name() ) ;
}
catch( ... ) {
cdebug << "DynInvoke Names catched ERROR" << endl ;
}
- cdebug << ServiceInParameter().length() << " input parameters and "
- << ServiceOutParameter().length() << " output parameters" << endl ;
if ( IsComputingNode() ) {
cdebug << ThreadNo() << " !ObjInterface " << Name()
<< " IsComputingNode DynInvoke" << endl ;
+ cdebug << ServiceInParameter().length()-1 << " input parameters and "
+ << ServiceOutParameter().length() << " output parameters" << endl ;
DynInvoke( myObjComponent,
ServiceName() ,
&InParametersList[1] , ServiceInParameter().length()-1 ,
else if ( IsFactoryNode() ) {
cdebug << ThreadNo() << " !ObjInterface " << Name()
<< " IsFactoryNode DynInvoke" << endl ;
+ cdebug << ServiceInParameter().length() << " input parameters and "
+ << ServiceOutParameter().length() << " output parameters" << endl ;
DynInvoke( myObjComponent,
ServiceName() ,
&InParametersList[0] , ServiceInParameter().length() ,
// sleep( 1 ) ;
// }
+ ostringstream astr ;
+ astr << "Graph " << _OutNode->Graph()->Name() << " Node " << Name() << " is done : "
+ << Automaton()->StateName( State() ) ;
+ _OutNode->Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
if ( Err ) {
if ( ControlState() == SUPERV::ToKillState ||
ControlState() == SUPERV::ToKillDoneState ||
// << " --> GraphExecutor::InNodeThreads::SetWaitingStates " << Name() << endl;
docdebug = true ;
}
- anInPort->State( SUPERV::WaitingState ) ;
+ if ( !anInPort->IsDataStream() ) {
+ anInPort->State( SUPERV::WaitingState ) ;
+ }
}
}
for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
- for ( j = 0 ; j < GetChangeNodeOutPort( i )->InPortsSize() ; j++ ) {
- GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ;
+ GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ;
+ for ( j = 0 ; j < anOutPort->InPortsSize() ; j++ ) {
if ( !( IsGOTONode() && anOutPort->IsGate() ) &&
- !( IsEndLoopNode() && ( anOutPort->IsGate() || anOutPort->IsLoop() ) ) ) {
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) _OutNode->GetChangeGraphNode( anOutPort->ChangeInPorts( j )->NodeName() )->GetInNode() ;
+ !( IsEndLoopNode() && ( anOutPort->IsGate() ||
+ anOutPort->IsLoop() ) ) &&
+ !anOutPort->IsDataStream() &&
+ !anOutPort->ChangeInPorts( j )->IsDataStream() ) {
+// cdebug << ThreadNo()
+// << " GraphExecutor::InNodeThreads::SetWaitingStates "
+// << Name() << "( " << anOutPort->PortName() << " ) --> InPort "
+// << anOutPort->ChangeInPorts( j )->PortName() << " from Node "
+// << anOutPort->ChangeInPorts( j )->NodeName() << endl;
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) _OutNode->Graph()->GetChangeGraphNode( anOutPort->ChangeInPorts( j )->NodeName() )->GetInNode() ;
if ( aNode != EndNode ) {
aNode->SetWaitingStates( EndNode ) ;
}
if ( IsGOTONode() ||
( IsEndLoopNode() && GetNodeInLoop()->GetOutPort()->BoolValue() ) ) {
+ cdebug << ThreadNo() << " Successed_SuccessAction " << Name()
+ << " SetWaitingStates " << endl ;
const GraphBase::OutPort * aGateOutPort ;
if ( IsGOTONode() ) {
aGateOutPort = GetNodeOutGate() ;
}
for ( i = 0 ; i < aGateOutPort->InPortsSize() ; i++ ) {
const GraphBase::InPort * anInPort = aGateOutPort->InPorts( i ) ;
- GraphExecutor::InNode * aLabelNode = (GraphExecutor::InNode *) _OutNode->GetChangeGraphNode( anInPort->NodeName() )->GetInNode() ;
+ GraphExecutor::InNode * aLabelNode = (GraphExecutor::InNode *) _OutNode->Graph()->GetChangeGraphNode( anInPort->NodeName() )->GetInNode() ;
// cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " will Loop to HeadNode "
// << aLabelNode->Name() << " from port " << anInPort->PortName() << endl ;
aLabelNode->SetWaitingStates( this ) ;
// cdebug << endl;
for ( i = 0 ; i < LinkedNodesSize() ; i++ ) {
bool IgnoreForEndLoop = false ;
- toNode = (GraphExecutor::InNode *) LinkedNodes( i )->GetInNode() ;
+ GraphBase::ComputingNode * aComputingNode ;
+ aComputingNode = (GraphBase::ComputingNode * ) LinkedNodes( i ) ;
+ toNode = (GraphExecutor::InNode *) aComputingNode->GetInNode() ;
// cdebug << ThreadNo() << " Successed_SuccessAction of " << Name()
// << " [" << i << "] " << LinkedNodes( i )->Name() << endl ;
if ( toNode && !toNode->IsDataFlowNode() ) {
*anAny <<= (long ) 0 ;
theOutPort->Value( anAny ) ;
}
- anInPort->State( SUPERV::WaitingState ) ;
+ if ( !anInPort->IsDataStream() ) {
+ anInPort->State( SUPERV::WaitingState ) ;
+ }
D.Name = CORBA::string_dup( anInPort->GetServicesParameter().Parametername ) ;
cdebug << ThreadNo() << " ArgIn" << i << " " << anInPort->Kind() ;
cdebug << " " << D.Name << " " << anInPort->GetServicesParameter().Parametertype << " : " ;
}
}
OutParametersList[i] = D ;
- if ( anOutPort->IsGate() ) {
- aGateOutPort = anOutPort ;
- cdebug << " Gate " ;
- long l = 1;
- OutParametersList[i].Value <<= l;
- anOutPort->Value( OutParametersList[i].Value );
- }
- else if ( anOutPort->IsLoop() ) {
- cdebug << " Loop " ;
- anOutPort->Value( OutParametersList[i].Value );
+ if ( !anOutPort->IsDataStream() ) {
+ if ( anOutPort->IsGate() ) {
+ aGateOutPort = anOutPort ;
+ cdebug << " Gate " ;
+ long l = 1;
+ OutParametersList[i].Value <<= l;
+ anOutPort->Value( OutParametersList[i].Value );
+ }
+ else if ( anOutPort->IsLoop() ) {
+ cdebug << " Loop " ;
+ anOutPort->Value( OutParametersList[i].Value );
// InLoop Port of EndLoopNode is ready :
- anOutPort->ChangeInPorts(0)->State( SUPERV::ReadyState ) ;
- }
- else if ( anOutPort->IsSwitch() ) {
- cdebug << " Switch " ;
- anOutPort->Value( OutParametersList[i].Value );
- if ( anOutPort->InPortsSize() && anOutPort->ChangeInPorts( 0 )->IsGate() ) {
- if ( OrSwitch && anOutPort->BoolValue() ) {
- cdebug << "GraphExecutor::InNodeThreads::OutParameters more than one switch is true WARNING"
- << endl ;
- }
- else {
- OrSwitch = OrSwitch | anOutPort->BoolValue() ;
- }
- }
- cdebug << "OrSwitch " << OrSwitch ;
- }
- else {
- cdebug << " Param " ;
- anOutPort->Value( OutParametersList[i].Value );
- }
- anOutPort->State( NewState ) ;
- anOutPort->Done( true ) ;
+ anOutPort->ChangeInPorts(0)->State( SUPERV::ReadyState ) ;
+ }
+ else if ( anOutPort->IsSwitch() ) {
+ cdebug << " Switch " ;
+ anOutPort->Value( OutParametersList[i].Value );
+ if ( anOutPort->InPortsSize() && anOutPort->ChangeInPorts( 0 )->IsGate() ) {
+ if ( OrSwitch && anOutPort->BoolValue() ) {
+ cdebug << "GraphExecutor::InNodeThreads::OutParameters more than one switch is true WARNING"
+ << endl ;
+ }
+ else {
+ OrSwitch = OrSwitch | anOutPort->BoolValue() ;
+ }
+ }
+ cdebug << "OrSwitch " << OrSwitch ;
+ }
+ else {
+ cdebug << " Param " ;
+ anOutPort->Value( OutParametersList[i].Value );
+ }
+ anOutPort->State( NewState ) ;
+ anOutPort->Done( true ) ;
+ }
int j ;
for ( j = 0 ; j < anOutPort->InPortsSize() ; j++ ) {
bool fromGOTO = false ;
- GraphBase::OutPort * aGOTOPort = _OutNode->GetChangeGraphNode( anOutPort->ChangeInPorts( j )->NodeName() )->GetChangeNodeInGate()->GetOutPort() ;
+ GraphBase::OutPort * aGOTOPort = _OutNode->Graph()->GetChangeGraphNode( anOutPort->ChangeInPorts( j )->NodeName() )->GetChangeNodeInGate()->GetOutPort() ;
if ( aGOTOPort ) {
fromGOTO = aGOTOPort->IsGOTO() ;
}
#include "DataFlowExecutor_OutNode.hxx"
+#include "Graph_Impl.hxx"
+
// Implementation de la classe GraphEditor::GraphControl
extern GraphExecutor::FiniteStateMachine * theAutomaton ;
extern int _ArgC ;
extern char ** _ArgV ;
-GraphExecutor::OutNode::OutNode() :
- Graph() {
+GraphExecutor::OutNode::OutNode() {
+// Graph() {
_Valid = false ;
_Executable = false ;
_Done = false ;
GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ,
- const char * DebugFileName ) :
- Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) {
- cdebug_in << "GraphEditor::OutNode::OutNode(" << DataFlowName << ")" << endl;
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode ) {
+// Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) {
+ Set_prof_debug( ORB , DebugFileName ) ;
+ cdebug_in << "GraphEditor::OutNode::OutNode(" << DataFlowName << " , " << aKindOfNode << ")" << endl;
+ if ( aKindOfNode == SUPERV::DataFlowGraph ) {
+ _StreamGraph = NULL ;
+// _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;
+ _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName ,
+ _prof_debug , _fdebug ) ;
+ }
+ else if ( aKindOfNode == SUPERV::DataStreamGraph ) {
+// _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;;
+ _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName ,
+ _prof_debug , _fdebug ) ;
+ _Graph = _StreamGraph ;
+ }
_Valid = false ;
_Executable = false ;
_Done = false ;
const char * DataFlowAuthor ,
const char * DataFlowComputer ,
const char * DataFlowComment ,
- const char * DebugFileName ) :
- Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
- DataFlowInterfaceName , DataFlowName , DataFlowkind ,
- DataFlowFirstCreation , DataFlowLastModification ,
- DataFlowEditorRelease , DataFlowAuthor ,
- DataFlowComputer , DataFlowComment , DebugFileName ) {
+ const char * DebugFileName ) {
+// Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
+// DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+// DataFlowFirstCreation , DataFlowLastModification ,
+// DataFlowEditorRelease , DataFlowAuthor ,
+// DataFlowComputer , DataFlowComment , DebugFileName ) {
+ Set_prof_debug( ORB , DebugFileName ) ;
+
+ cdebug_in << "GraphEditor::OutNode::OutNode(" << DataFlowName << " , " << DataFlowkind << ")" << endl;
+ if ( DataFlowkind == SUPERV::DataFlowGraph ) {
+ _StreamGraph = NULL ;
+ _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
+ DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+ DataFlowFirstCreation , DataFlowLastModification ,
+ DataFlowEditorRelease , DataFlowAuthor ,
+ DataFlowComputer , DataFlowComment ,
+ _prof_debug , _fdebug ) ;
+// DataFlowComputer , DataFlowComment , DebugFileName ) ;
+ }
+ else if ( DataFlowkind == SUPERV::DataStreamGraph ) {
+ _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
+ DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+ DataFlowFirstCreation , DataFlowLastModification ,
+ DataFlowEditorRelease , DataFlowAuthor ,
+ DataFlowComputer , DataFlowComment ,
+ _prof_debug , _fdebug ) ;
+ _Graph = _StreamGraph ;
+ }
_Valid = false ;
_Executable = false ;
_Done = false ;
GraphExecutor::OutNode::~OutNode() {
}
+void GraphExecutor::OutNode::Set_prof_debug( CORBA::ORB_ptr ORB ,
+ const char * DebugFileName ) {
+ _Graph_prof_debug = 0 ;
+ if ( DebugFileName ) {
+ _fdebug = new ofstream( DebugFileName );
+ SetDebug( ORB , &_Graph_prof_debug , _fdebug ) ;
+ MESSAGE( endl << "Trace redirected to file " << DebugFileName << endl)
+ }
+}
+
bool GraphExecutor::OutNode::LoadDataFlow(const GraphBase::SGraph &aDataFlow ) {
bool RetVal = false ;
RetVal = LoadInfo( aDataFlow.Info ) ;
- if ( GraphBase::Service::ServiceName() != NULL ) {
+ if ( Graph()->ServiceName() != NULL ) {
// MESSAGE( "GraphExecutor::OutNode::LoadDataFlow" );
if ( RetVal ) {
RetVal = LoadNodes( aDataFlow.Nodes ) ;
bool GraphExecutor::OutNode::LoadXml( const char* myFileName ) {
bool RetVal = false ;
GraphBase::SGraph aDataFlow ;
- if ( GraphBase::Graph::LoadXml( _Orb , myFileName , aDataFlow ) ) {
+ if ( Graph()->LoadXml( _Orb , myFileName , aDataFlow ) ) {
RetVal = LoadDataFlow( aDataFlow ) ;
// if ( aConstructor && RetVal )
// RetVal = Name( aDataFlow.Info.theName.c_str() ) ;
}
bool GraphExecutor::OutNode::LoadInfo(const GraphBase::SNode &aDataFlowInfo ) {
- cdebug << "GraphExecutor::OutNode::LoadInfo" << endl ;
+ cdebug << "GraphExecutor::OutNode::LoadInfo _StreamGraph " << _StreamGraph << endl ;
// ComponentName( aDataFlowInfo.theComponentName.c_str() ) ;
- Name( aDataFlowInfo.theName.c_str() ) ;
- Kind( aDataFlowInfo.theKind ) ;
- DataService( _Orb , aDataFlowInfo.theService , Graph_prof_debug() , Graph_fdebug() ) ;
- FirstCreation( aDataFlowInfo.theFirstCreation ) ;
- LastModification( aDataFlowInfo.theLastModification ) ;
- EditorRelease( aDataFlowInfo.theEditorRelease.c_str() ) ;
- Author( aDataFlowInfo.theAuthor.c_str() ) ;
-// Computer( aDataFlowInfo.theContainer.c_str() ) ;
- Comment( aDataFlowInfo.theComment.c_str() ) ;
+ Graph()->Name( aDataFlowInfo.theName.c_str() ) ;
+ Graph()->Kind( aDataFlowInfo.theKind ) ;
+ if ( Graph()->IsDataStreamNode() ) {
+ StreamGraph()->SetStreamParams( aDataFlowInfo.theTimeout , aDataFlowInfo.theDataStreamTrace , aDataFlowInfo.theDeltaTime ) ;
+ }
+ Graph()->DataService( _Orb , aDataFlowInfo.theService , _prof_debug , _fdebug ) ;
+ Graph()->FirstCreation( aDataFlowInfo.theFirstCreation ) ;
+ Graph()->LastModification( aDataFlowInfo.theLastModification ) ;
+ Graph()->EditorRelease( aDataFlowInfo.theEditorRelease.c_str() ) ;
+ Graph()->Author( aDataFlowInfo.theAuthor.c_str() ) ;
+// Graph()->Computer( aDataFlowInfo.theContainer.c_str() ) ;
+ Graph()->Comment( aDataFlowInfo.theComment.c_str() ) ;
// Not in OutNode/DataFlow but in InNode/DataFlow_in_an_other_DataFlow
-// Coordinates( aDataFlowInfo.theX , aDataFlowInfo.theY ) ;
+// Graph()->Coordinates( aDataFlowInfo.theX , aDataFlowInfo.theY ) ;
return true ;
}
anInNode->GraphExecutor::InNode::InLineNode()->DefPortsOfNode(
_Orb , aNode.theService , anInNode->NamePtr() ,
anInNode->Kind() ,
- Graph_prof_debug() , Graph_fdebug() ) ;
-#if 0
- GraphBase::InLineNode * aINode = anInNode->InLineNode() ;
- GraphBase::LoopNode * aLNode = NULL ;
- if ( aINode->IsLoopNode() ) {
- aLNode = anInNode->LoopNode() ;
- aLNode->SetPythonFunction( aNode.theListOfFuncName[ 0 ].c_str() ,
- *aNode.theListOfPythonFunctions[ 0 ] ) ;
- aLNode->SetMorePythonFunction( aNode.theListOfFuncName[ 1 ].c_str() ,
- *aNode.theListOfPythonFunctions[ 1 ] ) ;
- aLNode->SetNextPythonFunction( aNode.theListOfFuncName[ 2 ].c_str() ,
- *aNode.theListOfPythonFunctions[ 2 ] ) ;
- }
- else if ( aINode->IsInLineNode() || aINode->IsGOTONode() ||
- aINode->IsSwitchNode() || aINode->IsEndSwitchNode() ) {
- aINode->SetPythonFunction( aNode.theListOfFuncName[ 0 ].c_str() ,
- *aNode.theListOfPythonFunctions[ 0 ] ) ;
- }
-#endif
+ _prof_debug , _fdebug ) ;
}
-#if 0
- if ( aNode.theListOfParameters.size() ) { // BusPorts ...
- int j ;
- for ( j = 0 ; j < aNode.theListOfParameters.size() ; j++ ) {
- GraphBase::InPort * InputPort = anInNode->AddInPort(
- aNode.theListOfParameters[ j ].theInParameter.Parametername ,
- aNode.theListOfParameters[ j ].theInParameter.Parametertype ) ;
- GraphBase::OutPort * OutputPort = anInNode->AddOutPort(
- aNode.theListOfParameters[ j ].theOutParameter.Parametername ,
- aNode.theListOfParameters[ j ].theOutParameter.Parametertype ) ;
- anInNode->InOutPort( InputPort , OutputPort ) ;
- }
+// GraphBase::ComputingNode * theNode = Graph()->GetChangeGraphNode( aNode.theName.c_str() ) ;
+
+ unsigned int j ;
+ for ( j = 0 ; j < aNode.theListOfInDataStreams.size() ; j++ ) {
+ GraphBase::InPort * anInPort ;
+ anInPort = anInNode->ComputingNode()->AddInDataStreamPort( aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parametername ,
+ aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parametertype ,
+ aNode.theListOfInDataStreams[ j ].theDataStreamParameter.Parameterdependency ,
+ SUPERV::DataStreamParameter ) ;
+ ((GraphBase::InDataStreamPort * ) anInPort)->SetParams( aNode.theListOfInDataStreams[ j ].theKindOfSchema ,
+ aNode.theListOfInDataStreams[ j ].theKindOfInterpolation ,
+ aNode.theListOfInDataStreams[ j ].theKindOfExtrapolation ) ;
}
-#endif
+ for ( j = 0 ; j < aNode.theListOfOutDataStreams.size() ; j++ ) {
+ GraphBase::OutPort * anOutPort ;
+ anOutPort = anInNode->ComputingNode()->AddOutDataStreamPort( aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parametername ,
+ aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parametertype ,
+ aNode.theListOfOutDataStreams[ j ].theDataStreamParameter.Parameterdependency ,
+ SUPERV::DataStreamParameter ) ;
+ ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues( aNode.theListOfOutDataStreams[ j ].theNumberOfValues ) ;
+ }
+
+
+// theNode->DataStreamInPortsNumber( aNode.theDataStreamInArgsNumber ) ;
+// theNode->DataStreamOutPortsNumber( aNode.theDataStreamOutArgsNumber ) ;
+// cdebug << "GraphExecutor::OutNode::LoadNodes " << anInNode->Name()
+// << " InPortsSize " << theNode->GetNodeInPortsSize()
+// << " OutPortsSize " << theNode->GetNodeOutPortsSize()
+// << " DataStreamInPortsNumber " << aNode.theDataStreamInArgsNumber
+// << " DataStreamOutPortsNumber " << aNode.theDataStreamOutArgsNumber
+// << endl ;
+// int j ;
+// if ( aNode.theDataStreamInArgsNumber ) { // -1 because of Gates
+// for ( j = theNode->GetNodeInPortsSize() - aNode.theDataStreamInArgsNumber - 1 ; j < theNode->GetNodeInPortsSize() - 1 ; j++ ) {
+// cdebug << "GraphExecutor::OutNode::LoadNodes " << anInNode->Name()
+// << " InPort " << theNode->GetChangeNodeInPort( j )->PortName()
+// << " Kind( DataStreamParameter)" << endl ;
+// theNode->GetChangeNodeInPort( j )->Kind( SUPERV::DataStreamParameter ) ;
+// }
+// }
+// if ( aNode.theDataStreamOutArgsNumber ) {
+// int withgate = 1 ;
+// if ( theNode->IsLoopNode() || theNode->IsEndLoopNode() ) {
+// withgate = 0 ;
+// }
+// for ( j = theNode->GetNodeOutPortsSize() - aNode.theDataStreamOutArgsNumber - withgate ; j < theNode->GetNodeOutPortsSize() - withgate ; j++ ) {
+// cdebug << "GraphExecutor::OutNode::LoadNodes " << anInNode->Name()
+// << " OutPort " << theNode->GetChangeNodeOutPort( j )->PortName()
+// << " Kind( DataStreamParameter)" << endl ;
+// theNode->GetChangeNodeOutPort( j )->Kind( SUPERV::DataStreamParameter ) ;
+// }
+// }
}
for ( i = 0 ; i < (int ) aListOfNodes.size() ; i++ ) {
GraphBase::SNode aNode = aListOfNodes[ i ] ;
- anInNode = (GraphExecutor::InNode * ) GetChangeGraphNode( aNode.theName.c_str() )->GetInNode() ;
- cdebug << "GraphExecutor::OutNode::LoadNodes " << anInNode->Name() << "IsOneOfGOTONodes "
+ anInNode = (GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( aNode.theName.c_str() )->GetInNode() ;
+ cdebug << "GraphExecutor::OutNode::LoadNodes " << anInNode->Name() << " IsOneOfGOTONodes "
<< anInNode->IsOneOfGOTONodes() << " " << aNode.theCoupledNode.c_str() << endl ;
if ( anInNode->IsOneOfGOTONodes() && strlen( aNode.theCoupledNode.c_str() ) ) {
GraphBase::GOTONode * aCoupledNode ;
- aCoupledNode = (GraphBase::GOTONode * ) GetGraphNode( aNode.theName.c_str() ) ;
- aCoupledNode->CoupledNode( (GraphBase::GOTONode * ) GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ) ;
+ aCoupledNode = (GraphBase::GOTONode * ) Graph()->GetGraphNode( aNode.theName.c_str() ) ;
+ aCoupledNode->CoupledNode( (GraphBase::GOTONode * ) Graph()->GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ) ;
}
}
return RetVal ;
int i ;
for ( i = 0 ; i < (int ) aListOfLinks.size() ; i++ ) {
GraphBase::SLink aLink = aListOfLinks[ i ] ;
- RetVal = AddLink( aLink.FromNodeName.c_str() ,
- aLink.FromServiceParameterName.c_str() ,
- aLink.ToNodeName.c_str() ,
- aLink.ToServiceParameterName.c_str() ,
- aLink.aLinkValue ) ;
+ RetVal = Graph()->AddLink( aLink.FromNodeName.c_str() ,
+ aLink.FromServiceParameterName.c_str() ,
+ aLink.ToNodeName.c_str() ,
+ aLink.ToServiceParameterName.c_str() ,
+ aLink.aLinkValue ) ;
// aLink.aLinkValue.Value , aLink.aLinkValue.Kind ) ;
if ( !RetVal )
break ;
int i ;
for ( i = 0 ; i < (int ) aListOfDatas.size() ; i++ ) {
GraphBase::SLink aLink = aListOfDatas[ i ] ;
- if ( !strcmp( aLink.FromNodeName.c_str() , Name() ) )
- RetVal = GraphBase::Graph::AddInputData( aLink.ToNodeName.c_str() ,
- aLink.ToServiceParameterName.c_str() ,
- aLink.aLinkValue ) ;
+ if ( !strcmp( aLink.FromNodeName.c_str() , Graph()->Name() ) )
+ RetVal = Graph()->AddInputData( aLink.ToNodeName.c_str() ,
+ aLink.ToServiceParameterName.c_str() ,
+ aLink.aLinkValue ) ;
// aLink.aLinkValue.Value , aLink.aLinkValue.Kind ) ;
- else if ( !strcmp( aLink.ToNodeName.c_str() , Name() ) ) {
- RetVal = AddOutputData( aLink.FromNodeName.c_str() ,
- aLink.FromServiceParameterName.c_str() ,
- aLink.aLinkValue ) ;
+ else if ( !strcmp( aLink.ToNodeName.c_str() , Graph()->Name() ) ) {
+ RetVal = Graph()->AddOutputData( aLink.FromNodeName.c_str() ,
+ aLink.FromServiceParameterName.c_str() ,
+ aLink.aLinkValue ) ;
// aLink.aLinkValue.Value ,
// aLink.aLinkValue.Kind ) ;
- AddLink( aLink.FromNodeName.c_str() , (GraphBase::ComputingNode *) this ) ;
+ Graph()->AddLink( aLink.FromNodeName.c_str() , (GraphBase::ComputingNode *) this ) ;
}
else {
cdebug << "GraphExecutor::OutNode::LoadDatas Error " << aLink.FromNodeName
- << " and " << aLink.ToNodeName << " differents from " << Name()
+ << " and " << aLink.ToNodeName << " differents from " << Graph()->Name()
<< endl ;
RetVal = false ;
}
cdebug_in << "GraphExecutor::OutNode::AddNode(" << NodeComponentName << " , "
<< NodeName << ")" << endl;
GraphExecutor::InNode *Nd = NULL ;
- Nd = new GraphExecutor::InNode( _Orb, NamingService() , NodeService ,
+ Nd = new GraphExecutor::InNode( _Orb, Graph()->NamingService() , NodeService ,
NodeComponentName , NodeInterfaceName ,
NodeName , NodeKindOfNode ,
aFuncName , aPythonFunction ,
NodeFirstCreation , NodeLastModification ,
NodeEditorRelease , NodeAuthor ,
NodeComputer , NodeComment , false , NodeX , NodeY ,
- Graph_prof_debug() , Graph_fdebug() ) ;
- GraphBase::Graph::AddNode( Nd->ComputingNode() ) ;
+ _prof_debug , _fdebug ) ;
+ Graph()->AddNode( Nd->ComputingNode() ) ;
cdebug_out << "GraphExecutor::OutNode::AddNode" << endl;
return Nd ;
}
const char* ToNodeName2 ,
const char* ToParameterName2 ) {
cdebug_in << "GraphExecutor::OutNode::AddInputData" << endl;
- bool RetVal = GraphBase::Graph::AddInputData( ToNodeName1 ,
- ToParameterName1 ,
- ToNodeName2 ,
- ToParameterName2 ) ;
+ bool RetVal = Graph()->AddInputData( ToNodeName1 ,
+ ToParameterName1 ,
+ ToNodeName2 ,
+ ToParameterName2 ) ;
cdebug_out << "GraphExecutor::OutNode::AddInputData" << endl;
_Valid = false ;
return RetVal ;
_Executable = false ;
- if ( !CreateService() ) {
+ if ( !Graph()->CreateService() ) {
cdebug << "This DataFlow has invalid type(s)." << endl ;
return false ;
}
-
- if ( !Sort() ) {
+ int SubStreamGraphsNumber = 0 ;
+ if ( !Graph()->Sort( SubStreamGraphsNumber ) ) {
cdebug << "This DataFlow is not valid." << endl ;
return false ;
}
+ if ( Graph()->IsDataStreamNode() ) {
+ StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
+ }
// CreateService() ;
- InLineServices() ;
+ Graph()->InLineServices() ;
- ComputingNodes() ;
+ Graph()->ComputingNodes() ;
_Valid = true ;
if ( !IsValid() )
return false ;
- if ( DataServerNodes() )
+ if ( Graph()->DataServerNodes() )
_Executable = true ;
else {
cdebug << "This DataFlow is not executable." << endl ;
if ( Executable() ) {
_ControlState = SUPERV::VoidState ;
_SuspendedThreads = 0 ;
- ThreadNo( pthread_self() ) ;
+ Graph()->ThreadNo( pthread_self() ) ;
Done( false ) ;
_JustStarted = true ;
int i ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) GraphNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->GraphNodes( i )->GetInNode() ;
if ( !PyInitialized() && anInNode->IsOneOfInLineNodes() ) {
if ( !Py_IsInitialized() ) {
// Py_Initialize() ;
}
}
// One more time because inline nodes may share one definition of the same function
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) GraphNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->GraphNodes( i )->GetInNode() ;
if ( anInNode->IsOneOfInLineNodes() ) {
- if ( anInNode->InitPythonFunctions( true ) ) {
+ if ( !anInNode->InitPythonFunctions( true ) ) {
+ cdebug << "GraphExecutor::OutNode::Run InitPythonFunctions ERROR "
+ << anInNode->Name() << endl ;
+ return false ;
}
}
}
cdebug << "Execution starting GraphExecutor::Action_DataOk_RunService Node "
- << Name() << endl ;
+ << Graph()->Name() << endl ;
PushEvent( NULL , GraphExecutor::ReadyEvent ,
SUPERV::DataReadyState ) ;
State( SUPERV::DataReadyState ) ;
- for ( i = 0 ; i < HeadNodesSize() ; i++ ) {
- GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) HeadNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->HeadNodesSize() ; i++ ) {
+ GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->HeadNodes( i )->GetInNode() ;
if ( anInNode->State() != SUPERV::DataReadyState ) {
cdebug << "GraphExecutor::OutNode::Run inconsistency State of Node "
<< anInNode->Name() << " : " << anInNode->State() << endl ;
// PushEvent( anInNode , GraphExecutor::ReadyEvent ,
// SUPERV::DataReadyState ) ;
anInNode->CreateNewThread( true ) ;
- anInNode->DataFromNode( Name() ) ;
+ anInNode->DataFromNode( Graph()->Name() ) ;
if ( AndSuspend ) {
anInNode->State( SUPERV::DataWaitingState ) ;
anInNode->ControlState( SUPERV::ToSuspendStartState ) ;
State( SUPERV::ExecutingState ) ;
};
}
-
+ ostringstream astr ;
+ astr << "Graph " << Graph()->Name() << " is running" ;
+ Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
RetVal = true ;
}
else {
bool RetVal = false ;
cdebug_in << "GraphExecutor::OutNode::Run( " << aNodeName << " , "
<< AtNodeName << " , " << AndSuspend << ")" << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode() ;
if ( anInNode ) {
RetVal = anInNode->ReStart( AtNodeName , AndSuspend ) ;
}
SUPERV::AutomatonState InNodeState ;
bool AllDone = true ;
if ( !Done() ) {
- for ( j = 0 ; j < QueueNodesSize() ; j++ ) {
- InNodeState = ( (GraphExecutor::InNode * ) QueueNodes( j )->GetInNode() )->State() ;
+ for ( j = 0 ; j < Graph()->QueueNodesSize() ; j++ ) {
+ InNodeState = ( (GraphExecutor::InNode * ) Graph()->QueueNodes( j )->GetInNode() )->State() ;
cdebug << j << ". "
- << ( (GraphExecutor::InNode * ) QueueNodes( j )->GetInNode() )->Name()
+ << ( (GraphExecutor::InNode * ) Graph()->QueueNodes( j )->GetInNode() )->Name()
<< " " << theAutomaton->StateName( InNodeState ) << endl ;
if ( InNodeState != SUPERV::SuccessedState &&
InNodeState != SUPERV::ErroredState &&
}
if ( AllDone ) {
int alivenodes = 0 ;
- for ( j = 0 ; j < GraphNodesSize() ; j++ ) {
+ for ( j = 0 ; j < Graph()->GraphNodesSize() ; j++ ) {
GraphExecutor::InNode * aNode ;
- aNode = (GraphExecutor::InNode * ) GraphNodes( j )->GetInNode() ;
+ aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( j )->GetInNode() ;
SUPERV::GraphState aState = AutomatonGraphState( aNode->State() ) ;
cdebug << "GraphExecutor::OutNode::CheckAllDone " << aNode->Name() << " "
<< theAutomaton->StateName( aNode->State() ) << " CreateNewThread " << aNode->CreateNewThread()
}
if ( IsDone() ) {
MESSAGE("================================================================================") ;
- MESSAGE( Name() << " IS DONE : " << theAutomaton->StateName( AutomatonState() ) << " EventQSize "
+ MESSAGE( Graph()->Name() << " IS DONE : " << theAutomaton->StateName( AutomatonState() ) << " EventQSize "
<< EventQSize() ) ;
MESSAGE("================================================================================") ;
cdebug << "================================================================================" << endl ;
- cdebug << Name() << " IS DONE : " << theAutomaton->StateName( AutomatonState() ) << " EventQSize "
+ cdebug << Graph()->Name() << " IS DONE : " << theAutomaton->StateName( AutomatonState() ) << " EventQSize "
<< EventQSize() << endl ;
cdebug << "================================================================================" << endl ;
- //cout << Name() << " IS DONE : " << theAutomaton->StateName( AutomatonState() ) << " EventQSize "
+ ostringstream astr ;
+ astr << "Graph " << Graph()->Name() << " is done : "
+ << theAutomaton->StateName( AutomatonState() ) ;
+ Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
+ //cout << Graph()->Name() << " IS DONE : " << theAutomaton->StateName( AutomatonState() ) << " EventQSize "
// << EventQSize() << endl ;
}
cdebug_out << "GraphExecutor::OutNode::CheckAllDone " << IsDone()
long GraphExecutor::OutNode::Thread( const char * aNodeName ) {
long RetVal = 0 ;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( aNodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode() ;
if ( anInNode ) {
RetVal = anInNode->ThreadNo() ;
}
_EventNodes.push_back( aNode->Name() ) ;
}
else {
- _EventNodes.push_back( Name() ) ;
+ _EventNodes.push_back( Graph()->Name() ) ;
}
_Events.push_back( anEvent ) ;
_States.push_back( aState ) ;
// << aNode->Automaton()->ControlStateName( aNode->ControlState() ) ;
}
else {
-// cdebug << "PushEvent " << Name() ;
+// cdebug << "PushEvent " << Graph()->Name() ;
// cdebug << " " << theAutomaton->EventName( anEvent ) << " "
// << theAutomaton->StateName( aState ) ;
}
aState != SUPERV::RunningState &&
aState != SUPERV::SuspendDoneState &&
aState != SUPERV::SuspendErroredState ) {
- NodeName = Name() ;
- while ( sts && !strcmp( NodeName , Name() ) ) {
+ NodeName = Graph()->Name() ;
+ while ( sts && !strcmp( NodeName , Graph()->Name() ) ) {
sts = EventWait( aNodeName , anEvent , aState ) ;
NodeName = *aNodeName ;
}
_States.pop_front() ;
}
- aNode = ((GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode()) ;
+ aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode()) ;
cdebug << "EventW Previous Node " << NodeName << " ThreadsNumber "
<< ThreadsNumber
<< " _EventNodes.size() " << _EventNodes.size() << " "
}
void GraphExecutor::OutNode::State(SUPERV::AutomatonState aState ) {
-// cdebug << "GraphExecutor::OutNode::State " << Name() << " "
+// cdebug << "GraphExecutor::OutNode::State " << Graph()->Name() << " "
// << theAutomaton->StateName( AutomatonGraphState( _State ) ) << " ---> "
// << theAutomaton->StateName( AutomatonGraphState( aState ) ) << endl ;
_State = aState ;
SUPERV::GraphState GraphExecutor::OutNode::State( const char * NodeName ) {
// cdebug_in << "GraphExecutor::OutNode::State " << NodeName << endl;
SUPERV::AutomatonState aret = SUPERV::UnKnownState ;
- const GraphBase::ComputingNode * aCNode = GetGraphNode( NodeName ) ;
+ const GraphBase::ComputingNode * aCNode = Graph()->GetGraphNode( NodeName ) ;
if ( aCNode ) {
GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *)aCNode->GetInNode() ;
if ( anInNode ) {
const char * ServiceParameterName ) {
// cdebug_in << "GraphExecutor::OutNode::State " << NodeName << " "
// << ServiceParameterName<< endl;
- SUPERV::GraphState aret = PortState( NodeName , ServiceParameterName ) ;
+ SUPERV::GraphState aret = Graph()->PortState( NodeName , ServiceParameterName ) ;
// cdebug_out << "GraphExecutor::OutNode::State" << endl ;
return aret ;
}
SUPERV::AutomatonState GraphExecutor::OutNode::AutomatonState( const char * NodeName ) {
// cdebug_in << "GraphExecutor::OutNode::AutomatonState " << NodeName << endl;
SUPERV::AutomatonState aret = SUPERV::UnKnownState ;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode )
aret = anInNode->State() ;
// cdebug_out << "GraphExecutor::OutNode::AutomatonState" << endl ;
SUPERV::ControlState GraphExecutor::OutNode::ControlState( const char * NodeName ) {
// cdebug_in << "GraphExecutor::OutNode::ControlState " << NodeName << endl;
SUPERV::ControlState aret = SUPERV::VoidState ;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode )
aret = anInNode->ControlState() ;
// cdebug_out << "GraphExecutor::OutNode::ControlState" << endl ;
void GraphExecutor::OutNode::ControlClear( const char * NodeName ) {
// cdebug_in << "GraphExecutor::OutNode::ControlClear " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode )
anInNode->ControlClear() ;
// cdebug_out << "GraphExecutor::OutNode::ControlClear" << endl ;
bool GraphExecutor::OutNode::IsWaiting( const char * NodeName ) {
bool aret = false ;
// cdebug_in << "GraphExecutor::OutNode::IsWaiting " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->IsWaiting() ;
}
bool GraphExecutor::OutNode::IsReady( const char * NodeName ) {
bool aret = false ;
// cdebug_in << "GraphExecutor::OutNode::IsReady " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->IsReady() ;
}
bool GraphExecutor::OutNode::IsRunning( const char * NodeName ) {
bool aret = false ;
// cdebug_in << "GraphExecutor::OutNode::IsRunning " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->IsRunning() ;
}
bool GraphExecutor::OutNode::IsDone( const char * NodeName ) {
bool aret = false ;
// cdebug_in << "GraphExecutor::OutNode::IsDone " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->IsDone() ;
}
bool GraphExecutor::OutNode::IsSuspended( const char * NodeName ) {
bool aret = false ;
// cdebug_in << "GraphExecutor::OutNode::IsSuspended " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->IsSuspended() ;
}
const char * ServiceParameterName ) {
// cdebug_in << "GraphExecutor::OutNode::IsDone " << NodeName << " "
// << ServiceParameterName<< endl;
- bool aret = PortDone( NodeName , ServiceParameterName ) ;
+ bool aret = Graph()->PortDone( NodeName , ServiceParameterName ) ;
// cdebug_out << "GraphExecutor::OutNode::IsDone" << endl ;
return aret ;
}
cdebug_in << "GraphExecutor::OutNode::ContainerKill" << endl;
_ControlState = SUPERV::ToSuspendState ;
int i ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) GraphNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
bool sts = aNode->ContainerKill() ;
if ( sts && aNode->IsKilled() ) {
cdebug << aNode->Name() << " killed" << endl ;
}
}
if ( !RetVal || Threads() != 0 ) {
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) GraphNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
if ( !aNode->IsKilled() && !aNode->IsWaiting() && !aNode->IsDone() ) {
aNode->KilledAction() ;
}
cdebug_in << "GraphExecutor::OutNode::Suspend" << endl;
// _ControlState = SUPERV::ToSuspendState ;
int i ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) GraphNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
bool sts = aNode->Suspend() ;
if ( sts && aNode->IsSuspended() ) {
RetVal += 1 ;
if ( RetVal ) {
State( SUPERV::SuspendedState ) ;
MESSAGE("================================================================================") ;
- MESSAGE( Name() << " IS SUSPENDED" ) ;
+ MESSAGE( Graph()->Name() << " IS SUSPENDED" ) ;
MESSAGE("================================================================================") ;
}
else {
MESSAGE("================================================================================") ;
- MESSAGE( Name() << " IS NOT SUSPENDED" ) ;
+ MESSAGE( Graph()->Name() << " IS NOT SUSPENDED" ) ;
MESSAGE("================================================================================") ;
}
cdebug_out << "GraphExecutor::OutNode::Suspend" << theAutomaton->StateName( State() ) << endl ;
if ( IsSuspended() ) {
State( SUPERV::ExecutingState ) ;
int i ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) GraphNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
aNode->ControlState( SUPERV::VoidState ) ;
if ( aNode->IsSuspended() ) {
cdebug << aNode->Name() << "->Resume " << theAutomaton->StateName( aNode->State() )
}
}
else {
- cdebug << Name() << " not suspended " << theAutomaton->StateName( State() ) << endl ;
+ cdebug << Graph()->Name() << " not suspended " << theAutomaton->StateName( State() ) << endl ;
}
if ( RetVal ) {
MESSAGE("================================================================================") ;
- MESSAGE( Name() << " IS RESUMED" ) ;
+ MESSAGE( Graph()->Name() << " IS RESUMED" ) ;
MESSAGE("================================================================================") ;
}
else {
MESSAGE("================================================================================") ;
- MESSAGE( Name() << " IS NOT RESUMED" ) ;
+ MESSAGE( Graph()->Name() << " IS NOT RESUMED" ) ;
MESSAGE("================================================================================") ;
}
cdebug_out << "GraphExecutor::OutNode::Resume" << theAutomaton->StateName( State() ) << " " << RetVal << endl ;
cdebug_in << "GraphExecutor::OutNode::Kill" << endl;
_ControlState = SUPERV::ToSuspendState ;
int i ;
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) GraphNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
bool sts = aNode->Kill() ;
if ( sts && aNode->IsKilled() ) {
cdebug << aNode->Name() << " killed" << endl ;
}
}
if ( !RetVal || Threads() != 0 ) {
- for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) GraphNodes( i )->GetInNode() ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
if ( !aNode->IsKilled() && !aNode->IsWaiting() && !aNode->IsDone() ) {
cdebug << aNode->Name() << " not killed : "
<< theAutomaton->StateName( aNode->State() ) << " " << aNode->Name() << "->"
State( SUPERV::KilledState ) ;
if ( RetVal ) {
MESSAGE("================================================================================") ;
- MESSAGE( Name() << " IS KILLED" ) ;
+ MESSAGE( Graph()->Name() << " IS KILLED" ) ;
MESSAGE("================================================================================") ;
}
else {
MESSAGE("================================================================================") ;
- MESSAGE( Name() << " IS NOT KILLED" ) ;
+ MESSAGE( Graph()->Name() << " IS NOT KILLED" ) ;
MESSAGE("================================================================================") ;
}
cdebug_out << "GraphExecutor::OutNode::Kill" << endl ;
cdebug_out << "GraphExecutor::OutNode::Stop" << endl ;
if ( RetVal ) {
MESSAGE("================================================================================") ;
- MESSAGE( Name() << " IS STOPPED" ) ;
+ MESSAGE( Graph()->Name() << " IS STOPPED" ) ;
MESSAGE("================================================================================") ;
}
return RetVal ;
bool GraphExecutor::OutNode::ReadyWait( const char * NodeName ) {
bool aret = false ;
cdebug_in << "GraphExecutor::OutNode::ReadyWait " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->ReadyWait() ;
}
bool GraphExecutor::OutNode::RunningWait( const char * NodeName ) {
bool aret = false ;
cdebug_in << "GraphExecutor::OutNode::RunningWait " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->RunningWait() ;
}
bool GraphExecutor::OutNode::DoneWait( const char * NodeName ) {
bool aret = false ;
cdebug_in << "GraphExecutor::OutNode::DoneWait " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->DoneWait() ;
}
bool GraphExecutor::OutNode::SuspendedWait( const char * NodeName ) {
bool aret = false ;
cdebug_in << "GraphExecutor::OutNode::SuspendedWait " << NodeName << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) GetGraphNode( NodeName )->GetInNode() ;
+ GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
if ( anInNode ) {
aret = anInNode->SuspendedWait() ;
}
long GraphExecutor::OutNode::LastLevelDone() {
int RetVal = -1 ;
int i , j ;
- for ( i = 0 ; i <= LevelMax() ; i++ ) {
- for ( j = 0 ; j <= NodesNumber( i ) ; j++ ) {
- GraphBase::ComputingNode * aNode = SortedNodes( i , j ) ;
+ for ( i = 0 ; i <= Graph()->LevelMax() ; i++ ) {
+ for ( j = 0 ; j <= Graph()->NodesNumber( i ) ; j++ ) {
+ GraphBase::ComputingNode * aNode = Graph()->SortedNodes( i , j ) ;
if ( !IsDone( aNode->Name() ) ) {
break ;
}
}
- if ( j != NodesNumber( i ) + 1 )
+ if ( j != Graph()->NodesNumber( i ) + 1 )
break ;
RetVal = i ;
}
const char * ServiceParameterName ) {
// cdebug_in << "GraphExecutor::OutNode::GetInData " << NodeName << " "
// << ServiceParameterName << endl ;
- const CORBA::Any * retdata = PortInData( NodeName , ServiceParameterName ) ;
+ const CORBA::Any * retdata = Graph()->PortInData( NodeName , ServiceParameterName ) ;
// cdebug_out << "GraphExecutor::OutNode::GetInData" << endl ;
return retdata ;
}
const char * ServiceParameterName ) {
// cdebug_in << "GraphExecutor::OutNode::GetOutData " << NodeName << " "
// << ServiceParameterName << endl ;
- const CORBA::Any * retdata = PortOutData( NodeName , ServiceParameterName ) ;
+ const CORBA::Any * retdata = Graph()->PortOutData( NodeName , ServiceParameterName ) ;
// cdebug_out << "GraphExecutor::OutNode::GetOutData" << endl ;
return retdata ;
}
const long GraphExecutor::OutNode::CpuUsed() {
- return GraphBase::Graph::CpuUsed() ;
+ return Graph()->CpuUsed() ;
}
const long GraphExecutor::OutNode::CpuUsed( const char * aNodeName ) {
- GraphBase::ComputingNode * aNode = GetChangeGraphNode( aNodeName ) ;
+ GraphBase::ComputingNode * aNode = Graph()->GetChangeGraphNode( aNodeName ) ;
if ( aNode ) {
GraphExecutor::InNode * anInNode = (GraphExecutor::InNode * ) aNode->GetInNode() ;
if ( anInNode ) {
#include "SALOME_Component_i.hxx"
-#include "DataFlowBase_Graph.hxx"
+#include "DataFlowBase_StreamGraph.hxx"
#include "DataFlowExecutor_InNode.hxx"
namespace GraphExecutor {
- class OutNode : public GraphBase::Graph {
+// class OutNode : public GraphBase::Graph {
+ class OutNode : public GraphBase::Base {
private :
+ GraphBase::StreamGraph * _StreamGraph ;
+ GraphBase::Graph * _Graph ;
+
+ int _Graph_prof_debug ;
+
bool _PyInitialized ;
bool _Valid ;
bool _Executable ;
OutNode() ;
OutNode( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ,
- const char * DebugFileName );
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode );
OutNode( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
const SALOME_ModuleCatalog::Service& DataFlowService ,
const char *DataFlowComponentName ,
const char * DebugFileName ) ;
virtual ~OutNode() ;
+ void Set_prof_debug( CORBA::ORB_ptr ORB , const char * DebugFileName ) ;
+ GraphBase::StreamGraph * StreamGraph() {
+ return _StreamGraph ; } ;
+ GraphBase::StreamGraph * StreamGraph() const {
+ return _StreamGraph ; } ;
+ GraphBase::Graph * Graph() {
+ return _Graph ; } ;
+ GraphBase::Graph * Graph() const {
+ return _Graph ; } ;
+
bool LoadDataFlow( const GraphBase::SGraph &aDataFlow ) ;
bool LoadXml( const char* myFileName ) ;
bool LoadInfo( const GraphBase::SNode &aDataFlowInfo ) ;
long SuspendedThreads() { return _SuspendedThreads ; } ;
void JoinedWait() ;
+ pthread_t ThreadNo() {
+ return _Graph->ThreadNo() ; } ;
long Thread( const char * NodeName ) ;
bool PushEvent( GraphExecutor::InNode * aNode ,
}
PyObject * GraphExecutor::InNode::InitPyDynInvoke( char * PyFuncName ,
- const SUPERV::ListOfStrings * aPythonFunction ) {
+ const SUPERV::ListOfStrings * aPythonFunction ,
+ bool & Err ) {
bool RetVal = true ;
+ Err = false ;
string aPyFunc ;
PyObject * thePyRunMethod = NULL ;
if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ;
RetVal = false ;
+ Err = true ;
}
else {
PyFuncRunned( true ) ;
CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \
-I${KERNEL_ROOT_DIR}/include/salome
-#CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wno-deprecated
CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
-I${KERNEL_ROOT_DIR}/include/salome
-#LDFLAGS+= -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lOpUtil -lSalomeLoggerServer -lc $(PYTHON_LIBS) $(QT_MT_LIBS) $(OGL_LIBS)
LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lOpUtil -lSALOMELocalTrace \
-lc $(QT_MT_LIBS) $(OGL_LIBS) \
-L${KERNEL_ROOT_DIR}/lib/salome
+#LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
@CONCLUDE@