]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
SALOME PAL V1_4_1
authorsmh <smh@opencascade.com>
Mon, 5 Apr 2004 10:41:04 +0000 (10:41 +0000)
committersmh <smh@opencascade.com>
Mon, 5 Apr 2004 10:41:04 +0000 (10:41 +0000)
16 files changed:
INSTALL
Makefile.in
adm_local/unix/make_commence.in
bin/VERSION
configure.in.base
doc/Makefile.in
idl/Makefile.in
resources/SUPERV_en.xml
src/SUPERVGUI/SUPERVGUI.cxx
src/SUPERVGUI/SUPERVGUI_Information.cxx
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_Main.h
src/SUPERVGUI/SUPERVGUI_Service.cxx
src/SUPERVGUI/SUPERVGUI_View.cxx
src/SUPERVGUI/SUPERVGUI_View.h
src/SUPERVGUI/SUPERV_msg_en.po

diff --git a/INSTALL b/INSTALL
index b6698b4e166adc7723ad76ffb432289827fb61f4..46c83dc6eaec52eec0aa4f03042937dcd44fc01c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,3 +1,3 @@
-This is the version 1.4.0 of SUPERV
+This is the version 1.4.1 of SUPERV
 Compatible with :
-       - KERNEL 1.4.0
+       - KERNEL 1.4.1
index a3c3ea3890ceab938ce00d246f95f4e13badb6d0..5fbee4dd1ff0754adb0172d3eb955d89fd9f5000 100644 (file)
@@ -14,7 +14,7 @@ VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:./bin:@top_srcdir@/idl
 
 @COMMENCE@
 
-SUBDIRS = idl src examples
+SUBDIRS = idl src examples doc
 
 RESOURCES_FILES = \
 components.png \
@@ -30,6 +30,7 @@ run.png \
 steps.png \
 SUPERV_en.xml \
 SUPERV_fr.xml \
+SUPERV.config \
 SUPERVCatalog.xml \
 suspend-resume.gif \
 Superv_tree_superv.png
@@ -53,10 +54,10 @@ include/salome/SALOMEconfig.h: salome_adm/unix/SALOMEconfig.ref
 # test if SALOMEconfig.h has changed (contents)
 salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h
        @if ! [ -a $@ ]; then \
-         cp -p $< $@;        \
+         cp -p -f $< $@;        \
        fi;                   \
        if ! cmp $< $@; then  \
-         cp -p $< $@;        \
+         cp -p -f $< $@;        \
        fi;                   \
 
 include/salome/sstream: salome_adm/unix/sstream
@@ -80,7 +81,7 @@ install-include: $(include_list)
        $(INSTALL) -d  $(includedir)
        @for f in X $(include_list); do                         \
           if test $$f != X; then                               \
-            ($(INSTALL_DATA) $$f $(includedir)/. || exit 1);   \
+            ($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1);        \
           fi;                                                  \
        done
 
index 370582e407e2f509e6dbeab88675db7bfbc58685..dc5c94ddd1dce4c7d90b9a687115175ff80a4cf5 100644 (file)
@@ -131,7 +131,7 @@ OMNIORB_CXXFLAGS    = @OMNIORB_CXXFLAGS@
 
 OMNIORB_IDL         = @OMNIORB_IDL@
 OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
-OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
+OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
 
 OMNIORB_IDL_CLN_H   = @OMNIORB_IDL_CLN_H@
 OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@
@@ -148,7 +148,7 @@ CORBA_INCLUDES    = @CORBA_INCLUDES@
 CORBA_LIBS        = @CORBA_LIBS@
 CORBA_CXXFLAGS    = @CORBA_CXXFLAGS@
 
-IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
+IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
 IDLPYFLAGS  = @IDLPYFLAGS@
 
 IDL = @IDL@
@@ -202,13 +202,13 @@ idldir=${prefix}/idl/salome
 sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
 incmakedir=${prefix}/salome_adm/unix
 
-docdir=$(datadir)/doc
+docdir=${prefix}/doc/salome
 
 #
 # begin of package rules
 #
 
-.PHONY: all lib bin inc resources data doc tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
+.PHONY: all lib bin inc resources data docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
 
 .SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm
 
