]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Fix for bug PAL13947 : Improvement of the Container Set-up in Supervision.
authormkr <mkr@opencascade.com>
Thu, 28 Dec 2006 08:10:05 +0000 (08:10 +0000)
committermkr <mkr@opencascade.com>
Thu, 28 Dec 2006 08:10:05 +0000 (08:10 +0000)
13 files changed:
idl/SUPERV.idl
src/GraphBase/DataFlowBase_Base.cxx
src/GraphBase/DataFlowBase_Base.hxx
src/GraphBase/DataFlowBase_Graph.hxx
src/GraphEditor/DataFlowEditor_OutNode.cxx
src/SUPERVGUI/SUPERVGUI_Service.cxx
src/SUPERVGUI/SUPERVGUI_Service.h
src/SUPERVGUI/SUPERV_msg_en.po
src/Supervision/CNode_Impl.cxx
src/Supervision/FNode_Impl.cxx
src/Supervision/Graph_Impl.cxx
src/Supervision/Graph_Impl.hxx
src/Supervision/SuperV_Impl.cxx

index 959ddb7650456f694ee8d30f5893f16cacb6ba3b..a26a9105a517468b5ab074f5605d67226c558345 100644 (file)
@@ -990,7 +990,19 @@ This interface includes a set of methods used for management of the graphs in %S
     /*! Forces use of Editor's data model and destroy of Executor
      */
     void Editing();
-    
+
+    /*! Returns the default name of container for C component
+     */
+    string DefaultCContainerName();
+
+    /*! Returns the default name of container for Python component
+     */
+    string DefaultPythonContainerName();
+
+    /*! Returns the last container name associated with the ComponentName component
+     */
+    string ContainerNameForComponent( in string ComponentName );
+
   } ;
 
 
index 12ca867205ea08691beabff9f54e825c0e5a908f..a21a234d60774341f2ae65be53e9b5bf98c537b4 100644 (file)
@@ -34,6 +34,7 @@ char *SuperVision_Version = "3.0" ;
 char *NULLSTRING = "" ;
 
 char *FACTORYSERVER = "localhost/FactoryServer" ;
