Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/superv.git] / src / GraphBase / DataFlowBase_ComputingNode.cxx
index 54139b0a1bbb54817363afca3386e8a41394eada..cafe8512556b4e6437229d4ce2699ddf9cd5b304 100644 (file)
@@ -333,11 +333,15 @@ void GraphBase::ComputingNode::NodePort( const char * NodeName ,
   }
 }
 
-bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName ) {
+bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName, bool isInput ) {
   bool RetVal = false ;
-  const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
-  if ( thePort ) {
-    RetVal = thePort->IsPortConnected() ;
+  if ( isInput ) { // mkr : PAL8060
+    // we have to know the type of the port, because of input and output ports 
+    // belong to one node may have the same names
+    const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
+    if ( thePort ) {
+      RetVal = thePort->IsPortConnected() ;
+    }
   }
   else {
     const GraphBase::OutPort * thePort = GetOutPort( ToServiceParameterName ) ;
@@ -371,9 +375,9 @@ GraphBase::SNode * GraphBase::ComputingNode::GetInfo() {
   Info->theName = Name() ;
   Info->theKind = Kind() ;
   if ( IsDataStreamNode() ) {
-    long Timeout ;
+    CORBA::Long Timeout ;
     SUPERV::KindOfDataStreamTrace DataStreamTrace ;
-    double DeltaTime ;
+    CORBA::Double DeltaTime ;
     ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
     Info->theTimeout = Timeout ;
     Info->theDataStreamTrace = DataStreamTrace ;
@@ -462,6 +466,7 @@ void GraphBase::ComputingNode::UpdateMacroPorts( GraphBase::Graph * aGraph ) {
       cdebug << "UpdateMacroPorts DelInPort In" << i << " " << GetNodeInPort( i )->PortName() << " "
              << GetNodeInPort( i )->PortType() << " " << GetNodeInPort( i )->Kind() << endl ;
       DelInPort( GetNodeInPort( i )->PortName() ) ;
+      i--; // mkr : fix for bug PAL8004
     }
   }
   int index ;
@@ -1162,9 +1167,9 @@ bool GraphBase::ComputingNode::SaveXML( QDomDocument & Graph , QDomElement & inf
   kind.appendChild( aField ) ;
 
   if ( IsDataStreamNode() && HasDataStream() != 0 ) {
-    long Timeout ;
+    CORBA::Long Timeout ;
     SUPERV::KindOfDataStreamTrace DataStreamTrace ;
-    double DeltaTime ;
+    CORBA::Double DeltaTime ;
     ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
 
     QDomElement timeout = Graph.createElement("streamgraph-timeout") ;
@@ -1531,9 +1536,9 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
   }
   else if ( IsDataStreamNode() && HasDataStream() != 0 ) {
     f << "    " << Name() << " = StreamGraph( '" << Name() << "' )" << endl ;
-    long Timeout ;
+    CORBA::Long Timeout ;
     SUPERV::KindOfDataStreamTrace DataStreamTrace ;
-    double DeltaTime ;
+    CORBA::Double DeltaTime ;
     ((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
     f << "    " << aGraphName << ".SetStreamParams( " << Timeout << " , SUPERV." << DataStreamTrace
       << " , " << DeltaTime << " )" << endl ;
@@ -1704,6 +1709,11 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
             f << "    " << "O" << Name() << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
               << endl ;
          }
+//JR 02.09.2005 : GetOutPort for Gates was missing
+          else if ( anOutPort->IsGate() ) {
+            f << "    " << "O" << Name() << anOutPort->PortName() << " = "
+              << Name() << ".GetOutPort( '" << anOutPort->PortName() << "' )" << endl ;
+          }
         }
         for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
           const GraphBase::InPort * anInPort = aCoupledNode->GetNodeInPort(i) ;