index aa919302fe879131e81cafecacc47dc512a4c13a..713eff3dc8c5b5a14b73daf06e12d1406fcada6b 100755 (executable)
@@ -1 +1 @@
-THIS IS SALOME - SUPERV VERSION: 1.4.0
+THIS IS SALOME - SUPERV VERSION: 1.4.1
index 212a37556a24f2ab891e0a58eac3a6c89761778b..16b69067734b17eeffeb3f5f1c5339b0df91801c 100644 (file)
@@ -294,7 +294,7 @@ else
 fi
 
 # make other build directories
-for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources share/salome/doc idl
+for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl
 do
 #   if test ! -d $rep ; then
 #      eval mkdir $rep
@@ -327,14 +327,15 @@ dnl copy shells and utilities contained in the bin directory
 dnl excluding .in files (treated in AC-OUTPUT below) and CVS 
 dnl directory
 
-cd bin
+mkdir -p bin/salome
+cd bin/salome
 for i in $ROOT_SRCDIR/bin/*
 do
   local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
   case "$local_bin" in
         *.in | *~)                    ;;
-        ./bin/CVS)                    ;;
-        *) ln -fs $i; echo $local_bin ;;
+        ./bin/CVS | ./bin/salome)                    ;;
+        *) /usr/bin/install -C $i .; echo $local_bin ;;
   esac
 done
 cd $ROOT_BUILDDIR
index 01901597158e9cc36fca315a781abd5d150fc032..7295ede75128e9e51b474f63ed9f8d7a128bb3df 100644 (file)
@@ -11,9 +11,11 @@ top_builddir=..
 srcdir=@srcdir@
 VPATH=.:@srcdir@
 
-SUBDIRS=html 
+SUBDIRS= salome
 
-doc:
+@COMMENCE@
+
+docs:
        @@SETX@; for d in $(SUBDIRS); do        \
           (cd $$d && $(MAKE) $@) || exit 1;    \
        done
@@ -31,3 +33,8 @@ install:
        @@SETX@; for d in $(SUBDIRS); do        \
           (cd $$d && $(MAKE) $@) || exit 1;    \
        done
+
+uninstall:
+       @@SETX@; for d in $(SUBDIRS); do        \
+          (cd $$d && $(MAKE) $@) || exit 1;    \
+       done
index bf0306b7681d552347470d2411fc9d3840a5b419..c831f208166b2e2a2ba1fd2ff90ebf6bf1dbf21f 100644 (file)
 # 
 #  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
 #
+
 #
 #
 #  File   : Makefile.in
 #  Module : idl
-
 top_srcdir=@top_srcdir@
 top_builddir=..
 srcdir=@srcdir@
-VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome
+VPATH=.:${KERNEL_ROOT_DIR}/idl/salome
 
 @COMMENCE@
 
@@ -35,11 +35,14 @@ IDL_FILES = \
 PY_CLIENT_IDL = $(IDL_FILES)
 
 # we copy all idl file in $(top_builddir)/idl
-inc: $(IDL_FILES:%=$(top_builddir)/idl/%)
+inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
+
+$(top_builddir)/idl/salome:
+       mkdir $@
 
-$(IDL_FILES:%=$(top_builddir)/idl/%):$(top_builddir)/idl/%:%
+$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%)
 #      $(CP) $< $@
-       cp -f $< $@
+       cp -f $^ $(top_builddir)/idl/salome
 
 
 lib: pyidl
@@ -51,7 +54,7 @@ pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py)
 $(PYTHON_BUILD_SITE):
        $(INSTALL) -d  $@
 
-$(PYTHON_BUILD_SITE)/%_idl.py: %.idl
+$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl
        $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $<
 
 
@@ -59,12 +62,12 @@ $(PYTHON_BUILD_SITE)/%_idl.py: %.idl
 install: install-pyidl install-idl
 
 # create directory $(idldir) and copy idl files into it
-install-idl: $(IDL_FILES)
+install-idl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
        $(INSTALL) -d  $(idldir)
        $(INSTALL_DATA) $^ $(idldir)
 
 
-install-pyidl: $(IDL_FILES)
+install-pyidl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
        $(INSTALL) -d  $(PYTHON_SITE_INSTALL)
        @for file in $^ dummy; do \
          if [ $$file != "dummy" ]; then \
@@ -79,6 +82,6 @@ cleandep:
 
 distclean:
        -$(RM) *.py
-       -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/%)
+       -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
        -$(RM) Makefile
 
index 054260523a30ea2cb0147d6cde9ca50478fe0d9b..c26850984744d7d86d9fca07d9d4f78d9a8c7906 100755 (executable)
@@ -34,7 +34,7 @@
                        </menu-item>
                </menubar>
 
-               <toolbar label-id="Supervision">
+               <toolbar label-id="Supervisor">
                        <toolbutton-item item-id="301" label-id="Import"         icon-id="import.gif"         tooltip-id="Import Dataflow"   accel-id="" toggle-id="" execute-action=""/>
                        <toolbutton-item item-id="302" label-id="Export"         icon-id="export.gif"         tooltip-id="Export Dataflow"   accel-id="" toggle-id="" execute-action=""/>
                        <toolbutton-item item-id="303" label-id="New"            icon-id="edit.png"           tooltip-id="New Dataflow"      accel-id="" toggle-id="" execute-action=""/>
index 5f57e853113e8b748b6f3e052cb562287d71938b..394710b9da2e466cecf82190236295ca85ebec8d 100644 (file)
@@ -91,6 +91,10 @@ void SUPERVGUI::init(QAD_Desktop* parent) {
         //info    = new SUPERVGUI_Information();
         cursor  = desktop->cursor();
        connect(desktop->getMainFrame(), SIGNAL(windowActivated(QWidget*)), this, SLOT(setMain(QWidget*)));
+
+       int anId = 300;
+       parent->menuBar()->changeItem(anId,parent->getComponentUserName("SUPERV"));
+       
     };
 }
 
@@ -100,7 +104,7 @@ QAD_StudyFrame* SUPERVGUI::createGraph() {
                                                   VIEW_GRAPHSUPERV, false);
   if (aStudyFrame) {
     connect(aStudyFrame, 
-           SIGNAL(sfBeforeStudyFrameClosing(QAD_StudyFrame*)), 
+           SIGNAL(sfStudyFrameClosing(QAD_StudyFrame*)), 
            &Supervision, 
            SLOT(onGraphClosed(QAD_StudyFrame*)));
   }
index 1151a7793f61d53da3e6708758631d2380062a7e..5ee9b3c774e39ef2c527f0d5b1777b933e4a40b1 100644 (file)
@@ -88,7 +88,8 @@ SUPERVGUI_Information::SUPERVGUI_Information(SUPERV_CNode node, bool isReadOnly)
     compnameV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
     compnameV->setMinimumSize( 200, 0 );
     compnameV->setReadOnly( true/*isReadOnly*/ );