+char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
 
 GraphBase::Base::Base() {
   _prof_debug = NULL ;
index 4dd042eef4ed65747d9b2ecb5b71fbd4a6388b7c..b4f75bb087bdeadca2e565e234b4a09de67447d2 100644 (file)
@@ -55,6 +55,7 @@ extern char *SuperVision_Version ;
 extern char *NULLSTRING ;
 
 extern char *FACTORYSERVER ;
+extern char *FACTORYSERVERPY ;
 
 inline char * my_strdup( const char * s ) {
   if (s == NULL) return NULL;
index 0dab620b9021ee3945b5b62f4c298c59424ad123..47e53acf102868a71b702e2b4dfb928eef08685a 100644 (file)
@@ -90,12 +90,14 @@ namespace GraphBase {
 //      int                              _SubStreamGraphsSize ;
 //      vector<vector<ComputingNode *> > _SubStreamGraphs ;
 
-      string _Messages ;
+    string _Messages ;
 
-      bool AddLink( GraphBase::ComputingNode *fromNode ,
-                    GraphBase::OutPort *fromPort ,
-                    GraphBase::ComputingNode *toNode ,
-                    GraphBase::InPort *toPort ) ;
+    map< string, string > _MapOfComponentNameContainer ; // mkr : PAL13947
+    
+    bool AddLink( GraphBase::ComputingNode *fromNode ,
+                 GraphBase::OutPort *fromPort ,
+                 GraphBase::ComputingNode *toNode ,
+                 GraphBase::InPort *toPort ) ;
 
     public:
 
@@ -372,6 +374,28 @@ namespace GraphBase {
                            Engines::Container_var & myContainer ,
                            Engines::Component_var & objComponent ) ;
 
+    // mkr : PAL13947
+    void InsertToMapOfComponentNameContainer( const char * theComponentName, 
+                                             const char * theContainer) {
+      _MapOfComponentNameContainer[ theComponentName ] = theContainer ;
+    }
+
+    // mkr : PAL13947    
+    const char * RetrieveFromMapOfComponentNameContainer( const char * theComponentName ) {
+      if ( _MapOfComponentNameContainer.empty() 
+          ||
+          _MapOfComponentNameContainer.find(theComponentName) == _MapOfComponentNameContainer.end() )
+       return NULL ;
+      
+      return _MapOfComponentNameContainer[ theComponentName ].c_str() ;
+    }
+
+    // mkr : PAL13947
+    void ClearMapOfComponentNameContainer() {
+      if ( !_MapOfComponentNameContainer.empty() )
+       _MapOfComponentNameContainer.clear();
+    }
+
   };
   
 };
index 1a4e2e00db54486f01b86814d3aa59b82bebae9e..cb6736d80083b385c22d06dd1ea61e6ab5a25d5d 100644 (file)
@@ -349,6 +349,10 @@ bool GraphEditor::OutNode::LoadNodes(map< string , int > & aMapOfNodes ,
                         aNode.theAuthor.c_str() , aNode.theContainer.c_str() ,
                         aNode.theComment.c_str() ,
                         aNode.theCoords.theX , aNode.theCoords.theY ) ;
+
+    // insert container into < ComponentName, Container > map for corresponding component
+    Graph()->InsertToMapOfComponentNameContainer( aNode.theComponentName.c_str(), aNode.theContainer.c_str() ) ; // mkr : PAL13947
+
     string * aNodetheName = new string( aNode.theName ) ;
     aMapOfNodes[ *aNodetheName ] = Graph()->GetGraphNodeIndex( anInNode->Name() ) ;
     if ( anInNode->IsOneOfInLineNodes() || anInNode->IsMacroNode() ) {
index 2bdc79a3a1ca7327356732c6530bf12b8beb6b76..10b50937f3c28d2ed54de172885c027835cbe5cf 100644 (file)
@@ -117,6 +117,8 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
   aBaseLayoutV->setSpacing(10);
 
   QHBoxLayout* aBaseLayout = new QHBoxLayout(aCorbaPane); //!!
+  aBaseLayout->setMargin(5);
+  aBaseLayout->setSpacing(10);
  
   components = new QListView(aCorbaPane);
   components->addColumn(tr("COL_COMPONENTS"));
@@ -127,6 +129,7 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
   components->setColumnAlignment(3, AlignLeft);
   components->setSelectionMode(QListView::Extended);
   components->setRootIsDecorated(true);
+
 //  aBaseLayout->addWidget(components);
   aBaseLayoutV->addWidget(components); //!!
 
@@ -137,11 +140,16 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
 //NRI   connect(aComputeCBtn, SIGNAL(clicked()), this, SLOT(addComputeNode())); //!!
 //NRI   aComputeCBtn->setDefault(false); 
 
-  QPushButton* aComputeBtn = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane);
-  connect(aComputeBtn, SIGNAL(clicked()), this, SLOT(addFactoryNode()));
-  aComputeBtn->setDefault(true); 
+  QPushButton* aComputeBtnDef = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane);
+  connect(aComputeBtnDef, SIGNAL(clicked()), this, SLOT(addFactoryNodeDef()));
+  aComputeBtnDef->setDefault(true); 
+
+  QPushButton* aComputeBtnCust = new QPushButton(tr("TIT_ADDFNODE_CUST"), aCorbaPane);
+  connect(aComputeBtnCust, SIGNAL(clicked()), this, SLOT(addFactoryNodeCust()));
+  aComputeBtnCust->setDefault(true); 
 
-  aBaseLayout->addWidget(aComputeBtn);
+  aBaseLayout->addWidget(aComputeBtnDef);
+  aBaseLayout->addWidget(aComputeBtnCust);
   //NRI  aBaseLayout->addWidget(aComputeCBtn); //!!
 
   aBaseLayoutV->insertLayout(-1, aBaseLayout);
@@ -420,7 +428,7 @@ void SUPERVGUI_Service::addComputeNode() {
   }
 }
 
-void SUPERVGUI_Service::addFactoryNode() {
+void SUPERVGUI_Service::addFactoryNodeDef() {
   SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
   CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication());
   if ( !anApp ) return;
@@ -492,6 +500,115 @@ void SUPERVGUI_Service::addFactoryNode() {
   }
 }
 
