Salome HOME
*** empty log message ***
[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   if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) {
554     aKind = aKind.setNum( SUPERV::DataFlowGraph ) ;
555   }
556   else {
557     aKind = aKind.setNum( Kind() ) ;
558   }
559   aField = Graph.createTextNode( aKind ) ;
560   node.appendChild( kind ) ;
561   kind.appendChild( aField ) ;
562
563   if ( IsDataStreamNode() ) {
564     long Timeout ;
565     SUPERV::KindOfDataStreamTrace DataStreamTrace ;
566     double DeltaTime ;
567     ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
568
569     QDomElement timeout = Graph.createElement("streamgraph-timeout") ;
570     QString aTimeout ;
571     aTimeout = aTimeout.setNum( Timeout ) ;
572     aField = Graph.createTextNode( aTimeout ) ;
573     node.appendChild( timeout ) ;
574     timeout.appendChild( aField ) ;
575
576     QDomElement datastreamtrace = Graph.createElement("streamgraph-datastreamtrace") ;
577     QString aDataStreamTrace ;
578     aDataStreamTrace = aDataStreamTrace.setNum( DataStreamTrace ) ;
579     aField = Graph.createTextNode( aDataStreamTrace ) ;
580     node.appendChild( datastreamtrace ) ;
581     datastreamtrace.appendChild( aField ) ;
582
583     QDomElement deltatime = Graph.createElement("streamgraph-deltatime") ;
584     QString aDeltaTime ;
585     aDeltaTime = aDeltaTime.setNum( DeltaTime ) ;
586     aField = Graph.createTextNode( aDeltaTime ) ;
587     node.appendChild( deltatime ) ;
588     deltatime.appendChild( aField ) ;
589   }
590
591   QDomElement couplednode = Graph.createElement("coupled-node") ;
592   if ( IsGOTONode() || IsLoopNode() || IsEndLoopNode() ||
593        IsSwitchNode() || IsEndSwitchNode() ) {
594 //    f << Tabs << "<coupled-node>" << CoupledNode << "</coupled-node>"
595 //      << endl ;
596     aField = Graph.createTextNode( CoupledNode ) ;
597   }
598   else {
599 //    f << Tabs << "<coupled-node>?</coupled-node>" << endl ;
600     aField = Graph.createTextNode( "?" ) ;
601   }
602   node.appendChild(couplednode) ;
603   couplednode.appendChild( aField ) ;
604
605 //  f << Tabs << "<service>" << endl ;
606   QDomElement service = Graph.createElement("service") ;
607   node.appendChild(service) ;
608   QDomElement servicename = Graph.createElement("service-name") ;
609   if ( strlen( ServiceName() ) ) {
610 //    f << Tabs << "    <service-name>" << ServiceName() << "</service-name>" << endl ;
611     aField = Graph.createTextNode( ServiceName() ) ;
612   }
613   else {
614 //    f << Tabs << "    <service-name>?</service-name>" << endl ;
615     aField = Graph.createTextNode( "?" ) ;
616   }
617   service.appendChild(servicename) ;
618   servicename.appendChild( aField ) ;
619
620   QDomElement inParameterlist = Graph.createElement("inParameter-list") ;
621   service.appendChild(inParameterlist) ;
622   unsigned int i;
623   GraphBase::ComputingNode * aNode = (GraphBase::ComputingNode * ) this ;
624   for ( i = 0 ; i < ServiceInParameter().length() ; i++ ) {
625     const GraphBase::InPort * anInPort ;
626     anInPort = aNode->GetInPort( ServiceInParameter()[i].Parametername ) ;
627     if ( !anInPort->IsDataStream() ) {
628       cdebug << "SaveXML " << i << ". " << ServiceInParameter()[i].Parametername
629              << " InParameterPort " << anInPort->Kind() << endl ;
630       QDomElement inParameter = Graph.createElement("inParameter") ;
631       inParameterlist.appendChild(inParameter) ;
632       QDomElement inParametertype = Graph.createElement("inParameter-type") ;
633       if ( strlen( ServiceInParameter()[i].Parametertype ) ) {
634         aField = Graph.createTextNode( strdup( ServiceInParameter()[i].Parametertype ) ) ;
635       }
636       else {
637         aField = Graph.createTextNode( "?" ) ;
638       }
639       inParameter.appendChild(inParametertype) ;
640       inParametertype.appendChild( aField ) ;
641       QDomElement inParametername = Graph.createElement("inParameter-name") ;
642       if ( strlen( ServiceInParameter()[i].Parametername ) ) {
643         aField = Graph.createTextNode( strdup(ServiceInParameter()[i].Parametername) ) ;
644       }
645       else {
646         aField = Graph.createTextNode( "?" ) ;
647       }
648       inParameter.appendChild(inParametername) ;
649       inParametername.appendChild( aField ) ;
650     }
651   }
652   QDomElement outParameterlist = Graph.createElement("outParameter-list") ;
653   service.appendChild(outParameterlist) ;
654   for ( i = 0 ; i < ServiceOutParameter().length() ; i++ ) {
655     const GraphBase::OutPort * anOutPort ;
656     anOutPort = aNode->GetOutPort( ServiceOutParameter()[i].Parametername ) ;
657     if ( !anOutPort->IsDataStream() ) {
658       cdebug << "SaveXML " << i << ". " << ServiceOutParameter()[i].Parametername
659              << " OutParameterPort " << anOutPort->Kind() << endl ;
660       QDomElement outParameter = Graph.createElement("outParameter") ;
661       outParameterlist.appendChild(outParameter) ;
662       QDomElement outParametertype = Graph.createElement("outParameter-type") ;
663       if ( strlen( ServiceOutParameter()[i].Parametertype ) ) {
664         aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametertype) ) ;
665       }
666       else {
667         aField = Graph.createTextNode( "?" ) ;
668       }
669       outParameter.appendChild(outParametertype) ;
670       outParametertype.appendChild( aField ) ;
671       QDomElement outParametername = Graph.createElement("outParameter-name") ;
672       if ( strlen( ServiceOutParameter()[i].Parametername ) ) {
673         aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametername) ) ;
674       }
675       else {
676         aField = Graph.createTextNode( "?" ) ;
677       }
678       outParameter.appendChild(outParametername) ;
679       outParametername.appendChild( aField ) ;
680     }
681   }
682
683   QDomElement DataStreamlist = Graph.createElement("DataStream-list") ;
684   node.appendChild( DataStreamlist ) ;
685   for ( i = 0 ; i < (unsigned int ) GetNodeInPortsSize() ; i++ ) {
686     const GraphBase::InPort * anInPort ;
687     anInPort = aNode->GetNodeInPort( i ) ;
688     if ( anInPort->IsDataStream() ) {
689       cdebug << "SaveXML " << i << " " << Name() << " " << anInPort->PortName() << " " << anInPort->PortType()
690              << " InDataStreamPort " << anInPort->Kind() << endl ;
691       QDomElement inParameter = Graph.createElement("inParameter") ;
692       DataStreamlist.appendChild(inParameter) ;
693       QDomElement inParametertype = Graph.createElement("inParameter-type") ;
694       QString aType ;
695       aType = aType.setNum( StringToDataStreamType( anInPort->PortType() ) ) ;
696       cdebug << "SaveXML " << anInPort->PortType() << " --> " << StringToDataStreamType( anInPort->PortType() )
697              << " " << aType << endl ;
698       aField = Graph.createTextNode( aType ) ;
699       inParameter.appendChild(inParametertype) ;
700       inParametertype.appendChild( aField ) ;
701       QDomElement inParametername = Graph.createElement("inParameter-name") ;
702       if ( strlen( anInPort->PortName() ) ) {
703         aField = Graph.createTextNode( strdup(anInPort->PortName()) ) ;
704       }
705       else {
706         aField = Graph.createTextNode( "?" ) ;
707       }
708       inParameter.appendChild(inParametername) ;
709       inParametername.appendChild( aField ) ;
710       cdebug << "SaveXML " << anInPort->PortName() << endl ;
711       QDomElement inParameterdependency = Graph.createElement("inParameter-dependency") ;
712       QString aDependency ;
713       aDependency = aDependency.setNum( anInPort->Dependency() ) ;
714       aField = Graph.createTextNode( aDependency ) ;
715       inParameter.appendChild(inParameterdependency) ;
716       inParameterdependency.appendChild( aField ) ;
717       cdebug << "SaveXML Dependency " << anInPort->Dependency() << endl ;
718       SUPERV::KindOfSchema        aKindOfSchema ;
719       SUPERV::KindOfInterpolation aKindOfInterpolation ;
720       SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
721       ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
722       QDomElement inParameterKindOfSchema = Graph.createElement("inParameter-schema") ;
723       QString aSchema ;
724       aSchema = aSchema.setNum( aKindOfSchema ) ;
725       aField = Graph.createTextNode( aSchema ) ;
726       inParameter.appendChild(inParameterKindOfSchema) ;
727       inParameterKindOfSchema.appendChild( aField ) ;
728       cdebug << "SaveXML aKindOfSchema " << aKindOfSchema << endl ;
729       QDomElement inParameterKindOfInterpolation = Graph.createElement("inParameter-interpolation") ;
730       QString anInterpolation ;
731       anInterpolation = anInterpolation.setNum( aKindOfInterpolation ) ;
732       aField = Graph.createTextNode( anInterpolation ) ;
733       inParameter.appendChild(inParameterKindOfInterpolation) ;
734       inParameterKindOfInterpolation.appendChild( aField ) ;
735       cdebug << "SaveXML aKindOfInterpolation " << aKindOfInterpolation << endl ;
736       QDomElement inParameterKindOfExtrapolation = Graph.createElement("inParameter-extrapolation") ;
737       QString anExtrapolation ;
738       anExtrapolation = anExtrapolation.setNum( aKindOfExtrapolation ) ;
739       aField = Graph.createTextNode( anExtrapolation ) ;
740       inParameter.appendChild(inParameterKindOfExtrapolation) ;
741       inParameterKindOfExtrapolation.appendChild( aField ) ;
742       cdebug << "SaveXML aKindOfExtrapolation " << aKindOfExtrapolation << endl ;
743     }
744   }
745   for ( i = 0 ; i < (unsigned int ) GetNodeOutPortsSize() ; i++ ) {
746     const GraphBase::OutPort * anOutPort ;
747     anOutPort = aNode->GetNodeOutPort( i ) ;
748     if ( anOutPort->IsDataStream() ) {
749       cdebug << "SaveXML " << i << " " << Name() << " " << anOutPort->PortName() << " " << anOutPort->PortType()
750              << " OutDataStreamPort " << anOutPort->Kind() << endl ;
751       QDomElement outParameter = Graph.createElement("outParameter") ;
752       DataStreamlist.appendChild(outParameter) ;
753       QDomElement outParametertype = Graph.createElement("outParameter-type") ;
754       QString aType ;
755       aType = aType.setNum( StringToDataStreamType( anOutPort->PortType() ) ) ;
756       cdebug << "SaveXML " << anOutPort->PortType() << " --> " << StringToDataStreamType( anOutPort->PortType() )
757              << " " << aType << endl ;
758       aField = Graph.createTextNode( aType ) ;
759       outParameter.appendChild(outParametertype) ;
760       outParametertype.appendChild( aField ) ;
761       QDomElement outParametername = Graph.createElement("outParameter-name") ;
762       if ( strlen( anOutPort->PortName() ) ) {
763         aField = Graph.createTextNode( strdup(anOutPort->PortName() ) ) ;
764       }
765       else {
766         aField = Graph.createTextNode( "?" ) ;
767       }
768       outParameter.appendChild(outParametername) ;
769       outParametername.appendChild( aField ) ;
770       cdebug << "SaveXML " << anOutPort->PortName() << endl ;
771       QDomElement outParameterdependency = Graph.createElement("outParameter-dependency") ;
772       QString aDependency ;
773       aDependency = aDependency.setNum( anOutPort->Dependency() )  ;
774       aField = Graph.createTextNode( aDependency ) ;
775       outParameter.appendChild(outParameterdependency) ;
776       outParameterdependency.appendChild( aField ) ;
777       cdebug << "SaveXML Dependency " << anOutPort->Dependency() << endl ;
778       long aNumberOfValues ;
779       aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
780       QDomElement outParameterNumberOfValues = Graph.createElement("outParameter-values") ;
781       QString aValues ;
782       aValues = aValues.setNum( aNumberOfValues ) ;
783       aField = Graph.createTextNode( aValues ) ;
784       outParameter.appendChild(outParameterNumberOfValues) ;
785       outParameterNumberOfValues.appendChild( aField ) ;
786       cdebug << "SaveXML NumberOfValues " << ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() << endl ;
787     }
788   }
789 //  f << Tabs << "</Parameter-list>" << endl ;    
790
791 //  f << Tabs << "<PyFunction-list>" << endl ;
792   QDomElement PyFunctionlist = Graph.createElement("PyFunction-list") ;
793   node.appendChild( PyFunctionlist ) ;
794   for ( i = 0 ; i < PythonFunctions.size() ; i++ ) {
795 //    f << Tabs << "    <PyFunction>" << endl ;
796     QDomElement PyFunction = Graph.createElement("PyFunction") ;
797     PyFunctionlist.appendChild( PyFunction ) ;
798     int j ;
799     QDomElement FuncName = Graph.createElement("FuncName") ;
800     if ( strlen( FuncNames[i].c_str() ) ) {
801       aField = Graph.createTextNode( FuncNames[i].c_str() ) ;
802     }
803     else {
804       aField = Graph.createTextNode( "?" ) ;
805     }
806     PyFunction.appendChild( FuncName ) ;
807     FuncName.appendChild( aField ) ;
808     if ( (*PythonFunctions[i]).length() ) {
809       for ( j = 0 ; j < (int ) (*PythonFunctions[i]).length() ; j++ ) {
810         QDomElement PyFunc = Graph.createElement("PyFunc") ;
811         QDomCDATASection aCDATA ;
812       // mpv: Linux 8.0 compiler compatibility
813         char * aCDATAChar = strdup ((*PythonFunctions[i])[j]) ;
814         int i ;
815         for ( i = 0 ; i < (int ) strlen( aCDATAChar ) ; i++ ) {
816           if ( aCDATAChar[ i ] != ' ' ) {
817             break ;
818           }
819         }
820         if ( i == (int ) strlen( aCDATAChar ) ) {
821           aCDATA = Graph.createCDATASection( "?" ) ;
822         }
823         else {
824           aCDATA = Graph.createCDATASection( aCDATAChar ) ;
825         }
826         PyFunction.appendChild( PyFunc ) ;
827         PyFunc.appendChild( aCDATA ) ;
828       }
829     }
830     else {
831       QDomElement PyFunc = Graph.createElement("PyFunc") ;
832       QDomCDATASection aCDATA = Graph.createCDATASection( "?" ) ;
833       PyFunction.appendChild( PyFunc ) ;
834       PyFunc.appendChild( aCDATA ) ;
835     }
836   }
837
838 //  f << Tabs << "<creation-date>" << FirstCreation() << "</creation-date>"
839 //    << endl ;
840   QDomElement creationdate = Graph.createElement("creation-date") ;
841   char fdate[30] ;
842   sprintf( fdate , "%d/%d/%d - %d:%d:%d" ,  FirstCreation().Day , FirstCreation().Month , FirstCreation().Year , FirstCreation().Hour , FirstCreation().Minute , FirstCreation().Second ) ;
843   aField = Graph.createTextNode( fdate ) ;
844   node.appendChild( creationdate ) ;
845   creationdate.appendChild( aField ) ;
846 //  f << Tabs << "<lastmodification-date>" << LastModification()
847 //    << "</lastmodification-date>" << endl ;
848   QDomElement lastmodificationdate = Graph.createElement("lastmodification-date") ;
849   char ldate[30] ;
850   sprintf( ldate , "%d/%d/%d - %d:%d:%d" , LastModification().Day , LastModification().Month , LastModification().Year , LastModification().Hour , LastModification().Minute , LastModification().Second ) ;
851   aField = Graph.createTextNode( ldate ) ;
852   node.appendChild( lastmodificationdate ) ;
853   lastmodificationdate.appendChild( aField ) ;
854 //  f << Tabs << "<editor-release>" << EditorRelease() << "</editor-release>"
855 //    << endl ;
856   QDomElement editorrelease = Graph.createElement("editor-release") ;
857   aField = Graph.createTextNode( EditorRelease() ) ;
858   node.appendChild( editorrelease ) ;
859   editorrelease.appendChild( aField ) ;
860   QDomElement author = Graph.createElement("author") ;
861   if ( strlen( Author() ) ) {
862 //    f << Tabs << "<author>" << Author() << "</author>" << endl ;
863     aField = Graph.createTextNode( Author() ) ;
864   }
865   else {
866 //    f << Tabs << "<author>?</author>" << endl ;
867     aField = Graph.createTextNode( "?" ) ;
868   }
869   node.appendChild( author ) ;
870   author.appendChild( aField ) ;
871   QDomElement container = Graph.createElement("container") ;
872   if ( IsFactoryNode() && strlen( Computer) ) {
873 //    f << Tabs << "<container>" << Computer << "</container>" << endl ;
874     aField = Graph.createTextNode( Computer ) ;
875   }
876   else {
877 //    f << Tabs << "<container>?</container>" << endl ;
878     aField = Graph.createTextNode( "?" ) ;
879   }
880   node.appendChild( container ) ;
881   container.appendChild( aField ) ;
882   QDomElement comment = Graph.createElement("comment") ;
883   if ( strlen( Comment() ) ) {
884 //    f << Tabs << "<comment>" << Comment() << "</comment>" << endl ;
885     aField = Graph.createTextNode( Comment() ) ;
886   }
887   else {
888 //    f << Tabs << "<comment>?</comment>" << endl ;
889     aField = Graph.createTextNode( "?" ) ;
890   }
891   node.appendChild( comment ) ;
892   comment.appendChild( aField ) ;
893 //  f << Tabs << "<x-position>" << XCoordinate << "</x-position>" << endl ;
894   QDomElement xposition = Graph.createElement("x-position") ;
895   QString aXCoordinate ;
896   aXCoordinate = aKind.setNum( XCoordinate ) ;
897   aField = Graph.createTextNode( aXCoordinate ) ;
898   node.appendChild( xposition ) ;
899   xposition.appendChild( aField ) ;
900 //  f << Tabs << "<y-position>" << YCoordinate << "</y-position>" << endl ;
901   QDomElement yposition = Graph.createElement("y-position") ;
902   QString aYCoordinate ;
903   aYCoordinate = aKind.setNum( YCoordinate ) ;
904   aField = Graph.createTextNode( aYCoordinate ) ;
905   node.appendChild( yposition ) ;
906   yposition.appendChild( aField ) ;
907   cdebug_out << "SaveXML Node " << Name() << endl ;
908   return true ;
909 }
910
911 bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
912                                        const char * ComponentName ,
913                                        const char * InterfaceName ,
914                                        const char * Computer ,
915                                        const GraphBase::InLineNode * aCoupledNode ,
916                                        const ListOfFuncName FuncNames ,
917                                        const ListOfPythonFunctions PythonFunctions ,
918                                        int XCoordinate , int YCoordinate ) const {
919   if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) {
920     f << Name() << " = Graph( '" << Name() << "' )" << endl ;
921   }
922   else if ( IsDataStreamNode() ) {
923     f << Name() << " = StreamGraph( '" << Name() << "' )" << endl ;
924     long Timeout ;
925     SUPERV::KindOfDataStreamTrace DataStreamTrace ;
926     double DeltaTime ;
927     ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
928     f << aGraphName << ".SetStreamParams( " << Timeout << " , SUPERV." << DataStreamTrace
929       << " , " << DeltaTime << " )" << endl ;
930   }
931   else if ( IsComputingNode() ) {
932     int i ;
933     f << Name() << "_ServiceinParameter = []" << endl ;
934     for ( i = 0 ; i < (int ) ServiceInParameter().length() ; i++ ) {
935       f << Name() << "_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( '"
936         << ServiceInParameter()[i].Parametertype << "' , '"
937         << ServiceInParameter()[i].Parametername << "' ) )" << endl ;
938     }
939     f << Name() << "_ServiceoutParameter = []" << endl ;
940     for ( i = 0 ; i < (int ) ServiceOutParameter().length() ; i++ ) {
941       f << Name() << "_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( '"
942         << ServiceOutParameter()[i].Parametertype << "' , '"
943         << ServiceOutParameter()[i].Parametername << "' ) )" << endl ;
944     }
945     f << Name() << "_ServiceinStreamParameter = []" << endl ;
946     for ( i = 0 ; i < (int ) ServiceInStreamParameter().length() ; i++ ) {
947       f << Name() << "_ServiceinStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( SALOME_ModuleCatalog."
948         << ServiceInStreamParameter()[i].Parametertype << " , '"
949         << ServiceInStreamParameter()[i].Parametername << "' , SALOME_ModuleCatalog."
950         << ServiceInStreamParameter()[i].Parameterdependency << " ) )" << endl ;
951     }
952     f << Name() << "_ServiceoutStreamParameter = []" << endl ;
953     for ( i = 0 ; i < (int ) ServiceOutStreamParameter().length() ; i++ ) {
954       f << Name() << "_ServiceoutStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( SALOME_ModuleCatalog."
955         << ServiceOutStreamParameter()[i].Parametertype << " , '"
956         << ServiceOutStreamParameter()[i].Parametername << "' , SALOME_ModuleCatalog."
957         << ServiceOutStreamParameter()[i].Parameterdependency << " ) )" << endl ;
958     }
959     f << Name() << "_Service = SALOME_ModuleCatalog.Service( '" << ServiceName()
960       << "' , " << Name() << "_ServiceinParameter"
961       << " , " << Name() << "_ServiceoutParameter"
962       << " , " << Name() << "_ServiceinStreamParameter"
963       << " , " << Name() << "_ServiceoutStreamParameter"
964       << " , 0 , 0 )" << endl ;
965     f << Name() << " = " << aGraphName << ".CNode( " << Name() << "_Service" << " )"
966       << endl ;
967   }
968   else if ( IsFactoryNode() ) {
969     f << Name() << " = " << aGraphName << ".FNode( '" << ComponentName
970       << "' , '" << InterfaceName << "' , '" << ServiceName() << "' )"
971       << endl ;
972   }
973   else if ( IsEndLoopNode() || IsEndSwitchNode() ) {
974 // It is done with LoopNode or SwitchNode with CoupledNode()
975   }
976   else {
977     f << "Py" << Name() << " = []" << endl ;
978     int i ;
979     SUPERV::ListOfStrings aPyFunc ;
980     if ( PythonFunctions.size() ) {
981       aPyFunc = *PythonFunctions[0] ;
982       for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
983         f << "Py" << Name() << ".append( '" << aPyFunc[i] << "' )" << endl ;
984       }
985     }
986     if ( IsInLineNode() ) {
987       f << Name() << " = " << aGraphName << ".INode( '" << FuncNames[0].c_str() << "' , Py"
988         << Name() << " )" << endl ;
989     }
990     else if ( IsGOTONode() ) {
991       if ( aCoupledNode ) {
992         f << Name() << " = " << aGraphName << ".GNode( '" << FuncNames[0].c_str() << "' , Py"
993           << Name() << " , '" << aCoupledNode->Name() << "' )" << endl ;
994       }
995       else {
996         f << Name() << " = " << aGraphName << ".GNode( '" << FuncNames[0].c_str() << "' , Py"
997           << Name() << " , '' )" << endl ;
998       }
999     }
1000     else {
1001 //      char * EndName = NULL ;
1002 //      EndName = new char[ 3 + strlen( Name() ) + 1 ] ;
1003 //      strcpy( EndName , "End" ) ;
1004 //      strcat( EndName , Name() ) ;
1005       char * EndName = aCoupledNode->Name() ;
1006       if ( IsLoopNode() ) {
1007         int i ;
1008         SUPERV::ListOfStrings aPyMore = *PythonFunctions[1] ;
1009         SUPERV::ListOfStrings aPyNext = *PythonFunctions[2] ;
1010         f << "PyMore" << Name() << " = []" << endl ;
1011         for ( i = 0 ; i < (int ) aPyMore.length() ; i++ ) {
1012           f << "PyMore" << Name() << ".append( '" << aPyMore[i] << "' )" << endl ;
1013         }
1014         f << "PyNext" << Name() << " = []" << endl ;
1015         for ( i = 0 ; i < (int ) aPyNext.length() ; i++ ) {
1016           f << "PyNext" << Name() << ".append( '" << aPyNext[i] << "' )" << endl ;
1017         }
1018         f << Name() << "," << EndName << " = " << aGraphName << ".LNode( '"
1019           << FuncNames[0].c_str() << "' , Py" << Name() << " , '"
1020           << FuncNames[1].c_str() << "' , PyMore" << Name()
1021           << " , '" << FuncNames[2].c_str() << "' , PyNext"
1022           << Name() << " )" << endl ;
1023         f << EndName << ".SetName( '" << aCoupledNode->Name() << "' )" << endl ;
1024         f << EndName << ".SetAuthor( '" << aCoupledNode->Author() << "' )" << endl ;
1025         f << EndName << ".SetComment( '" << aCoupledNode->Comment() << "' )" << endl ;
1026         f << EndName << ".Coords( " << aCoupledNode->XCoordinate() << " , "
1027           << aCoupledNode->YCoordinate() << " )" << endl ;
1028         SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
1029         f << "Py" << aCoupledNode->Name() << " = []" << endl ;
1030         for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
1031           f << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
1032             << endl ;
1033         }
1034         f << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
1035         for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
1036           const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
1037           cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
1038                  << " " << anInPort->Kind() << endl ;
1039           if ( anInPort->IsLoop() ) {
1040             f << "I" << Name() << anInPort->PortName() << " = "
1041               << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1042           }
1043           else if ( anInPort->IsInLine() ) {
1044             f << "I" << Name() << anInPort->PortName() << " = "
1045               << Name() << ".InPort( '" << anInPort->PortName() << "' , '"
1046               << anInPort->PortType() << "' )" << endl ;
1047           }
1048           else if ( anInPort->IsDataStream() ) {
1049             f << "I" << Name() << anInPort->PortName() << " = " << Name()
1050               << ".InStreamPort( '" << anInPort->PortName()
1051               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
1052               << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
1053             SUPERV::KindOfSchema        aKindOfSchema ;
1054             SUPERV::KindOfInterpolation aKindOfInterpolation ;
1055             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
1056             ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
1057             f << "I" << Name() << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
1058               << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
1059           }
1060           else if ( anInPort->IsGate() ) {
1061             f << "I" << Name() << anInPort->PortName() << " = "
1062               << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1063           }
1064         }
1065         for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1066           const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
1067           cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
1068                  << " " << anOutPort->Kind() << endl ;
1069           if ( anOutPort->IsInLine() || anOutPort->IsLoop() ) {
1070             f << "O" << Name() << anOutPort->PortName() << " = "
1071               << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1072           }
1073           else if ( anOutPort->IsDataStream() ) {
1074             f << "O" << Name() << anOutPort->PortName() << " = " << Name()
1075               << ".OutStreamPort( '" << anOutPort->PortName()
1076               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
1077               << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
1078             long aNumberOfValues ;
1079             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
1080             f << "O" << Name() << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
1081               << endl ;
1082           }
1083         }
1084         for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
1085           const GraphBase::InPort * anInPort = aCoupledNode->GetNodeInPort(i) ;
1086           cdebug << "Node " << aCoupledNode->Name() << " InPort " << anInPort->PortName()
1087                  << " " << anInPort->Kind() << endl ;
1088           if ( anInPort->IsInLine() || anInPort->IsLoop() || anInPort->IsGate() ) {
1089             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1090               << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1091           }
1092           else if ( anInPort->IsDataStream() ) {
1093             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1094               << ".InStreamPort( '" << anInPort->PortName()
1095               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
1096               << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
1097             SUPERV::KindOfSchema        aKindOfSchema ;
1098             SUPERV::KindOfInterpolation aKindOfInterpolation ;
1099             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
1100             ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
1101             f << "I" << EndName << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
1102               << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
1103           }
1104         }
1105         for ( i = 0 ; i < aCoupledNode->GetNodeOutPortsSize() ; i++ ) {
1106           const GraphBase::OutPort * anOutPort = aCoupledNode->GetNodeOutPort(i) ;
1107           cdebug << "Node " << aCoupledNode->Name() << " OutPort " << anOutPort->PortName()
1108                  << " " << anOutPort->Kind() << endl ;
1109           if ( anOutPort->IsInLine() || anOutPort->IsLoop() || anOutPort->IsGate() ) {
1110             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1111               << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1112           }
1113           else if ( anOutPort->IsDataStream() ) {
1114             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1115               << ".OutStreamPort( '" << anOutPort->PortName()
1116               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
1117               << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
1118             long aNumberOfValues ;
1119             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
1120             f << "O" << EndName << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
1121               << endl ;
1122           }
1123         }
1124       }
1125       else if ( IsSwitchNode() ) {
1126         f << Name() << "," << EndName << " = " << aGraphName << ".SNode( '"
1127           << FuncNames[0].c_str() << "' , Py" << Name() << " )" << endl ;
1128         f << EndName << ".SetName( '" << aCoupledNode->Name() << "' )" << endl ;
1129         f << EndName << ".SetAuthor( '" << aCoupledNode->Author() << "' )" << endl ;
1130         f << EndName << ".SetComment( '" << aCoupledNode->Comment() << "' )" << endl ;
1131         f << EndName << ".Coords( " << aCoupledNode->XCoordinate() << " , "
1132           << aCoupledNode->YCoordinate() << " )" << endl ;
1133         SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
1134         f << "Py" << aCoupledNode->Name() << " = []" << endl ;
1135         for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
1136           f << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
1137             << endl ;
1138         }
1139         f << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
1140         for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
1141           const GraphBase::InPort * anInPort = aCoupledNode->GetNodeInPort(i) ;
1142           cdebug << "Node " << aCoupledNode->Name() << " InPort " << anInPort->PortName()
1143                  << " " << anInPort->Kind() << endl ;
1144 //          if ( anInPort->IsGate() || anInPort->IsEndSwitch() ) {
1145           if ( anInPort->IsGate() ) {
1146             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1147               << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1148           }
1149           else if ( anInPort->IsInLine() || anInPort->IsEndSwitch() ) {
1150             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1151               << ".InPort( '" << anInPort->PortName()
1152               << "' , '" << anInPort->PortType() << "' )" << endl ;
1153           }
1154           else if ( anInPort->IsDataStream() ) {
1155             f << "I" << EndName << anInPort->PortName() << " = " << EndName
1156               << ".InStreamPort( '" << anInPort->PortName()
1157               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
1158               << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
1159             SUPERV::KindOfSchema        aKindOfSchema ;
1160             SUPERV::KindOfInterpolation aKindOfInterpolation ;
1161             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
1162             ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
1163             f << "I" << EndName << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
1164               << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
1165           }
1166         }
1167         for ( i = 0 ; i < aCoupledNode->GetNodeOutPortsSize() ; i++ ) {
1168           const GraphBase::OutPort * anOutPort = aCoupledNode->GetNodeOutPort(i) ;
1169           cdebug << "Node " << aCoupledNode->Name() << " OutPort " << anOutPort->PortName()
1170                  << " " << anOutPort->Kind() << endl ;
1171 //          if ( anOutPort->IsGate() || anOutPort->IsEndSwitch() ) {
1172           if ( anOutPort->IsGate() ) {
1173             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1174               << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1175           }
1176           else if ( anOutPort->IsInLine() || anOutPort->IsSwitch() ) {
1177             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1178               << ".OutPort( '" << anOutPort->PortName()
1179               << "' , '" << anOutPort->PortType() << "' )" << endl ;
1180           }
1181           else if ( anOutPort->IsDataStream() ) {
1182             f << "O" << EndName << anOutPort->PortName() << " = " << EndName
1183               << ".OutStreamPort( '" << anOutPort->PortName()
1184               << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
1185               << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
1186             long aNumberOfValues ;
1187             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
1188             f << "O" << EndName << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
1189               << endl ;
1190           }
1191         }
1192       }
1193       delete [] EndName ;
1194     }
1195   }
1196
1197   if ( IsEndLoopNode() || IsEndSwitchNode() ) {
1198 // It is done with LoopNode or SwitchNode with CoupledNode()
1199   }
1200   else {
1201     f << Name() << ".SetName( '" << Name() << "' )" << endl ;
1202     f << Name() << ".SetAuthor( '" << Author() << "' )" << endl ;
1203     if ( IsFactoryNode() ) {
1204       f << Name() << ".SetContainer( '" << Computer << "' )" << endl ;
1205     }
1206     f << Name() << ".SetComment( '" << Comment() << "' )" << endl ;
1207     f << Name() << ".Coords( " << XCoordinate << " , " << YCoordinate << " )" << endl ;
1208
1209     if ( IsComputingNode() || IsFactoryNode() ) {
1210       int i ;
1211       for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
1212         const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
1213         if ( !anInPort->IsDataStream() ) {
1214           cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
1215                  << " " << anInPort->Kind() << endl ;
1216           f << "I" << Name() << anInPort->PortName() << " = "
1217             << Name() << ".GetInPort( '" << anInPort->PortName() << "' )" << endl ;
1218         }
1219       }
1220       for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1221         const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
1222         if ( !anOutPort->IsDataStream() ) {
1223           cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
1224                  << " " << anOutPort->Kind() << endl ;
1225           f << "O" << Name() << anOutPort->PortName() << " = "
1226             << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1227         }
1228       }
1229     }
1230     else if ( IsOneOfInLineNodes() && !IsLoopNode() ) {
1231       int i ;
1232       for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
1233         const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
1234         cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
1235                << " " << anInPort->Kind() << endl ;
1236         if ( anInPort->IsInLine() || anInPort->IsEndSwitch() ) {
1237           f << "I" << Name() << anInPort->PortName() << " = "
1238             << Name() << ".InPort( '" << anInPort->PortName() << "' , '"
1239             << anInPort->PortType() << "' )" << endl ;
1240         }
1241         else if ( anInPort->IsGate() ) {
1242           f << "I" << Name() << anInPort->PortName() << " = "
1243             << Name() << ".GetInPort( '" << anInPort->PortName()  << "' )" << endl ;
1244         }
1245       }
1246       for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1247         const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
1248         cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
1249                << " " << anOutPort->Kind() << endl ;
1250         if ( anOutPort->IsInLine() || anOutPort->IsSwitch() ) {
1251           f << "O" << Name() << anOutPort->PortName() << " = "
1252             << Name() << ".OutPort( '" << anOutPort->PortName()
1253             << "' , '" << anOutPort->PortType() << "' )" << endl ;
1254         }
1255         else if ( anOutPort->IsGate() ) {
1256           f << "O" << Name() << anOutPort->PortName() << " = "
1257             << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
1258         }
1259       }
1260     }
1261     if ( !IsDataFlowNode() && !IsDataStreamNode() ) {
1262       int i ;
1263       for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
1264         const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
1265         cdebug << "Node " << Name() << " InPort " << anInPort->PortName()
1266                << " " << anInPort->Kind() << endl ;
1267         if ( anInPort->IsDataStream() ) {
1268           if ( IsOneOfInLineNodes() ) {
1269             f << "I" << Name() << anInPort->PortName() << " = "
1270               << Name() << ".InStreamPort( '" << anInPort->PortName() << "' , SALOME_ModuleCatalog."
1271               << StringToDataStreamType( anInPort->PortType() ) << " , SALOME_ModuleCatalog."
1272               << anInPort->Dependency() << " )" << endl ;
1273           }
1274           else {
1275             f << "I" << Name() << anInPort->PortName() << " = "
1276               << Name() << ".GetInStreamPort( '" << anInPort->PortName() << "' )" << endl ;
1277           }
1278           SUPERV::KindOfSchema        aKindOfSchema ;
1279           SUPERV::KindOfInterpolation aKindOfInterpolation ;
1280           SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
1281           ((GraphBase::InDataStreamPort * ) anInPort)->Params( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) ;
1282           f << "I" << Name() << anInPort->PortName() << ".SetParams( SUPERV." << aKindOfSchema << " , SUPERV."
1283             << aKindOfInterpolation << " , SUPERV." << aKindOfExtrapolation << " )" << endl ;
1284         }
1285       }
1286       for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1287         const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
1288         cdebug << "Node " << Name() << " OutPort " << anOutPort->PortName()
1289                << " " << anOutPort->Kind() << endl ;
1290         if ( anOutPort->IsDataStream() ) {
1291           if ( IsOneOfInLineNodes() ) {
1292             f << "O" << Name() << anOutPort->PortName() << " = "
1293               << Name() << ".OutStreamPort( '" << anOutPort->PortName() << "' , SALOME_ModuleCatalog."
1294               << StringToDataStreamType( anOutPort->PortType() ) << " , SALOME_ModuleCatalog."
1295               << anOutPort->Dependency() << " )" << endl ;
1296           }
1297           else {
1298             f << "O" << Name() << anOutPort->PortName() << " = "
1299               << Name() << ".GetOutStreamPort( '" << anOutPort->PortName() << "' )" << endl ;
1300           }
1301           long aNumberOfValues ;
1302           aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
1303           f << "O" << Name() << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )" << endl ;
1304         }
1305       }
1306     }
1307   }
1308
1309   return true ;
1310 }
1311
1312 void GraphBase::ComputingNode::NodeInfo(ostream & s) const {
1313   s << *this ;
1314   ListPorts( s , true ) ;
1315   s << ends ;
1316 }
1317
1318 ostream & operator<< (ostream & f,const GraphBase::ComputingNode & G) {
1319 //  f << "ComponentName    " << G.ComponentName() << endl ;
1320   if ( G.IsComputingNode() ) {
1321     f << "NodeName         " << G.Name() << endl ;
1322   }
1323   else {
1324     f << "DataFlowName     " << G.Name() << endl ;
1325   }
1326   f << "Kind             " << G.Kind() << endl ;
1327   f << "Service          " << *G.GetService() ;
1328   f << "FirstCreation    " << G.FirstCreation () << endl ;
1329   f << "LastModification " << G.LastModification() << endl ;
1330   f << "EditorRelease    " << G.EditorRelease() << endl ;
1331   f << "Author           " << G.Author() << endl ;
1332 //  f << "Computer         " << G.Computer() << endl ;
1333   f << "Comment          " << G.Comment() << endl ;
1334   f << endl ;
1335   
1336   return f;
1337 }
1338
1339 void GraphBase::ComputingNode::ListLinks(ostream &f ) const {
1340   int i ;
1341   for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1342     const GraphBase::OutPort* fromPort = GetNodeOutPort( i ) ;
1343     if ( fromPort->IsPortConnected() ) {
1344       int j ;
1345       for ( j = 0 ; j < fromPort->InPortsSize() ; j++ ) {
1346         if ( j == 0 ) {
1347           f << "FromNode " << Name() << endl ;
1348         }
1349         f << "         FromServiceParameterName "
1350           << fromPort->GetServicesParameter().Parametername ;
1351         const GraphBase::InPort* toPort = fromPort->InPorts( j ) ;
1352         f << " ToNode " << toPort->NodeName() ;
1353         f << " ToServiceParameterName "
1354           << toPort->GetServicesParameter().Parametername;
1355         f << " Value " ;
1356         fromPort->StringValue( f ) ;
1357         f << endl ;
1358       }
1359     }
1360   }
1361 }
1362
1363 ostream & operator<< (ostream &fOut,const SUPERV::SDate &D) {
1364 //  cdebug_in << "operator<< GraphEditor::Date" << endl;
1365
1366   fOut  << D.Day << "/" 
1367         << D.Month << "/" 
1368         << D.Year << " - " 
1369         << D.Hour << ":" 
1370         << D.Minute <<  ":"  
1371         << D.Second;
1372
1373 //  cdebug_out << "operator<< GraphEditor::Date" << endl;
1374   return fOut;
1375 }
1376