2 //=============================================================================
3 // File : DataFlowBase_LoopNode.cxx
5 // Author : Jean Rahuel, CEA
8 //=============================================================================
13 #include "DataFlowBase_LoopNode.hxx"
15 GraphBase::LoopNode::LoopNode() :
16 GraphBase::GOTONode::GOTONode() {
18 cdebug << "GraphBase::LoopNode::LoopNode " << this
19 << " _Name " << (void *) Name() << " " << Name() << " _Comment "
20 << (void *) Comment() << " " << Comment() << " " << endl ;
24 GraphBase::LoopNode::LoopNode( CORBA::ORB_ptr ORB ,
25 SALOME_NamingService* ptrNamingService ,
26 const char * InitName ,
27 const SUPERV::ListOfStrings & anInitPythonFunction ,
28 const char * MoreName ,
29 const SUPERV::ListOfStrings & aMorePythonFunction ,
30 const char * NextName ,
31 const SUPERV::ListOfStrings & aNextPythonFunction ,
32 const char *NodeName ,
33 const SUPERV::KindOfNode akind ,
34 const SUPERV::SDate NodeFirstCreation ,
35 const SUPERV::SDate NodeLastModification ,
36 const char * NodeEditorRelease ,
37 const char * NodeAuthor ,
38 const char * NodeComment ,
39 const bool GeneratedName ,
42 int * Graph_prof_debug ,
43 ostream * Graph_fdebug ) :
44 GraphBase::GOTONode::GOTONode( ORB , ptrNamingService , InitName , anInitPythonFunction ,
45 NodeName , akind , NodeFirstCreation ,
46 NodeLastModification , NodeEditorRelease ,
47 NodeAuthor , NodeComment , GeneratedName ,
48 X , Y , Graph_prof_debug , Graph_fdebug ) {
50 cdebug_in << "GraphBase::LoopNode::LoopNode " << this
51 << "' _Name " << (void *) Name() << " '" << Name() << " _Comment "
52 << (void *) Comment() << " " << Comment() << " "
53 << " KindOfNode " << Kind() << " InitName " << InitName
54 << " MoreName " << MoreName << " NextName " << NextName
55 << " ServiceName " << ServiceName() << " In("
56 << ServiceInParameter().length()
57 << ") Out(" << ServiceOutParameter().length() << ")" << endl ;
59 cdebug << "GraphBase::LoopNode::LoopNode SetMorePythonFunction " << MoreName << " "
60 << aMorePythonFunction[0] << endl ;
61 SetMorePythonFunction( MoreName , aMorePythonFunction ) ;
62 cdebug << "GraphBase::LoopNode::LoopNode SetNextPythonFunction " << NextName << " "
63 << aNextPythonFunction[0] << endl ;
64 SetNextPythonFunction( NextName , aNextPythonFunction ) ;
66 cdebug_out << "GraphBase::LoopNode::LoopNode" << endl;
69 GraphBase::LoopNode::~LoopNode() {
70 cdebug << "GraphBase::Node::~Node " << this
71 << " _Name " << (void *) Name() << " " << Name() << " _Comment "
72 << (void *) Comment() << " " << Comment() << " " << endl ;
73 // if ( _ComponentName != NULLSTRING )
74 // delete [] _ComponentName ;
76 // delete [] _EditorRelease ;
77 // if ( _Author != NULLSTRING )
78 // delete [] _Author ;
79 // if ( _Computer != FACTORYSERVER )
80 // delete [] _Computer;
81 // if ( Comment() != NULLSTRING )
82 // delete [] Comment();
85 //bool GraphBase::LoopNode::SaveXML( ostream &f , char *Tabs ,
86 bool GraphBase::LoopNode::SaveXML( QDomDocument & Graph , QDomElement & info ,
87 int XCoordinate , int YCoordinate ) {
88 GraphBase::ListOfPythonFunctions aPythonFunction ;
89 aPythonFunction.resize( 3 ) ;
90 aPythonFunction[0] = PythonFunction() ;
91 aPythonFunction[1] = MorePythonFunction() ;
92 aPythonFunction[2] = NextPythonFunction() ;
93 GraphBase::ListOfFuncName aFuncNames ;
94 aFuncNames.resize( 3 ) ;
95 aFuncNames[0] = CORBA::string_dup( PyFuncName() ) ;
96 aFuncNames[1] = CORBA::string_dup( PyMoreName() ) ;
97 aFuncNames[2] = CORBA::string_dup( PyNextName() ) ;
98 char * CoupledName = "" ;
99 if ( CoupledNode() ) {
100 CoupledName = CoupledNode()->Name() ;
102 // return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" ,
103 return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" ,
105 aFuncNames , aPythonFunction ,
106 XCoordinate , YCoordinate ) ;
109 bool GraphBase::LoopNode::SavePY( ostream &f , const char * aGraphName ,
110 int XCoordinate , int YCoordinate ) {
111 GraphBase::ListOfPythonFunctions aPythonFunction ;
112 aPythonFunction.resize( 3 ) ;
113 aPythonFunction[0] = PythonFunction() ;
114 aPythonFunction[1] = MorePythonFunction() ;
115 aPythonFunction[2] = NextPythonFunction() ;
116 GraphBase::ListOfFuncName aFuncNames ;
117 aFuncNames.resize( 3 ) ;
118 aFuncNames[0] = CORBA::string_dup( PyFuncName() ) ;
119 aFuncNames[1] = CORBA::string_dup( PyMoreName() ) ;
120 aFuncNames[2] = CORBA::string_dup( PyNextName() ) ;
121 return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" ,
123 aFuncNames , aPythonFunction ,
124 XCoordinate , YCoordinate ) ;