+void SUPERVGUI_Service::addFactoryNodeCust() {
+  SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
+  CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication());
+  if ( !anApp ) return;
+
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if ( !aSupMod ) {
+    MESSAGE("NULL Supervision module!");
+    return;
+  }
+
+  SUPERVGUI_Main* aMain = aSupMod->getMain();
+  if (aMain==0) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+  } else if (!aMain->isEditable()) {
+    QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));     
+  } else {
+    CORBA::Object_ptr obj  = naming->Resolve("/Kernel/ModulCatalog");
+    SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
+    *aModuleCatalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
+    if (CORBA::is_nil(*aModuleCatalog)) {
+      QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+    } else {
+      QListViewItem*        item;
+      bool                  b = false;
+      
+      QListViewItemIterator iSel(components);
+      int count = 0;
+      for (; iSel.current(); ++iSel) { // check : how many objects are selected (single or multi)
+       item = iSel.current();
+       if (item->isSelected()) count++;
+       if ( count > 1) break;
+      }
+          
+      QListViewItemIterator i(components);
+      QString anAuthor, aContainer, aComment;
+      bool DoneSetting = false;
+      int aRes = 0;
+      for (; i.current(); ++i) {
+       item = i.current();
+       if (item->isSelected()) {
+         const char* service   = item->text(0).latin1();
+         const char* interface = item->parent()->text(0).latin1();
+         //const char* component = anApp->moduleName(item->parent()->parent()->text(0).latin1());
+         // mkr : PAL13135 -->
+         if ( aSupMod->getInterfaceNameMap().contains(item->parent()->parent()->text(0)) ) {
+           const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->parent()->text(0)).data();
+           // mkr : PAL13135 <--
+
+           SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
+           if (myComponent==NULL) {
+             QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+           } 
+           else {
+             const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
+             SUPERV_CNode aNode;
+             if ( myService->TypeOfNode == 0 ) { // ComputeNode
+               aNode = aMain->getDataflow()->CNode(*myService);
+               if (CORBA::is_nil( aNode ) ) {
+                 QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));        
+                 return;
+               }
+             } 
+             else { // Factory Node
+
+               SUPERVGUI_CustomSettings* aCSDialog = 0;
+               if ( count > 1 && !DoneSetting) { // multi selection
+                 DoneSetting = true;
+                 aCSDialog = new SUPERVGUI_CustomSettings(item, true, myComponent->implementation_type());
+               }
+               else if ( count == 1 ) // single selection
+                 aCSDialog = new SUPERVGUI_CustomSettings(item, false, myComponent->implementation_type());
+               
+               if ( aCSDialog ) {
+                 aRes = aCSDialog->exec();
+                 if (aRes) {
+                   anAuthor = aCSDialog->Author();
+                   aContainer = aCSDialog->Container();
+                   aComment = aCSDialog->Comment();
+                 }
+                 delete aCSDialog;
+               }
+               
+               aNode = aMain->getDataflow()->FNode(component, interface, *myService, myComponent->implementation_type()); // mkr : PAL11273
+               if ( CORBA::is_nil( aNode ) ) {
+                 QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));        
+                 return;
+               }
+
+               if (aRes) {
+                 aNode->SetAuthor(anAuthor.latin1());
+                 SUPERV::FNode::_narrow(aNode)->SetContainer(aContainer.latin1());
+                 aNode->SetComment(aComment.latin1());
+               }
+               
+             }
+             SUPERV::INode_var aDummyEndNode;
+             addNode( aNode, aDummyEndNode, myX, myY );
+             b = true;
+           }
+         }
+       }
+      }
+      if ( !b ) {
+       QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
+      }
+    }
+  }
+}
 
 void SUPERVGUI_Service::addInlineNode() {
   SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
@@ -1061,3 +1178,166 @@ void SUPERVGUI_Service::addNode( SUPERV::CNode_var theNode, SUPERV::INode_var th
   }
 }
 