-    compnameV->setText( SUPERV::FNode::_narrow(node)->GetComponentName() );
+    compnameV->setText( QAD_Application::getDesktop()->getComponentUserName(
+                  SUPERV::FNode::_narrow(node)->GetComponentName()) );
 
     intnameL = new QLabel( tr( "INTERFACE_NAME_LBL" ), TopGroup ); 
     intnameV = new QLineEdit( TopGroup );      
index 284888742e361908d88b5c8c0cc8ffef74784f66..08541c5822de12db5a97d679bc9cb796deae2a54 100644 (file)
@@ -157,6 +157,7 @@ void SUPERVGUI_Main::init(QAD_Desktop* theDesktop) {
 
   myThread = new SUPERVGUI_Thread();
   myThread->setMain(this);
+  connect(this, SIGNAL(KillMyThread(bool)), myThread, SLOT(KillThread(bool)));
 
   myIsKilled = false;
   //myIsRunned = false;
@@ -225,13 +226,27 @@ SUPERVGUI_Main::~SUPERVGUI_Main() {
   delete notification; // kloss : nota bene : quand un datalow est detruit : verifier que les canaux de notification sont aussi detruit
   if (!SUPERV_isNull(dataflow)) {
     if (dataflow->IsExecuting()) {
-      if (QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), 
+      if (QMessageBox::warning(QAD_Application::getDesktop(),
+                              tr("WARNING"), 
                               tr("MSG_DF_RUNNING"), 
                               tr("MSG_DF_EXECUTION"), 
                               tr("MSG_DF_KILL")) == 1) {
-       dataflow->Kill();
+       if (dataflow->Kill()) {
+         if (myThread->running()) 
+           myThread->wait();
+       }
+      }
+      else {
+       emit KillMyThread(true);
+       if (myThread->running()) 
+         myThread->wait();
       }
     }
+    else {
+      emit KillMyThread(true);
+      if (myThread->running()) 
+       myThread->wait();
+    }
   }
 }
 
@@ -1134,8 +1149,6 @@ void SUPERVGUI_Main::checkExecution() {
   }
 }
 
