Salome HOME
Merge from OCC_development_generic_2006 mergefrom_OCC_development_generic_2006_07Feb06
authorsmh <smh@opencascade.com>
Tue, 7 Feb 2006 15:13:39 +0000 (15:13 +0000)
committersmh <smh@opencascade.com>
Tue, 7 Feb 2006 15:13:39 +0000 (15:13 +0000)
Preparation of 3.2.0a1

55 files changed:
idl/SUPERV.idl
src/GraphBase/DataFlowBase_ComputingNode.cxx
src/GraphBase/DataFlowBase_ComputingNode.hxx
src/GraphEditor/DataFlowEditor_DataFlow.lxx
src/GraphEditor/DataFlowEditor_InNode.hxx
src/GraphEditor/DataFlowEditor_OutNode.cxx
src/SUPERVGUI/Makefile.in
src/SUPERVGUI/SUPERVGUI.cxx
src/SUPERVGUI/SUPERVGUI_ArrayView.cxx
src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx
src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.h
src/SUPERVGUI/SUPERVGUI_Canvas.cxx
src/SUPERVGUI/SUPERVGUI_Canvas.h
src/SUPERVGUI/SUPERVGUI_CanvasArray.cxx
src/SUPERVGUI/SUPERVGUI_CanvasArray.h
src/SUPERVGUI/SUPERVGUI_CanvasCellNodePrs.h
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.h
src/SUPERVGUI/SUPERVGUI_CanvasControlNodePrs.cxx
src/SUPERVGUI/SUPERVGUI_CanvasControlNodePrs.h
src/SUPERVGUI/SUPERVGUI_CanvasLink.cxx
src/SUPERVGUI/SUPERVGUI_CanvasLink.h
src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasNode.h
src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx
src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.h
src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx
src/SUPERVGUI/SUPERVGUI_CanvasPort.h
src/SUPERVGUI/SUPERVGUI_CanvasView.cxx
src/SUPERVGUI/SUPERVGUI_CanvasView.h
src/SUPERVGUI/SUPERVGUI_Clipboard.cxx
src/SUPERVGUI/SUPERVGUI_Def.h
src/SUPERVGUI/SUPERVGUI_Information.cxx
src/SUPERVGUI/SUPERVGUI_Information.h
src/SUPERVGUI/SUPERVGUI_Library.cxx
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_Main.h
src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx
src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.h
src/SUPERVGUI/SUPERVGUI_Notification.cxx
src/SUPERVGUI/SUPERVGUI_Notification.h
src/SUPERVGUI/SUPERVGUI_Selection.h
src/SUPERVGUI/SUPERVGUI_Service.cxx
src/SUPERVGUI/SUPERVGUI_Service.h
src/SUPERVGUI/SUPERV_images.po
src/SUPERVGUI/SUPERV_msg_en.po
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
src/Supervision/SuperV.py
src/Supervision/batchmode_SuperV.py

index f4502eb5b069f6dfcbb04c33a607cb633c368059..ce99fb0fa9f8c09101e9cd8f2a78f36a60b02b17 100644 (file)
@@ -631,6 +631,11 @@ the component from the container, which will be called for execution of the calc
 \param aContainer Container containing the component.
 */
     boolean SetContainer(in string aContainer ) ;
+/*! Method to define if %FNode gets from a component, which is implemented in C++ or Python.
+  Returns True if it's a C++ component node
+*/
+    boolean IsCimpl() ;
+
   } ;
 /*! \brief %INode class
 
@@ -778,7 +783,8 @@ This interface includes a set of methods used for management of the graphs in %S
     */
     SUPERV::FNode FNode( in string aComponentName ,
                          in string anInterfaceName ,
-                         in SALOME_ModuleCatalog::Service aService ) ;
+                         in SALOME_ModuleCatalog::Service aService ,
+                        in boolean isCimpl ) ;
 
     /*! Creates an InLine Node in a Graph.
     */
index f5203ff30304ec4108b2b318d5520771b533bbf8..d8c606e98892a862e8933e9bec0fffd8acdb9e38 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 ) ;
@@ -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 ;
index 76b84f4aced55eda06128baf51ee642d67858a08..9770303f78f3c833bf45c2e8dcf761dd5305a174 100644 (file)
@@ -183,7 +183,7 @@ namespace GraphBase {
                      const char * ServiceParameterName ,
                      char ** aNode , char ** aPort ) ;
 
-      bool IsLinked(const char * ToServiceParameterName ) ;
+      bool IsLinked(const char * ToServiceParameterName, bool isInput ) ; // mkr : PAL8060
       bool HasInput(const char * ToServiceParameterName ) ;
 
       GraphBase::SNode * GetInfo() ;