+/*!
+  Constructor
+*/
+SUPERVGUI_CustomSettings::SUPERVGUI_CustomSettings(QListViewItem* theItem,
+                                                  bool isMultiSel,
+                                                  bool isCimpl)
+     : QDialog( SUIT_Session::session()->activeApplication()->desktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) 
+{
+  Trace("SUPERVGUI_CustomSettings::SUPERVGUI_CustomSettings");
+
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if ( !aSupMod ) {
+    MESSAGE("NULL Supervision module!");
+    return;
+  }
+
+  SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
+
+  setSizeGripEnabled( true );
+
+  QGridLayout* TopLayout = new QGridLayout( this );
+  TopLayout->setSpacing( 6 );
+  TopLayout->setMargin( 11 );
+    
+  QGroupBox* TopGroup = new QGroupBox( this, "TopGroup" );
+  TopGroup->setColumnLayout(0, Qt::Vertical );
+  TopGroup->layout()->setSpacing( 0 );
+  TopGroup->layout()->setMargin( 0 );
+  QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() );
+  TopGroupLayout->setAlignment( Qt::AlignTop );
+  TopGroupLayout->setSpacing( 6 );
+  TopGroupLayout->setMargin( 11 );
+
+  QLabel* authL = new QLabel( tr( "AUTHOR_LBL" ), TopGroup); 
+  authV = new QLineEdit( TopGroup );
+  authV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  authV->setMinimumSize( 200, 0 );
+  authV->setText( "" );
+
+  contL = new QLabel( tr( "CONTAINER_LBL" ), TopGroup ); 
+  contV = new QLineEdit( TopGroup );
+  contV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  contV->setMinimumSize( 200, 0 );
+  
+  QLabel* commL = new QLabel( tr( "COMMENT_LBL" ), TopGroup); 
+  commV = new QMultiLineEdit( TopGroup );
+  commV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+  commV->setMinimumSize( 200, 100 );
+
+  if ( !aSupMod->getInterfaceNameMap().contains(theItem->parent()->parent()->text(0)) ) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
+    return;
+  }
+  const char* component = aSupMod->getInterfaceNameMap().find(theItem->parent()->parent()->text(0)).data();
+
+  QString aNodeDefComment;
+  if ( !isMultiSel ) {
+    // 1) set caption
+    const char* service = theItem->text(0).latin1();
+    aNodeDefComment = QString(service) + QString(tr("COMMENT_FROM")) + QString(component);
+    setCaption( tr( "TLT_CUSTOMPARAMETERS_SINGLE" ) + aNodeDefComment );
+  }
+  else {
+    // 1) set caption
+    aNodeDefComment = QString("Factory Node");
+    setCaption( tr( "TLT_CUSTOMPARAMETERS_MULTI" ) );
+  }
+  
+  // 2) set Container
+  SUPERVGUI_Main* aMain = aSupMod->getMain();
+  if (aMain==0) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+    return;
+  }
+  const char* aContainer = aMain->getDataflow()->ContainerNameForComponent(component);
+  if ( aContainer && strlen(aContainer) > 0 )
+    contV->setText( QString(aContainer) );
+  else if ( isCimpl ) // C++ implementation
+    contV->setText( QString(aMain->getDataflow()->DefaultCContainerName()) );
+  else // Python implementation
+    contV->setText( QString(aMain->getDataflow()->DefaultPythonContainerName()) );
+
+  // 3) set comment
+  commV->setText( aNodeDefComment );
+
+  TopGroupLayout->addWidget( authL, 1, 0 );
+  TopGroupLayout->addWidget( authV, 1, 1 );
+  TopGroupLayout->addWidget( contL, 2, 0 );
+  TopGroupLayout->addWidget( contV, 2, 1 );
+  TopGroupLayout->addWidget( commL, 7, 0 );
+  TopGroupLayout->addMultiCellWidget( commV, 7, 8, 1, 1 );
+  TopGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding  ), 8, 0 );
+  TopGroupLayout->setColStretch( 1, 5 );
+
+  QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
+  GroupButtons->setColumnLayout(0, Qt::Vertical );
+  GroupButtons->layout()->setSpacing( 0 );
+  GroupButtons->layout()->setMargin( 0 );
+  QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
+  GroupButtonsLayout->setAlignment( Qt::AlignTop );
+  GroupButtonsLayout->setSpacing( 6 );
+  GroupButtonsLayout->setMargin( 11 );
+
+  QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
+  connect( okB,     SIGNAL( clicked() ), this, SLOT( okButton() ) );
+  QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
+  connect( cancelB, SIGNAL( clicked() ), this, SLOT( koButton() ) );
+
+  GroupButtonsLayout->addWidget( okB, 0, 0 );
+  GroupButtonsLayout->addItem  ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+  GroupButtonsLayout->addWidget( cancelB, 0, 2 );
+
+  TopLayout->addWidget( TopGroup,     0, 0 );
+  TopLayout->addWidget( GroupButtons, 1, 0 );
+  TopLayout->setRowStretch( 0, 1 );
+  TopLayout->setRowStretch( 1, 0 );
+
+  resize(370,200);
+}
+
+/*!
+  Destructor
+*/
+SUPERVGUI_CustomSettings::~SUPERVGUI_CustomSettings() {
+  Trace("SUPERVGUI_CustomSettings::~SUPERVGUI_CustomSettings");
+}
+
+/*!
+  Get author
+*/
+QString SUPERVGUI_CustomSettings::Author() {
+  return authV->text();
+}
+
+/*!
+  Get container
+*/
+QString SUPERVGUI_CustomSettings::Container() {
+  return contV->text();
+}
+
+/*!
+  Get comment
+*/
+QString SUPERVGUI_CustomSettings::Comment() {
+  return commV->text();
+}
+
+/*!
+  <OK> button slot
+*/
+void SUPERVGUI_CustomSettings::okButton() {
+  Trace("SUPERVGUI_CustomSettings::okButton");
+  accept();
+}
+
+/*!
+  <Cancel> button slot
+*/
+void SUPERVGUI_CustomSettings::koButton() {
+  Trace("SUPERVGUI_CustomSettings::koButton");
+  reject();
+}
index 6fb1f56e41f5fe793b50e5e7a2889279eaae4337..f28da4ce52a247935ba6cb6858c0171c16758fa4 100644 (file)
@@ -115,7 +115,8 @@ private:
 private slots:
     void tabChanged(QWidget *);
     void addComputeNode();
