Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/superv.git] / src / GraphBase / DataFlowBase_ComputingNode.cxx
1 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : DataFlowBase_ComputingNode.cxx
8 //  Author : Jean Rahuel, CEA
9 //  Module : SUPERV
10 //  $Header:
11
12 using namespace std;
13 //#include <sstream>
14 //#include <iostream>
15
16 #include "DataFlowBase_StreamGraph.hxx"
17 //#include "DataFlowBase_LoopNode.hxx"
18
19 static void InitFields( //SUPERV::KindOfNode &_Kind ,
20                         SUPERV::SDate      &_FirstCreation ,
21                         SUPERV::SDate      &_LastModification ,
22                         char *             &_EditorRelease ,
23                         char *             &_Author ,
24                         char *             &_Comment ,
25                         //bool               &_HeadNode ,
26                         bool               &_GeneratedName ,
27                         //int                &_DataStreamInPortsNumber ,
28                         //int                &_DataStreamOutPortsNumber ,
29                         int                &_ConnectedInPortsNumber ,
30                         int                &_DecrConnectedInPortsNumber ) {
31                         //int                &_LinkedNodesSize ,
32                         //int                &_SubGraphNumber ) {
33   time_t T = time(NULL);
34   struct tm * Tm = localtime(&T);
35
36 //  _Kind = SUPERV::DataFlowGraph ;
37
38   _FirstCreation.Second = _LastModification.Second = Tm->tm_sec;
39   _FirstCreation.Minute = _LastModification.Minute = Tm->tm_min;
40   _FirstCreation.Hour   = _LastModification.Hour   = Tm->tm_hour;
41   _FirstCreation.Day    = _LastModification.Day    = Tm->tm_mday;
42   _FirstCreation.Month  = _LastModification.Month  = Tm->tm_mon + 1;
43   _FirstCreation.Year   = _LastModification.Year   = Tm->tm_year + 1900; 
44
45   _EditorRelease = new char[ strlen( SuperVision_Version ) + 1 ] ;
46   strcpy( _EditorRelease , SuperVision_Version ) ;
47   _Author = NULLSTRING ;
48 //  _Computer = new char[ strlen( FACTORYSERVER ) + 1 ] ;
49 //  strcpy( _Computer  , FACTORYSERVER ) ;
50   _Comment = NULLSTRING ;
51
52 //  _SubGraphNumber = 0 ;
53 //  _HeadNode = false ;
54   _GeneratedName = false ;
55
56 //  _DataStreamInPortsNumber = 0 ;
57 //  _DataStreamOutPortsNumber = 0 ;
58
59   _ConnectedInPortsNumber = 0 ;
60   _DecrConnectedInPortsNumber = 0 ;
61 //  _LinkedNodesSize = 0 ;
62 //  _SubGraphNumber = 0 ;
63 }
64
65 GraphBase::ComputingNode::ComputingNode() :
66 //  GraphBase::PortsOfNode::PortsOfNode() {
67   GraphBase::StreamNode::StreamNode() {
68
69   InitFields( //_Kind ,
70               _FirstCreation ,
71               _LastModification ,
72               _EditorRelease ,
73               _Author ,
74               _Comment ,
75               //_HeadNode ,
76               _GeneratedName ,
77               //_DataStreamInPortsNumber ,
78               //_DataStreamOutPortsNumber ,
79               _ConnectedInPortsNumber ,
80               _DecrConnectedInPortsNumber ) ;
81               //_LinkedNodesSize ,
82               //_SubGraphNumber ) ;
83   Kind( SUPERV::DataFlowGraph ) ;
84   _NamingService = NULL ;
85   _Node = SUPERV::CNode::_nil() ;
86   _InNode = NULL ;
87   _ThreadNo = pthread_self() ;
88   cdebug << "GraphBase::Node::Node "  << this << " "  << endl ;
89
90 }
91
92 GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB ,
93                                          SALOME_NamingService* ptrNamingService ,
94                                          const char * aDataFlowName ,
95                                          int * Graph_prof_debug ,
96                                          ofstream * Graph_fdebug ) :
97 //  GraphBase::PortsOfNode::PortsOfNode( aDataFlowName ) {
98   GraphBase::StreamNode::StreamNode( aDataFlowName ) {
99
100 //  MESSAGE( "GraphBase::ComputingNode::ComputingNode " << aDataFlowName << " Graph_prof_debug " << Graph_prof_debug ) ;
101   InitFields( //_Kind ,
102               _FirstCreation ,
103               _LastModification ,
104               _EditorRelease ,
105               _Author ,
106               _Comment ,
107               //_HeadNode ,
108               _GeneratedName ,
109               //_DataStreamInPortsNumber ,
110               //_DataStreamOutPortsNumber ,
111               _ConnectedInPortsNumber ,
112               _DecrConnectedInPortsNumber ) ;
113               //_LinkedNodesSize ,
114               //_SubGraphNumber ) ;
115
116   Kind( SUPERV::DataFlowGraph ) ;
117   _ORB = CORBA::ORB::_duplicate( ORB ) ;
118   _NamingService = ptrNamingService ;
119   _Node = SUPERV::CNode::_nil() ;
120   _InNode = NULL ;
121   _ThreadNo = pthread_self() ;
122
123   if ( Graph_prof_debug ) {
124 //    MESSAGE( "GraphBase::ComputingNode::ComputingNode --> SetDebug" ) ;
125 //    cout << "GraphBase::ComputingNode::ComputingNode --> SetDebug" << endl ;
126     _Graph_prof_debug = Graph_prof_debug ;
127     _Graph_fdebug = Graph_fdebug ;
128     SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
129   }
130 //  else {
131 //    cout << "GraphBase::ComputingNode::ComputingNode NO SetDebug" << endl ;
132 //  }
133   cdebug << "GraphBase::ComputingNode::ComputingNode "  << this 
134          << " Name '" << Name() << "' "  << _FirstCreation
135          << " "  << _LastModification << endl ;
136 }
137
138 GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB ,
139                                          SALOME_NamingService* ptrNamingService ,
140                                          const SALOME_ModuleCatalog::Service& aService ,
141                                          const char *NodeName ,
142                                          const SUPERV::KindOfNode akind ,
143                                          const SUPERV::SDate NodeFirstCreation ,
144                                          const SUPERV::SDate NodeLastModification  ,
145                                          const char * NodeEditorRelease ,
146                                          const char * NodeAuthor ,
147                                          const char * NodeComment ,
148                                          const bool   GeneratedName ,
149                                          const long   X ,
150                                          const long   Y ,
151                                          int * Graph_prof_debug ,
152                                          ofstream * Graph_fdebug ) :
153 //  GraphBase::PortsOfNode::PortsOfNode() {
154   GraphBase::StreamNode::StreamNode( NodeName ) {
155
156   _ORB = CORBA::ORB::_duplicate( ORB ) ;
157   _NamingService = ptrNamingService ;
158   _Node = SUPERV::CNode::_nil() ;
159   _InNode = NULL ;
160   _ThreadNo = pthread_self() ;
161
162   Kind( akind ) ;
163 //  _Kind = akind ;
164
165   time_t T = time(NULL);
166   struct tm * Tm = localtime(&T);
167
168   _FirstCreation.Second = _LastModification.Second = Tm->tm_sec;
169   _FirstCreation.Minute = _LastModification.Minute = Tm->tm_min;
170   _FirstCreation.Hour   = _LastModification.Hour   = Tm->tm_hour;
171   _FirstCreation.Day    = _LastModification.Day    = Tm->tm_mday;
172   _FirstCreation.Month  = _LastModification.Month  = Tm->tm_mon + 1;
173   _FirstCreation.Year   = _LastModification.Year   = Tm->tm_year + 1900; 
174
175   if ( NodeEditorRelease != NULLSTRING ) {
176     _EditorRelease = new char[ strlen( NodeEditorRelease ) + 1 ] ;
177     strcpy( _EditorRelease , NodeEditorRelease ) ;
178   }
179   else {
180     _EditorRelease = new char[ strlen( SuperVision_Version ) + 1 ] ;
181     strcpy( _EditorRelease , SuperVision_Version ) ;
182   }
183
184   if ( NodeAuthor != NULLSTRING ) {
185     _Author = new char[ strlen( NodeAuthor ) + 1 ] ;
186     strcpy( _Author  , NodeAuthor ) ;
187   }
188   else {
189     _Author = NULLSTRING ;
190   }
191
192   if ( NodeComment != NULLSTRING ) {
193     _Comment = new char[ strlen( NodeComment ) + 1 ] ;
194     strcpy( _Comment  , NodeComment ) ;
195   }
196   else {
197     _Comment = NULLSTRING ;
198   }
199
200 //  _SubGraphNumber = 0 ;
201 //  _HeadNode = false ;
202   _GeneratedName = GeneratedName ;
203
204 //  const char *aNodeName = NodeName ;
205 //  _Name = new char[strlen(aNodeName)+1];
206 //  strcpy(_Name , aNodeName);
207
208 //  _DataStreamInPortsNumber = 0 ;
209 //  _DataStreamOutPortsNumber = 0 ;
210
211   _ConnectedInPortsNumber = 0 ;
212   _DecrConnectedInPortsNumber = 0 ;
213 //  _LinkedNodesSize = 0 ;
214
215   _X = X ;
216   _Y = Y ;
217
218   _Graph_prof_debug = Graph_prof_debug ;
219   _Graph_fdebug = Graph_fdebug ;
220 //  MESSAGE( "GraphBase::ComputingNode::ComputingNode " << NodeName
221 //           << " _Graph_prof_debug " << _Graph_prof_debug ) ;
222   SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
223   cdebug_in << "GraphBase::ComputingNode::ComputingNode(" << aService.ServiceName << "," << NodeName << ","
224             << akind << ")" << endl;
225   
226
227   DefPortsOfNode( ORB , aService , NamePtr() , Kind() , Graph_prof_debug , Graph_fdebug ) ;
228   cdebug << "GraphBase::ComputingNode::ComputingNode "  << this 
229          << " Name '" << Name()
230          << "' KindOfNode " << Kind()
231          << " ServiceName '" << ServiceName() << "' In(" << ServiceInParameter().length()
232          << ") Out(" << ServiceOutParameter().length() << ")" << endl ;
233
234   cdebug_out << "GraphBase::ComputingNode::ComputingNode" << endl;
235 }
236
237 GraphBase::ComputingNode::~ComputingNode() {
238   cdebug << "GraphBase::ComputingNode::~ComputingNode "  << this 
239          << " Name() "<< Name() << " _Comment "
240          << (void *) _Comment << " "  << _Comment << " "  << endl ;
241 }
242
243 //->StreamNode bool GraphBase::ComputingNode::Name( const char * aName) {
244 //->StreamNode   cdebug_in << "GraphBase::ComputingNode::Name " << _Name << endl;
245 //->StreamNode   if ( _Name ) {
246 //->StreamNode     cdebug << "GraphBase::ComputingNode::ReName "  << _Name << " --> " << aName << endl ;
247 //->StreamNode     delete [] _Name ;
248 //->StreamNode   }
249 //->StreamNode   _Name = new char[strlen(aName)+1] ;
250 //->StreamNode   strcpy( _Name , aName ) ;
251 //->StreamNode   cdebug_out << "GraphBase::ComputingNode::Name " << _Name << endl;
252 //->StreamNode   return true ;
253 //->StreamNode }
254
255 SUPERV::SDate GraphBase::ComputingNode::FirstCreation () const {
256 //  cdebug << "GraphBase::ComputingNode::FirstCreation "
257 //         << " Name '" << Name() << "' "  << _FirstCreation << " "  
258 //         << _LastModification << endl ;
259   return _FirstCreation;
260 }
261
262 SUPERV::SDate GraphBase::ComputingNode::LastModification () const {
263   return _LastModification ;
264 }
265
266 void GraphBase::ComputingNode::FirstCreation(const SUPERV::SDate aDate ) {
267   _FirstCreation = aDate ;
268 }
269
270 void GraphBase::ComputingNode::LastModification(const SUPERV::SDate aDate ) {
271   _LastModification = aDate ;
272 }
273
274 bool GraphBase::ComputingNode::EditorRelease(const char * c){
275   if ( _EditorRelease && _EditorRelease != NULLSTRING )
276     delete _EditorRelease;
277   _EditorRelease = my_strdup(c);
278   return true ;
279 }
280
281 bool GraphBase::ComputingNode::Author(const char * a) {
282   cdebug_in << "GraphBase::ComputingNode::Author " << _Author << endl;
283   if ( _Author && _Author != NULLSTRING )
284     delete _Author;
285   _Author = my_strdup(a);
286   cdebug_out << "GraphBase::ComputingNode::Author " << _Author << endl;
287   return true ;
288 }
289
290 bool GraphBase::ComputingNode::Comment(const char *c) {
291   cdebug_in << "GraphBase::ComputingNode::Comment " << _Comment << endl;
292   if ( _Comment != NULLSTRING )
293     delete [] _Comment;
294   _Comment = my_strdup(c);
295   cdebug_out << "GraphBase::ComputingNode::Comment " << _Comment << endl;
296   return true ;
297 }
298
299 void GraphBase::ComputingNode::NodePort( const char * NodeName ,
300                                 const char * ServiceParameterName ,
301                                 char ** aNode , char ** aPort ) {
302   if ( strcmp( NodeName , Name() ) ) {
303     *aNode = my_strdup( NodeName ) ;
304     *aPort = my_strdup( ServiceParameterName ) ;
305   }
306   else {
307     char * BPort = strchr( ServiceParameterName , '\\' ) ;
308     if ( BPort ) {
309       int len = BPort - ServiceParameterName ;
310       *aNode = new char [ len + 1 ] ;
311       strncpy( *aNode , ServiceParameterName , len ) ;
312       (*aNode)[ len ] = '\0' ;
313       *aPort = my_strdup( &BPort[ 1 ] ) ;
314     }
315     else {
316       *aNode = my_strdup( NULLSTRING ) ;
317       *aPort = my_strdup( NULLSTRING ) ;
318     }
319   }
320 }
321
322 bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName ) {
323   bool RetVal = false ;
324   const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
325   if ( thePort ) {
326     RetVal = thePort->IsConnected() ;
327   }
328   else {
329     const GraphBase::OutPort * thePort = GetOutPort( ToServiceParameterName ) ;
330     if ( thePort ) {
331       RetVal = thePort->IsConnected() ;
332     }
333   }
334   return RetVal ;
335 }
336
337 bool GraphBase::ComputingNode::HasInput(const char * ToServiceParameterName ) {
338   bool RetVal = false ;
339   const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
340   if ( IsDataFlowNode() && thePort ) {
341     RetVal = true ;
342   }
343   else if ( thePort ) {
344 //    cout << "GraphBase::ComputingNode::HasInput theInPort " << thePort << " " << thePort->PortName() << " of "
345 //         << thePort->NodeName() << " IsDataConnected " << thePort->IsDataConnected() << " OutPort "
346 //         << thePort->GetOutPort() << endl ;
347     RetVal = thePort->IsDataConnected() ;
348   }
349   else {
350     const GraphBase::OutPort * thePort = GetOutPort( ToServiceParameterName ) ;
351     if ( thePort ) {
352       RetVal = thePort->IsDataConnected() ;
353     }
354   }
355   return RetVal ;
356 }
357
358 GraphBase::SNode * GraphBase::ComputingNode::GetInfo() {
359   cdebug_in << "GraphBase::ComputingNode::GetInfo" << endl;
360   GraphBase::SNode * Info = new GraphBase::SNode ;
361 //  Info->theComponentName = ComponentName() ;
362 //  Info->theInterfaceName = InterfaceName() ;
363   Info->theName = Name() ;
364   Info->theKind = Kind() ;
365   if ( IsDataStreamNode() ) {
366     long Timeout ;
367     SUPERV::KindOfDataStreamTrace DataStreamTrace ;
368     double DeltaTime ;
369     ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
370     Info->theTimeout = Timeout ;
371     Info->theDataStreamTrace = DataStreamTrace ;
372     Info->theDeltaTime = DeltaTime ;
373   }
374   Info->theService = *GetService() ;
375 //  Info->theListOfParameters = *GetListOfParameters() ;
376   Info->theFirstCreation = FirstCreation() ;
377   Info->theLastModification = LastModification() ;
378   Info->theEditorRelease = EditorRelease() ;
379   Info->theAuthor = Author() ;
380 //  Info->theContainer = Computer() ;
381   Info->theComment = Comment() ;
382   Info->theCoords.theX = GraphBase::ComputingNode::XCoordinate() ;
383   Info->theCoords.theY = GraphBase::ComputingNode::YCoordinate() ;
384   cdebug_out << "GraphBase::ComputingNode::GetInfo" << endl;
385   return Info ;
386 }
387
388 void GraphBase::ComputingNode::DelInPort( const char * InputParameterName ) {
389   GraphBase::PortsOfNode::DelInPort( InputParameterName ) ;
390 }
391 void GraphBase::ComputingNode::DelOutPort( const char * OutputParameterName ) {
392   GraphBase::PortsOfNode::DelOutPort( OutputParameterName ) ;
393 }
394
395 GraphBase::InPort * GraphBase::ComputingNode::AddInPort( const char * InputParameterName ,
396                                                          const char * InputParameterType ,
397                                                          const SUPERV::KindOfPort aKindOfPort ) {
398   cdebug << "AddInPort " << Name() << " ConnectedInPortsNumber " << ConnectedInPortsNumber() << endl ;
399   return GraphBase::PortsOfNode::AddInPort( _ORB , NamePtr() ,
400                                             Kind() ,
401                                             InputParameterName ,
402                                             InputParameterType ,
403                                             aKindOfPort ,
404 //                                            DataStreamInPortsNumber() ,
405                                             _Graph_prof_debug , _Graph_fdebug ) ;
406 }
407 GraphBase::OutPort * GraphBase::ComputingNode::AddOutPort( const char * OutputParameterName ,
408                                                            const char * OutputParameterType ,
409                                                            const SUPERV::KindOfPort aKindOfPort ) {
410   cdebug << "AddOutPort " << Name() << " ConnectedInPortsNumber " << ConnectedInPortsNumber() << endl ;
411   return GraphBase::PortsOfNode::AddOutPort( _ORB , NamePtr() ,
412                                              Kind() ,
413                                              OutputParameterName ,
414                                              OutputParameterType ,
415                                              aKindOfPort ,
416 //                                             DataStreamOutPortsNumber() ,
417                                              _Graph_prof_debug , _Graph_fdebug ) ;
418 }
419
420 void GraphBase::ComputingNode::DelInDataStreamPort( const char * InputParameterName ) {
421   GraphBase::PortsOfNode::DelInPort( InputParameterName ) ;
422 }
423 void GraphBase::ComputingNode::DelOutDataStreamPort( const char * OutputParameterName ) {
424   GraphBase::PortsOfNode::DelOutPort( OutputParameterName ) ;
425 }
426
427 GraphBase::InDataStreamPort * GraphBase::ComputingNode::AddInDataStreamPort( const char * InputParameterName ,
428                                                                              const SALOME_ModuleCatalog::DataStreamType InputParameterType ,
429                                                                              const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
430                                                                              const SUPERV::KindOfPort aKindOfPort ) {
431 //  IncrDataStreamInPorts() ;
432   GraphBase::InDataStreamPort * aDataStreamPort ;
433   aDataStreamPort = (GraphBase::InDataStreamPort * ) GraphBase::PortsOfNode::AddInPort( _ORB , NamePtr() ,
434                                                                                         Kind() ,
435                                                                                         InputParameterName ,
436                                                                                         DataStreamTypeToString( InputParameterType ).c_str() ,
437                                                                                         aKindOfPort ,
438 //                                                                                        DataStreamInPortsNumber() ,
439                                                                                         _Graph_prof_debug , _Graph_fdebug ) ;
440   aDataStreamPort->Dependency( aDependency ) ;
441   if ( aDependency == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL ) {
442     aDataStreamPort->SetParams( SUPERV::TI , SUPERV::L1 , SUPERV::EXTRANULL ) ;
443   }
444   return aDataStreamPort ;
445 }
446 GraphBase::OutDataStreamPort * GraphBase::ComputingNode::AddOutDataStreamPort( const char * OutputParameterName ,
447                                                                                const SALOME_ModuleCatalog::DataStreamType OutputParameterType ,
448                                                                                const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
449                                                                                const SUPERV::KindOfPort aKindOfPort ) {
450 //  IncrDataStreamOutPorts() ;
451   GraphBase::OutDataStreamPort * aDataStreamPort ;
452   aDataStreamPort = (GraphBase::OutDataStreamPort * ) GraphBase::PortsOfNode::AddOutPort( _ORB , NamePtr() ,
453                                                                                           Kind() ,
454                                                                                           OutputParameterName ,
455                                                                                           DataStreamTypeToString( OutputParameterType ).c_str() ,
456                                                                                           aKindOfPort ,
457 //                                                                                          DataStreamOutPortsNumber() ,
458                                                                                           _Graph_prof_debug , _Graph_fdebug ) ;
459   aDataStreamPort->Dependency( aDependency ) ;
460   return aDataStreamPort ;
461 }
462
463
464 #include <sys/time.h>
465 #include <sys/resource.h>
466 #include <unistd.h>
467
468 const long GraphBase::ComputingNode::CpuUsed() {
469   struct rusage usage ;
470   if ( getrusage( RUSAGE_SELF , &usage ) == -1 ) {
471     perror("GraphBase::CpuUsed") ;
472     return 0 ;
473   }
474 //  return usage.ru_utime.__time_t tv_sec ;
475   cdebug << "CpuUsed " << usage.ru_utime.tv_sec << " " << usage.ru_utime.tv_usec << " "
476          << usage.ru_stime.tv_sec << " " << usage.ru_stime.tv_usec << endl ;
477   return usage.ru_utime.tv_sec ;
478 }
479
480 #if 0
481 const GraphBase::ListOfParameters * GraphBase::ComputingNode::GetListOfParameters() const {
482   GraphBase::ListOfParameters * aListOfParameters = new GraphBase::ListOfParameters ;
483   if ( IsInLineNode() || IsGOTONode() ) {
484     unsigned int i;
485     for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
486       const InPort * anInPort = GetNodeInPort( i ) ;
487       if ( anInPort->IsBus() ) {
488         int size = aListOfParameters->size() ;
489         aListOfParameters->resize( size + 1 ) ;
490         (*aListOfParameters)[size].theInParameter.Parametername = anInPort->PortName() ;
491         (*aListOfParameters)[size].theInParameter.Parametertype = anInPort->PortType() ;
492         const OutPort * anOutPort = GetNodeOutPort( anInPort->PortIndex() ) ;
493         (*aListOfParameters)[size].theOutParameter.Parametername = anOutPort->PortName() ;
494         (*aListOfParameters)[size].theOutParameter.Parametertype = anOutPort->PortType() ;
495       }
496     }
497   }
498   return aListOfParameters ;
499 }
500 #endif
501
502 bool GraphBase::ComputingNode::SaveXML( QDomDocument & Graph , QDomElement & info ,
503                                         const char * ComponentName ,
504                                         const char * InterfaceName ,
505                                         const char * Computer ,
506                                         const char * CoupledNode ,
507                                         const ListOfFuncName FuncNames ,
508                                         const ListOfPythonFunctions PythonFunctions ,
509                                         int XCoordinate , int YCoordinate ) const {
510   cdebug_in << "SaveXML Node " << Name() << endl ;
511   QDomElement node = Graph.createElement( "node" ) ;
512   info.appendChild( node ) ;
513   QDomElement componentname = Graph.createElement( "component-name" ) ;
514   QDomText aField ;
515   if ( strlen( ComponentName ) ) {
516 //    f << Tabs << "<component-name>" << ComponentName << "</component-name>"
517 //      << endl ;
518 //    componentname.setNodeValue( ComponentName ) ;
519     aField = Graph.createTextNode( ComponentName ) ;
520   }
521   else {
522 //    f << Tabs << "<component-name>?</component-name>" << endl ;
523 //    componentname.setNodeValue( "?" ) ;
524     aField = Graph.createTextNode( "?" ) ;
525   }
526   node.appendChild( componentname ) ;
527   componentname.appendChild( aField ) ;
528
529   QDomElement interfacename = Graph.createElement("interface-name") ;
530   if ( strlen( InterfaceName ) ) {
531 //    f << Tabs << "<interface-name>" << InterfaceName << "</interface-name>"
532 //      << endl ;
533 //    interfacename.setAttribute("name" , InterfaceName ) ;
534     aField = Graph.createTextNode( InterfaceName ) ;
535   }
536   else {
537 //    f << Tabs << "<interface-name>?</interface-name>" << endl ;
538 //    interfacename.setAttribute("name" , "?" ) ;
539     aField = Graph.createTextNode( "?" ) ;
540   }
541   node.appendChild(interfacename) ;
542   interfacename.appendChild( aField ) ;
543
544 //  f << Tabs << "<node-name>" << Name() << "</node-name>" << endl ;
545   QDomElement nodename = Graph.createElement("node-name") ;
546   aField = Graph.createTextNode( Name() ) ;
547   node.appendChild( nodename ) ;
548   nodename.appendChild( aField ) ;
549
550 //  f << Tabs << "<kind>" << (int ) Kind() << "</kind>" << endl ;
551   QDomElement kind = Graph.createElement( "kind" ) ;
552   QString aKind ;
553
554   // san - Presumably, data stream graphs should be always saved with kind = DataStreamGraph
555 // JR : the bug was at line 566 : && HasDataStream() != 0 was missing
556   if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) {
557     aKind = aKind.setNum( SUPERV::DataFlowGraph ) ;
558   }
559   else {
560     aKind = aKind.setNum( Kind() ) ;
561   }
562   aField = Graph.createTextNode( aKind ) ;
563   node.appendChild( kind ) ;
564   kind.appendChild( aField ) ;
565
566   if ( IsDataStreamNode() && HasDataStream() != 0 ) {
567     long Timeout ;
568     SUPERV::KindOfDataStreamTrace DataStreamTrace ;
569     double DeltaTime ;
570     ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
571
572     QDomElement timeout = Graph.createElement("streamgraph-timeout") ;
573     QString aTimeout ;
574     aTimeout = aTimeout.setNum( Timeout ) ;
575     aField = Graph.createTextNode( aTimeout ) ;
576     node.appendChild( timeout ) ;
577     timeout.appendChild( aField ) ;
578
579     QDomElement datastreamtrace = Graph.createElement("streamgraph-datastreamtrace") ;
580     QString aDataStreamTrace ;
581     aDataStreamTrace = aDataStreamTrace.setNum( DataStreamTrace ) ;
582     aField = Graph.createTextNode( aDataStreamTrace ) ;
583     node.appendChild( datastreamtrace ) ;
584     datastreamtrace.appendChild( aField ) ;
585
586     QDomElement deltatime = Graph.createElement("streamgraph-deltatime") ;
587     QString aDeltaTime ;
588     aDeltaTime = aDeltaTime.setNum( DeltaTime ) ;
589     aField = Graph.createTextNode( aDeltaTime ) ;
590     node.appendChild( deltatime ) ;
591     deltatime.appendChild( aField ) ;
592   }
593
594   QDomElement couplednode = Graph.createElement("coupled-node") ;
595   if ( IsGOTONode() || IsLoopNode() || IsEndLoopNode() ||
596        IsSwitchNode() || IsEndSwitchNode() ) {
597 //    f << Tabs << "<coupled-node>" << CoupledNode << "</coupled-node>"
598 //      << endl ;
599     aField = Graph.createTextNode( CoupledNode ) ;
600   }
601   else {
602 //    f << Tabs << "<coupled-node>?</coupled-node>" << endl ;
603     aField = Graph.createTextNode( "?" ) ;
604   }
605   node.appendChild(couplednode) ;
606   couplednode.appendChild( aField ) ;
607
608 //  f << Tabs << "<service>" << endl ;
609   QDomElement service = Graph.createElement("service") ;
610   node.appendChild(service) ;
611   QDomElement servicename = Graph.createElement("service-name") ;
612   if ( strlen( ServiceName() ) ) {
613 //    f << Tabs << "    <service-name>" << ServiceName() << "</service-name>" << endl ;
614     aField = Graph.createTextNode( ServiceName() ) ;
615   }
616   else {
617 //    f << Tabs << "    <service-name>?</service-name>" << endl ;
618     aField = Graph.createTextNode( "?" ) ;
619   }
620   service.appendChild(servicename) ;
621   servicename.appendChild( aField ) ;
622
623   QDomElement inParameterlist = Graph.createElement("inParameter-list") ;
624   service.appendChild(inParameterlist) ;
625   unsigned int i;
626   GraphBase::ComputingNode * aNode = (GraphBase::ComputingNode * ) this ;
627   for ( i = 0 ; i < ServiceInParameter().length() ; i++ ) {
628     const GraphBase::InPort * anInPort ;
629     anInPort = aNode->GetInPort( ServiceInParameter()[i].Parametername ) ;
630     if ( !anInPort->IsDataStream() ) {
631       cdebug << "SaveXML " << i << ". " << ServiceInParameter()[i].Parametername
632              << " InParameterPort " << anInPort->Kind() << endl ;
633       QDomElement inParameter = Graph.createElement("inParameter") ;
634       inParameterlist.appendChild(inParameter) ;
635       QDomElement inParametertype = Graph.createElement("inParameter-type") ;
636       if ( strlen( ServiceInParameter()[i].Parametertype ) ) {
637         aField = Graph.createTextNode( strdup( ServiceInParameter()[i].Parametertype ) ) ;
638       }
639       else {
640         aField = Graph.createTextNode( "?" ) ;
641       }
642       inParameter.appendChild(inParametertype) ;
643       inParametertype.appendChild( aField ) ;
644       QDomElement inParametername = Graph.createElement("inParameter-name") ;
645       if ( strlen( ServiceInParameter()[i].Parametername ) ) {
646         aField = Graph.createTextNode( strdup(ServiceInParameter()[i].Parametername) ) ;
647       }
648       else {
649         aField = Graph.createTextNode( "?" ) ;
650       }
651       inParameter.appendChild(inParametername) ;
652       inParametername.appendChild( aField ) ;
653     }
654   }
655   QDomElement outParameterlist = Graph.createElement("outParameter-list") ;
656   service.appendChild(outParameterlist) ;
657   for ( i = 0 ; i < ServiceOutParameter().length() ; i++ ) {
658     const GraphBase::OutPort * anOutPort ;
659     anOutPort = aNode->GetOutPort( ServiceOutParameter()[i].Parametername ) ;
660     if ( !anOutPort->IsDataStream() ) {
661       cdebug << "SaveXML " << i << ". " << ServiceOutParameter()[i].Parametername
662              << " OutParameterPort " << anOutPort->Kind() << endl ;
663       QDomElement outParameter = Graph.createElement("outParameter") ;
664       outParameterlist.appendChild(outParameter) ;
665       QDomElement outParametertype = Graph.createElement("outParameter-type") ;
666       if ( strlen( ServiceOutParameter()[i].Parametertype ) ) {
667         aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametertype) ) ;
668       }
669       else {
670         aField = Graph.createTextNode( "?" ) ;
671       }
672       outParameter.appendChild(outParametertype) ;
673       outParametertype.appendChild( aField ) ;
674       QDomElement outParametername = Graph.createElement("outParameter-name") ;
675       if ( strlen( ServiceOutParameter()[i].Parametername ) ) {
676         aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametername) ) ;
677       }
678       else {
679         aField = Graph.createTextNode( "?" ) ;
680       }
681       outParameter.appendChild(outParametername) ;
682       outParametername.appendChild( aField ) ;
683     }
684   }
685
686   QDomElement DataStreamlist = Graph.createElement("DataStream-list") ;
687   node.appendChild( DataStreamlist ) ;
688   for ( i = 0 ; i < (unsigned int ) GetNodeInPortsSize() ; i++ ) {
689     const GraphBase::InPort * anInPort ;
690     anInPort = aNode->GetNodeInPort( i ) ;
691     if ( anInPort->IsDataStream() ) {
692       cdebug << "SaveXML " << i << " " << Name() << " " << anInPort->PortName() << " " << anInPort->PortType()
693              << " InDataStreamPort " << anInPort->Kind() << endl ;
694       QDomElement inParameter = Graph.createElement("inParameter") ;
695       DataStreamlist.appendChild(inParameter) ;
696       QDomElement inParametertype = Graph.createElement("inParameter-type") ;
697       QString aType ;
698       aType = aType.setNum( StringToDataStreamType( anInPort->PortType() ) ) ;
699       cdebug << "SaveXML " << anInPort->PortType() << " --> " << StringToDataStreamType( anInPort->PortType() )
700              << " " << aType << endl ;
701       aField = Graph.createTextNode( aType ) ;
702       inParameter.appendChild(inParametertype) ;
703       inParametertype.appendChild( aField ) ;
704       QDomElement inParametername = Graph.createElement("inParameter-name") ;
705       if ( strlen( anInPort->PortName() ) ) {
706         aField = Graph.createTextNode( strdup(anInPort->PortName()) ) ;
707       }
708       else {
709         aField = Graph.createTextNode( "?" ) ;
710       }
711       inParameter.appendChild(inParametername) ;
712       inParametername.appendChild( aField ) ;
713       cdebug << "SaveXML " << anInPort->PortName() << endl ;
714       QDomElement inParameterdependency = Graph.createElement("inParameter-dependency") ;
715       QString aDependency ;
716       aDependency = aDependency.setNum( anInPort->Dependency() ) ;
717       aField = Graph.createTextNode( aDependency ) ;
718       inParameter.appendChild(inParameterdependency) ;
719       inParameterdependency.appendChild( aField ) ;
720       cdebug << "SaveXML Dependency " << anInPort->Dependency() << endl ;
721       SUPERV::KindOfSchema        aKindOfSchema ;
722       SUPERV::KindOfInterpolation aKindOfInterpolation ;
723       SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
724       ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
725       QDomElement inParameterKindOfSchema = Graph.createElement("inParameter-schema") ;
726       QString aSchema ;
727       aSchema = aSchema.setNum( aKindOfSchema ) ;
728       aField = Graph.createTextNode( aSchema ) ;
729       inParameter.appendChild(inParameterKindOfSchema) ;
730       inParameterKindOfSchema.appendChild( aField ) ;
731       cdebug << "SaveXML aKindOfSchema " << aKindOfSchema << endl ;
732       QDomElement inParameterKindOfInterpolation = Graph.createElement("inParameter-interpolation") ;
733       QString anInterpolation ;
734       anInterpolation = anInterpolation.setNum( aKindOfInterpolation ) ;
735       aField = Graph.createTextNode( anInterpolation ) ;
736       inParameter.appendChild(inParameterKindOfInterpolation) ;
737       inParameterKindOfInterpolation.appendChild( aField ) ;
738       cdebug << "SaveXML aKindOfInterpolation " << aKindOfInterpolation << endl ;
739       QDomElement inParameterKindOfExtrapolation = Graph.createElement("inParameter-extrapolation") ;
740       QString anExtrapolation ;
741       anExtrapolation = anExtrapolation.setNum( aKindOfExtrapolation ) ;
742       aField = Graph.createTextNode( anExtrapolation ) ;
743       inParameter.appendChild(inParameterKindOfExtrapolation) ;
744       inParameterKindOfExtrapolation.appendChild( aField ) ;
745       cdebug << "SaveXML aKindOfExtrapolation " << aKindOfExtrapolation << endl ;
746     }
747   }
748   for ( i = 0 ; i < (unsigned int ) GetNodeOutPortsSize() ; i++ ) {
749     const GraphBase::OutPort * anOutPort ;
750     anOutPort = aNode->GetNodeOutPort( i ) ;
751     if ( anOutPort->IsDataStream() ) {
752       cdebug << "SaveXML " << i << " " << Name() << " " << anOutPort->PortName() << " " << anOutPort->PortType()
753              << " OutDataStreamPort " << anOutPort->Kind() << endl ;
754       QDomElement outParameter = Graph.createElement("outParameter") ;
755       DataStreamlist.appendChild(outParameter) ;
756       QDomElement outParametertype = Graph.createElement("outParameter-type") ;
757       QString aType ;
758       aType = aType.setNum( StringToDataStreamType( anOutPort->PortType() ) ) ;
759       cdebug << "SaveXML " << anOutPort->PortType() << " --> " << StringToDataStreamType( anOutPort->PortType() )
760              << " " << aType << endl ;
761       aField = Graph.createTextNode( aType ) ;
762       outParameter.appendChild(outParametertype) ;
763       outParametertype.appendChild( aField ) ;
764       QDomElement outParametername = Graph.createElement("outParameter-name") ;
765       if ( strlen( anOutPort->PortName() ) ) {
766         aField = Graph.createTextNode( strdup(anOutPort->PortName() ) ) ;
767       }
768       else {
769         aField = Graph.createTextNode( "?" ) ;
770       }
771       outParameter.appendChild(outParametername) ;
772       outParametername.appendChild( aField ) ;
773       cdebug << "SaveXML " << anOutPort->PortName() << endl ;
774       QDomElement outParameterdependency = Graph.createElement("outParameter-dependency") ;
775       QString aDependency ;
776       aDependency = aDependency.setNum( anOutPort->Dependency() )  ;
777       aField = Graph.createTextNode( aDependency ) ;
778       outParameter.appendChild(outParameterdependency) ;
779       outParameterdependency.appendChild( aField ) ;
780       cdebug << "SaveXML Dependency " << anOutPort->Dependency() << endl ;
781       long aNumberOfValues ;
782       aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
783       QDomElement outParameterNumberOfValues = Graph.createElement("outParameter-values") ;
784       QString aValues ;
785       aValues = aValues.setNum( aNumberOfValues ) ;
786       aField = Graph.createTextNode( aValues ) ;
787       outParameter.appendChild(outParameterNumberOfValues) ;
788       outParameterNumberOfValues.appendChild( aField ) ;
789       cdebug << "SaveXML NumberOfValues " << ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() << endl ;
790     }
791   }
792 //  f << Tabs << "</Parameter-list>" << endl ;    
793
794 //  f << Tabs << "<PyFunction-list>" << endl ;
795   QDomElement PyFunctionlist = Graph.createElement("PyFunction-list") ;
796   node.appendChild( PyFunctionlist ) ;
797   for ( i = 0 ; i < PythonFunctions.size() ; i++ ) {
798 //    f << Tabs << "    <PyFunction>" << endl ;
799     QDomElement PyFunction = Graph.createElement("PyFunction") ;
800     PyFunctionlist.appendChild( PyFunction ) ;
801     int j ;
802     QDomElement FuncName = Graph.createElement("FuncName") ;
803     if ( strlen( FuncNames[i].c_str() ) ) {
804       aField = Graph.createTextNode( FuncNames[i].c_str() ) ;
805     }
806     else {
807       aField = Graph.createTextNode( "?" ) ;
808     }
809     PyFunction.appendChild( FuncName ) ;
810     FuncName.appendChild( aField ) ;
811     if ( (*PythonFunctions[i]).length() ) {
812       for ( j = 0 ; j < (int ) (*PythonFunctions[i]).length() ; j++ ) {
813         QDomElement PyFunc = Graph.createElement("PyFunc") ;
814         QDomCDATASection aCDATA ;
815       // mpv: Linux 8.0 compiler compatibility
816         char * aCDATAChar = strdup ((*PythonFunctions[i])[j]) ;
817         int i ;
818         for ( i = 0 ; i < (int ) strlen( aCDATAChar ) ; i++ ) {
819           if ( aCDATAChar[ i ] != ' ' ) {
820             break ;
821           }
822         }
823         if ( i == (int ) strlen( aCDATAChar ) ) {
824           aCDATA = Graph.createCDATASection( "?" ) ;
825         }
826         else {
827           aCDATA = Graph.createCDATASection( aCDATAChar ) ;
828         }
829         PyFunction.appendChild( PyFunc ) ;
830         PyFunc.appendChild( aCDATA ) ;
831       }
832     }
833     else {
834       QDomElement PyFunc = Graph.createElement("PyFunc") ;
835       QDomCDATASection aCDATA = Graph.createCDATASection( "?" ) ;
836       PyFunction.appendChild( PyFunc ) ;
837       PyFunc.appendChild( aCDATA ) ;
838     }
839   }
840
841 //  f << Tabs << "<creation-date>" << FirstCreation() << "</creation-date>"
842 //    << endl ;
843   QDomElement creationdate = Graph.createElement("creation-date") ;
844   char fdate[30] ;
845   sprintf( fdate , "%d/%d/%d - %d:%d:%d" ,  FirstCreation().Day , FirstCreation().Month , FirstCreation().Year , FirstCreation().Hour , FirstCreation().Minute , FirstCreation().Second ) ;
846   aField = Graph.createTextNode( fdate ) ;
847   node.appendChild( creationdate ) ;
848   creationdate.appendChild( aField ) ;
849 //  f << Tabs << "<lastmodification-date>" << LastModification()
850 //    << "</lastmodification-date>" << endl ;
851   QDomElement lastmodificationdate = Graph.createElement("lastmodification-date") ;
852   char ldate[30] ;
853   sprintf( ldate , "%d/%d/%d - %d:%d:%d" , LastModification().Day , LastModification().Month , LastModification().Year , LastModification().Hour , LastModification().Minute , LastModification().Second ) ;
854   aField = Graph.createTextNode( ldate ) ;
855   node.appendChild( lastmodificationdate ) ;
856   lastmodificationdate.appendChild( aField ) ;
857 //  f << Tabs << "<editor-release>" << EditorRelease() << "</editor-release>"
858 //    << endl ;
859   QDomElement editorrelease = Graph.createElement("editor-release") ;
860   aField = Graph.createTextNode( EditorRelease() ) ;
861   node.appendChild( editorrelease ) ;
862   editorrelease.appendChild( aField ) ;
863   QDomElement author = Graph.createElement("author") ;
864   if ( strlen( Author() ) ) {
865 //    f << Tabs << "<author>" << Author() << "</author>" << endl ;
866     aField = Graph.createTextNode( Author() ) ;
867   }
868   else {
869 //    f << Tabs << "<author>?</author>" << endl ;
870     aField = Graph.createTextNode( "?" ) ;
871   }
872   node.appendChild( author ) ;
873   author.appendChild( aField ) ;
874   QDomElement container = Graph.createElement("container") ;
875   if ( IsFactoryNode() && strlen( Computer) ) {
876 //    f << Tabs << "<container>" << Computer << "</container>" << endl ;
877     aField = Graph.createTextNode( Computer ) ;
878   }
879   else {
880 //    f << Tabs << "<container>?</container>" << endl ;
881     aField = Graph.createTextNode( "?" ) ;
882   }
883   node.appendChild( container ) ;
884   container.appendChild( aField ) ;
885   QDomElement comment = Graph.createElement("comment") ;
886   if ( strlen( Comment() ) ) {
887 //    f << Tabs << "<comment>" << Comment() << "</comment>" << endl ;
888     aField = Graph.createTextNode( Comment() ) ;
889   }
890   else {
891 //    f << Tabs << "<comment>?</comment>" << endl ;
892     aField = Graph.createTextNode( "?" ) ;
893   }
894   node.appendChild( comment ) ;
895   comment.appendChild( aField ) ;
896 //  f << Tabs << "<x-position>" << XCoordinate << "</x-position>" << endl ;
897   QDomElement xposition = Graph.createElement("x-position") ;
898   QString aXCoordinate ;
899   aXCoordinate = aKind.setNum( XCoordinate ) ;
900   aField = Graph.createTextNode( aXCoordinate ) ;
901   node.appendChild( xposition ) ;
902   xposition.appendChild( aField ) ;
903 //  f << Tabs << "<y-position>" << YCoordinate << "</y-position>" << endl ;
904   QDomElement yposition = Graph.createElement("y-position") ;
905   QString aYCoordinate ;
906   aYCoordinate = aKind.setNum( YCoordinate ) ;
907   aField = Graph.createTextNode( aYCoordinate ) ;
908   node.appendChild( yposition ) ;
909   yposition.appendChild( aField ) ;
910   cdebug_out << "SaveXML Node " << Name() << endl ;
911   return true ;
912 }
913
914 bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
915                                        const char * ComponentName ,
916                                        const char * InterfaceName ,
917                                        const char * Computer ,
918                                        const GraphBase::InLineNode * aCoupledNode ,
919                                        const ListOfFuncName FuncNames ,
920                                        const ListOfPythonFunctions PythonFunctions ,
921                                        int XCoordinate , int YCoordinate ) const {
922   // san - Presumably, data stream graphs should be always saved with kind = DataStreamGraph
923 // JR : the bug was at line 927 : && HasDataStream() != 0 was missing
924   if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) {
925     f << Name() << " = Graph( '" << Name() << "' )" << endl ;
926   }
927   else if ( IsDataStreamNode() && HasDataStream() != 0 ) {
928     f << Name() << " = StreamGraph( '" << Name() << "' )" << endl ;
929     long Timeout ;
930     SUPERV::KindOfDataStreamTrace DataStreamTrace ;
931     double DeltaTime ;
932     ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
933     f << aGraphName << ".SetStreamParams( " << Timeout << " , SUPERV." << DataStreamTrace
934       << " , " << DeltaTime << " )" << endl ;
935   }
936   else if ( IsComputingNode() ) {
937     int i ;
938     f << Name() << "_ServiceinParameter = []" << endl ;
939     for ( i = 0 ; i < (int ) ServiceInParameter().length() ; i++ ) {
940       f << Name() << "_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( '"
941         << ServiceInParameter()[i].Parametertype << "' , '"
942         << ServiceInParameter()[i].Parametername << "' ) )" << endl ;
943     }
944     f << Name() << "_ServiceoutParameter = []" << endl ;
945     for ( i = 0 ; i < (int ) ServiceOutParameter().length() ; i++ ) {
946       f << Name() << "_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( '"
947         << ServiceOutParameter()[i].Parametertype << "' , '"
948         << ServiceOutParameter()[i].Parametername << "' ) )" << endl ;
949     }
950     f << Name() << "_ServiceinStreamParameter = []" << endl ;
951     for ( i = 0 ; i < (int ) ServiceInStreamParameter().length() ; i++ ) {
952       f << Name() << "_ServiceinStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( SALOME_ModuleCatalog."
953         << ServiceInStreamParameter()[i].Parametertype << " , '"
954         << ServiceInStreamParameter()[i].Parametername << "' , SALOME_ModuleCatalog."
955         << ServiceInStreamParameter()[i].Parameterdependency << " ) )" << endl ;
956     }
957     f << Name() << "_ServiceoutStreamParameter = []" << endl ;
958     for ( i = 0 ; i < (int ) ServiceOutStreamParameter().length() ; i++ ) {
959       f << Name() << "_ServiceoutStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( SALOME_ModuleCatalog."
960         << ServiceOutStreamParameter()[i].Parametertype << " , '"
961         << ServiceOutStreamParameter()[i].Parametername << "' , SALOME_ModuleCatalog."
962         << ServiceOutStreamParameter()[i].Parameterdependency << " ) )" << endl ;
963     }
964     f << Name() << "_Service = SALOME_ModuleCatalog.Service( '" << ServiceName()
965       << "' , " << Name() << "_ServiceinParameter"
966       << " , " << Name() << "_ServiceoutParameter"
967       << " , " << Name() << "_ServiceinStreamParameter"
968       << " , " << Name() << "_ServiceoutStreamParameter"
969       << " , 0 , 0 )" << endl ;
970     f << Name() << " = " << aGraphName << ".CNode( " << Name() << "_Service" << " )"
971       << endl ;
972   }
973   else if ( IsFactoryNode() ) {
974     f << Name() << " = " << aGraphName << ".FNode( '" << ComponentName
975       << "' , '" << InterfaceName << "' , '" << ServiceName() << "' )"
976       << endl ;
977   }
978   else if ( IsEndLoopNode() || IsEndSwitchNode() ) {
979 // It is done with LoopNode or SwitchNode with CoupledNode()
980   }
981   else {
982     f << "Py" << Name() << " = []" << endl ;
983     int i ;
984     SUPERV::ListOfStrings aPyFunc ;
985     if ( PythonFunctions.size() ) {
986       aPyFunc = *PythonFunctions[0] ;
987       for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
988         f << "Py" << Name() << ".append( '" << aPyFunc[i] << "' )" << endl ;
989       }
990     }
991     if ( IsInLineNode() ) {
992       f << Name() << " = " << aGraphName << ".INode( '" << FuncNames[0].c_str() << "' , Py"
993         << Name() << " )" << endl ;
994     }
995     else if ( IsGOTONode() ) {
996       if ( aCoupledNode ) {
997         f << Name() << " = " << aGraphName << ".GNode( '" << FuncNames[0].c_str() << "' , Py"
998           << Name() << " , '" << aCoupledNode->Name() << "' )" << endl ;
999       }
1000       else {
1001         f << Name() << " = " << aGraphName << ".GNode( '" << FuncNames[0].c_str() << "' , Py"
1002           << Name() << " , '' )" << endl ;
1003       }
1004     }
1005     else {
1006 //      char * EndName = NULL ;
1007 //      EndName = new char[ 3 + strlen( Name() ) + 1 ] ;
1008 //      strcpy( EndName , "End" ) ;
1009 //      strcat( EndName , Name() ) ;
1010       char * EndName = aCoupledNode->Name() ;
1011       if ( IsLoopNode() ) {
1012         int i ;
1013         SUPERV::ListOfStrings aPyMore = *PythonFunctions[1] ;
1014         SUPERV::ListOfStrings aPyNext = *PythonFunctions[2] ;
1015         f << "PyMore" << Name() << " = []" << endl ;
1016         for ( i = 0 ; i < (int ) aPyMore.length() ; i++ ) {
1017           f << "PyMore" << Name() << ".append( '" << aPyMore[i] << "' )" << endl ;
1018         }
1019         f << "PyNext" << Name() << " = []" << endl ;
1020         for ( i = 0 ; i < (int ) aPyNext.length() ; i++ ) {
1021           f << "PyNext" << Name() << ".append( '" << aPyNext[i] << "' )" << endl ;
1022         }
1023         f << Name() << "," << EndName << " = " << aGraphName << ".LNode( '"
1024           << FuncNames[0].c_str() << "' , Py" << Name() << " , '"
1025           << FuncNames[1].c_str() << "' , PyMore" << Name()
1026           << " , '" << FuncNames[2].c_str() << "' , PyNext"
1027           << Name() << " )" << endl ;
1028         f << EndName << ".SetName( '" << aCoupledNode->Name() << "' )" << endl ;
1029         f << EndName << ".SetAuthor( '" << aCoupledNode->Author() << "' )" << endl ;
1030         f << EndName << ".SetComment( '" << aCoupledNode->Comment() << "' )" << endl ;
1031         f << EndName << ".Coords( " << aCoupledNode->XCoordinate() << " , "
1032           << aCoupledNode->YCoordinate() << " )" << endl ;
1033         SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
1034         f << "Py" << aCoupledNode->Name() << " = []" << endl ;
1035         for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
1036           f << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
1037             << endl ;
1038         }
1039         f << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
1040         for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
1041           const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
1042           cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
1043                  << " " << anInPort->Kind() << endl ;
1044           if ( anInPort->IsLoop() ) {
1045             f << "I" << Name() << anInPort->PortName() << " = "
1046               << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1047           }
1048           else if ( anInPort->IsInLine() ) {
1049             f << "I" << Name() << anInPort->PortName() << " = "
1050               << Name() << ".InPort( '" << anInPort->PortName() << "' , '"
1051               << anInPort->PortType() << "' )" << endl ;
1052           }
1053           else if ( anInPort->IsDataStream() ) {
1054             f << "I" << Name() << anInPort->PortName() << " = " << Name()
1055               << ".InStreamPort( '" << anInPort->PortName()
1056               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
1057               << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
1058             SUPERV::KindOfSchema        aKindOfSchema ;
1059             SUPERV::KindOfInterpolation aKindOfInterpolation ;
1060             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
1061             ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
1062             f << "I" << Name() << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
1063               << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
1064           }
1065           else if ( anInPort->IsGate() ) {
1066             f << "I" << Name() << anInPort->PortName() << " = "
1067               << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1068           }
1069         }
1070         for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1071           const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
1072           cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
1073                  << " " << anOutPort->Kind() << endl ;
1074           if ( anOutPort->IsInLine() || anOutPort->IsLoop() ) {
1075             f << "O" << Name() << anOutPort->PortName() << " = "
1076               << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1077           }
1078           else if ( anOutPort->IsDataStream() ) {
1079             f << "O" << Name() << anOutPort->PortName() << " = " << Name()
1080               << ".OutStreamPort( '" << anOutPort->PortName()
1081               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
1082               << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
1083             long aNumberOfValues ;
1084             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
1085             f << "O" << Name() << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
1086               << endl ;
1087           }
1088         }
1089         for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
1090           const GraphBase::InPort * anInPort = aCoupledNode->GetNodeInPort(i) ;
1091           cdebug << "Node " << aCoupledNode->Name() << " InPort " << anInPort->PortName()
1092                  << " " << anInPort->Kind() << endl ;
1093           if ( anInPort->IsInLine() || anInPort->IsLoop() || anInPort->IsGate() ) {
1094             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1095               << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1096           }
1097           else if ( anInPort->IsDataStream() ) {
1098             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1099               << ".InStreamPort( '" << anInPort->PortName()
1100               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
1101               << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
1102             SUPERV::KindOfSchema        aKindOfSchema ;
1103             SUPERV::KindOfInterpolation aKindOfInterpolation ;
1104             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
1105             ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
1106             f << "I" << EndName << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
1107               << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
1108           }
1109         }
1110         for ( i = 0 ; i < aCoupledNode->GetNodeOutPortsSize() ; i++ ) {
1111           const GraphBase::OutPort * anOutPort = aCoupledNode->GetNodeOutPort(i) ;
1112           cdebug << "Node " << aCoupledNode->Name() << " OutPort " << anOutPort->PortName()
1113                  << " " << anOutPort->Kind() << endl ;
1114           if ( anOutPort->IsInLine() || anOutPort->IsLoop() || anOutPort->IsGate() ) {
1115             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1116               << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1117           }
1118           else if ( anOutPort->IsDataStream() ) {
1119             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1120               << ".OutStreamPort( '" << anOutPort->PortName()
1121               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
1122               << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
1123             long aNumberOfValues ;
1124             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
1125             f << "O" << EndName << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
1126               << endl ;
1127           }
1128         }
1129       }
1130       else if ( IsSwitchNode() ) {
1131         f << Name() << "," << EndName << " = " << aGraphName << ".SNode( '"
1132           << FuncNames[0].c_str() << "' , Py" << Name() << " )" << endl ;
1133         f << EndName << ".SetName( '" << aCoupledNode->Name() << "' )" << endl ;
1134         f << EndName << ".SetAuthor( '" << aCoupledNode->Author() << "' )" << endl ;
1135         f << EndName << ".SetComment( '" << aCoupledNode->Comment() << "' )" << endl ;
1136         f << EndName << ".Coords( " << aCoupledNode->XCoordinate() << " , "
1137           << aCoupledNode->YCoordinate() << " )" << endl ;
1138         SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
1139         f << "Py" << aCoupledNode->Name() << " = []" << endl ;
1140         for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
1141           f << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
1142             << endl ;
1143         }
1144         f << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
1145         for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
1146           const GraphBase::InPort * anInPort = aCoupledNode->GetNodeInPort(i) ;
1147           cdebug << "Node " << aCoupledNode->Name() << " InPort " << anInPort->PortName()
1148                  << " " << anInPort->Kind() << endl ;
1149 //          if ( anInPort->IsGate() || anInPort->IsEndSwitch() ) {
1150           if ( anInPort->IsGate() ) {
1151             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1152               << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1153           }
1154           else if ( anInPort->IsInLine() || anInPort->IsEndSwitch() ) {
1155             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1156               << ".InPort( '" << anInPort->PortName()
1157               << "' , '" << anInPort->PortType() << "' )" << endl ;
1158           }
1159           else if ( anInPort->IsDataStream() ) {
1160             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1161               << ".InStreamPort( '" << anInPort->PortName()
1162               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
1163               << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
1164             SUPERV::KindOfSchema        aKindOfSchema ;
1165             SUPERV::KindOfInterpolation aKindOfInterpolation ;
1166             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
1167             ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
1168             f << "I" << EndName << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
1169               << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
1170           }
1171         }
1172         for ( i = 0 ; i < aCoupledNode->GetNodeOutPortsSize() ; i++ ) {
1173           const GraphBase::OutPort * anOutPort = aCoupledNode->GetNodeOutPort(i) ;
1174           cdebug << "Node " << aCoupledNode->Name() << " OutPort " << anOutPort->PortName()
1175                  << " " << anOutPort->Kind() << endl ;
1176 //          if ( anOutPort->IsGate() || anOutPort->IsEndSwitch() ) {
1177           if ( anOutPort->IsGate() ) {
1178             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1179               << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1180           }
1181           else if ( anOutPort->IsInLine() || anOutPort->IsSwitch() ) {
1182             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1183               << ".OutPort( '" << anOutPort->PortName()
1184               << "' , '" << anOutPort->PortType() << "' )" << endl ;
1185           }
1186           else if ( anOutPort->IsDataStream() ) {
1187             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1188               << ".OutStreamPort( '" << anOutPort->PortName()
1189               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
1190               << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
1191             long aNumberOfValues ;
1192             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
1193             f << "O" << EndName << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
1194               << endl ;
1195           }
1196         }
1197       }
1198       delete [] EndName ;
1199     }
1200   }
1201
1202   if ( IsEndLoopNode() || IsEndSwitchNode() ) {
1203 // It is done with LoopNode or SwitchNode with CoupledNode()
1204   }
1205   else {
1206     f << Name() << ".SetName( '" << Name() << "' )" << endl ;
1207     f << Name() << ".SetAuthor( '" << Author() << "' )" << endl ;
1208     if ( IsFactoryNode() ) {
1209       f << Name() << ".SetContainer( '" << Computer << "' )" << endl ;
1210     }
1211     f << Name() << ".SetComment( '" << Comment() << "' )" << endl ;
1212     f << Name() << ".Coords( " << XCoordinate << " , " << YCoordinate << " )" << endl ;
1213
1214     if ( IsComputingNode() || IsFactoryNode() ) {
1215       int i ;
1216       for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
1217         const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
1218         if ( !anInPort->IsDataStream() ) {
1219           cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
1220                  << " " << anInPort->Kind() << endl ;
1221           f << "I" << Name() << anInPort->PortName() << " = "
1222             << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1223         }
1224       }
1225       for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1226         const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
1227         if ( !anOutPort->IsDataStream() ) {
1228           cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
1229                  << " " << anOutPort->Kind() << endl ;
1230           f << "O" << Name() << anOutPort->PortName() << " = "
1231             << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1232         }
1233       }
1234     }
1235     else if ( IsOneOfInLineNodes() && !IsLoopNode() ) {
1236       int i ;
1237       for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
1238         const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
1239         cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
1240                << " " << anInPort->Kind() << endl ;
1241         if ( anInPort->IsInLine() || anInPort->IsEndSwitch() ) {
1242           f << "I" << Name() << anInPort->PortName() << " = "
1243             << Name() << ".InPort( '" << anInPort->PortName() << "' , '"
1244             << anInPort->PortType() << "' )" << endl ;
1245         }
1246         else if ( anInPort->IsGate() ) {
1247           f << "I" << Name() << anInPort->PortName() << " = "
1248             << Name() << ".GetInPort( '" << anInPort->PortName()  << "' )" << endl ;
1249         }
1250       }
1251       for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1252         const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
1253         cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
1254                << " " << anOutPort->Kind() << endl ;
1255         if ( anOutPort->IsInLine() || anOutPort->IsSwitch() ) {
1256           f << "O" << Name() << anOutPort->PortName() << " = "
1257             << Name() << ".OutPort( '" << anOutPort->PortName()
1258             << "' , '" << anOutPort->PortType() << "' )" << endl ;
1259         }
1260         else if ( anOutPort->IsGate() ) {
1261           f << "O" << Name() << anOutPort->PortName() << " = "
1262             << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1263         }
1264       }
1265     }
1266     if ( !IsDataFlowNode() && !IsDataStreamNode() ) {
1267       int i ;
1268       for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
1269         const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
1270         cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
1271                << " " << anInPort->Kind() << endl ;
1272         if ( anInPort->IsDataStream() ) {
1273           if ( IsOneOfInLineNodes() ) {
1274             f << "I" << Name() << anInPort->PortName() << " = "
1275               << Name() << ".InStreamPort( '" << anInPort->PortName() << "' , SALOME_ModuleCatalog."
1276               << StringToDataStreamType( anInPort->PortType() ) << " , SALOME_ModuleCatalog."
1277               << anInPort->Dependency() << " )" << endl ;
1278           }
1279           else {
1280             f << "I" << Name() << anInPort->PortName() << " = "
1281               << Name() << ".GetInStreamPort( '" << anInPort->PortName() << "' )" << endl ;
1282           }
1283           SUPERV::KindOfSchema        aKindOfSchema ;
1284           SUPERV::KindOfInterpolation aKindOfInterpolation ;
1285           SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
1286           ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
1287           f << "I" << Name() << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
1288             << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
1289         }
1290       }
1291       for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1292         const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
1293         cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
1294                << " " << anOutPort->Kind() << endl ;
1295         if ( anOutPort->IsDataStream() ) {
1296           if ( IsOneOfInLineNodes() ) {
1297             f << "O" << Name() << anOutPort->PortName() << " = "
1298               << Name() << ".OutStreamPort( '" << anOutPort->PortName() << "' , SALOME_ModuleCatalog."
1299               << StringToDataStreamType( anOutPort->PortType() ) << " , SALOME_ModuleCatalog."
1300               << anOutPort->Dependency() << " )" << endl ;
1301           }
1302           else {
1303             f << "O" << Name() << anOutPort->PortName() << " = "
1304               << Name() << ".GetOutStreamPort( '" << anOutPort->PortName() << "' )" << endl ;
1305           }
1306           long aNumberOfValues ;
1307           aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
1308           f << "O" << Name() << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )" << endl ;
1309         }
1310       }
1311     }
1312   }
1313
1314   return true ;
1315 }
1316
1317 void GraphBase::ComputingNode::NodeInfo(ostream & s) const {
1318   s << *this ;
1319   ListPorts( s , true ) ;
1320   s << ends ;
1321 }
1322
1323 ostream & operator<< (ostream & f,const GraphBase::ComputingNode & G) {
1324 //  f << "ComponentName    " << G.ComponentName() << endl ;
1325   if ( G.IsComputingNode() ) {
1326     f << "NodeName         " << G.Name() << endl ;
1327   }
1328   else {
1329     f << "DataFlowName     " << G.Name() << endl ;
1330   }
1331   f << "Kind             " << G.Kind() << endl ;
1332   f << "Service          " << *G.GetService() ;
1333   f << "FirstCreation    " << G.FirstCreation () << endl ;
1334   f << "LastModification " << G.LastModification() << endl ;
1335   f << "EditorRelease    " << G.EditorRelease() << endl ;
1336   f << "Author           " << G.Author() << endl ;
1337 //  f << "Computer         " << G.Computer() << endl ;
1338   f << "Comment          " << G.Comment() << endl ;
1339   f << endl ;
1340   
1341   return f;
1342 }
1343
1344 void GraphBase::ComputingNode::ListLinks(ostream &f ) const {
1345   int i ;
1346   for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1347     const GraphBase::OutPort* fromPort = GetNodeOutPort( i ) ;
1348     if ( fromPort->IsPortConnected() ) {
1349       int j ;
1350       for ( j = 0 ; j < fromPort->InPortsSize() ; j++ ) {
1351         if ( j == 0 ) {
1352           f << "FromNode " << Name() << endl ;
1353         }
1354         f << "         FromServiceParameterName "
1355           << fromPort->GetServicesParameter().Parametername ;
1356         const GraphBase::InPort* toPort = fromPort->InPorts( j ) ;
1357         f << " ToNode " << toPort->NodeName() ;
1358         f << " ToServiceParameterName "
1359           << toPort->GetServicesParameter().Parametername;
1360         f << " Value " ;
1361         fromPort->StringValue( f ) ;
1362         f << endl ;
1363       }
1364     }
1365   }
1366 }
1367
1368 ostream & operator<< (ostream &fOut,const SUPERV::SDate &D) {
1369 //  cdebug_in << "operator<< GraphEditor::Date" << endl;
1370
1371   fOut  << D.Day << "/" 
1372         << D.Month << "/" 
1373         << D.Year << " - " 
1374         << D.Hour << ":" 
1375         << D.Minute <<  ":"  
1376         << D.Second;
1377
1378 //  cdebug_out << "operator<< GraphEditor::Date" << endl;
1379   return fOut;
1380 }
1381