index d793893356a2a37d6ac40595f2b95d579c680252..24f63f6f932c1423e893233dab6e184265c81c0f 100644 (file)
@@ -476,7 +476,11 @@ inline bool GraphEditor::DataFlow::IsReadOnly() {
 
 inline long GraphEditor::DataFlow::LevelMax() {
 //  if ( !IsValid( false ) ) {
-  if ( !IsExecutable() ) {
+//  if ( !IsExecutable() ) {
+  // mkr : IPAL9974 -->
+  int SubStreamGraphsNumber = 0 ;
+  if ( !IsValid() || !Graph()->Sort( SubStreamGraphsNumber ) ) {
+  // mkr : IPAL9974 <-- 
     return 0 ;
   }
   return Graph()->LevelMax() ;
@@ -484,7 +488,8 @@ inline long GraphEditor::DataFlow::LevelMax() {
 
 inline SUPERV::ListOfStrings * GraphEditor::DataFlow::LevelNodes(long aLevel ) {
 //  if ( !IsValid( false ) ) {
-  if ( !IsExecutable() ) {
+//  if ( !IsExecutable() ) {
+  if ( !IsValid() ) { // mkr : IPAL9974
     return ((SUPERV::ListOfStrings * ) NULL ) ;
   }
   return Graph()->LevelNodes( aLevel ) ;
@@ -492,7 +497,11 @@ inline SUPERV::ListOfStrings * GraphEditor::DataFlow::LevelNodes(long aLevel ) {
 
 inline long GraphEditor::DataFlow::ThreadsMax() {
 //  if ( !IsValid() ) {
-  if ( !IsExecutable() ) {
+//  if ( !IsExecutable() ) {
+  // mkr : IPAL9974 -->
+  int SubStreamGraphsNumber = 0 ;      
+  if ( !IsValid()  || !Graph()->Sort( SubStreamGraphsNumber ) ) {
+  // mkr : IPAL9974 <--
     return 0 ;
   }
   return Graph()->ThreadsMax() ;
index 0bb2a91154b929c39c3ca92a52fad09a626e4357..9a6bac596034ed4f16535e313e31f06a4bee2ac0 100644 (file)
@@ -222,8 +222,8 @@ namespace GraphEditor {
       void DelOutPort( const char * OutputParameterName ) {
            _ComputingNode->DelOutPort( OutputParameterName ) ; } ;
 
-      bool IsLinked(const char * ToServiceParameterName ) {
-           return _ComputingNode->IsLinked( ToServiceParameterName ) ; } ;
+      bool IsLinked(const char * ToServiceParameterName, bool isInput ) {
+           return _ComputingNode->IsLinked( ToServiceParameterName, isInput ) ; } ; // mkr : PAL8060
       bool HasInput(const char * ToServiceParameterName ) {
            return _ComputingNode->HasInput( ToServiceParameterName ) ; } ;
 
index 5221b4f8f01ffc09eb0b925e8236f1798842bc0d..52d6601074ac71b7ad3b5b52e0a286e7d4f42d1a 100644 (file)
@@ -36,14 +36,11 @@ using namespace std;
 map< string , int > _MapOfGraphNames;
 
 string GraphInstanceName( const char * aGraphName ) {
+  // mkr : PAL8004 -->
+  // For Macro nodes : names of subgraphs must be unique and differ from the main dataflow
+  // name (i.e. the dataflow with MacroLevel = 0).
+  // It is neccessary for reqursive call of LoadDataFlows(...) method for MacroNodes execution.
   int GraphInstanceNumber = _MapOfGraphNames[ aGraphName ] ;
-  if ( GraphInstanceNumber ) {
-    _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
-  }
-  else {
-    GraphInstanceNumber = 0 ;
-    _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
-  }
   string theGraphInstanceName = string( aGraphName ) ;
   if ( GraphInstanceNumber ) {
     theGraphInstanceName += "_" ;
@@ -51,6 +48,10 @@ string GraphInstanceName( const char * aGraphName ) {
     astr << GraphInstanceNumber ;
     theGraphInstanceName += astr.str() ;
   }
+  if ( theGraphInstanceName != string( aGraphName ) )
+    _MapOfGraphNames[ theGraphInstanceName ] = GraphInstanceNumber ;
+  _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
+  // mkr : PAL8004 <--
   return theGraphInstanceName ;
 }
 
index 0655a8779f8bb55ea4d9780c98fcc796ecdcc0a4..465b18d2711934c8e3dd28f09dfecb44da777fb5 100644 (file)
@@ -68,7 +68,7 @@ LIB_SRC = SUPERVGUI.cxx                      \
          SUPERVGUI_Notification.cxx         \
          SUPERVGUI_ManagePortsDlg.cxx       \
          SUPERVGUI_Library.cxx              \
-         SUPERVGUI_Clipboard.cxx
+         SUPERVGUI_Clipboard.cxx              
 
 LIB_MOC = SUPERVGUI.h                        \
          SUPERVGUI_ArrayView.h              \
@@ -86,7 +86,7 @@ LIB_MOC = SUPERVGUI.h                        \
          SUPERVGUI_Notification.h           \
          SUPERVGUI_ManagePortsDlg.h         \
          SUPERVGUI_Library.h                \
-         SUPERVGUI_Clipboard.h
+         SUPERVGUI_Clipboard.h 
 
 LIB_CLIENT_IDL = SALOMEDS.idl                \
                 SALOMEDS_Attributes.idl     \
index 35c14746b24e011c755b6af81a9903c467ada8cf..4f75dfb09c80fcfbc246399f16d9127643861bfb 100644 (file)
 //  Author : Francis KLOSS
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_DataModel.h"
 #include "SUPERVGUI_Selection.h"
 
-
-#include "SALOMEDSClient.hxx"
-#include <boost/shared_ptr.hpp>
-using namespace boost;
-
 #include "CAM_Application.h"
 #include "OB_Browser.h"
 #include "OB_ListItem.h"
@@ -63,6 +57,10 @@ using namespace boost;
 #include <qinputdialog.h>
 #include <qmenubar.h>
 
+#include "SALOMEDSClient.hxx"
+#include <boost/shared_ptr.hpp>
+using namespace boost;
+
 int SUPERVGUI::factory = 0;
 
 extern "C" {
@@ -489,6 +487,8 @@ void SUPERVGUI::displayDataflow() {
     else {
       // second case : get empty initial view frame as new ViewFrame object
       aViewFrame = myInitialViewFrame;
+      // mkr : PAL8237 : remove first "gag" Main from children
+      aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
     }
 
     if( aViewFrame ) {
@@ -678,6 +678,8 @@ bool SUPERVGUI::createDataflow( const NEW_DF_MODE mode, bool theInitialDF ) {
   else {
     // 2. get empty initial view frame as new ViewFrame object
     aViewFrame = myInitialViewFrame;
+    // mkr : PAL8237 : remove first "gag" Main from children
+    aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
   }
 
   if ( aViewFrame ) {
index 08477e5477f5cf04eed7ef11b2bf72a2c168c4d1..772ce27bb6b9921e7fec889c2ffe3eb63edd5dcc 100644 (file)
@@ -6,12 +6,12 @@
 //  Author : 
 //  Module : SUPERV
 
-
-using namespace std;
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_ArrayView.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_CanvasLink.h"
+#include "SUPERVGUI_CanvasPort.h"
 
 #include <qcolordialog.h>
 
@@ -192,25 +192,63 @@ void SUPERVGUI_ToolTip::maybeTip(const QPoint& theP) {
   // compute collision rectangle
   QRect aSel(theP.x()-MARGIN, theP.y()-MARGIN, 1+2*MARGIN, 1+2*MARGIN);
 
-  QCanvasItemList l = ((SUPERVGUI_ArrayView*)parentWidget())->canvas()->collisions(aSel);
+  QCanvasItemList l = ((QCanvasView*)parentWidget())->canvas()->collisions(aSel);
   for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+    // tooltip for node
     if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node) {
-      SUPERVGUI_CanvasCellNodePrs* aNodePrs = (SUPERVGUI_CanvasCellNodePrs*) (*it);
+      SUPERVGUI_CanvasNodePrs* aNodePrs = (SUPERVGUI_CanvasNodePrs*) (*it);
       QObject* anObj = aNodePrs->getObject(theP);
-      if (anObj->inherits("SUPERVGUI_CanvasCellNode")) {
+      if (anObj->inherits("SUPERVGUI_CanvasNode")) {
        
        QRect aTitleRect = aNodePrs->getTitleRect();
+       QRect aLabelRect = aNodePrs->getLabelRect();
+       QRect aStatusRect = aNodePrs->getStatusRect();
+
+       if (aTitleRect.bottom()+1 == aLabelRect.top() &&
+           aLabelRect.bottom()+1 == aStatusRect.top()) {
+         QRect aTipRect(aTitleRect.left(), aTitleRect.top(), aTitleRect.width(),
+                        aTitleRect.height() + aLabelRect.height() + aStatusRect.height());
+         tip(aTipRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
+         return;
+       }
+
        if (aTitleRect.contains(theP, true)) {
-         tip(aTitleRect, ((SUPERVGUI_CanvasCellNode*)anObj)->getEngine()->Name());
+         tip(aTitleRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
          return;
        }
 
-       QRect aLabelRect = aNodePrs->getLabelRect();
        if (aLabelRect.contains(theP, true)) {
-         tip(aLabelRect, ((SUPERVGUI_CanvasCellNode*)anObj)->getLabelText());
+         tip(aLabelRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
          return;
        }
+
+       if (aStatusRect.contains(theP, true)) {
+         tip(aStatusRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
+         return;
+       }
+       
       }
+      // tooltip for nodes' port
+      if (anObj->inherits("SUPERVGUI_CanvasPort")) {
+       SUPERVGUI_CanvasPort* aPort = (SUPERVGUI_CanvasPort*)anObj;
+       tip(aPort->getPrs()->getPortRect(), 
+           aPort->getEngine()->Type() + QString(" ") + aPort->getPrs()->getText());
+       return;
+      }
+    }
+    // tootip for links' point
+    if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkPoint) {
+       SUPERVGUI_CanvasPointPrs* aPrs = (SUPERVGUI_CanvasPointPrs*) (*it);
+       if (aPrs->getLink()->getMain()->getViewType() == CANVAS)
+         tip(aSel, aPrs->getLink()->getToolTipText());
+       return;
+    }
+    // tooltip for links' edge
+    if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkEdge) {
+       SUPERVGUI_CanvasEdgePrs* aPrs = (SUPERVGUI_CanvasEdgePrs*) (*it);
+       if (aPrs->getLink()->getMain()->getViewType() == CANVAS)
+         tip(aSel, aPrs->getLink()->getToolTipText());
+       return;
     }
   }
 }
index 334b7c3413510e01279c7fe68df157f9cabf7bec..54cf5fa61d8bdafcbbb7e45159759d2cbf1adbfb 100644 (file)
@@ -8,13 +8,9 @@
 //  Author : Vitaly SMETANNIKOV
 //  Module : SUPERV
 
-using namespace std;
-
 #include "SALOMEDSClient.hxx"
 #include "SALOMEDS_SObject.hxx"
 #include "SALOMEDS_Study.hxx"
-#include <boost/shared_ptr.hpp>
-using namespace boost;
 
 #include "SalomeApp_Application.h"
 #include "LightApp_SelectionMgr.h"
@@ -36,6 +32,9 @@ using namespace boost;
 #include <qgroupbox.h>
 #include <qvalidator.h>
 
+#include <boost/shared_ptr.hpp>
+using namespace boost;
+
 /**
  * Constructor
  */
@@ -216,7 +215,8 @@ SUPERVGUI_BrowseNodeDlg::~SUPERVGUI_BrowseNodeDlg() {
 void SUPERVGUI_BrowseNodeDlg::setValues() {
   SUPERVGUI_PortField* aField;
   for ( aField = myPortsList.first(); aField; aField = myPortsList.next() ) {
-    aField->updateGUI();
+    if ( aField->getData().isEmpty() || aField->getData().isNull() ) // mkr : PAL11406
+      aField->updateGUI();
   }
 }
 
index 19563ce5a758c077b4895c822bbd7b61321a32cc..b22fda2fbf7ca0c3769826142cbd2650cf857ae7 100644 (file)
@@ -29,8 +29,9 @@ public:
 
   bool isEditable () { return myIsEditable; }
 
-  void setData( const QString& data ) { myValue->setText( data ); myValue->home( false ); }
-  void updateGUI()   { myValue->setText( myPort->ToString() ); }
+  QString getData() const { return myValue->text(); } // mkr : PAL11406
+  void    setData( const QString& data ) { myValue->setText( data ); myValue->home( false ); }
+  void    updateGUI()   { myValue->setText( myPort->ToString() ); }
 
   bool setNewValue();
   
index 776849d0db5c10190448fa418f7d3d5c371554e1..56e41fd341518939ffc65407c5c10714d8552666 100644 (file)
@@ -6,7 +6,6 @@
 //  Author : Natalia KOPNOVA
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_Main.h"
index 32c01aab1aac35c4313eeed1b1704ba66e5781fa..f9f523ce67822e311c03434743a195d9a6f5c803 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_Canvas_H
 #define SUPERVGUI_Canvas_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include <qcanvas.h>
 
index 19d07d227521aa716a8a2df355a4b9ed07116bfe..07e07cec5ddda7da56c103de04142bab7526808b 100644 (file)
@@ -6,7 +6,6 @@
 //  Author : 
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_CanvasArray.h"
 #include "SUPERVGUI_Main.h"
@@ -148,9 +147,7 @@ bool SUPERVGUI_CanvasArray::create() {
   int             x, y;
  
   int             nligs = myMain->getDataflow()->LevelMax();
-  cout<<"-> myMain->getDataflow()->LevelMax() = "<<myMain->getDataflow()->LevelMax()<<endl;
   int             ncols = myMain->getDataflow()->ThreadsMax();
-  cout<<"-> myMain->getDataflow()->ThreadsMax() = "<<myMain->getDataflow()->ThreadsMax()<<endl;
   
   // there is no any calculations
   if (ncols == 0) return false;
index 98449da959e898e295497c1d8a00b225319770dc..88bb2d72ea6ebd3510d35f50ed4a2bad523fbf9b 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_CanvasArray_H
 #define SUPERVGUI_CanvasArray_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_CanvasControlNode.h"
 
index b3dd459ae95fb24ee6f6a1274aaea304cd2903c5..c34f0ed6dcc07be4f5dd02bc1dad3db48a49964f 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_CanvasCellNodePrs_H
 #define SUPERVGUI_CanvasCellNodePrs_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_CanvasNodePrs.h"
 #include "SUPERVGUI_CanvasControlNode.h"
index 8e505cc5c1154e06aa46c2313f95bda29ee77e0f..0ceb073303d8f915604b223db8d7b9edd2f6e754 100644 (file)
@@ -6,7 +6,6 @@
 //  Author : Natalia KOPNOVA
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI_CanvasControlNode.h"
 #include "SUPERVGUI_CanvasControlNodePrs.h"
 #include "SUPERVGUI_CanvasCellNodePrs.h"
index fb5a50e78b015f8592504c8b8f547e0dc8c0543e..cd43afae635a588f554f1458b5e3cfffa2c829ad 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_CanvasControlNode_H
 #define SUPERVGUI_CanvasControlNode_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_CanvasNode.h"
 #include <qdialog.h>
index c8b00f631142adfbb949f53a738616c5cf68ef4a..f51649b9139fbe7406636e5ce75535a874d7484c 100644 (file)
@@ -6,8 +6,6 @@
 //  Author : Natalia KOPNOVA
 //  Module : SUPERV
 
-
-using namespace std;
 #include "SUPERVGUI_CanvasControlNodePrs.h"
 #include "SUPERVGUI_CanvasControlNode.h"
 #include "SUPERVGUI_Canvas.h"
index 536833dfd2fe300948eeb48532bcddadf68ccb5d..5b0bb9712825ceb1be29d067c4f2d951753b3747 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_CanvasControlNodePrs_H
 #define SUPERVGUI_CanvasControlNodePrs_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_CanvasNodePrs.h"
 
index 955d3b89698ce8f31daf577d3e557866e4610c7a..a58cbb5458bbad5f78a65a9917650c3045305c0d 100644 (file)
@@ -6,7 +6,6 @@
 //  Author : Natalia KOPNOVA
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI_CanvasLink.h"
 #include "SUPERVGUI_Canvas.h"
 #include "SUPERVGUI_CanvasPort.h"
@@ -52,6 +51,9 @@ SUPERVGUI_CanvasLink::SUPERVGUI_CanvasLink(QObject* theParent, SUPERVGUI_Main* t
     else
       myColor = DRAW_COLOR;
   }
+
+  // mkr : PAL8237
+  connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
 }
 
 SUPERVGUI_CanvasLink::~SUPERVGUI_CanvasLink()
@@ -231,7 +233,10 @@ void SUPERVGUI_CanvasLink::remove() {
       }
     }
     myLink->destroy();
+
+    emit objectCreatedDeleted(); // mkr : PAL8237
   }
+
   delete this;
   if (aPort && !aValue.isEmpty() && myMain->getDataflow()->GraphLevel() == 0) {
     aPort->setValue(aValue);
@@ -254,8 +259,10 @@ void SUPERVGUI_CanvasLink::addPoint() {
       anIndex = aPoint->getIndex()+1;
       if (anIndex < 1) anIndex = 1;
     }
-    if (myLink && !SUPERV_isNull(myLink)) 
+    if (myLink && !SUPERV_isNull(myLink)) {
       myLink->AddCoord(anIndex, mySelectedPoint.x(), mySelectedPoint.y());
+      emit objectCreatedDeleted(); // mkr : PAL8237
+    }
     merge();
     myMain->getCanvas()->update();
   }
@@ -264,13 +271,25 @@ void SUPERVGUI_CanvasLink::addPoint() {
 void SUPERVGUI_CanvasLink::removePoint() {
   if (mySelectedItem && mySelectedItem->rtti() == SUPERVGUI_Canvas::Rtti_LinkPoint) {
     SUPERVGUI_CanvasPointPrs* aPoint = (SUPERVGUI_CanvasPointPrs*) mySelectedItem;
-    if (myLink && !SUPERV_isNull(myLink)) 
+    if (myLink && !SUPERV_isNull(myLink)) {
       myLink->RemoveCoord(aPoint->getIndex());
+      emit objectCreatedDeleted(); // mkr : PAL8237
+    }
     merge();
     myMain->getCanvas()->update();
   }
 }
 
+QString SUPERVGUI_CanvasLink::getToolTipText() const {
+  QString aTTT;
+  if (myInputPort && myOutputPort)
+    aTTT = myOutputPort->getEngine()->Node()->Name() + QString(" : ") + 
+      myOutputPort->getEngine()->Name() + QString(" => ") +
+      myInputPort->getEngine()->Node()->Name() + QString(" : ") + 
+      myInputPort->getEngine()->Name();
+  return aTTT;
+}
+
 /*
 //===============================================================================
 //  SUPERVGUI_CanvasStreamLink: new link to be created
index 3865950d8cf953d8cf54e37b7dd40f3588334239..f9592afda818ffd4aee735b822f74522f54eaadb 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_CanvasLink_H
 #define SUPERVGUI_CanvasLink_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include <qcanvas.h>
 #include <qvaluevector.h>
@@ -42,6 +41,11 @@ class SUPERVGUI_CanvasLink : public QObject {
     void setSelectedObject(QCanvasItem* theItem, const QPoint& thePoint);
     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
 
+    QString getToolTipText() const;
+
+  signals:
+    void objectCreatedDeleted(); // mkr : PAL8237
+
   public slots:
     virtual void remove();
     void addPoint();
index 66bf49ba35e653b345c7e5f1d360c0c3d89f450c..cd3a9550bc30c42b221f7c45cc84ff3172342fb0 100644 (file)
@@ -6,7 +6,6 @@
 //  Author : Natalia KOPNOVA
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI_CanvasNode.h"
 #include "SUPERVGUI_CanvasNodePrs.h"
 #include "SUPERVGUI_CanvasPort.h"
@@ -77,6 +76,10 @@ SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode( SUIT_ResourceMgr* mgr, QObject* theP
   }
 
   isIgnore = false;
+
+  // mkr : PAL8237
+  connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
+  emit objectCreatedDeleted();
 }
 
 SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode()
@@ -105,6 +108,14 @@ SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasNode::getPrs()
 
 SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasNode::createPrs() const
 {
+  //
+  //SUPERVGUI_PrsNode* glNode = new SUPERVGUI_PrsNode( (SUPERVGUI_CanvasNode*)this );
+  //glNode->setFirstPoint( new GLViewer_Pnt( 10, 10 ) );
+  //glNode->compute();
+  //glNode->update();
+  //getGLContext()->insertObject( glNode, true /*false*/ );
+  //
+  
   return new SUPERVGUI_CanvasNodePrs( myMgr, myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
 }
 
@@ -119,6 +130,8 @@ void SUPERVGUI_CanvasNode::createPort(SUPERV::Port_ptr thePort)
   if (aPort) {
     connect(aPort, SIGNAL(destroyed(QObject*)), this, SLOT(onDestroyed(QObject*)));
     if (!isIgnore) getPrs()->updatePorts();
+    
+    emit objectCreatedDeleted(); // mkr : PAL8237
   }
 }
 
@@ -386,6 +399,9 @@ void SUPERVGUI_CanvasNode::remove() {
   SUPERVGUI_Canvas* aCanvas = myMain->getCanvas();
   setDestroyed();
   myNode->destroy();
+
+  emit objectCreatedDeleted(); // mkr : PAL8237
+  
   delete this;
   aCanvas->update();
 }
@@ -681,3 +697,12 @@ void SUPERVGUI_CanvasNode::exportToLib() {
   else
     SUIT_MessageBox::error1( SUIT_Session::session()->activeApplication()->desktop(), tr( "ERROR" ), tr( "MSG_BAD_INODE" ), tr( "OK" ) );
 }
+
+QString SUPERVGUI_CanvasNode::getToolTipText() const {
+  if ( myNode->IsFactory() )
+    return QString("Name : ") + SUPERV::FNode::_narrow(myNode)->Name() +
+      QString("\nContainer : ") + SUPERV::FNode::_narrow(myNode)->GetContainer() +
+      QString("\nComponentName : ") + SUPERV::FNode::_narrow(myNode)->GetComponentName() +
+      QString("\nInterfaceName : ") + SUPERV::FNode::_narrow(myNode)->GetInterfaceName();
+  return QString("Name : ") + myNode->Name() + '\n' + getLabelText();
+}
index 0be086ddd806ba398cf1cf975615d046ce000ca5..d34a65490f0a2ef961fb90fdc89cc1cc5143a3f3 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_CanvasNode_H
 #define SUPERVGUI_CanvasNode_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_BrowseNodeDlg.h"
 #include <qstringlist.h>
@@ -72,6 +71,11 @@ class SUPERVGUI_CanvasNode : public QObject {
 
     QString getLabelText() const { return myLabelText; }
 
+    virtual QString getToolTipText() const;
+
+  signals:
+    void objectCreatedDeleted(); // mkr : PAL8237
+
   public slots:
     void suspendResume();
     void kill();
@@ -101,7 +105,7 @@ class SUPERVGUI_CanvasNode : public QObject {
     virtual void pastePort();
     void managePorts();
     void exportToLib();
-
+  
   protected:
     // redefined by most of CanvasNode successors
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
index d82abd2a81bec413dc67b51a4faebf7120ff500c..6f03a189458a5976921bb8d9cd096999c77a616f 100644 (file)
@@ -6,12 +6,12 @@
 //  Author : Natalia KOPNOVA
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI_CanvasNodePrs.h"
 #include "SUPERVGUI_CanvasNode.h"
 #include "SUPERVGUI_CanvasPort.h"
 #include "SUPERVGUI_Canvas.h"
 #include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_Main.h"
 
 #include "SUIT_ResourceMgr.h"
 
@@ -21,7 +21,7 @@ using namespace std;
 #include <sys/timeb.h>
 #endif
 
-#define PORT_MARGIN 2
+//#define PORT_MARGIN 2
 #undef PORT_HEIGHT // to avoid warning message
 #define PORT_HEIGHT LABEL_HEIGHT
 #define TEXT_MARGIN 5
@@ -561,7 +561,8 @@ void SUPERVGUI_CanvasNodePrs::draw(QPainter& thePainter)
 {
   thePainter.setPen(pen());
   thePainter.setBrush(nodeColor());
-  drawShape(thePainter);
+  if ( !CORBA::is_nil( myNode->getMain()->getDataflow()->Node( myNode->name() ) ) ) // mkr : IPAL11360
+    drawShape(thePainter);
 }
 
 void SUPERVGUI_CanvasNodePrs::drawShape(QPainter& thePainter) 
@@ -671,7 +672,12 @@ void SUPERVGUI_CanvasNodePrs::drawPort(QPainter& thePainter)
       ++it;
       if (obj->inherits("SUPERVGUI_CanvasPort")) {
        aPort = (SUPERVGUI_CanvasPort*) obj;
-       if (!aPort->getEngine()->IsGate()) {
+
+       SUPERV_Port aPortEng = aPort->getEngine();
+       //      if ( CORBA::is_nil( aPortEng ) )
+       //        printf ( "---\n port engine IS NIL ---\n\n" );
+
+       if ( !CORBA::is_nil( aPortEng ) && !aPortEng->IsGate() ) {
          aPort->getPrs()->draw(thePainter);
        }
       }
@@ -878,9 +884,13 @@ bool SUPERVGUI_CanvasPortPrs::isAlert() const
 QString SUPERVGUI_CanvasPortPrs::getText() const
 {
   SUPERV_Port aPort = myPort->getEngine();
-  QString aText = aPort->Name();
-  if (aPort->IsParam() || aPort->IsInLine() || myPort->isStream())
-    aText = aText + "=" + aPort->ToString();
+  QString aText;
+  if ( !CORBA::is_nil( aPort ) ) {
+    aText = aPort->Name();
+    if (aPort->IsParam() || aPort->IsInLine() || myPort->isStream())
+      aText = aText + "=" + aPort->ToString();
+  }
+  //  printf( "--- return text of port : %s ---\n", aText.latin1() );
   return aText;
 }
 
index b59bd154e3cd8f48fd4636ad13f9208adc71a95f..dabf8cbedb503454f0084ef50548efcfd1be9cd7 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_CanvasNodePrs_H
 #define SUPERVGUI_CanvasNodePrs_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 
 #include <qcanvas.h>
index 8274ca96bc9b49a57c437f9c0e7e68e8bf3768d8..2b8b0f51add8e481827c7cc3b0601cd3c4e080d5 100644 (file)
@@ -6,7 +6,6 @@
 //  Author : Natalia KOPNOVA
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI_CanvasPort.h"
 #include "SUPERVGUI_CanvasNode.h"
 #include "SUPERVGUI_CanvasLink.h"
@@ -29,6 +28,9 @@ SUPERVGUI_CanvasPort::SUPERVGUI_CanvasPort(QObject* theParent, SUPERVGUI_Main* t
 
   // setName(myPort->Name());
   setName(myMain->getCanvas()->getPortName(thePort));
+
+  // mkr : PAL8237
+  connect(this, SIGNAL(objectDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
 }
 
 SUPERVGUI_CanvasPort::~SUPERVGUI_CanvasPort()
@@ -138,6 +140,9 @@ void SUPERVGUI_CanvasPort::remove() {
 
   Trace("SUPERVGUI_CanvasPort::remove");
   myPort->destroy();
+  
+  emit objectDeleted(); // mkr : PAL8237
+
   delete this;
 }
 
index 0d964ed9b9fadfcf3d347c54339b9641e7cf8b3f..6ed5f5dc0af3a246654e4f914fe0b4a83453858c 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SUPERVGUI_CanvasPort_H
 #define SUPERVGUI_CanvasPort_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 
 
@@ -42,6 +41,9 @@ class SUPERVGUI_CanvasPort : public QObject {
     void removeLink(SUPERVGUI_CanvasLink* theLink);
     void updateLinks();
 
+  signals:
+    void objectDeleted(); // mkr : PAL8237
+
   public slots:
     void sketchLink();
     virtual void remove();
index c33671658d7ee0419d38d0ac5c85d2243ea95aca..f2b54a7bb360728b6d53d5c3303afd59ec2b1aef 100644 (file)
@@ -8,8 +8,6 @@
 //  Author : Natalia KOPNOVA
 //  Module : SUPERV
 
-using namespace std;
-
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_CanvasView.h"
 #include "SUPERVGUI_Main.h"
@@ -19,6 +17,8 @@ using namespace std;
 #include "SUPERVGUI_CanvasNodePrs.h"
 #include "SUPERVGUI_Clipboard.h"
 
+#include "SUPERVGUI_ArrayView.h" //for tooltip testing
+
 #include "SUIT_MessageBox.h"
 
 #include <qpixmap.h>
@@ -160,6 +160,9 @@ SUPERVGUI_CanvasView::SUPERVGUI_CanvasView(SUPERVGUI_Canvas* theCanvas, SUPERVGU
     myPopup->insertSeparator();
     myShowToolBarItem = myPopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), myMain, SLOT( onShowToolbar() ) );
   }
+
+  // mkr : PAL8237
+  connect(this, SIGNAL(objectCreated()), myMain, SLOT(onObjectCreatedDeleted()));
 }
  
 
@@ -439,6 +442,10 @@ void SUPERVGUI_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
     setHilighted(0);
   }
 
+  // QToolTip for title and label for SUPERVGUI_CanvasNode
+  SUPERVGUI_ToolTip* aTT = new SUPERVGUI_ToolTip(this);
+  aTT->maybeTip(p);
+
   busy = false;
 }
 
@@ -677,6 +684,8 @@ void SUPERVGUI_CanvasView::endSketch(SUPERVGUI_CanvasPort* thePort)
     SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(canvas(), myMain, aLinkEngine);
     aLink->show();
 
+    emit objectCreated(); // mkr : PAL8237
+
     canvas()->update();
     myIsLinkCreating = false;
 
index feda50168b02caa0a792882d6c5e5b13fb81c06d..082a6c7f4e4b262ced20870a2fdeffabbd512d91 100644 (file)
@@ -37,6 +37,9 @@ class SUPERVGUI_CanvasView: public QCanvasView {
     bool isAnyLinkCreating() const { return myIsLinkCreating; }
     void startSketch(SUPERVGUI_CanvasPort* thePort);
 
+  signals:
+    void objectCreated(); // mkr : PAL8237
+
   public slots:
     void addToStudy();
     void onTimeout();
index fab39c44289777637a3fc794a7e9b8a44e536d08..bffc222096e147401b5174202b2c4836febde40b 100644 (file)
@@ -158,8 +158,9 @@ void SUPERVGUI_Clipboard::pasteNode() {
     case SUPERV::FactoryNode : 
       {
        SUPERV::FNode_var aFNode = dataflow->FNode( SUPERV::FNode::_narrow(aNode)->GetComponentName(),
-                                              SUPERV::FNode::_narrow(aNode)->GetInterfaceName(),
-                                              *SUPERV::FNode::_narrow(aNode)->Service() );
+                                                   SUPERV::FNode::_narrow(aNode)->GetInterfaceName(),
+                                                   *SUPERV::FNode::_narrow(aNode)->Service(),
+                                                   SUPERV::FNode::_narrow(aNode)->IsCimpl()); // mkr : PAL11273
        if (CORBA::is_nil(aFNode)) {
          QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
          return;
index 1abc0b8ffaf8389f36d05fc38cd3bd015c32af6b..a78b457d811cb4270a5cfaeb4c7c1bb2d9666da7 100644 (file)
@@ -79,7 +79,8 @@ NODE_Editing   "",          NODE_RED, NODE_GREEN, NODE_BLUE, true,  false,  true
 // -----
 
 #define PORT_WIDTH  75
-#define PORT_HEIGHT 28
+#define PORT_HEIGHT 20
+#define PORT_MARGIN 2
 
 // Taille des points carres constituant les lignes entre les noeuds
 // ----------------------------------------------------------------
index 2fda73acfdd1f2e003a8c8517585373d3ee9ac6a..d7474486e0e938f8e12743c4b3d7ced4deda63f7 100644 (file)
@@ -25,7 +25,6 @@
 //  Author : Francis KLOSS
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI_Information.h"
 
 #include "CAM_Application.h"
index 115b822f3b796a76198e2d05b48068e079f382fe..97e5ec1956662b21c04840f54136d7f6d545115b 100644 (file)
@@ -25,7 +25,6 @@
 //  Author : Francis KLOSS
 //  Module : SUPERV
 
-using namespace std;
 #ifndef SUPERVGUI_Information_H
 #define SUPERVGUI_Information_H
 
index 4af1b37b8e2a09ded89effeb1437cd38e240d44d..044f5de08f9d9ff0c70b4fd7cd8539c427058854 100644 (file)
@@ -101,8 +101,33 @@ bool SUPERVGUI_Library::createLibFile() const {
       return true;
     }
     else {
-      SUIT_MessageBox::error1( (QWidget*)(SUIT_Session::session()->activeApplication()->desktop()), tr( "ERROR" ), tr( "MSG_ERROR_LIB1" ), tr( "OK" ) );
-      return false; // error opening library file for writing
+      // mkr : PAL8557
+      QString aFullPath = GetLibraryFileName();
+      QString aDir = aFullPath.left( aFullPath.findRev('/')+1 );
+      const int toCreateDir = SUIT_MessageBox::warn2( (QWidget*)(SUIT_Session::session()->activeApplication()->desktop()), tr( "ERROR" ), 
+                                                     tr( "MSG_ERROR_LIB_DIR_NOT_EXIST_RECREATE" ).arg(aDir), tr( "BUT_YES" ), tr( "BUT_NO" ), 1, 0, 0 );
+      if ( toCreateDir ) { // user selected to create a new ./salome subdirectory in HOME directory
+       
+       // create directory
+       QString aCommand = QString("mkdir ") + aDir;
+       int status = system( aCommand.latin1() );
+       
+       if ( status == -1 || status == 217 ) {
+         SUIT_MessageBox::error1( (QWidget*)(SUIT_Session::session()->activeApplication()->desktop()), tr( "ERROR" ), tr( "MSG_ERROR_LIB_RECREATE_DIR" ).arg(aDir), tr( "OK" ) );
+         return false;
+       }
+       
+       // create XML file
+       libFile.open( IO_WriteOnly | IO_Truncate );
+        QDomDocument doc( DOCTYPE ); // create a simple XML stub
+        doc.appendChild( doc.createElement( ROOT_ELEMENT ) ); // IMPORTANT: do not delete this root element
+        QTextStream stream( &libFile );
+        doc.save( stream, 0 );
+        libFile.close();
+        return true;
+      }
+      else // user chose not to create a new ./salome subdirectory in HOME directory
+       return false;
     }
   }
   catch ( ... ) {
@@ -163,6 +188,11 @@ bool SUPERVGUI_Library::Export( SUPERV::INode_var theNode ) const {
                                                      tr( "MSG_ERROR_LIB_IS_RECREATE" ), tr( "BUT_YES" ), tr( "BUT_NO" ), 1, 0, 0 );
       if ( toRecreate ) { // user selected to recreate a bad XML file
        libFile.close(); // in case it was opened by doc.setContent()
+       
+       // remove old bad file
+       QString aCommand = QString("rm -f ") + libFile.name();
+       system( aCommand.latin1() );
+
        if ( !createLibFile() )
          return false; // error opening library file for writing.  MB was already displayed
        
index 3ffa305d5aaac52c2840d305c031f60401e78c64..49c4b88b015ebfed807232726cb5355c68aadbac 100644 (file)
 //  Author : Francis KLOSS
 //  Module : SUPERV
 
-using namespace std;
-
 #include "SALOMEDSClient.hxx"
 #include "SALOMEDS_Study.hxx"
 #include "SALOMEDS_SObject.hxx"
-#include <boost/shared_ptr.hpp>
-using namespace boost;
 
 #include "NOTIFICATION.hxx"
 #include "SALOME_Event.hxx"
 #include "SUPERVGraph_ViewFrame.h"
+#include "SUPERVGraph_ViewModel.h"
 
 #include "LogWindow.h"
 #include "OB_Browser.h"
@@ -65,7 +62,11 @@ using namespace boost;
 #include <qlineedit.h>
 #include <qcombobox.h>
 
-SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, SUIT_Desktop* theDesktop, SUPERV_Graph theDataFlow )
+#include <boost/shared_ptr.hpp>
+using namespace boost;
+
+SUPERVGUI_Main::SUPERVGUI_Main( SUPERVGraph_ViewFrame* theParent, 
+                               SUIT_Desktop* theDesktop, SUPERV_Graph theDataFlow )
      : SUPERVGraph_View(theParent),
        myLogged( false ),
        myFiltered( false ),
@@ -75,10 +76,11 @@ SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, SUIT_Desktop* t
        myStep( false ),
        myTrace( false ),
        myVerbose( false )
-     //myExecuted( false )
+  //myExecuted( false )
 {
   Trace("SUPERVGUI_Main::SUPERVGUI_Main (copy)");
-  theParent->setViewWidget(this);  
+  setFocusPolicy( StrongFocus );  // mkr : IPAL11388
+  theParent->setViewWidget(this);
   dataflow = theDataFlow;
   if (SUPERV_isNull(dataflow)) {
     QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_COPY"));
@@ -86,6 +88,8 @@ SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, SUIT_Desktop* t
   } else {
     init(theDesktop);
   }
+  // mkr : IPAL11362
+  connect(this, SIGNAL(EventToSync()), this, SLOT(onObjectCreatedDeleted()));
 }
 
 void SUPERVGUI_Main::init(SUIT_Desktop* theDesktop) {
@@ -271,13 +275,17 @@ void SUPERVGUI_Main::syncAsync() {
 void SUPERVGUI_Main::execute( char *  theNodeName, SUPERV::GraphState theNodeState ) {
   if (myCurrentView == CANVAS || myCurrentView == CONTROLFLOW) {
     SUPERVGUI_CanvasNode* aNode = (SUPERVGUI_CanvasNode*) myCanvas->child(theNodeName, "SUPERVGUI_CanvasNode");
-    if ( aNode )
+    if ( aNode ) {
       aNode->sync();
+      emit EventToSync(); // mkr : IPAL11362
+    }
   }
   else if (myCurrentView == CANVASTABLE) {
     SUPERVGUI_CanvasCellNode* aNode = (SUPERVGUI_CanvasCellNode*) myArray->child(theNodeName, "SUPERVGUI_CanvasCellNode");
-    if (aNode) 
+    if (aNode) {
       aNode->sync();
+      emit EventToSync(); // mkr : IPAL11362
+    }
   }
 
   // asv : 26.01.05 : Bug PAL7164 : puting out-value to study if the "put_to_Study" flag is set on a 
@@ -556,6 +564,33 @@ void SUPERVGUI_Main::onShowToolbar()
     aVF->getToolBar()->show();
 }
 
+// mkr : PAL8237 : synchronize many views of the same dataflow (objects creation/deletion)
+void SUPERVGUI_Main::onObjectCreatedDeleted()
+{
+  if ( study ) {
+    if ( STD_Application* app = dynamic_cast<STD_Application*>( study->application() ) ) {
+      ViewManagerList aVMList;
+      app->viewManagers( SUPERVGraph_Viewer::Type(), aVMList );
+      SUIT_ViewManager* aVM;
+      for ( aVM = aVMList.first(); aVM; aVM = aVMList.next() ) {
+       QPtrVector<SUIT_ViewWindow> aVWList = aVM->getViews();
+       for ( int i = 0; i < aVWList.count(); i++ ) {
+         SUPERVGraph_ViewFrame* aVW = dynamic_cast<SUPERVGraph_ViewFrame*>( aVWList[i] );
+         QObjectList* aMainList = aVW->queryList("SUPERVGUI_Main");
+         if ( aMainList->count() == 1 ) {
+           SUPERVGUI_Main* aMain = dynamic_cast<SUPERVGUI_Main*>( aMainList->first() );
+           if ( aMain )
+             if ( !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
+                  && 
+                  aMain != this ) // not equal mains
+               aMain->getCanvas()->merge();
+         }
+       }
+      }
+    }
+  }
+}
+
 void SUPERVGUI_Main::run( const bool andSuspend ) {
   Trace("SUPERVGUI_Main::run");
   if ( SUPERV_isNull(dataflow) ) 
@@ -570,7 +605,11 @@ void SUPERVGUI_Main::run( const bool andSuspend ) {
       QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTVALID") + QString(" : ") + QString(dataflow->Messages()));
     } 
     else if (!dataflow->IsExecutable()) {
-      QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE") + QString(" : ") + QString(dataflow->Messages()));
+      QString aMessage = QString(dataflow->Messages());
+      if ( aMessage.isEmpty() ) // mkr : IPAL11471
+       QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE"));
+      else
+       QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE") + QString(" : ") + aMessage);
     } 
     else if (myCanvasView->isAnyLinkCreating()) {
       QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_CRL_NOTCOMPLETE"));
@@ -817,6 +856,7 @@ void SUPERVGUI_Main::showPopup(QPopupMenu* p, QMouseEvent* e) {
   //if (dataflow->IsExecuting()) return;
 
   CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication());
+  if ( !anApp->activeModule() ) return;
   if ( anApp->activeModule()->moduleName().compare( anApp->moduleTitle( "SUPERV" ) ) !=0 ) return;
 
   if (e->button() == RightButton) {
@@ -1057,9 +1097,13 @@ bool SUPERVGUI_Main::putDataStudy( SUPERV_Port p, const char* inout ) {
            SALOMEDS::SObject_var aTmpSO;// = aSO;
            SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aStudy.get() );
            if ( !aSStudy ) return false;
-           aTmpSO = aDriver->PublishInStudy( aSStudy->GetStudy(), aTmpSO, anObject, "" );
-           aBuilder->Addreference(aSO, _PTR(SObject)(new SALOMEDS_SObject( aTmpSO )) );
-           PublishOtherComponent = true;
+           try {
+             aTmpSO = aDriver->PublishInStudy( aSStudy->GetStudy(), aTmpSO, anObject, "" );
+             aBuilder->Addreference(aSO, _PTR(SObject)(new SALOMEDS_SObject( aTmpSO )) );
+             PublishOtherComponent = true;
+           }
+           catch ( ... ) { // mkr : PAL8150
+           }
          } 
          else { // can't publish object: abort transaction
            MESSAGE( "CanPublishInStudy() returned FALSE.  ok, AbortCommand.." );
index 5fde3aeeecf62c989f114dbea625d45b7831c5a1..146c90f1b07f6851b11e1df8cf2019dd95c4f0d8 100644 (file)
@@ -137,6 +137,7 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
 
   signals:
     void KillMyThread(bool theValue);
+    void EventToSync(); // mkr : IPAL11362
 
   public slots:
     void execute(char * theNodeNode, SUPERV::GraphState theNodeState);
@@ -158,6 +159,8 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     void onSubGraphActivated( SUIT_ViewWindow* );
 
     void onShowToolbar();
+
+    void onObjectCreatedDeleted(); // mkr : PAL8237
  
   private slots:
     void chooseData(QListViewItem* item);
@@ -172,12 +175,12 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     SUPERV_Graph            dataflow;
 
     QMap<QString, SUIT_ViewWindow*> mySubGraphs;
-    QMap<QString, QString>          mySubGraphMap;
-    SUIT_ViewWindow*                myLastGraph;
+    QMap<QString, QString>  mySubGraphMap;
+    SUIT_ViewWindow*        myLastGraph;
 
-    SUIT_Study*                     study;
-    OB_Browser*                     objectBrowser;
-    LogWindow*                      message;
+    SUIT_Study*             study;
+    OB_Browser*             objectBrowser;
+    LogWindow*              message;
 
     GraphViewType           myCurrentView;
     SUPERVGUI_CanvasArray*  myArray;
@@ -209,8 +212,8 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
 
     SUPERVGUI_Thread*       myThread; 
 
-    QPtrList< char * >                myEventNodes ;
-    QPtrList< SUPERV::GraphState >    myStates ;
+    QPtrList<char*>         myEventNodes ;
+    QPtrList<SUPERV::GraphState> myStates ;
     QTimer*                 myTimer;
 };
 
index fb4c5573d30bbf820b4cda2f891f9e3fc019c70d..bbf2d1e1329e5d33e6763d5edf2d4578b38590ef 100644 (file)
@@ -8,8 +8,6 @@
 //  Author : Alexander SLADKOV
 //  Module : SUPERV
 
-using namespace std;
-
 #include "SUIT_Desktop.h"
 #include "SUIT_Session.h"
 
@@ -17,7 +15,7 @@ using namespace std;
 #include "SUPERVGUI_CanvasNode.h"
 #include "SUPERVGUI_CanvasPort.h"
 #include "SUPERVGUI_CanvasControlNode.h"
-#include "SUPERVGUI.h"
+#include "SUPERVGUI_CanvasLink.h"
 
 #include <qlayout.h>
 #include <qlabel.h>
@@ -294,6 +292,33 @@ void SUPERVGUI_ManagePortsDlg::init()
 SUPERVGUI_ManagePortsDlg::~SUPERVGUI_ManagePortsDlg() {
 }
 
+// mkr : PAL8060
+void SUPERVGUI_ManagePortsDlg::createLinkEngine( SUPERV::Port_ptr thePort, 
+                                                QValueList< QPair< QString,QString > >& theOwnList, 
+                                                QValueList< QPair< QString,QString > >& theCorrespList ) {
+  // pair <NodeName, PortName> for the given port
+  QPair<QString, QString> anOwnPair(QString(thePort->Node()->Name()), QString(thePort->Name()));
+  int aNum = theOwnList.contains(anOwnPair);
+  while ( aNum > 0 ) {
+    int anId = theOwnList.findIndex(anOwnPair); // get index in theOwnList
+    QPair<QString, QString> aCorrespPair = theCorrespList[anId]; // corresponding pair in theCorrespList
+    
+    theOwnList.remove(theOwnList.at(anId));
+    theCorrespList.remove(theCorrespList.at(anId));
+    
+    SUPERV_Port aCorrespPort = myNode->getMain()->getDataflow()->Node(aCorrespPair.first)->Port(aCorrespPair.second);
+    SUPERV_Link aLinkEngine;
+    if ( thePort->IsInput() )
+      aLinkEngine = myNode->getMain()->getDataflow()->Link(aCorrespPort, thePort);
+    else
+      aLinkEngine = myNode->getMain()->getDataflow()->Link(thePort, aCorrespPort);
+    SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(myNode->getMain()->getCanvas(), myNode->getMain(), aLinkEngine);
+    aLink->show();
+    
+    aNum--;
+  }  
+}
+
 /** 
  * Set the ports as entered by user (order, name/type, etc.) and close the dialog
  */
@@ -314,14 +339,61 @@ void SUPERVGUI_ManagePortsDlg::accept() {
     // automatically removes the corresponding Output Port.  So for Loops the
     // oldPorts list should be filtered to include only Input Ports.
     // But I'll filter Gate-s as well..
+    bool isAnyLinked = false; // check if any port from old ports is linked
+    // map PortName <-> (PortType, PortInputValue) for non linked input ports, which have input
+    QMap< QString, QPair< QString,QString > > InNameInput;
     QObjectList portsToRemove;
     while ( (obj = it.current()) != 0 ) {
       ++it;
       SUPERV::Port_var aPort = ((SUPERVGUI_CanvasPort*)obj)->getEngine();
-      if ( !aPort->IsGate() && ( !isLoop || aPort->IsInput() ) )
+      if ( !aPort->IsGate() && ( !isLoop || aPort->IsInput() ) ) {
        portsToRemove.append( obj );
+      }
+      // check if port has a link (output porst of Loop node are also checked)
+      if ( !aPort->IsGate() && aPort->IsLinked() && !isAnyLinked)
+       isAnyLinked = true;
+      // check if input port has an input value
+      if ( !aPort->IsGate() && aPort->IsInput() && aPort->HasInput() )
+       InNameInput.insert( QString(aPort->Name()), 
+                           QPair<QString, QString>(QString(aPort->Type()),QString(aPort->ToString())) );
     }
     delete oldPorts; // delete the list, not the objects
+
+    // mkr : PAL8060 -->
+    QString aNodeName = myNode->getEngine()->Name();
+    QValueList< QPair< QString,QString > > InPortsL, OutPortsL;
+    if ( isAnyLinked ) {
+      // if myNode has linked port(s), create two lists of In/Out ports (InPortsL, OutPortsL) to identify all links for myNode
+      QObjectList* list = myNode->getMain()->getCanvas()->queryList("SUPERVGUI_CanvasLink");
+      QObjectListIt listit( *list );
+      QObject *listobj;
+      while ( (listobj = listit.current()) != 0 ) {
+       ++listit;
+       SUPERV::Link_var aLink = ((SUPERVGUI_CanvasLink*)listobj)->getEngine();
+       if ( aNodeName.compare(aLink->InPort()->Node()->Name()) == 0
+            ||
+            aNodeName.compare(aLink->OutPort()->Node()->Name()) == 0 ) {
+         QPair<QString, QString> InPair(QString(aLink->InPort()->Node()->Name()), QString(aLink->InPort()->Name()));
+         QPair<QString, QString> OutPair(QString(aLink->OutPort()->Node()->Name()), QString(aLink->OutPort()->Name()));
+         InPortsL.append(InPair);
+         OutPortsL.append(OutPair);
+       }
+
+       if ( isLoop ) {
+         // put into In/Out lists all links for corresponding EndLoop node
+         QString aCoupledNodeName = ((SUPERVGUI_CanvasStartNode*)myNode)->getCoupled()->getEngine()->Name();
+         if ( aCoupledNodeName.compare(aLink->InPort()->Node()->Name()) == 0
+              ||
+              aCoupledNodeName.compare(aLink->OutPort()->Node()->Name()) == 0 ) {
+           QPair<QString, QString> InPair(QString(aLink->InPort()->Node()->Name()), QString(aLink->InPort()->Name()));
+           QPair<QString, QString> OutPair(QString(aLink->OutPort()->Node()->Name()), QString(aLink->OutPort()->Name()));
+           InPortsL.append(InPair);
+           OutPortsL.append(OutPair);
+         } 
+       }
+      }
+    }
+    // mkr : PAL8060 <--
     
     // portsToRemove list contains:
     // for Loop node: all INPUT ports except Gates
@@ -338,19 +410,78 @@ void SUPERVGUI_ManagePortsDlg::accept() {
     for ( i = 0; i < myInList->count(); i++ ) {
       item = (PortListItem*)myInList->item( i );
       aPort = aINode->InPort( item->PortName.latin1(), item->PortType.latin1() );
-      myNode->createPort( aPort.in() );
+      if ( InNameInput.contains( item->PortName ) 
+          && 
+          item->PortType.compare(InNameInput[item->PortName].first) == 0 ) {
+       // i.e. aPort is input and had a value (not linked!)
+       // if ports' name and type didn't change and ports had an input value => set this value again
+       SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+       if ( aSupMod )
+         aPort->Input( aSupMod->getEngine()->StringValue( InNameInput[item->PortName].second ) );
+       myNode->createPort( aPort.in() );
+      }
+      else {
+       myNode->createPort( aPort.in() );
+       // mkr : PAL8060
+       if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() )
+         // create links for those input ports, which had links earlier
+         createLinkEngine( aPort, InPortsL, OutPortsL );
+      }
+    }
+    
+    if ( isLoop ) {
       // asv : 11.01.05 : for Loop nodes do the same as in SUPERVGUI_CanvasStartNode::addInputPort()
-      if ( isLoop ) {
-       SUPERVGUI_CanvasStartNode* aStartLoopNode = (SUPERVGUI_CanvasStartNode*)myNode;
-       aStartLoopNode->merge();
-       aStartLoopNode->getCoupled()->merge();
+      SUPERVGUI_CanvasStartNode* aStartLoopNode = (SUPERVGUI_CanvasStartNode*)myNode;
+      aStartLoopNode->merge();
+      aStartLoopNode->getCoupled()->merge();
+     
+      // mkr : PAL8060 -->
+      if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() ) {
+
+       // 1) create old links for output ports of Loop node
+       QObjectList* aPortsOut = aStartLoopNode->queryList("SUPERVGUI_CanvasPortOut");
+       QObjectListIt aPorstOutit( *aPortsOut );
+       QObject *listobj;
+       while ( (listobj = aPorstOutit.current()) != 0 ) {
+         ++aPorstOutit;
+       
+         SUPERV::Port_var aPortOut = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
+         createLinkEngine( aPortOut, OutPortsL, InPortsL );
+       }
+
+       // 2) create old links for input ports of EndLoop node
+       QObjectList* aPortsIn = aStartLoopNode->getCoupled()->queryList("SUPERVGUI_CanvasPortIn");
+       QObjectListIt aPorstInit( *aPortsIn );
+       while ( (listobj = aPorstInit.current()) != 0 ) {
+         ++aPorstInit;
+       
+         SUPERV::Port_var aPortIn = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
+         createLinkEngine( aPortIn, InPortsL, OutPortsL );
+       }
+
+       // 3) create old links for output ports of EndLoop node
+       aPortsOut = aStartLoopNode->getCoupled()->queryList("SUPERVGUI_CanvasPortOut");
+       aPorstOutit = QObjectListIt( *aPortsOut );
+       while ( (listobj = aPorstOutit.current()) != 0 ) {
+         ++aPorstOutit;
+       
+         SUPERV::Port_var aPortOut = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
+         createLinkEngine( aPortOut, OutPortsL, InPortsL );
+       }
       }
+      // mkr : PAL8060 <--
     }
+
     // creating Out-ports, except LoopNode-s
     for ( i = 0; i < myOutList->count() && !isLoop; i++ ) {
       item = (PortListItem*)myOutList->item( i );
       aPort = aINode->OutPort( item->PortName.latin1(), item->PortType.latin1() );
       myNode->createPort( aPort.in() );
+
+      // mkr : PAL8060
+      if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() )
+       // create links for those output ports, which had links earlier
+       createLinkEngine( aPort, OutPortsL, InPortsL );
     }  
 
     // 2. update the node's presentation
@@ -397,16 +528,20 @@ void SUPERVGUI_ManagePortsDlg::init( const SUPERVGUI_CanvasNode* theNode ) {
   
   // 1. fill myTypeCombo with all available types
   myTypeCombo->insertStrList( gTypes );
-
+  
   // 2. fill Input and Output listboxes with Ports' names/types
   QStringList aTypes;
   SUPERV_Ports aPorts = aINode->Ports();
   for ( int i=0; i < aPorts->length(); i++ ) {
     if ( aPorts[i]->IsGate() )
       continue;
-    if ( aPorts[i]->IsInput() )
+    if ( aPorts[i]->IsInput()
+        &&
+        !myInList->findItem( QString( "%1 (%2)" ).arg( aPorts[i]->Name() ).arg( aPorts[i]->Type() ) ) ) // mkr : PAL11332
       new PortListItem( myInList, aPorts[i]->Name(), aPorts[i]->Type() );
-    else 
+    if ( !aPorts[i]->IsInput()
+        &&
+        !myOutList->findItem( QString( "%1 (%2)" ).arg( aPorts[i]->Name() ).arg( aPorts[i]->Type() ) ) ) // mkr : PAL11332 
       new PortListItem( myOutList, aPorts[i]->Name(), aPorts[i]->Type() );
   }
 }
index 345d1cb424f8b3819e5476761b41638aaa50d810..1e3506b75e07eb8f76448607134a2b19cb56adeb 100644 (file)
 #ifndef SUPERVGUI_ManagePortsDlg_H
 #define SUPERVGUI_ManagePortsDlg_H
 
+#include "SUPERVGUI.h"
+
 #include <qdialog.h>
 #include <qlistbox.h>
 #include <qstringlist.h>
 #include <qlineedit.h>
 #include <qcombobox.h>
+#include <qpair.h>
 
 class SUPERVGUI_CanvasNode;
 
@@ -68,6 +71,10 @@ protected:
   void moveUp( QListBox* );
   void moveDown( QListBox* );
   void moveItem( QListBox* theLB, const int from, const int to );
+  // mkr : PAL8060
+  void createLinkEngine( SUPERV::Port_ptr thePort, 
+                        QValueList< QPair< QString,QString > >& theOwnList, 
+                        QValueList< QPair< QString,QString > >& theCorrespList );
   
 private:
   void init();
index e991427486dd4ee45c51dc2b334a0563140499b8..7d1e7eff9848e8e495894045fb597f5b2bdf7fb7 100644 (file)
@@ -25,8 +25,6 @@
 //  Author : Francis KLOSS
 //  Module : SUPERV
 
-using namespace std;
-
 #include "SUPERVGUI_Notification.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI_CanvasNode.h"
index 82ef1ebd2fc366b0f8ff7b0e6b4bbeaac05fed00..2f3fc8da3dcf4f5e726ce9906e294d773d522c99 100644 (file)
@@ -28,7 +28,6 @@
 #ifndef SUPERVGUI_Notification_H
 #define SUPERVGUI_Notification_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include <qdialog.h>
 #include <qlist.h>
index 74f97162617e7acca4a1750e38ca2f3c119139d2..c08c5ad314f84586f54d0e310d58a8ab99330242 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "SALOMEDSClient.hxx"
 #include <boost/shared_ptr.hpp>
-using namespace boost;
 
 class SALOME_InteractiveObject;
 
index 3afcebbf2ff55fe2c6be16c0feac03eb04271a4e..3f495403c6a388fdea00d22ab4cc105952d86454 100644 (file)
@@ -25,7 +25,6 @@
 //  Author : Francis KLOSS
 //  Module : SUPERV
 
-using namespace std;
 #include "SUPERVGUI_Service.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI_Library.h"
@@ -471,7 +470,7 @@ void SUPERVGUI_Service::addFactoryNode() {
                }
              } 
              else { // Factory Node
-               aNode = aMain->getDataflow()->FNode(component, interface, *myService);
+               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;
@@ -519,6 +518,12 @@ void SUPERVGUI_Service::addInlineNode() {
          return;
        }
        SUPERV::INode_var aDummyEndNode;
+       // here we have to 
+       // 1) parse nodes' python function to find ports names
+       // 2) create ports for engine node with found names and "undefined" types
+       //    ( aNode->InPort(name,type), aNode->OutPort(name,type) )
+       // P.S. CanvasNode->createPort(...) for create presentation of port
+       //      will be called from addNode(...) (inside CanvasNode constructor)
        addNode( aNode, aDummyEndNode, myX, myY );
       }
       break;
index 366648ce56b2630b55c84e1278fa9c4c7f5a49a4..3a466790dff17010eacc81404631a599e613a384 100644 (file)
@@ -28,7 +28,6 @@
 #ifndef SUPERVGUI_Service_H
 #define SUPERVGUI_Service_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include <qtabwidget.h>
 #include <qhgroupbox.h>
index 0d0e8a009efd3c38190713d118420fb5d77e218e..3277a1f747b546883d0fdddfe669370bfa11c2fd 100644 (file)
@@ -65,3 +65,6 @@ msgstr "kill.png"
 
 msgid "ICO_SUSPEND/RESUME"
 msgstr "suspend-resume.gif"
+
+msgid "ICO_NODE_INLINE"
+msgstr "node_inline.png"
index 706508f8034a993027880202090e18db0ea5a15c..95ee79d497184cee3063e2b526ad35f750d059b0 100644 (file)
@@ -781,13 +781,19 @@ msgid "MSG_ERROR_LIB1"
 msgstr "Error creating a library file and opening for writing."
 
 msgid "MSG_ERROR_LIB_IS_RECREATE"
-msgstr "Library file is corrupt (bad XML structure).  Remove it and create a new one?"
+msgstr "Library file is corrupt (bad XML structure) or read-protected.  Remove it and create a new one?"
+
+msgid "MSG_ERROR_LIB_DIR_NOT_EXIST_RECREATE"
+msgstr "%1 directory doesn't exist. Create it?"
+
+msgid "MSG_ERROR_LIB_RECREATE_DIR"
+msgstr "Can not create %1 directory."
 
 msgid "MSG_ERROR_LIB_IO"
 msgstr "Unknown I/O error occured creating new library file."
 
 msgid "MSG_ERROR_LIB_WRITE"
-msgstr "Error writing library file!"
+msgstr "Error writing library file: file is write-protected!"
 
 msgid "MSG_ERROR_LIB_NIL_NODE"
 msgstr "Error: the node to be exported is NULL"
index 9dd23bbfb7676741de0438a4ab7a14414c40cb28..31a2dbe4ec277f88eebb85ce8990a906f90f66e7 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 ;
@@ -1017,7 +1035,7 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() {
           begin = false ;
         }
         if ( anInPort->IsLoop() || ( anInPort->IsGate() && anInPort->IsNotConnected() && 
-                                     ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
+                                     ( /*IsExecuting() || */DataFlowEditor()->IsReadOnly() ) ) ) { // mkr : IPAL11362
 //          MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
         }
         else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
@@ -1072,7 +1090,7 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() {
           begin = false ;
         }
         if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && anOutPort->IsNotConnected() &&
-                                      ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
+                                      ( /*IsExecuting() || */DataFlowEditor()->IsReadOnly() ) ) ) { // mkr : IPAL11362
 //          MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
         }
         else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
@@ -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..942649746b3449d2933e0ffc6f7f6f62a38fe8af 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 ;
@@ -43,6 +44,7 @@ FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
   _Orb = CORBA::ORB::_duplicate(orb);
   _Poa = poa ;
   _ContId = contId ;
+  _isCimpl = isCimpl ;
 //  DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
 //                                           NodeInterfaceName , NodeName ,
 //                                           NodeKindOfNode ) ) ;
@@ -68,6 +70,7 @@ FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
   _Orb = CORBA::ORB::_duplicate(orb);
   _Poa = poa ;
   _ContId = contId ;
+  _isCimpl = true ;
   endService( "FNode_Impl::FNode_Impl" );  
 }
 
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..a00e43fd791c8bbf36ec48cacd66db7348d0173b 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);
@@ -1804,6 +1808,13 @@ long Graph_Impl::SuspendedThreads() {
 
 bool Graph_Impl::Begin() {
   bool RetVal = false ;
+  // mkr : IPAL11408 : "Run()" method returns "0" after trying to start graph execution.
+  // If we call Run() method from Python script two times for one graph, we have to be sure,
+  // that first execution of this graph ended (i.e. GraphEditor::DataFlow::Editing() method was called).
+  // Otherwise, the second call of Run() method will return 0. Therefore, we have to waiting for
+  // the first execution finish. 
+  // NB! From GUI we cann't run dataflow if its previous execution not finished.
+  while ( !DataFlowEditor()->IsEditing() ) {} // waiting for the previous execution of this graph ended
   if ( DataFlowEditor()->IsEditing() ) {
     if ( pthread_mutex_lock( &_MutexExecutorWait ) ) {
       perror("pthread_mutex_lock _MutexExecutorWait") ;
@@ -2178,7 +2189,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() ) ;
@@ -2406,20 +2418,20 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
           myPorts = *(myEndOfSwitch->Ports()) ;
           for ( j = 0 ; j < (int ) myPorts.length() ; j++ ) {
             if ( myPorts[ j ]->IsInput() ) {
-              aPort = myNode->InPort( myPorts[ j ]->Name() , myPorts[ j ]->Type() ) ;
+              aPort = anEndOfSwitch->InPort( myPorts[ j ]->Name() , myPorts[ j ]->Type() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
            }
             else {
-              aPort = myNode->OutPort( myPorts[ j ]->Name() , myPorts[ j ]->Type() ) ;
+              aPort = anEndOfSwitch->OutPort( myPorts[ j ]->Name() , myPorts[ j ]->Type() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
            }
          }
           if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
             SUPERV::ListOfStreamPorts myStreamSwitchPorts = *(myEndOfSwitch->StreamPorts()) ;
             for ( j = 0 ; j < (int ) myStreamSwitchPorts.length() ; j++ ) {
               if ( myStreamSwitchPorts[ j ]->IsInput() ) {
-                aPort = myNode->InStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ;
+                aPort = anEndOfSwitch->InStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
              }
               else {
-                aPort = myNode->OutStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ;
+                aPort = anEndOfSwitch->OutStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
              }
            }
          }
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" ) ;
index f68f82a6d4e04576d774b262ec46043d9feb70a4..69a38e3870e00ea1308554cb37f00f8d35373971 100644 (file)
@@ -38,7 +38,6 @@ except :
 import os
 import re
 from types import *
-import readline
 
 #try :
 #    SuperVision = SuperV_Swig( len(sys.argv) , sys.argv )
@@ -591,6 +590,8 @@ class FNode(CNode):
         return self.N.SetInterfaceName( anInterfaceName )
     def SetContainer( self , aComputer ):
         return self.N.SetContainer( aComputer )
+    def IsCimpl( self ):
+        return self.N.isCimpl
 
 ##########################################################
 class INode(CNode):
@@ -798,13 +799,27 @@ class Graph(GNode):
         #if SuperVision.Swig :
             #aService = Service_Swig( aService )
         return self.FNode( aComponent , anInterface , aService )
+    def FNodeImpl( self , aComponent , anInterface , aService, isCimpl ):
+        NodeComponent = modulecatalog.GetComponent( aComponent )
+        aService = NodeComponent.GetService( anInterface , aService )
+        aNode = self.G.FNode( aComponent , anInterface , aService, isCimpl )
+        if aNode != None :
+            aNode.isCimpl = isCimpl
+            myNode = FNode( aNode , self.G.Verbose )
+            return myNode
+        ErrMsg = "Failed to create a Node with Service " + aService.ServiceName
+        if self.G.Verbose :
+            print ErrMsg
+        return aNode
     def FNode( self , aComponent , anInterface , aService ):
+        # create node with C++ implementation type by default
         NodeComponent = modulecatalog.GetComponent( aComponent )
         aService = NodeComponent.GetService( anInterface , aService )
         #if SuperVision.Swig :
             #aService = Service_Swig( aService )
-        aNode = self.G.FNode( aComponent , anInterface , aService )
+        aNode = self.G.FNode( aComponent , anInterface , aService, 1 )
         if aNode != None :
+            aNode.isCimpl = 1
             myNode = FNode( aNode , self.G.Verbose )
             return myNode
         ErrMsg = "Failed to create a Node with Service " + aService.ServiceName
index 17d3f2487b33b99d29cdf18127a472c67718b2b3..9dfb5e00f5d229c7017fc80b3d32c92c37587da7 100644 (file)
@@ -40,7 +40,6 @@ except :
 import os
 import re
 from types import *
-import readline
 import SALOMEDS
 import SALOMEDS_Attributes_idl
 #try :
@@ -608,6 +607,8 @@ class FNode(CNode):
         return self.N.SetInterfaceName( anInterfaceName )
     def SetContainer( self , aComputer ):
         return self.N.SetContainer( aComputer )
+    def IsCimpl( self ):
+        return self.N.isCimpl
 
 ##########################################################
 class INode(CNode):
@@ -815,13 +816,27 @@ class Graph(GNode):
         #if SuperVision.Swig :
             #aService = Service_Swig( aService )
         return self.FNode( aComponent , anInterface , aService )
+    def FNodeImpl( self , aComponent , anInterface , aService, isCimpl ):
+        NodeComponent = modulecatalog.GetComponent( aComponent )
+        aService = NodeComponent.GetService( anInterface , aService )
+        aNode = self.G.FNode( aComponent , anInterface , aService, isCimpl )
+        if aNode != None :
+            aNode.isCimpl = isCimpl
+            myNode = FNode( aNode , self.G.Verbose )
+            return myNode
+        ErrMsg = "Failed to create a Node with Service " + aService.ServiceName
+        if self.G.Verbose :
+            print ErrMsg
+        return aNode
     def FNode( self , aComponent , anInterface , aService ):
+        # create node with C++ implementation type by default
         NodeComponent = modulecatalog.GetComponent( aComponent )
         aService = NodeComponent.GetService( anInterface , aService )
         #if SuperVision.Swig :
             #aService = Service_Swig( aService )
-        aNode = self.G.FNode( aComponent , anInterface , aService )
+        aNode = self.G.FNode( aComponent , anInterface , aService, 1 )
         if aNode != None :
+            aNode.isCimpl = 1
             myNode = FNode( aNode , self.G.Verbose )
             return myNode
         ErrMsg = "Failed to create a Node with Service " + aService.ServiceName