-    void addFactoryNode();
+    void addFactoryNodeDef();
+    void addFactoryNodeCust();
     void addInlineNode();
     void addMacroNode();
     void typeNodeSelected(int theRow);
@@ -210,4 +211,28 @@ private:
   SUPERVGUI_PythonEditPane* myNextPane;
 };
 
+class SUPERVGUI_CustomSettings: public QDialog {
+  Q_OBJECT
+
+  public:
+    SUPERVGUI_CustomSettings(QListViewItem* theItem, bool isMultiSel, bool isCimpl);
+    virtual ~SUPERVGUI_CustomSettings();
+
+    QString Author();
+    QString Container();
+    QString Comment();
+
+  private slots:
+    void okButton();
+    void koButton();
+
+  private:
+
+    QLineEdit*      authV;
+    QLineEdit*      contV;
+    QLabel*         contL;
+
+    QMultiLineEdit* commV;
+};
+
 #endif
index 45a1d25d7e2b6558736455e8d5d82cb5ea40a0b4..e4a7523550c0c67b56306e73a01963b30e2a5dc8 100644 (file)
@@ -495,6 +495,12 @@ msgstr "Rename Dataflow"
 msgid "TLT_INFORMATIONS"
 msgstr "Informations"
 
+msgid "TLT_CUSTOMPARAMETERS_SINGLE"
+msgstr "Set Custom Parameters for "
+
+msgid "TLT_CUSTOMPARAMETERS_MULTI"
+msgstr "Set Custom Parameters for a selected nodes"
+
 msgid "TLT_DSGRAPHPARAMS"
 msgstr "Data Stream Graph Parameters"
 
@@ -633,6 +639,9 @@ msgstr "Add Compute Node"
 msgid "TIT_ADDFNODE"
 msgstr "Add Node"
 
+msgid "TIT_ADDFNODE_CUST"
+msgstr "Add Node and Customize Parameters"
+
 msgid "BTN_FACTORYNODE"
 msgstr "Factory"
 
index 3b2addf9c9309fed1bae4bf31df8f7d7eb1419d8..6933b275ed99863ebf8b615a34baf5c6d5c3e579 100644 (file)
@@ -37,8 +37,6 @@ 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 , 
index a7a801aa13fdbc785b13f3494d3e825bc43a0f7f..b136c7faacb079cac747aee5f9f03ae54eb1a6e6 100644 (file)
@@ -64,6 +64,13 @@ FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
 //                                           NodeKindOfNode ) ) ;
   DataFlowNode()->ComponentName( NodeComponentName ) ;
   DataFlowNode()->InterfaceName( NodeInterfaceName ) ;
