]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
1) Fix for bug PAL8060 : Supervisor: Edit ports - existing links are deleted.
authormkr <mkr@opencascade.com>
Fri, 20 Jan 2006 07:44:21 +0000 (07:44 +0000)
committermkr <mkr@opencascade.com>
Fri, 20 Jan 2006 07:44:21 +0000 (07:44 +0000)
2) Fix for bug PAL11273 : How to set the name of the container in a Factory Node.

src/Supervision/CNode_Impl.cxx
src/Supervision/CNode_Impl.hxx
src/Supervision/FNode_Impl.cxx
src/Supervision/FNode_Impl.hxx
src/Supervision/Graph_Impl.cxx
src/Supervision/Graph_Impl.hxx
src/Supervision/Port_Impl.cxx

index 9dd23bbfb7676741de0438a4ab7a14414c40cb28..7f3cf4c9f5332c441e4c2656511c4499f4d6e513 100644 (file)
@@ -23,6 +23,8 @@ using namespace std;
 
 #include "StreamPort_Impl.hxx"
 
+char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
+
 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
                        PortableServer::POA_ptr poa ,
                        PortableServer::ObjectId * contId , 
@@ -65,7 +67,8 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
                         const char * NodeName ,
                         const SUPERV::KindOfNode NodeKindOfNode ,
                         const char * FuncName  ,
-                        const SUPERV::ListOfStrings & PythonFunction ) :
+                        const SUPERV::ListOfStrings & PythonFunction ,
+                       bool isCimpl ) :
   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
 //  beginService( "CNode_Impl::CNode_Impl" );
 //  cout << "CNode_Impl::CNode_Impl -->" << endl ;
@@ -92,10 +95,25 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
     aPythonFunction.resize(1) ;
     aPythonFunction[0] = &PythonFunction ;
   }
-  _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
-                                            NodeKindOfNode ,
-                                            aFuncName ,
-                                            aPythonFunction ) ;
+
+  // mkr : PAL11273 -->
+  if ( isCimpl ) // C++ implementation
+    _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
+                                              NodeKindOfNode ,
+                                              aFuncName ,
+                                              aPythonFunction ) ;
+  else // Python implementation
+    _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
+                                              NodeKindOfNode ,
+                                              aFuncName ,
+                                              aPythonFunction ,
+                                              SUPERV::SDate() ,
+                                              SUPERV::SDate() ,
+                                              NULLSTRING ,
+                                              NULLSTRING ,
+                                              FACTORYSERVERPY ) ;
+  // mkr : PAL11273 <--
+
   _IsNode = true ;
 //  endService( "CNode_Impl::CNode_Impl" );  
 //  cout << "<-- CNode_Impl::CNode_Impl" << endl ;
@@ -1490,13 +1508,14 @@ long CNode_Impl::SubStreamGraph() {
   return RetVal ;
 }
 
-bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
+// mkr : PAL8060 : this method is not used
+/*bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
   beginService( "CNode_Impl::IsLinked" );
   bool RetVal = DataFlowNode()->IsLinked( ServiceParameterName ) ;
   MESSAGE( Name() << "->IsLinked( '" << ServiceParameterName << "' )" ) ;
   endService( "CNode_Impl::IsLinked" );
   return RetVal ;
-}
+  }*/
 
 bool CNode_Impl::HasInput(const char * ServiceParameterName ) {
 //  beginService( "CNode_Impl::HasInput" );
index 78c085c0d616be4a4b968591fc3bc162469d5b02..19ca441cf2da737c411210d74c5002ffcb4989b3 100644 (file)
@@ -54,7 +54,8 @@ class CNode_Impl : public POA_SUPERV::CNode ,
                 const char * NodeName = NULLSTRING ,
                 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::ComputingNode ,
                 const char * aFuncName = NULLSTRING ,
-                const SUPERV::ListOfStrings & aPythonFunction = SUPERV::ListOfStrings() ) ;
+                const SUPERV::ListOfStrings & aPythonFunction = SUPERV::ListOfStrings() ,
+               bool isCimpl = true ) ; // mkr : PAL11273 : C++ implementation by default
     CNode_Impl( CORBA::ORB_ptr orb ,
                PortableServer::POA_ptr poa ,
                PortableServer::ObjectId * contId , 
@@ -214,7 +215,8 @@ class CNode_Impl : public POA_SUPERV::CNode ,
     virtual long SubGraph() ;
     virtual long SubStreamGraph() ;
 
-    virtual bool IsLinked(const char * ToServiceParameterName ) ;
+  // mkr : PAL8060 : this method is not used
+  //virtual bool IsLinked(const char * ToServiceParameterName ) ;
     virtual bool HasInput(const char * ToServiceParameterName ) ;
 
 //    virtual SUPERV::Link_ptr GetLink(const char * ToServiceParameterName ) ;
index 99a431188ed819fd2ba10da001b1924ed140e0de..15e7b6244e06f2c94dfb166b0e196062e16e6344 100644 (file)
@@ -32,9 +32,10 @@ FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
                         const char * NodeComponentName ,
                         const char * NodeInterfaceName ,
                         const char * NodeName ,
-                        const SUPERV::KindOfNode NodeKindOfNode ) :
+                        const SUPERV::KindOfNode NodeKindOfNode ,
+                       bool isCimpl ) :
 //  Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
