]> SALOME platform Git repositories - modules/superv.git/blob - src/GraphBase/DataFlowBase_ComputingNode.cxx
Salome HOME
sources v1.2
[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_Node.cxx
8 //  Author : Jean Rahuel, CEA
9 //  Module : SUPERV
10 //  $Header:
11
12 using namespace std;
13 #include <strstream>
14 #include <iostream>
15
16 #include "DataFlowBase_InLineNode.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                 &_ConnectedInPortsNumber ,
28                         int                 &_DecrConnectedInPortsNumber,
29                         int                 &_LinkedNodesSize ,
30                         int                 &_SubGraphNumber ) {
31   time_t T = time(NULL);
32   struct tm * Tm = localtime(&T);
33
34   _Kind = SUPERV::DataFlowNode ;
35
36   _FirstCreation.Second = _LastModification.Second = Tm->tm_sec;
37   _FirstCreation.Minute = _LastModification.Minute = Tm->tm_min;
38   _FirstCreation.Hour   = _LastModification.Hour   = Tm->tm_hour;
39   _FirstCreation.Day    = _LastModification.Day    = Tm->tm_mday;
40   _FirstCreation.Month  = _LastModification.Month  = Tm->tm_mon + 1;
41   _FirstCreation.Year   = _LastModification.Year   = Tm->tm_year + 1900; 
42
43   _EditorRelease = new char[ strlen( SuperVision_Version ) + 1 ] ;
44   strcpy( _EditorRelease , SuperVision_Version ) ;
45   _Author = NULLSTRING ;
46 //  _Computer = new char[ strlen( FACTORYSERVER ) + 1 ] ;
47 //  strcpy( _Computer  , FACTORYSERVER ) ;
48   _Comment = NULLSTRING ;
49
50   _SubGraphNumber = 0 ;
51   _HeadNode = false ;
52   _GeneratedName = false ;
53
54   _ConnectedInPortsNumber = 0 ;
55   _DecrConnectedInPortsNumber = 0 ;
56   _LinkedNodesSize = 0 ;
57   _SubGraphNumber = 0 ;
58 }
59
60 GraphBase::ComputingNode::ComputingNode() :
61   GraphBase::PortsOfNode::PortsOfNode() {
62
63   InitFields( _Kind ,
64               _FirstCreation ,
65               _LastModification ,
66               _EditorRelease ,
67               _Author ,
68               _Comment ,
69               _HeadNode ,
70               _GeneratedName ,
71               _ConnectedInPortsNumber ,
72               _DecrConnectedInPortsNumber ,
73               _LinkedNodesSize ,
74               _SubGraphNumber ) ;
75   _NamingService = NULL ;
76   _Node = SUPERV::CNode::_nil() ;
77   _InNode = NULL ;
78   _ThreadNo = pthread_self() ;
79   _Name = NULL ;
80   cdebug << "GraphBase::Node::Node "  << this 
81           << " _Name "
82          << (void *) _Name << " " << _Name << " _Comment "
83          << (void *) _Comment << " "  << _Comment << " "  << endl ;
84
85 }
86
87 GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB ,
88                                          SALOME_NamingService* ptrNamingService ,
89                                          const char * aDataFlowName ,
90                                          int * Graph_prof_debug ,
91                                          ostream * Graph_fdebug ) :
92   GraphBase::PortsOfNode::PortsOfNode( aDataFlowName ) {
93
94   InitFields( _Kind ,
95               _FirstCreation ,
96               _LastModification ,
97               _EditorRelease ,
98               _Author ,
99               _Comment ,
100               _HeadNode ,
101               _GeneratedName ,
102               _ConnectedInPortsNumber ,
103               _DecrConnectedInPortsNumber ,
104               _LinkedNodesSize ,
105               _SubGraphNumber ) ;
106
107   _ORB = CORBA::ORB::_duplicate( ORB ) ;
108   _NamingService = ptrNamingService ;
109   _Graph_prof_debug = Graph_prof_debug ;
110   _Graph_fdebug = Graph_fdebug ;
111   _Node = SUPERV::CNode::_nil() ;
112   _InNode = NULL ;
113   _ThreadNo = pthread_self() ;
114
115   if ( aDataFlowName && strlen( aDataFlowName ) ) {
116     _Name = new char[ strlen( aDataFlowName )+1 ] ;
117     strcpy( _Name , aDataFlowName ) ;
118   }
119   else
120     _Name = NULL ;
121   if ( Graph_prof_debug ) {
122     SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
123 //    MESSAGE( "Invalid DataFlow Name." );
124   }
125   cdebug << "GraphBase::ComputingNode::ComputingNode "  << this 
126          << "' _Name "
127          << (void *) _Name << " '" << _Name << " _Comment "
128          << (void *) _Comment << " "  << _Comment << " "  << _FirstCreation
129          << " "  << _LastModification << endl ;
130 }
131
132 GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB ,
133                                          SALOME_NamingService* ptrNamingService ,
134                                          const SALOME_ModuleCatalog::Service& aService ,
135                                          const char *NodeName ,
136                                          const SUPERV::KindOfNode akind ,
137                                          const SUPERV::SDate NodeFirstCreation ,
138                                          const SUPERV::SDate NodeLastModification  ,
139                                          const char * NodeEditorRelease ,
140                                          const char * NodeAuthor ,
141                                          const char * NodeComment ,
142                                          const bool   GeneratedName ,
143                                          const long   X ,
144                                          const long   Y ,
145                                          int * Graph_prof_debug ,
146                                          ostream * Graph_fdebug ) :
147   GraphBase::PortsOfNode::PortsOfNode() {
148
149   _ORB = CORBA::ORB::_duplicate( ORB ) ;
150   _NamingService = ptrNamingService ;
151   _Graph_prof_debug = Graph_prof_debug ;
152   _Graph_fdebug = Graph_fdebug ;
153   _Node = SUPERV::CNode::_nil() ;
154   _InNode = NULL ;
155   _ThreadNo = pthread_self() ;
156
157   _Kind = akind ;
158
159   time_t T = time(NULL);
160   struct tm * Tm = localtime(&T);
161
162   _FirstCreation.Second = _LastModification.Second = Tm->tm_sec;
163   _FirstCreation.Minute = _LastModification.Minute = Tm->tm_min;
164   _FirstCreation.Hour   = _LastModification.Hour   = Tm->tm_hour;
165   _FirstCreation.Day    = _LastModification.Day    = Tm->tm_mday;
166   _FirstCreation.Month  = _LastModification.Month  = Tm->tm_mon + 1;
167   _FirstCreation.Year   = _LastModification.Year   = Tm->tm_year + 1900; 
168
169   if ( NodeEditorRelease ) {
170     _EditorRelease = new char[ strlen( NodeEditorRelease ) + 1 ] ;
171     strcpy( _EditorRelease , NodeEditorRelease ) ;
172   }
173   else {
174     _EditorRelease = new char[ strlen( SuperVision_Version ) + 1 ] ;
175     strcpy( _EditorRelease , SuperVision_Version ) ;
176   }
177
178   if ( NodeAuthor ) {
179     _Author = new char[ strlen( NodeAuthor ) + 1 ] ;
180     strcpy( _Author  , NodeAuthor ) ;
181   }
182   else
183     _Author = NULLSTRING ;
184
185   if ( NodeComment  ) {
186     _Comment = new char[ strlen( NodeComment ) + 1 ] ;
187     strcpy( _Comment  , NodeComment ) ;
188   }
189   else
190     _Comment = NULLSTRING ;
191
192   _SubGraphNumber = 0 ;
193   _HeadNode = false ;
194   _GeneratedName = GeneratedName ;
195
196   const char *aNodeName = NodeName ;
197   _Name = new char[strlen(aNodeName)+1];
198   strcpy(_Name , aNodeName);
199
200   _ConnectedInPortsNumber = 0 ;
201   _DecrConnectedInPortsNumber = 0 ;
202   _LinkedNodesSize = 0 ;
203
204   _X = X ;
205   _Y = Y ;
206
207   if ( Graph_prof_debug )
208     SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
209
210     DefPortsOfNode( ORB , aService , NamePtr() , Kind() ,
211                     Graph_prof_debug , Graph_fdebug ) ;
212
213   cdebug_in << "GraphBase::ComputingNode::ComputingNode(" << aService.ServiceName << ","
214             << aNodeName << "," << akind
215             << "," << NodeComment << ")" << endl;
216   
217   cdebug << "GraphBase::ComputingNode::ComputingNode "  << this 
218          << " _Name "
219          << (void *) _Name << " '" << _Name << "' _Comment "
220          << (void *) _Comment << " "  << _Comment << " " 
221          << " KindOfNode " << _Kind
222          << " ServiceName " << ServiceName() << " In(" << ServiceInParameter().length()
223          << ") Out(" << ServiceOutParameter().length() << ")" << endl ;
224
225   cdebug_out << "GraphBase::ComputingNode::ComputingNode" << endl;
226 }
227
228 GraphBase::ComputingNode::~ComputingNode() {
229   cdebug << "GraphBase::ComputingNode::~ComputingNode "  << this 
230          << " _Name "
231          << (void *) _Name << " " << _Name << " _Comment "
232          << (void *) _Comment << " "  << _Comment << " "  << endl ;
233 //  if ( _ComponentName != NULLSTRING )
234 //    delete [] _ComponentName ;
235 //  delete [] _Name ;
236 //  delete [] _EditorRelease ;
237 //  if ( _Author != NULLSTRING )
238 //    delete [] _Author ;
239 //  if ( _Computer != FACTORYSERVER )
240 //    delete [] _Computer;
241 //  if ( _Comment != NULLSTRING )
242 //    delete [] _Comment;
243 }
244
245 bool GraphBase::ComputingNode::Name( const char * aName) {
246   if ( _Name ) {
247     cdebug << "GraphBase::ComputingNode::ReName "  << _Name << " --> " << aName << endl ;
248     delete [] _Name ;
249   }
250   _Name = new char[strlen(aName)+1] ;
251   strcpy( _Name , aName ) ;
252   return true ;
253 }
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 bool GraphBase::ComputingNode::Kind(const SUPERV::KindOfNode aKind) {
267   _Kind = aKind ;
268   return true ;
269 }
270
271 void GraphBase::ComputingNode::FirstCreation(const SUPERV::SDate aDate ) {
272   _FirstCreation = aDate ;
273 }
274
275 void GraphBase::ComputingNode::LastModification(const SUPERV::SDate aDate ) {
276   _LastModification = aDate ;
277 }
278
279 bool GraphBase::ComputingNode::EditorRelease(const char * c){
280   if ( _EditorRelease && _EditorRelease != NULLSTRING )
281     delete _EditorRelease;
282   _EditorRelease = my_strdup(c);
283   return true ;
284 }
285
286 bool GraphBase::ComputingNode::Author(const char * a) {
287   if ( _Author && _Author != NULLSTRING )
288     delete _Author;
289   _Author = my_strdup(a);
290   return true ;
291 }
292
293 bool GraphBase::ComputingNode::Comment(const char *c) {
294   cdebug_in << "GraphBase::ComputingNode::Comment" << endl;
295   if ( _Comment != NULLSTRING )
296     delete [] _Comment;
297   _Comment = my_strdup(c);
298   cdebug_out << "GraphBase::ComputingNode::Comment" << endl;
299   return true ;
300 }
301
302 void GraphBase::ComputingNode::NodePort( const char * NodeName ,
303                                 const char * ServiceParameterName ,
304                                 char ** aNode , char ** aPort ) {
305   if ( strcmp( NodeName , Name() ) ) {
306     *aNode = my_strdup( NodeName ) ;
307     *aPort = my_strdup( ServiceParameterName ) ;
308   }
309   else {
310     char * BPort = strchr( ServiceParameterName , '\\' ) ;
311     if ( BPort ) {
312       int len = BPort - ServiceParameterName ;
313       *aNode = new char [ len + 1 ] ;
314       strncpy( *aNode , ServiceParameterName , len ) ;
315       (*aNode)[ len ] = '\0' ;
316       *aPort = my_strdup( &BPort[ 1 ] ) ;
317     }
318     else {
319       *aNode = my_strdup( NULLSTRING ) ;
320       *aPort = my_strdup( NULLSTRING ) ;
321     }
322   }
323 }
324
325 bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName ) {
326   bool RetVal = false ;
327   const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
328   if ( thePort ) {
329     RetVal = thePort->IsConnected() ;
330   }
331   else {
332     const GraphBase::OutPort * thePort = GetOutPort( ToServiceParameterName ) ;
333     if ( thePort ) {
334       RetVal = thePort->IsConnected() ;
335     }
336   }
337   return RetVal ;
338 }
339
340 bool GraphBase::ComputingNode::HasInput(const char * ToServiceParameterName ) {
341   bool RetVal = false ;
342   const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
343   if ( IsDataFlowNode() && thePort ) {
344     RetVal = true ;
345   }
346   else if ( thePort ) {
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   Info->theService = *GetService() ;
366 //  Info->theListOfParameters = *GetListOfParameters() ;
367   Info->theFirstCreation = FirstCreation() ;
368   Info->theLastModification = LastModification() ;
369   Info->theEditorRelease = EditorRelease() ;
370   Info->theAuthor = Author() ;
371 //  Info->theContainer = Computer() ;
372   Info->theComment = Comment() ;
373   Info->theCoords.theX = GraphBase::ComputingNode::XCoordinate() ;
374   Info->theCoords.theY = GraphBase::ComputingNode::YCoordinate() ;
375   cdebug_out << "GraphBase::ComputingNode::GetInfo" << endl;
376   return Info ;
377 }
378
379 GraphBase::InPort * GraphBase::ComputingNode::AddInPort( const char * InputParameterName ,
380                                                 const char * InputParameterType ) {
381   return GraphBase::PortsOfNode::AddInPort( _ORB , NamePtr() ,
382                                             Kind() ,
383                                             InputParameterName ,
384                                             InputParameterType ,
385                                             _Graph_prof_debug , _Graph_fdebug ) ;
386 }
387 GraphBase::OutPort * GraphBase::ComputingNode::AddOutPort( const char * OutputParameterName ,
388                                                   const char * OutputParameterType ) {
389   return GraphBase::PortsOfNode::AddOutPort( _ORB , NamePtr() ,
390                                              Kind() ,
391                                              OutputParameterName ,
392                                              OutputParameterType ,
393                                              _Graph_prof_debug , _Graph_fdebug ) ;
394 }
395
396 void GraphBase::ComputingNode::AddLink( GraphBase::ComputingNode * ToNode ) {
397   int index = GetLinkedNodeIndex( ToNode->Name() ) ;
398   if ( index < 0 ) {
399     cdebug << Name() << "->GraphBase::ComputingNode::AddLinkedNode( " << ToNode->Name()
400            << " ) new LinkedNode " << endl ;
401     _LinkedNodes.resize( _LinkedNodesSize+1 ) ;
402     _LinkedInPortsNumber.resize( _LinkedNodesSize+1 ) ;
403     _LinkedNodes[ _LinkedNodesSize ] = ToNode ;
404     _LinkedInPortsNumber[ _LinkedNodesSize ] = 1 ;
405     SetLinkedNodeIndex( ToNode->Name() , _LinkedNodesSize ) ;
406     index = _LinkedNodesSize ;
407     _LinkedNodesSize++ ;
408   }
409   else {
410     cdebug << Name() << "->GraphBase::ComputingNode::AddLinkedNode( " << ToNode->Name()
411            << " ) old LinkedNode " << _LinkedNodes[index ]->Name() << endl ;
412     _LinkedInPortsNumber[ index ] += 1 ;
413   }
414   cdebug << Name() << "->GraphBase::ComputingNode::AddLinkedNode( " << ToNode->Name()
415          << " ) LinkedNodesSize " << _LinkedNodesSize << " [ " << index
416          << " ] _LinkedInPortsNumber " << _LinkedInPortsNumber[ index ]
417          << " ConnectedInPortsNumber " << ToNode->ConnectedInPortsNumber()
418          << " + 1 Service " << ServiceName() << endl ;
419   ToNode->IncrConnectedInPortsNumber() ;
420 }
421
422 void GraphBase::ComputingNode::RemoveLink( GraphBase::ComputingNode * ToNode ) {
423   int index = GetLinkedNodeIndex( ToNode->Name() ) ;
424   if ( index >= 0 ) {
425     cdebug << "GraphBase::ComputingNode::RemoveLink( to " << ToNode->Name() << " from "
426            << Name() << " index : " << index << " ConnectedInPortsNumber "
427            << ToNode->ConnectedInPortsNumber() - 1 << " LinkedInPortsNumber "
428            << _LinkedInPortsNumber[ index ] << " - 1" << endl ;
429     ToNode->DecrConnectedInPortsNumber() ;
430     _LinkedInPortsNumber[ index ] -= 1 ;
431     if ( _LinkedInPortsNumber[ index ] == 0 ) {
432       _LinkedNodesSize-- ;
433       cdebug << "GraphBase::ComputingNode::RemoveLink new LinkedNodesSize "
434              << _LinkedNodesSize << " " << ToNode->Name() << " removed from "
435              << " linkednodes of " << Name() << endl ;
436       int i ;
437       for ( i = index ; i < _LinkedNodesSize ; i++ ) {
438         _LinkedNodes[ i ] = _LinkedNodes[ i+1 ] ;
439         _LinkedInPortsNumber[ i ] =  _LinkedInPortsNumber[ i+1 ] ;
440         SetLinkedNodeIndex( _LinkedNodes[ i ]->Name() , i ) ;
441       }
442       DelLinkedNodeIndex( ToNode->Name() ) ;
443       _LinkedNodes.resize( _LinkedNodesSize+1 ) ;
444       _LinkedInPortsNumber.resize( _LinkedNodesSize+1 ) ;
445     }
446   }
447   else {
448     cdebug << " Error index " << index << endl ;
449   }
450 }
451
452 void GraphBase::ComputingNode::ReNameLink( const char* OldNodeName ,
453                                   const char* NewNodeName ) {
454   cdebug_in << "GraphBase::ComputingNode::ReNameLink (" << OldNodeName << " , "
455             << NewNodeName << ")" << endl;
456   int index = GetLinkedNodeIndex( OldNodeName ) ;
457   if ( index >= 0 ) {
458     _MapOfLinkedNodes.erase( OldNodeName ) ;
459     SetLinkedNodeIndex( NewNodeName , index ) ;
460   }
461   cdebug_out << "GraphBase::ComputingNode::ReNameLink" << endl ;
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   QDomElement node = Graph.createElement( "node" ) ;
511   info.appendChild( node ) ;
512   QDomElement componentname = Graph.createElement( "component-name" ) ;
513   QDomText aField ;
514   if ( strlen( ComponentName ) ) {
515 //    f << Tabs << "<component-name>" << ComponentName << "</component-name>"
516 //      << endl ;
517 //    componentname.setNodeValue( ComponentName ) ;
518     aField = Graph.createTextNode( ComponentName ) ;
519   }
520   else {
521 //    f << Tabs << "<component-name>?</component-name>" << endl ;
522 //    componentname.setNodeValue( "?" ) ;
523     aField = Graph.createTextNode( "?" ) ;
524   }
525   node.appendChild( componentname ) ;
526   componentname.appendChild( aField ) ;
527
528   QDomElement interfacename = Graph.createElement("interface-name") ;
529   if ( strlen( InterfaceName ) ) {
530 //    f << Tabs << "<interface-name>" << InterfaceName << "</interface-name>"
531 //      << endl ;
532 //    interfacename.setAttribute("name" , InterfaceName ) ;
533     aField = Graph.createTextNode( InterfaceName ) ;
534   }
535   else {
536 //    f << Tabs << "<interface-name>?</interface-name>" << endl ;
537 //    interfacename.setAttribute("name" , "?" ) ;
538     aField = Graph.createTextNode( "?" ) ;
539   }
540   node.appendChild(interfacename) ;
541   interfacename.appendChild( aField ) ;
542
543 //  f << Tabs << "<node-name>" << Name() << "</node-name>" << endl ;
544   QDomElement nodename = Graph.createElement("node-name") ;
545   aField = Graph.createTextNode( Name() ) ;
546   node.appendChild( nodename ) ;
547   nodename.appendChild( aField ) ;
548
549 //  f << Tabs << "<kind>" << (int ) Kind() << "</kind>" << endl ;
550   QDomElement kind = Graph.createElement( "kind" ) ;
551   QString aKind ;
552   aKind = aKind.setNum( Kind() ) ;
553   aField = Graph.createTextNode( aKind ) ;
554   node.appendChild( kind ) ;
555   kind.appendChild( aField ) ;
556
557   QDomElement couplednode = Graph.createElement("coupled-node") ;
558   if ( IsGOTONode() || IsLoopNode() || IsEndLoopNode() ||
559        IsSwitchNode() || IsEndSwitchNode() ) {
560 //    f << Tabs << "<coupled-node>" << CoupledNode << "</coupled-node>"
561 //      << endl ;
562     aField = Graph.createTextNode( CoupledNode ) ;
563   }
564   else {
565 //    f << Tabs << "<coupled-node>?</coupled-node>" << endl ;
566     aField = Graph.createTextNode( "?" ) ;
567   }
568   node.appendChild(couplednode) ;
569   couplednode.appendChild( aField ) ;
570
571 //  f << Tabs << "<service>" << endl ;
572   QDomElement service = Graph.createElement("service") ;
573   node.appendChild(service) ;
574   QDomElement servicename = Graph.createElement("service-name") ;
575   if ( strlen( ServiceName() ) ) {
576 //    f << Tabs << "    <service-name>" << ServiceName() << "</service-name>" << endl ;
577     aField = Graph.createTextNode( ServiceName() ) ;
578   }
579   else {
580 //    f << Tabs << "    <service-name>?</service-name>" << endl ;
581     aField = Graph.createTextNode( "?" ) ;
582   }
583   service.appendChild(servicename) ;
584   servicename.appendChild( aField ) ;
585
586 //  f << Tabs << "      <inParameter-list>" << endl ;
587   QDomElement inParameterlist = Graph.createElement("inParameter-list") ;
588   service.appendChild(inParameterlist) ;
589   unsigned int i;
590   for ( i = 0 ; i < ServiceInParameter().length() ; i++ ) {
591 //    f << Tabs << "            <inParameter>" << endl ;
592     QDomElement inParameter = Graph.createElement("inParameter") ;
593     inParameterlist.appendChild(inParameter) ;
594 //    f << Tabs << "                    <inParameter-type>"
595 //      << ServiceInParameter()[i].Parametertype << "</inParameter-type>"
596 //      << endl ;
597     QDomElement inParametertype = Graph.createElement("inParameter-type") ;
598     // mpv: Linux 8.0 compiler compatibility
599 //    aField = Graph.createTextNode( (char *)ServiceInParameter()[i].Parametertype ) ;
600     aField = Graph.createTextNode( strdup(ServiceInParameter()[i].Parametertype) ) ;
601     inParameter.appendChild(inParametertype) ;
602     inParametertype.appendChild( aField ) ;
603 //    f << Tabs << "                    <inParameter-name>"
604 //      << ServiceInParameter()[i].Parametername << "</inParameter-name>"
605 //      << endl ;
606     QDomElement inParametername = Graph.createElement("inParameter-name") ;
607     // mpv: Linux 8.0 compiler compatibility
608 //    aField = Graph.createTextNode( (char *) ServiceInParameter()[i].Parametername ) ;
609     aField = Graph.createTextNode( strdup(ServiceInParameter()[i].Parametername) ) ;
610     inParameter.appendChild(inParametername) ;
611     inParametername.appendChild( aField ) ;
612 //    f << Tabs << "            </inParameter>" << endl ;
613   }
614 //  f << Tabs << "      </inParameter-list>" << endl ;
615 //  f << Tabs << "      <outParameter-list>" << endl ;
616   QDomElement outParameterlist = Graph.createElement("outParameter-list") ;
617   service.appendChild(outParameterlist) ;
618   for ( i = 0 ; i < ServiceOutParameter().length() ; i++ ) {
619 //    f << Tabs << "            <outParameter>" << endl ;
620     QDomElement outParameter = Graph.createElement("outParameter") ;
621     outParameterlist.appendChild(outParameter) ;
622 //    f << Tabs << "                    <outParameter-type>"
623 //      << ServiceOutParameter()[i].Parametertype << "</outParameter-type>"
624 //      << endl ;
625     QDomElement outParametertype = Graph.createElement("outParameter-type") ;
626     // mpv: Linux 8.0 compiler compatibility
627 //    aField = Graph.createTextNode( (char *) ServiceOutParameter()[i].Parametertype ) ;
628     aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametertype) ) ;
629     outParameter.appendChild(outParametertype) ;
630     outParametertype.appendChild( aField ) ;
631 //    f << Tabs << "                    <outParameter-name>"
632 //      << ServiceOutParameter()[i].Parametername << "</outParameter-name>"
633 //      << endl ;
634     QDomElement outParametername = Graph.createElement("outParameter-name") ;
635     // mpv: Linux 8.0 compiler compatibility
636 //    aField = Graph.createTextNode( (char *) ServiceOutParameter()[i].Parametername ) ;
637     aField = Graph.createTextNode( strdup(ServiceOutParameter()[i].Parametername) ) ;
638     outParameter.appendChild(outParametername) ;
639     outParametername.appendChild( aField ) ;
640 //    f << Tabs << "            </outParameter>" << endl ;
641   }
642 //  f << Tabs << "      </outParameter-list>" << endl ;
643 //  f << Tabs << "</service>" << endl ;
644
645 //  f << Tabs << "<Parameter-list>" << endl ;
646   QDomElement Parameterlist = Graph.createElement("Parameter-list") ;
647   node.appendChild( Parameterlist ) ;
648 #if 0
649   if ( IsInLineNode() || IsGOTONode() ||
650        IsLoopNode() || IsEndLoopNode() ||
651        IsSwitchNode() || IsEndSwitchNode() ) {
652     unsigned int i;
653     for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
654       const InPort * anInPort = GetNodeInPort( i ) ;
655       if ( anInPort->IsBus() ) {
656         f << Tabs << "  <inParameter>" << endl ;
657         f << Tabs << "          <inParameter-type>"
658           << anInPort->PortType() << "</inParameter-type>"
659           << endl ;
660         f << Tabs << "          <inParameter-name>"
661           << anInPort->PortName() << "</inParameter-name>"
662           << endl ;
663         f << Tabs << "  </inParameter>" << endl ;
664         const OutPort * anOutPort = GetNodeOutPort( anInPort->PortIndex() ) ;
665         f << Tabs << "  <outParameter>" << endl ;
666         f << Tabs << "          <outParameter-type>"
667           << anOutPort->PortType() << "</outParameter-type>"
668           << endl ;
669         f << Tabs << "          <outParameter-name>"
670           << anOutPort->PortName() << "</outParameter-name>"
671           << endl ;
672         f << Tabs << "  </outParameter>" << endl ;
673       }
674     }
675   }
676 #endif
677 //  f << Tabs << "</Parameter-list>" << endl ;    
678
679 //  f << Tabs << "<PyFunction-list>" << endl ;
680   QDomElement PyFunctionlist = Graph.createElement("PyFunction-list") ;
681   node.appendChild( PyFunctionlist ) ;
682   for ( i = 0 ; i < PythonFunctions.size() ; i++ ) {
683 //    f << Tabs << "    <PyFunction>" << endl ;
684     QDomElement PyFunction = Graph.createElement("PyFunction") ;
685     PyFunctionlist.appendChild( PyFunction ) ;
686     int j ;
687     for ( j = 0 ; j < (*PythonFunctions[i]).length() ; j++ ) {
688       if ( j == 0 ) {
689 //        if ( i == 0 ) {
690 //          f << Tabs << "              <FuncName>" << FuncNames[i].c_str()
691 //            << "</FuncName>" << endl ;
692           QDomElement FuncName = Graph.createElement("FuncName") ;
693           if ( strlen( FuncNames[i].c_str() ) ) {
694             aField = Graph.createTextNode( FuncNames[i].c_str() ) ;
695           }
696           else {
697             aField = Graph.createTextNode( "?" ) ;
698           }
699           PyFunction.appendChild( FuncName ) ;
700           FuncName.appendChild( aField ) ;
701 //      }
702 //        else if ( i == 1 ) {
703 //          f << Tabs << "              <FuncName>" << FuncNames[i].c_str()
704 //            << "</FuncName>" << endl ;
705 //      }
706 //        else if ( i == 2 ) {
707 //          f << Tabs << "              <FuncName>" << FuncNames[i].c_str()
708 //            << "</FuncName>" << endl ;
709 //      }
710       }
711 //      f << Tabs << "          <PyFunc>" << (*PythonFunctions[i])[j]
712 //        << "</PyFunc>" << endl ;
713       QDomElement PyFunc = Graph.createElement("PyFunc") ;
714       QDomCDATASection aCDATA ;
715       // mpv: Linux 8.0 compiler compatibility
716 //       char * aCDATAChar = (char *) (*PythonFunctions[i])[j] ;
717       char * aCDATAChar = strdup ((*PythonFunctions[i])[j]) ;
718       int i ;
719       for ( i = 0 ; i < strlen( aCDATAChar ) ; i++ ) {
720         if ( aCDATAChar[ i ] != ' ' ) {
721           break ;
722         }
723       }
724       if ( i == strlen( aCDATAChar ) ) {
725         aCDATA = Graph.createCDATASection( "?" ) ;
726       }
727       else {
728         aCDATA = Graph.createCDATASection( aCDATAChar ) ;
729       }
730       PyFunction.appendChild( PyFunc ) ;
731       PyFunc.appendChild( aCDATA ) ;
732     }
733 //    f << Tabs << "    </PyFunction>" << endl ;
734   }
735 //  f << Tabs << "</PyFunction-list>" << endl ;
736
737 //  f << Tabs << "<creation-date>" << FirstCreation() << "</creation-date>"
738 //    << endl ;
739   QDomElement creationdate = Graph.createElement("creation-date") ;
740   char fdate[30] ;
741   sprintf( fdate , "%d/%d/%d - %d:%d:%d" ,  FirstCreation().Day , FirstCreation().Month , FirstCreation().Year , FirstCreation().Hour , FirstCreation().Minute , FirstCreation().Second ) ;
742   aField = Graph.createTextNode( fdate ) ;
743   node.appendChild( creationdate ) ;
744   creationdate.appendChild( aField ) ;
745 //  f << Tabs << "<lastmodification-date>" << LastModification()
746 //    << "</lastmodification-date>" << endl ;
747   QDomElement lastmodificationdate = Graph.createElement("lastmodification-date") ;
748   char ldate[30] ;
749   sprintf( ldate , "%d/%d/%d - %d:%d:%d" , LastModification().Day , LastModification().Month , LastModification().Year , LastModification().Hour , LastModification().Minute , LastModification().Second ) ;
750   aField = Graph.createTextNode( ldate ) ;
751   node.appendChild( lastmodificationdate ) ;
752   lastmodificationdate.appendChild( aField ) ;
753 //  f << Tabs << "<editor-release>" << EditorRelease() << "</editor-release>"
754 //    << endl ;
755   QDomElement editorrelease = Graph.createElement("editor-release") ;
756   aField = Graph.createTextNode( EditorRelease() ) ;
757   node.appendChild( editorrelease ) ;
758   editorrelease.appendChild( aField ) ;
759   QDomElement author = Graph.createElement("author") ;
760   if ( strlen( Author() ) ) {
761 //    f << Tabs << "<author>" << Author() << "</author>" << endl ;
762     aField = Graph.createTextNode( Author() ) ;
763   }
764   else {
765 //    f << Tabs << "<author>?</author>" << endl ;
766     aField = Graph.createTextNode( "?" ) ;
767   }
768   node.appendChild( author ) ;
769   author.appendChild( aField ) ;
770   QDomElement container = Graph.createElement("container") ;
771   if ( IsFactoryNode() && strlen( Computer) ) {
772 //    f << Tabs << "<container>" << Computer << "</container>" << endl ;
773     aField = Graph.createTextNode( Computer ) ;
774   }
775   else {
776 //    f << Tabs << "<container>?</container>" << endl ;
777     aField = Graph.createTextNode( "?" ) ;
778   }
779   node.appendChild( container ) ;
780   container.appendChild( aField ) ;
781   QDomElement comment = Graph.createElement("comment") ;
782   if ( strlen( Comment() ) ) {
783 //    f << Tabs << "<comment>" << Comment() << "</comment>" << endl ;
784     aField = Graph.createTextNode( Comment() ) ;
785   }
786   else {
787 //    f << Tabs << "<comment>?</comment>" << endl ;
788     aField = Graph.createTextNode( "?" ) ;
789   }
790   node.appendChild( comment ) ;
791   comment.appendChild( aField ) ;
792 //  f << Tabs << "<x-position>" << XCoordinate << "</x-position>" << endl ;
793   QDomElement xposition = Graph.createElement("x-position") ;
794   QString aXCoordinate ;
795   aXCoordinate = aKind.setNum( XCoordinate ) ;
796   aField = Graph.createTextNode( aXCoordinate ) ;
797   node.appendChild( xposition ) ;
798   xposition.appendChild( aField ) ;
799 //  f << Tabs << "<y-position>" << YCoordinate << "</y-position>" << endl ;
800   QDomElement yposition = Graph.createElement("y-position") ;
801   QString aYCoordinate ;
802   aYCoordinate = aKind.setNum( YCoordinate ) ;
803   aField = Graph.createTextNode( aYCoordinate ) ;
804   node.appendChild( yposition ) ;
805   yposition.appendChild( aField ) ;
806   return true ;
807 }
808
809 bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
810                                        const char * ComponentName ,
811                                        const char * InterfaceName ,
812                                        const char * Computer ,
813                                        const GraphBase::InLineNode * aCoupledNode ,
814                                        const ListOfFuncName FuncNames ,
815                                        const ListOfPythonFunctions PythonFunctions ,
816                                        int XCoordinate , int YCoordinate ) const {
817   if ( IsDataFlowNode() ) {
818     f << Name() << " = Graph( '" << Name() << "' )" << endl ;
819   }
820   else if ( IsComputingNode() ) {
821     int i ;
822     f << Name() << "_ServiceinParameter = []" << endl ;
823     for ( i = 0 ; i < ServiceInParameter().length() ; i++ ) {
824       f << Name() << "_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( '"
825         << ServiceInParameter()[i].Parametertype << "' , '"
826         << ServiceInParameter()[i].Parametername << "' ) )" << endl ;
827     }
828     f << Name() << "_ServiceoutParameter = []" << endl ;
829     for ( i = 0 ; i < ServiceOutParameter().length() ; i++ ) {
830       f << Name() << "_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( '"
831         << ServiceOutParameter()[i].Parametertype << "' , '"
832         << ServiceOutParameter()[i].Parametername << "' ) )" << endl ;
833     }
834     f << Name() << "_Service = SALOME_ModuleCatalog.Service( '" << ServiceName()
835       << "' , " << Name() << "_ServiceinParameter" << " , "
836       << Name() << "_ServiceoutParameter" << " , 0 )" << endl ;
837     f << Name() << " = " << aGraphName << ".CNode( " << Name() << "_Service" << " )"
838       << endl ;
839   }
840   else if ( IsFactoryNode() ) {
841     f << Name() << " = " << aGraphName << ".FNode( '" << ComponentName
842       << "' , '" << InterfaceName << "' , '" << ServiceName() << "' )"
843       << endl ;
844   }
845   else {
846     f << "Py" << Name() << " = []" << endl ;
847     int i ;
848     SUPERV::ListOfStrings aPyFunc ;
849     if ( PythonFunctions.size() ) {
850       aPyFunc = *PythonFunctions[0] ;
851       for ( i = 0 ; i < aPyFunc.length() ; i++ ) {
852         f << "Py" << Name() << ".append( '" << aPyFunc[i] << "' )" << endl ;
853       }
854     }
855     if ( IsInLineNode() ) {
856       f << Name() << " = " << aGraphName << ".INode( '" << FuncNames[0].c_str() << "' , Py"
857         << Name() << " )" << endl ;
858     }
859     else if ( IsGOTONode() ) {
860       if ( aCoupledNode ) {
861         f << Name() << " = " << aGraphName << ".GNode( '" << FuncNames[0].c_str() << "' , Py"
862           << Name() << " , '" << aCoupledNode->Name() << "' )" << endl ;
863       }
864       else {
865         f << Name() << " = " << aGraphName << ".GNode( '" << FuncNames[0].c_str() << "' , Py"
866           << Name() << " , '' )" << endl ;
867       }
868     }
869     else {
870 //      char * EndName = NULL ;
871 //      EndName = new char[ 3 + strlen( Name() ) + 1 ] ;
872 //      strcpy( EndName , "End" ) ;
873 //      strcat( EndName , Name() ) ;
874       char * EndName = aCoupledNode->Name() ;
875       if ( IsLoopNode() ) {
876         SUPERV::ListOfStrings aPyMore = *PythonFunctions[1] ;
877         SUPERV::ListOfStrings aPyNext = *PythonFunctions[2] ;
878         f << "PyMore" << Name() << " = []" << endl ;
879         for ( i = 0 ; i < aPyMore.length() ; i++ ) {
880           f << "PyMore" << Name() << ".append( '" << aPyMore[i] << "' )" << endl ;
881         }
882         f << "PyNext" << Name() << " = []" << endl ;
883         for ( i = 0 ; i < aPyNext.length() ; i++ ) {
884           f << "PyNext" << Name() << ".append( '" << aPyNext[i] << "' )" << endl ;
885         }
886         f << Name() << "," << EndName << " = " << aGraphName << ".LNode( '"
887           << FuncNames[0].c_str() << "' , Py" << Name() << " , '"
888           << FuncNames[1].c_str() << "' , PyMore" << Name()
889           << " , '" << FuncNames[2].c_str() << "' , PyNext"
890           << Name() << " )" << endl ;
891         f << EndName << ".SetName( '" << aCoupledNode->Name() << "' )" << endl ;
892         f << EndName << ".SetAuthor( '" << aCoupledNode->Author() << "' )" << endl ;
893         f << EndName << ".SetComment( '" << aCoupledNode->Comment() << "' )" << endl ;
894         f << EndName << ".Coords( " << aCoupledNode->XCoordinate() << " , "
895           << aCoupledNode->YCoordinate() << " )" << endl ;
896       }
897       else if ( IsSwitchNode() ) {
898         f << Name() << "," << EndName << " = " << aGraphName << ".SNode( '"
899           << FuncNames[0].c_str() << "' , Py" << Name() << " )" << endl ;
900         f << EndName << ".SetName( '" << aCoupledNode->Name() << "' )" << endl ;
901         f << EndName << ".SetAuthor( '" << aCoupledNode->Author() << "' )" << endl ;
902         f << EndName << ".SetComment( '" << aCoupledNode->Comment() << "' )" << endl ;
903         f << EndName << ".Coords( " << aCoupledNode->XCoordinate() << " , "
904           << aCoupledNode->YCoordinate() << " )" << endl ;
905         SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
906         f << "Py" << aCoupledNode->Name() << " = []" << endl ;
907         for ( i = 0 ; i < aPyFunc.length() ; i++ ) {
908           f << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
909             << endl ;
910         }
911         f << EndName << ".SetPyFunction( 'End" << FuncNames[0].c_str() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
912         for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
913           const GraphBase::InPort * anInPort = aCoupledNode->GetNodeInPort(i) ;
914           if ( anInPort->IsInLine() || anInPort->IsEndSwitch() ) {
915             f << EndName << ".InPort( '" << anInPort->PortName()
916               << "' , '" << anInPort->PortType() << "' )" << endl ;
917           }
918         }
919         for ( i = 0 ; i < aCoupledNode->GetNodeOutPortsSize() ; i++ ) {
920           const GraphBase::OutPort * anOutPort = aCoupledNode->GetNodeOutPort(i) ;
921           if ( anOutPort->IsInLine() ) {
922             f << EndName << ".OutPort( '" << anOutPort->PortName()
923               << "' , '" << anOutPort->PortType() << "' )" << endl ;
924           }
925         }
926       }
927       delete [] EndName ;
928     }
929     for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
930       const GraphBase::InPort * anInPort = GetNodeInPort(i) ;
931       if ( anInPort->IsInLine() ) {
932         f << Name() << ".InPort( '" << anInPort->PortName() << "' , '"
933           << anInPort->PortType() << "' )" << endl ;
934       }
935     }
936     for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
937       const GraphBase::OutPort * anOutPort = GetNodeOutPort(i) ;
938       if ( anOutPort->IsInLine() || anOutPort->IsSwitch() ) {
939         f << Name() << ".OutPort( '" << anOutPort->PortName()
940           << "' , '" << anOutPort->PortType() << "' )" << endl ;
941       }
942     }
943   }
944
945   f << Name() << ".SetName( '" << Name() << "' )" << endl ;
946   f << Name() << ".SetAuthor( '" << Author() << "' )" << endl ;
947   if ( IsFactoryNode() ) {
948     f << Name() << ".SetContainer( '" << Computer << "' )" << endl ;
949   }
950   f << Name() << ".SetComment( '" << Comment() << "' )" << endl ;
951   f << Name() << ".Coords( " << XCoordinate << " , " << YCoordinate << " )" << endl ;
952
953 #if 0
954   if ( IsLoopNode() || IsSwitchNode() ) {
955     f << EndName << ".SetName( '" << CoupledNode
956       << "' )" << endl ;
957     f << EndName << ".SetAuthor( '" << CoupledNode->Author()
958       << "' )" << endl ;
959     f << EndName << ".SetComment( '" << CoupledNode->Comment()
960       << "' )" << endl ;
961     f << EndName << ".Coords( " << CoupledNode->XCoordinate() << " , "
962       << CoupledNode->YCoordinate() << " )" << endl ;
963     unsigned int i;
964     for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
965       const InPort * anInPort = GetNodeInPort( i ) ;
966       if ( anInPort->IsBus() ) {
967         const OutPort * anOutPort = GetNodeOutPort( anInPort->PortIndex() ) ;
968         f << Name() << ".BusPorts( '" << anInPort->PortName() << "' , '"
969           << anInPort->PortType() << "' , '" << anOutPort->PortName()
970           << "' , '" << anOutPort->PortType() << "' )" << endl ;
971       }
972     }
973   }
974 #endif
975   return true ;
976 }
977
978 void GraphBase::ComputingNode::NodeInfo(ostrstream & s) const {
979   int i ;
980   s << *this ;
981   ListPorts( s , true ) ;
982   s << ends ;
983 }
984
985 ostream & operator<< (ostream & f,const GraphBase::ComputingNode & G) {
986 //  f << "ComponentName    " << G.ComponentName() << endl ;
987   if ( G.IsComputingNode() )
988     f << "NodeName         " << G.Name() << endl ;
989   else
990     f << "DataFlowName     " << G.Name() << endl ;
991   f << "Kind             " << G.Kind() << endl ;
992   f << "Service          " << *G.GetService() ;
993   f << "FirstCreation    " << G.FirstCreation () << endl ;
994   f << "LastModification " << G.LastModification() << endl ;
995   f << "EditorRelease    " << G.EditorRelease() << endl ;
996   f << "Author           " << G.Author() << endl ;
997 //  f << "Computer         " << G.Computer() << endl ;
998   f << "Comment          " << G.Comment() << endl ;
999   f << endl ;
1000   
1001   return f;
1002 }
1003
1004 void GraphBase::ComputingNode::ListLinks(ostream &f ) const {
1005   int i ;
1006   for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
1007     const GraphBase::OutPort* fromPort = GetNodeOutPort( i ) ;
1008     if ( fromPort->IsPortConnected() ) {
1009       int j ;
1010       for ( j = 0 ; j < fromPort->InPortsSize() ; j++ ) {
1011         if ( j == 0 )
1012           f << "FromNode " << Name() << endl ;
1013         f << "         FromServiceParameterName "
1014           << fromPort->GetServicesParameter().Parametername ;
1015         const GraphBase::InPort* toPort = fromPort->InPorts( j ) ;
1016         f << " ToNode " << toPort->NodeName() ;
1017         f << " ToServiceParameterName "
1018           << toPort->GetServicesParameter().Parametername;
1019         f << " Value " ;
1020         fromPort->StringValue( f ) ;
1021         f << endl ;
1022       }
1023     }
1024   }
1025 }
1026
1027 ostream & operator<< (ostream &fOut,const SUPERV::SDate &D) {
1028 //  cdebug_in << "operator<< GraphEditor::Date" << endl;
1029
1030   fOut  << D.Day << "/" 
1031         << D.Month << "/" 
1032         << D.Year << " - " 
1033         << D.Hour << ":" 
1034         << D.Minute <<  ":"  
1035         << D.Second;
1036
1037 //  cdebug_out << "operator<< GraphEditor::Date" << endl;
1038   return fOut;
1039 }
1040