+
+  // mkr : PAL13947 -->
+  const char * aContainer = DataFlowEditor()->Graph()->RetrieveFromMapOfComponentNameContainer(NodeComponentName);
+  if ( aContainer ) // container for NodeComponentName component was found in the map
+    SetContainer( aContainer );
+  // mkr : PAL13947 <--
+
   endService( "FNode_Impl::FNode_Impl" );  
 //  cout << "<-- FNode_Impl::FNode_Impl" << endl ;
 }
@@ -161,6 +168,10 @@ bool FNode_Impl::SetContainer( const char * aDataFlowContainer ) {
 //  GraphExecutor::DataFlow * _DataFlowExecutor = DataFlowEditor()->Executor() ;
 //  if ( DataFlowEditor()->IsEditing() ) {
     RetVal = DataFlowNode()->Computer( aDataFlowContainer ) ;
+
+    // insert modified container into < ComponentName, Container > map
+    DataFlowEditor()->Graph()->InsertToMapOfComponentNameContainer( GetComponentName(), aDataFlowContainer ) ; // mkr : PAL13947
+
 //  }
 //  else if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() ||
 //            _DataFlowExecutor->IsSuspended( DataFlowNode()->Name() ) ) ) {
index 7564fd6402447b8bda97ee9c3762154e22be09c2..ceaf39c67e34f7ede6f8be8f26635aa2a5918c17 100644 (file)
@@ -2552,3 +2552,27 @@ void Graph_Impl::Editing() {
   }
 }
 
+/**
+ * Returns the default name of container for C component
+ */
+char* Graph_Impl::DefaultCContainerName() {
+  return FACTORYSERVER;
+}
+
+/**
+ * Returns the default name of container for Python component
+ */
+char* Graph_Impl::DefaultPythonContainerName() {
+  return FACTORYSERVERPY;
+}
+
+/*! 
+ * Returns the last container name associated with theComponentName component
+ */ 
+char* Graph_Impl::ContainerNameForComponent( const char * theComponentName ) {
+  const char* aContainer = DataFlowEditor()->Graph()->RetrieveFromMapOfComponentNameContainer(theComponentName);
+  if ( aContainer )
+    return my_strdup(aContainer);
+  else
+    return "";
+}
index 699fee05fb21f7e5b84c0157d640eedbc4973c4b..a6dffe743ae2778111cf75d4205a6fa170c26ec8 100644 (file)
@@ -212,6 +212,10 @@ class Graph_Impl : public POA_SUPERV::Graph ,
     virtual SUPERV::StreamGraph_ptr ToStreamGraph() ;
 
     virtual void Editing(); // Destroy Executor and use only Editor and its data model
+  
+    virtual char* DefaultCContainerName() ;
+    virtual char* DefaultPythonContainerName() ;
+    virtual char* ContainerNameForComponent( const char * theComponentName) ;
 
 private:
     bool run( const bool andSuspend = false ); // Run() calls run( false ), Start() calls run( true );
index 4fd4fd19c15075de335957c7d69f4a0948451e58..510d76c3b5f2b6aa14d5fa66c542497691041722 100644 (file)
@@ -835,6 +835,7 @@ SUPERV::Graph_ptr SuperV_Impl::GraphE(const char * aGraphName ) {
     myGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ;
   }
   myGraph->ReadOnly() ;
+  myGraph->DataFlowEditor()->Graph()->ClearMapOfComponentNameContainer() ; // mkr : PAL13947
   endService( "SuperV_Impl::GraphE" );
   return SUPERV::Graph::_duplicate(iobject) ;
 }
@@ -884,6 +885,7 @@ SUPERV::StreamGraph_ptr SuperV_Impl::StreamGraphE(const char * aGraphName ) {
     myStreamGraph->SetObjRef( SUPERV::StreamGraph::_duplicate( iobject ) ) ;
   }
   myStreamGraph->ReadOnly() ;
+  myStreamGraph->DataFlowEditor()->Graph()->ClearMapOfComponentNameContainer() ; // mkr : PAL13947
   endService( "SuperV_Impl::StreamGraphE" );
   return SUPERV::StreamGraph::_duplicate(iobject) ;
 }