-
-
 /******************************* SUPERVGUI_Thread class ****************************************/
 SUPERVGUI_Thread::SUPERVGUI_Thread()
      :QThread()
@@ -1160,8 +1173,6 @@ void SUPERVGUI_Thread::startThread(const char* m)
 
 void SUPERVGUI_Thread::stopThread(const char* m)
 {
-  //myIsActive = false;
-  //myMain->sync();
   myMain->getMessage()->setMessage(m);
 }
 
@@ -1170,6 +1181,13 @@ void SUPERVGUI_Thread::setMain(SUPERVGUI_Main* theMain)
   myMain = theMain;
 }
 
+void SUPERVGUI_Thread::KillThread(bool theValue)
+{
+  myMutex.lock();
+  myIsActive = !(theValue);
+  myMutex.unlock();
+}
+
 void SUPERVGUI_Thread::run()
 {
   SUPERV_CNode aNode = NULL;
@@ -1192,7 +1210,9 @@ void SUPERVGUI_Thread::run()
       
     if (aEvent == SUPERV::UndefinedEvent && aState == SUPERV::UndefinedState
        ||
-       aEvent == SUPERV::NoEvent && aState == SUPERV::NoState) {
+       aEvent == SUPERV::NoEvent && aState == SUPERV::NoState
+       ||
+       aEvent == SUPERV::KillEvent && aState == SUPERV::KillState) {
       if (myMain->getEventNodes().count()) {
        myMain->removeEventNodes();
       }
@@ -1257,6 +1277,10 @@ void SUPERVGUI_Thread::run()
       case SUPERV_Error : 
        stopThread(tr("MSG_GRAPH_ABORTED"));
        break;
+       
+      case SUPERV_Kill:
+       stopThread(tr("MSG_GRAPH_KILLED"));
+       break;
       }
 
       break;
@@ -1266,9 +1290,14 @@ void SUPERVGUI_Thread::run()
       //if list not empty call execute() -> sync()
       char * aNodeName = *(myMain->getEventNodes().getFirst());
       SUPERV::GraphState aNodeState = *(myMain->getStates().getFirst());
-      qApp->lock();
-      myMain->execute(aNodeName,aNodeState);  //this is from main
-      qApp->unlock();
+      if (!qApp->locked()) {
+       qApp->lock();
+       myMain->execute(aNodeName,aNodeState);  //this is from main
+       qApp->unlock();
+      }
+      else 
+       myMain->execute(aNodeName,aNodeState);  //this is from main
+
       myMain->removeFirstEN();
       myMain->removeFirstS();
     }
index 08692040f8072f66d921cc84aba2bdc8f257d265..d4d57064d71e4625c4bd9cc949b40511a0a06c21 100644 (file)
@@ -98,6 +98,7 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
 
     void lockedGraph(bool theLock) { myIsLocked = theLock; }
     bool isLocked() { return myIsLocked; }
+    bool isKilled() { return myIsKilled; }
 
     SUPERV::GraphState getNodeExecState();
     void setNodeExecState(SUPERV::GraphState theNodeExecState);
@@ -118,6 +119,9 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     void startTimer();
     void executionFinished();
 
+  signals:
+    void KillMyThread(bool theValue);
+
   public slots:
     void execute(char * theNodeNode, SUPERV::GraphState theNodeState);
     void sync();
