Salome HOME
MPV: Merge V1_2d
[modules/superv.git] / src / Supervision / CNode_Impl.cxx
index 860dd16a33e58d9d57c3b47c329550cfd35955f2..02cf4adcbd6a024636545457ec1b48c317ca6b6b 100644 (file)
@@ -175,8 +175,9 @@ bool CNode_Impl::Delete() {
   bool RetVal = false ;
   if ( _DataFlowEditor->IsEditing() ) {
     RetVal = _DataFlowEditor->RemoveNode( Name() ) ;
-    if ( RetVal )
+    if ( RetVal ) {
       RetVal = _DataFlowEditor->IsValid() ;
+    }
   }
   endService( "CNode_Impl::Delete" );
   return RetVal ;
@@ -202,7 +203,7 @@ char * CNode_Impl::Name() {
     RetVal = _DataFlowNode->Name() ;
   }
   else {
-   RetVal = _DataFlowEditor->Name() ;
+    RetVal = _DataFlowEditor->Name() ;
   }
 //  endService( "CNode_Impl::Name" );
   return CORBA::string_dup( RetVal );
@@ -216,7 +217,7 @@ bool CNode_Impl::SetName( const char * aDataFlowName ) {
                                             aDataFlowName ) ;
     }
     else {
-     RetVal = _DataFlowEditor->Name( aDataFlowName ) ;
+      RetVal = _DataFlowEditor->Name( aDataFlowName ) ;
     }
   }
 //  endService( "CNode_Impl::SetName" );
@@ -611,9 +612,9 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
   bool begin = true ;
   SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+  bool sts = false ;
+  GraphBase::InPort * anInPort = NULL ;
   if ( _DataFlowEditor->IsEditing() ) {
-    bool sts = false ;
-    GraphBase::InPort * anInPort ;
     if ( _IsNode ) {
       sts = _DataFlowEditor->AddInputData( _DataFlowNode->Name() ,
                                            ToServiceParameterName ,
@@ -652,8 +653,6 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
     }
   }
   else if ( _DataFlowExecutor ) {
-    bool sts = false ;
-    GraphBase::InPort * anInPort ;
     if ( _IsNode ) {
       sts = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() ,
                                                 ToServiceParameterName ,
@@ -694,6 +693,10 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
   if ( !begin ) {
     endService( "CNode_Impl::Input" );
   }
+  if ( CORBA::is_nil( iobject ) ) {
+    MESSAGE( "CNode_Impl::Input returns nil object _IsNode " << _IsNode << " sts " << sts << " anInPort "
+             << anInPort ) ;
+  }
   return SUPERV::Port::_duplicate( iobject ) ;
 }
 
@@ -712,13 +715,13 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() {
       }
       if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() && 
                                    ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
-        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
+//        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
         RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
       }
       else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
-        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
-                 << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
-                 << "/" << anInPort->IsConnected() ) ;
+//        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
+//                 << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
+//                 << "/" << anInPort->IsConnected() ) ;
         Port_Impl * myPort ;
         if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
           const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
@@ -748,7 +751,7 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() {
         anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
       }
       else {
-        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
+//        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
         RetVal[ i ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
       }
     }
@@ -760,11 +763,11 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() {
       }
       if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
                                     ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
-        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
+//        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
         RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
       }
       else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
-        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
+//        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
         const CORBA::Any * anAny = anOutPort->Value() ;
         Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId ,
                                             instanceName() , interfaceName() ,
@@ -782,7 +785,7 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() {
         anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
       }
       else {
-        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
+//        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
         RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
       }
     }