]> SALOME platform Git repositories - modules/superv.git/blobdiff - src/GraphBase/DataFlowBase_PortsOfNode.cxx
Salome HOME
*** empty log message ***
[modules/superv.git] / src / GraphBase / DataFlowBase_PortsOfNode.cxx
index da89abd630f548a37dece445954927ad044c7f95..e3ec6da61320edfb595198e3019cd9175373b7b0 100644 (file)
@@ -269,13 +269,20 @@ GraphBase::InPort * GraphBase::PortsOfNode::AddInPort( CORBA::ORB_ptr ORB ,
   cdebug_in << "DefPortsOfNode::AddInPort : " << *NodeName << " " << aKind << " "
             << InputParameterName << " " << InputParameterType << endl ;
   GraphBase::InPort * anInPort = NULL ;
+  SUPERV::KindOfPort aPortKind = SUPERV::UndefinedParameter ;
   if ( aKind == SUPERV::InLineNode || aKind == SUPERV::LoopNode ||
        aKind == SUPERV::EndLoopNode || aKind == SUPERV::SwitchNode ||
        aKind == SUPERV::EndSwitchNode || aKind == SUPERV::GOTONode ) {
-    SUPERV::KindOfPort aPortKind = SUPERV::InLineParameter ;
-    if ( aKind == SUPERV::EndSwitchNode ) {
-      aPortKind = SUPERV::EndSwitchParameter ;
-    }
+    aPortKind = SUPERV::ServiceParameter ;
+  }
+  else {
+    aPortKind = SUPERV::DataStreamParameter ;
+  }
+
+    //    SUPERV::KindOfPort aPortKind = SUPERV::InLineParameter ;
+    //    if ( aKind == SUPERV::EndSwitchNode ) {
+    //      aPortKind = SUPERV::EndSwitchParameter ;
+    //    }
     anInPort = GetChangeInPort( InputParameterName ) ;
     if ( anInPort == NULL ) {
       _NodeInPortsSize = _NodeInPortsSize + 1 ;
@@ -283,7 +290,6 @@ GraphBase::InPort * GraphBase::PortsOfNode::AddInPort( CORBA::ORB_ptr ORB ,
       SALOME_ModuleCatalog::ServicesParameter aServiceParameter ;
       aServiceParameter.Parametername = InputParameterName ;
       aServiceParameter.Parametertype = InputParameterType ;
-      SUPERV::KindOfPort aPortKind = SUPERV::ServiceParameter ;
       if ( aKind != SUPERV::EndLoopNode ) {
         _NodeInPorts[ _NodeInPortsSize-1 ] = _NodeInPorts[ _NodeInPortsSize-2 ] ; // Gate - Default
         _MapOfNodeInPorts.erase( _NodeInPorts[ _NodeInPortsSize-1 ]->PortName() ) ;
@@ -313,7 +319,7 @@ GraphBase::InPort * GraphBase::PortsOfNode::AddInPort( CORBA::ORB_ptr ORB ,
     else {
       cdebug << "InPort already exists" << endl ;
     }
-  }
+    //  }
   cdebug_out << "DefPortsOfNode::AddInPort _NodeInPortsSize " << _NodeInPortsSize
              << " " << anInPort->Kind() << endl ;
   return anInPort ;
@@ -329,10 +335,15 @@ GraphBase::OutPort * GraphBase::PortsOfNode::AddOutPort( CORBA::ORB_ptr ORB ,
   cdebug_in << "DefPortsOfNode::AddOutPort : " << *NodeName << " " << aKind << " "
             << OutputParameterName << " " << OutputParameterType << endl ;
   GraphBase::OutPort * anOutPort = NULL ;
+  SUPERV::KindOfPort aPortKind = SUPERV::UndefinedParameter ;
   if ( aKind == SUPERV::InLineNode || aKind == SUPERV::LoopNode ||
        aKind == SUPERV::EndLoopNode || aKind == SUPERV::SwitchNode ||
        aKind == SUPERV::EndSwitchNode || aKind == SUPERV::GOTONode ) {
-    SUPERV::KindOfPort aPortKind = SUPERV::InLineParameter ;
+    aPortKind = SUPERV::InLineParameter ;
+  }
+  else {
+    aPortKind = SUPERV::DataStreamParameter ;
+  }
     anOutPort = GetChangeOutPort( OutputParameterName ) ;
     if ( anOutPort == NULL ) {
       _NodeOutPortsSize = _NodeOutPortsSize + 1 ;
@@ -340,8 +351,8 @@ GraphBase::OutPort * GraphBase::PortsOfNode::AddOutPort( CORBA::ORB_ptr ORB ,
       SALOME_ModuleCatalog::ServicesParameter aServiceParameter ;
       aServiceParameter.Parametername = OutputParameterName ;
       aServiceParameter.Parametertype = OutputParameterType ;
-      if ( aKind == SUPERV::SwitchNode ) {
-        _NodeOutPorts[ _NodeOutPortsSize-1 ] = _NodeOutPorts[ _NodeOutPortsSize-2 ] ; // Default
+      if ( aKind != SUPERV::SwitchNode ) {
+        _NodeOutPorts[ _NodeOutPortsSize-1 ] = _NodeOutPorts[ _NodeOutPortsSize-2 ] ; // Gate - Default
         _MapOfNodeOutPorts.erase( _NodeOutPorts[ _NodeOutPortsSize-1 ]->PortName() ) ;
         _MapOfNodeOutPorts[ _NodeOutPorts[ _NodeOutPortsSize-1 ]->PortName() ] =  _NodeOutPortsSize-1 + 1 ;
         _MapOfNodeOutPorts[ OutputParameterName ] = _NodeOutPortsSize - 1 ;
@@ -369,7 +380,7 @@ GraphBase::OutPort * GraphBase::PortsOfNode::AddOutPort( CORBA::ORB_ptr ORB ,
     else {
       cdebug << "OutPort already exists" << endl ;
     }
-  }
+    //  }
   cdebug_out << "DefPortsOfNode::AddOutPort _NodeOutPortsSize "
              << _NodeOutPortsSize << " " << anOutPort->Kind() << endl ;
   return anOutPort ;