@@ -191,12 +195,16 @@ class SUPERVGUI_Thread : public QObject, public QThread {
   void stopThread(const char* m);
   void setMain(SUPERVGUI_Main* theMain);
 
+ public slots:
+   void KillThread(bool theValue); 
+  
  protected:
   void run();
 
  private:
   bool                myIsActive;
   SUPERVGUI_Main*     myMain;
+  QMutex              myMutex;
 
 };
 
index 2b13b08f9d0f466ae2a8f7347aa5b00664b542c5..0a6213790af0c39599b55172ceecf81afa7a0e5c 100644 (file)
@@ -127,16 +127,16 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
   //QHGroupBox* aAddBox = new QHGroupBox(tr("TIT_ADDNODE"), aCorbaPane); //!!
   //aAddBox->setInsideSpacing(20); //!!
 
-  QPushButton* aComputeCBtn = new QPushButton(tr("TIT_ADDCNODE"), aCorbaPane); //!!
-  connect(aComputeCBtn, SIGNAL(clicked()), this, SLOT(addComputeNode())); //!!
-  aComputeCBtn->setDefault(false); 
+//NRI   QPushButton* aComputeCBtn = new QPushButton(tr("TIT_ADDCNODE"), aCorbaPane); //!!
+//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); 
 
   aBaseLayout->addWidget(aComputeBtn);
-  aBaseLayout->addWidget(aComputeCBtn); //!!
+  //NRI  aBaseLayout->addWidget(aComputeCBtn); //!!
 
   aBaseLayoutV->insertLayout(-1, aBaseLayout);
   myTabPane->addTab(aCorbaPane, tr("MODULES_PANE"));