-  CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , NodeService , NodeName , NodeKindOfNode , NULLSTRING ) {
+  CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , NodeService , NodeName , NodeKindOfNode , NULLSTRING , SUPERV::ListOfStrings() , isCimpl ) {
 //  MESSAGE( NodeName << " " );
   beginService( "FNode_Impl::FNode_Impl" );
 //  cout << "FNode_Impl::FNode_Impl -->" << endl ;
index 0b9105e4312389276ef744887433ed9add41c2ea..3fd40570c30c4a9b0f84a70e4e55730588780b7a 100644 (file)
@@ -34,6 +34,7 @@ class FNode_Impl : public CNode_Impl ,
     CORBA::ORB_ptr _Orb ;
     PortableServer::POA_ptr _Poa ;
     PortableServer::ObjectId * _ContId ;
+    bool _isCimpl;
 
   public:
     FNode_Impl();
@@ -53,7 +54,8 @@ class FNode_Impl : public CNode_Impl ,
                 const char * NodeComponentName ,
                 const char * NodeInterfaceName ,
                 const char * NodeName = NULLSTRING ,
-                const SUPERV::KindOfNode NodeKindOfNode = SUPERV::FactoryNode ) ;
+                const SUPERV::KindOfNode NodeKindOfNode = SUPERV::FactoryNode ,
+               bool isCimpl = true ) ; // mkr : PAL11273 : C++ implementation by default
     FNode_Impl( CORBA::ORB_ptr orb ,
                PortableServer::POA_ptr poa ,
                PortableServer::ObjectId * contId , 
@@ -75,6 +77,8 @@ class FNode_Impl : public CNode_Impl ,
     virtual GraphBase::FactoryNode * BaseNode() {
             return DataFlowNode()->FactoryNode() ; } ;
 
+    virtual bool IsCimpl() { return _isCimpl; } ; // mkr : PAL11273
+  
 } ;
 
 #endif
index 9be1703f16358377d18d0719da98e2e93e36e8dd..266ec26ca6298dc414a974a77354095a66e0ee2f 100644 (file)
@@ -400,7 +400,8 @@ SUPERV::CNode_ptr Graph_Impl::CNode( const SALOME_ModuleCatalog::Service &NodeSe
 
 SUPERV::FNode_ptr Graph_Impl::FNode( const char * NodeComponentName ,
                                      const char * NodeInterfaceName ,
-                                     const SALOME_ModuleCatalog::Service &NodeService ) {
+                                     const SALOME_ModuleCatalog::Service &NodeService ,
+                                    bool isCimpl ) {
   beginService( "Graph_Impl::FNode" );
   SUPERV::FNode_var iobject = SUPERV::FNode::_nil() ;
   if ( DataFlowEditor()->IsEditing() && !DataFlowEditor()->IsReadOnly() && !IsMacro() ) {
@@ -409,7 +410,10 @@ SUPERV::FNode_ptr Graph_Impl::FNode( const char * NodeComponentName ,
                                           DataFlowEditor() ,
                                           NodeService ,
                                           NodeComponentName ,
-                                          NodeInterfaceName ) ;
+                                          NodeInterfaceName ,
+                                         NULLSTRING ,
+                                         SUPERV::FactoryNode ,
+                                         isCimpl ) ;
     if ( myNode->DataFlowNode() ) {
       PortableServer::ObjectId * id = myNode->getId() ;
       CORBA::Object_var obj = _poa->id_to_reference(*id);
@@ -2178,7 +2182,8 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
         SUPERV::FNode_var aNode = (aGraphNodes->FNodes)[ i ] ;
         SUPERV::FNode_ptr myNode = FNode( aNode->GetComponentName() ,
                                           aNode->GetInterfaceName() ,
-                                          *(aNode->Service()) ) ;
+                                          *(aNode->Service()) ,
+                                         aNode->IsCimpl() ) ; // mkr : PAL11273
         if ( !CORBA::is_nil( myNode ) ) {
           myNode->SetName( aNode->Name() ) ;
           myNode->SetAuthor( aNode->Author() ) ;
index e15f09575789da7207e891cd5ea6ac109cee4259..b8515c7dc18ab6a9ee4fa34c3d35b7892e512918 100644 (file)
@@ -114,7 +114,8 @@ class Graph_Impl : public POA_SUPERV::Graph ,
     virtual SUPERV::FNode_ptr FNode(
                           const char * NodeComponentName ,
                           const char * InterfaceName ,
-                          const SALOME_ModuleCatalog::Service &NodeService ) ;
+                          const SALOME_ModuleCatalog::Service &NodeService ,
+                         bool isCimpl ) ; // mkr : PAL11273 : C++ implementation by default
     virtual SUPERV::INode_ptr INode(
                           const char * FuncName ,
                           const SUPERV::ListOfStrings & PythonFunction ) ;
index 60d11ac02a05168636aba217f95458e9672c3080..f791aa2f5b0b6f23ef66937326e415d862425981 100644 (file)
@@ -465,7 +465,7 @@ bool Port_Impl::IsLinked() {
 //              << anInPort->PortName() << ")" << " ignored" ) ;
     }
     else {
-      RetVal = _DataFlowNode->IsLinked( _DataFlowPort->PortName() ) ;
+      RetVal = _DataFlowNode->IsLinked( _DataFlowPort->PortName(), IsInput() ) ; // mkr : PAL8060
     }
   }
 //  endService( "Port_Impl::IsLinked" ) ;