1 // SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : DataFlowBase_LoopNode.cxx
8 // Author : Jean Rahuel, CEA
16 #include "DataFlowBase_LoopNode.hxx"
18 GraphBase::LoopNode::LoopNode() :
19 GraphBase::GOTONode::GOTONode() {
21 cdebug << "GraphBase::LoopNode::LoopNode " << this
22 << " _Name " << (void *) Name() << " " << Name() << " _Comment "
23 << (void *) Comment() << " " << Comment() << " " << endl ;
27 GraphBase::LoopNode::LoopNode( CORBA::ORB_ptr ORB ,
28 SALOME_NamingService* ptrNamingService ,
29 const char * InitName ,
30 const SUPERV::ListOfStrings & anInitPythonFunction ,
31 const char * MoreName ,
32 const SUPERV::ListOfStrings & aMorePythonFunction ,
33 const char * NextName ,
34 const SUPERV::ListOfStrings & aNextPythonFunction ,
35 const char *NodeName ,
36 const SUPERV::KindOfNode akind ,
37 const SUPERV::SDate NodeFirstCreation ,
38 const SUPERV::SDate NodeLastModification ,
39 const char * NodeEditorRelease ,
40 const char * NodeAuthor ,
41 const char * NodeComment ,
42 const bool GeneratedName ,
45 int * Graph_prof_debug ,
46 ofstream * Graph_fdebug ) :
47 GraphBase::GOTONode::GOTONode( ORB , ptrNamingService , InitName , anInitPythonFunction ,
48 NodeName , akind , NodeFirstCreation ,
49 NodeLastModification , NodeEditorRelease ,
50 NodeAuthor , NodeComment , GeneratedName ,
51 X , Y , Graph_prof_debug , Graph_fdebug ) {
53 cdebug_in << "GraphBase::LoopNode::LoopNode " << this
54 << "' _Name " << (void *) Name() << " '" << Name() << " _Comment "
55 << (void *) Comment() << " " << Comment() << " "
56 << " KindOfNode " << Kind() << " InitName " << InitName
57 << " MoreName " << MoreName << " NextName " << NextName
58 << " ServiceName " << ServiceName() << " In("
59 << ServiceInParameter().length()
60 << ") Out(" << ServiceOutParameter().length() << ")" << endl ;
62 _MyPyMoreMethod = NULL ;
63 _MyPyNextMethod = NULL ;
65 cdebug << "GraphBase::LoopNode::LoopNode SetMorePythonFunction " << MoreName << " " ;
66 if ( aMorePythonFunction.length() ) {
67 cdebug << aMorePythonFunction[0] ;
70 SetMorePythonFunction( MoreName , aMorePythonFunction ) ;
71 cdebug << "GraphBase::LoopNode::LoopNode SetNextPythonFunction " << NextName << " " ;
72 if ( aNextPythonFunction.length() ) {
73 cdebug << aNextPythonFunction[0] ;
76 SetNextPythonFunction( NextName , aNextPythonFunction ) ;
78 cdebug_out << "GraphBase::LoopNode::LoopNode" << endl;
81 GraphBase::LoopNode::~LoopNode() {
82 cdebug << "GraphBase::Node::~Node " << this
83 << " _Name " << (void *) Name() << " " << Name() << " _Comment "
84 << (void *) Comment() << " " << Comment() << " " << endl ;
85 // if ( _ComponentName != NULLSTRING )
86 // delete [] _ComponentName ;
88 // delete [] _EditorRelease ;
89 // if ( _Author != NULLSTRING )
90 // delete [] _Author ;
91 // if ( _Computer != FACTORYSERVER )
92 // delete [] _Computer;
93 // if ( Comment() != NULLSTRING )
94 // delete [] Comment();
97 //bool GraphBase::LoopNode::SaveXML( ostream &f , char *Tabs ,
98 bool GraphBase::LoopNode::SaveXML( QDomDocument & Graph , QDomElement & info ,
99 int XCoordinate , int YCoordinate ) {
100 GraphBase::ListOfPythonFunctions aPythonFunction ;
101 aPythonFunction.resize( 3 ) ;
102 aPythonFunction[0] = PythonFunction() ;
103 aPythonFunction[1] = MorePythonFunction() ;
104 aPythonFunction[2] = NextPythonFunction() ;
105 GraphBase::ListOfFuncName aFuncNames ;
106 aFuncNames.resize( 3 ) ;
107 aFuncNames[0] = CORBA::string_dup( PyFuncName() ) ;
108 aFuncNames[1] = CORBA::string_dup( PyMoreName() ) ;
109 aFuncNames[2] = CORBA::string_dup( PyNextName() ) ;
110 char * CoupledName = "" ;
111 if ( CoupledNode() ) {
112 CoupledName = CoupledNode()->Name() ;
114 // return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" ,
115 return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" ,
117 aFuncNames , aPythonFunction ,
118 XCoordinate , YCoordinate ) ;
121 bool GraphBase::LoopNode::SavePY( ostream &f , const char * aGraphName ,
122 int XCoordinate , int YCoordinate ) {
123 GraphBase::ListOfPythonFunctions aPythonFunction ;
124 aPythonFunction.resize( 3 ) ;
125 aPythonFunction[0] = PythonFunction() ;
126 aPythonFunction[1] = MorePythonFunction() ;
127 aPythonFunction[2] = NextPythonFunction() ;
128 GraphBase::ListOfFuncName aFuncNames ;
129 aFuncNames.resize( 3 ) ;
130 aFuncNames[0] = CORBA::string_dup( PyFuncName() ) ;
131 aFuncNames[1] = CORBA::string_dup( PyMoreName() ) ;
132 aFuncNames[2] = CORBA::string_dup( PyNextName() ) ;
133 return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" ,
135 aFuncNames , aPythonFunction ,
136 XCoordinate , YCoordinate ) ;