@@ -229,7 +229,7 @@ void SUPERVGUI_Service::initialise() {
   long nbComp = lComponents->length();
   for (int i=0; i<nbComp; i++) {
     SALOME_ModuleCatalog::Acomponent_ptr C = (*aModuleCatalog)->GetComponent((char *)lComponents[i]);
-    QListViewItem* myComponentItem = new QListViewItem(components, (char*)lComponents[i]);
+    QListViewItem* myComponentItem = new QListViewItem(components, (char*)C->componentusername());
     myComponentItem->setSelectable(false);
     QString aIconName = C->component_icone();
     if (!aIconName.isEmpty()) {
@@ -285,9 +285,10 @@ SUPERVGUI_Service::~SUPERVGUI_Service() {
 }
 
 void SUPERVGUI_Service::addComputeNode() {
+  QAD_Desktop* aDesktop = QAD_Application::getDesktop();
   SUPERVGUI_Main* aMain = Supervision.getMain();
   if (aMain==0) {
-    QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
   } else {
     CORBA::Object_ptr obj  = naming->Resolve("/Kernel/ModulCatalog");
     SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
@@ -304,9 +305,9 @@ void SUPERVGUI_Service::addComputeNode() {
          const char* service   = item->text(0).latin1();
          const char* interface = item->parent()->text(0).latin1();
          const char* component = item->parent()->parent()->text(0).latin1();
-         SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
+         SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(aDesktop->getComponentName(component));
          if (myComponent==NULL) {
-           QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+           QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
          } else {
            const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
            b  = true;
@@ -324,16 +325,17 @@ void SUPERVGUI_Service::addComputeNode() {
        }
       }
       if (!b) {
-       QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NONODE_TOADD"));
+       QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
       }
     }
   }
 }
 
 void SUPERVGUI_Service::addFactoryNode() {
+  QAD_Desktop* aDesktop = QAD_Application::getDesktop();
   SUPERVGUI_Main* aMain = Supervision.getMain();
   if (aMain==0) {
-    QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
   } else {
     CORBA::Object_ptr obj  = naming->Resolve("/Kernel/ModulCatalog");
     SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
@@ -349,24 +351,49 @@ void SUPERVGUI_Service::addFactoryNode() {
        if (item->isSelected()) {
          const char* service   = item->text(0).latin1();
          const char* interface = item->parent()->text(0).latin1();
-         const char* component = item->parent()->parent()->text(0).latin1();
+         const char* component = aDesktop->getComponentName(item->parent()->parent()->text(0).latin1());
          SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
          if (myComponent==NULL) {
-           QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+           QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
          } else {
            const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
            b  = true;
            
-           SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
-           if (CORBA::is_nil(node)) {
-             QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));   
-             return;
+           MESSAGE ( " myService->TypeOfNode == " << myService->TypeOfNode ) 
+
+           if ( myService->TypeOfNode == 0 ) { // ComputeNode
+             SUPERV_CNode node = aMain->getDataflow()->CNode(*myService);
+             if (CORBA::is_nil(node)) {
+               QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));         
+               return;
+             }
+             node->Coords(myX, myY);
+             myX += NODE_DX;
+             myY += NODE_DY;
+             aMain->addComputeNode(SUPERV::CNode::_narrow(node));
+           } else { // Factory Node
+             SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
+             if (CORBA::is_nil(node)) {
+               QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));         
+               return;
+             }
+             node->Coords(myX, myY);
+             myX += NODE_DX;
+             myY += NODE_DY;
+             aMain->addComputeNode(SUPERV::CNode::_narrow(node));
+             
            }
-           node->Coords(myX, myY);
-           myX += NODE_DX;
-           myY += NODE_DY;
-           aMain->addComputeNode(SUPERV::CNode::_narrow(node));
-         }
+
+//         SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
+//         if (CORBA::is_nil(node)) {
+//           QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));   
+//           return;
+//         }
+//         node->Coords(myX, myY);
+//         myX += NODE_DX;
+//         myY += NODE_DY;
+//         aMain->addComputeNode(SUPERV::CNode::_narrow(node));
+         }
        }
       }
       if (!b) {
index 86fc5a6332e768b4903acf2ece6c28b96a590780..b85ddbc15e6af79d5076a63073e97547bd1c5f98 100644 (file)
@@ -12,7 +12,7 @@ using namespace std;
 #include "SUPERVGUI_View.h"
 #include "SUPERVGUI_Main.h"
 #include "QAD_Config.h"
-
+#include <qcolordialog.h>
 
 
 #if QT_VERSION >= 0x030005
@@ -60,6 +60,9 @@ SUPERVGUI_View::SUPERVGUI_View(SUPERVGUI_Main* theMain):
   myPopup->insertItem(tr("MSG_COPY_DATAFLOW"), main, SLOT(copy()));
   myPopup->insertItem(tr("MSG_FILTER_NOTIFY"), main, SLOT(filterNotification()));
 
+  myPopup->insertSeparator();
+  myPopup->insertItem(tr("MSG_CHANGE_BACKGROUND"), this, SLOT(changeBackground()));
+
   QString aRed   = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorRed");
   QString aGreen = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorGreen");
   QString aBlue  = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorBlue");
@@ -174,3 +177,10 @@ int SUPERVGUI_View::getLastX() {
 int SUPERVGUI_View::getLastY() {
   return myLastY;
 }
+void SUPERVGUI_View::changeBackground()
+{
+  QColor selColor = QColorDialog::getColor(viewport()->paletteBackgroundColor(), this );
+  if ( selColor.isValid() ) {
+    setPaletteBackgroundColor( selColor );
+  }
+}
index cfc8565ad0006c76beac9bed11db94b9d7224743..c039c8e762c9c501d601e18a95854b397461209c 100644 (file)
@@ -45,6 +45,7 @@ class SUPERVGUI_View: public QScrollView {
 
  public slots:
    void addToStudy();
+   void changeBackground();
 
  protected:
     void viewportMouseMoveEvent(QMouseEvent* theEvent);
index d53ad9ce1c2c6494d126231bfe0d425693792052..200e43ad85daddbd60a928e6d4805faaa35e8325 100644 (file)
@@ -432,6 +432,9 @@ msgstr "Switch Array"
 msgid "MSG_FILTER_NOTIFY"
 msgstr "Filter Notification"
 
+msgid "MSG_CHANGE_BACKGROUND"
+msgstr "Change background..."
+
 msgid "MSG_SWITCH_GRAPH"
 msgstr "Switch Graph"
 
@@ -559,7 +562,7 @@ msgid "TIT_ADDCNODE"
 msgstr "Add Compute Node"
 
 msgid "TIT_ADDFNODE"
-msgstr "Add Factory Node"
+msgstr "Add Node"
 
 msgid "BTN_FACTORYNODE"
 msgstr "Factory"