]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Mise à jour de ADAO pour le GUI V6.x
authorAndré Ribes <andre.ribes@edf.fr>
Wed, 22 Dec 2010 14:54:10 +0000 (15:54 +0100)
committerAndré Ribes <andre.ribes@edf.fr>
Wed, 22 Dec 2010 14:54:10 +0000 (15:54 +0100)
Création d'un composant C++
Création d'un fichier ADAO.py pour éviter le warning lors du
démarrage de SALOME

Makefile.am
configure.ac
idl/ADAO.idl
src/daSalome/daGUI/ADAO.py [new file with mode: 0644]
src/daSalome/daGUI/Makefile.am
src/daSalome/daGUI/daGuiComponent/Makefile.am [new file with mode: 0644]
src/daSalome/daGUI/daGuiComponent/adaogui_component.cxx [new file with mode: 0644]
src/daSalome/daGUI/daGuiComponent/adaogui_component.hxx [new file with mode: 0644]

index 6f72f7ac4433badce2944888306fae703224e0f0..e3f2ab9a6d437d937551f60e428395618cc24be7 100644 (file)
@@ -1,9 +1,15 @@
 include $(top_srcdir)/adm_local/make_common_starter.am
 
-SUBDIRS = src
+SUBDIRS =
 
 if SALOME_MODULE
-SUBDIRS += idl resources bin
+SUBDIRS += idl
+endif
+
+SUBDIRS += src
+
+if SALOME_MODULE
+SUBDIRS += resources bin
 endif
 
 if SPHINX_IS_OK
index b6bd102387896c0ffeee6f8782d1a43d894b526e..1694365d2f6d09f88190ea8222d69bac5a4d6195 100644 (file)
@@ -118,6 +118,7 @@ AC_CONFIG_FILES([
         src/daSalome/daGUI/daGuiImpl/Makefile
         src/daSalome/daGUI/daEficasWrapper/Makefile
         src/daSalome/daGUI/daEficasWrapper/eficasWrapper.py
+        src/daSalome/daGUI/daGuiComponent/Makefile
         src/tests/Makefile
         src/tests/daSalome/Makefile
         src/tests/daSalome/test000_Blue_AnalysisFile.py
index 11c9e093dc335dddc3ee4ff0851668b349ecf195..533cc9751c6d3890bbeae342bc831f44e394020d 100644 (file)
@@ -2,18 +2,17 @@
 #ifndef _ADAO_IDL_
 #define _ADAO_IDL_
 
+#include "SALOME_Component.idl"
 #include "DSC_Engines.idl"
-#include "SALOME_Exception.idl"
-#include "SALOME_PACOExtension.idl"
 
 module ADAO
 {
-typedef sequence<string> stringvec;
-typedef sequence<double> dblevec;
-typedef sequence<long> intvec;
-typedef Engines::dataref dataref;
-
-
+  interface ADAO_GUI_COMPONENT : Engines::Superv_Component
+  {
+   /*!
+    * Test that the component is ok
+    */
+    void print_ping();
+  };
 };
-
 #endif
diff --git a/src/daSalome/daGUI/ADAO.py b/src/daSalome/daGUI/ADAO.py
new file mode 100644 (file)
index 0000000..e69de29
index 1718d775a4fb61fb0454cadd0654db927a88aeb0..cc18e66b0ee7c11eba5b290bf958bab478163f58 100644 (file)
@@ -17,8 +17,8 @@
 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-SUBDIRS = daGuiImpl daEficasWrapper
+SUBDIRS = daGuiImpl daEficasWrapper daGuiComponent
 
 include $(top_srcdir)/adm_local/make_common_starter.am
 
-salomepython_PYTHON= ADAOGUI.py
+salomepython_PYTHON= ADAOGUI.py ADAO.py
diff --git a/src/daSalome/daGUI/daGuiComponent/Makefile.am b/src/daSalome/daGUI/daGuiComponent/Makefile.am
new file mode 100644 (file)
index 0000000..f774010
--- /dev/null
@@ -0,0 +1,14 @@
+
+include $(top_srcdir)/adm_local/make_common_starter.am
+
+AM_CFLAGS=$(SALOME_INCLUDES) -fexceptions
+
+lib_LTLIBRARIES= libADAOEngine.la
+salomeinclude_HEADERS= adaogui_component.hxx
+
+libADAOEngine_la_SOURCES        = adaogui_component.cxx
+nodist_libADAOEngine_la_SOURCES =
+libADAOEngine_la_CXXFLAGS       = -I$(top_builddir)/idl  $(KERNEL_INCLUDES) -I/usr/include
+libADAOEngine_la_LIBADD         = -L$(top_builddir)/idl -lADAO ${KERNEL_LIBS}
+libADAOEngine_la_LDFLAGS        =
+
diff --git a/src/daSalome/daGUI/daGuiComponent/adaogui_component.cxx b/src/daSalome/daGUI/daGuiComponent/adaogui_component.cxx
new file mode 100644 (file)
index 0000000..ae1f507
--- /dev/null
@@ -0,0 +1,69 @@
+#include <string>
+#include <iostream>
+#include "adaogui_component.hxx"
+
+using namespace std;
+
+//! Constructor for component "cppcompos" instance
+/*!
+ *
+ */
+ADAO_GUI_COMPONENT_i::ADAO_GUI_COMPONENT_i(CORBA::ORB_ptr orb,
+                                           PortableServer::POA_ptr poa,
+                                           PortableServer::ObjectId * contId,
+                                           const char *instanceName,
+                                           const char *interfaceName)
+: Superv_Component_i(orb, poa, contId, instanceName, interfaceName)
+{
+  _thisObj = this ;
+  _id = _poa->activate_object(_thisObj);
+}
+
+ADAO_GUI_COMPONENT_i::ADAO_GUI_COMPONENT_i(CORBA::ORB_ptr orb,
+                                           PortableServer::POA_ptr poa,
+                                           Engines::Container_ptr container,
+                                           const char *instanceName,
+                                           const char *interfaceName)
+: Superv_Component_i(orb, poa, container, instanceName, interfaceName)
+{
+  _thisObj = this ;
+  _id = _poa->activate_object(_thisObj);
+}
+
+void 
+ADAO_GUI_COMPONENT_i::destroy()
+{
+  Engines_Component_i::destroy();
+}
+
+CORBA::Boolean
+ADAO_GUI_COMPONENT_i::init_service(const char * service_name)
+{
+  CORBA::Boolean rtn = true;
+  return rtn;
+}
+
+void
+ADAO_GUI_COMPONENT_i::print_ping()
+{
+  std::cerr << "ADAO_GUI_COMPONENT_i ping" << std::endl;
+}
+//! Destructor for component "ADAO_GUI_COMPONENT_i" instance
+ADAO_GUI_COMPONENT_i::~ADAO_GUI_COMPONENT_i()
+{
+}
+
+extern "C"
+{
+  PortableServer::ObjectId * ADAOEngine_factory(CORBA::ORB_ptr orb,
+                                                PortableServer::POA_ptr poa,
+                                                PortableServer::ObjectId * contId,
+                                                const char *instanceName,
+                                                const char *interfaceName)
+  {
+    MESSAGE("PortableServer::ObjectId * ADAOEngine_factory()");
+    ADAO_GUI_COMPONENT_i * myEngine = new ADAO_GUI_COMPONENT_i(orb, poa, contId, instanceName, interfaceName);
+    return myEngine->getId() ;
+  }
+}
+
diff --git a/src/daSalome/daGUI/daGuiComponent/adaogui_component.hxx b/src/daSalome/daGUI/daGuiComponent/adaogui_component.hxx
new file mode 100644 (file)
index 0000000..6873bcb
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef _ADAO_GUI_COMPONENT_HXX_
+#define _ADAO_GUI_COMPONENT_HXX_
+
+#include <SALOME_Component.hh>
+#include "Superv_Component_i.hxx"
+#include "ADAO.hh"
+
+class ADAO_GUI_COMPONENT_i:
+  public virtual POA_ADAO::ADAO_GUI_COMPONENT,
+  public virtual Superv_Component_i
+{
+  public:
+    ADAO_GUI_COMPONENT_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa,
+                         PortableServer::ObjectId * contId,
+                         const char *instanceName, const char *interfaceName);
+    ADAO_GUI_COMPONENT_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa,
+                         Engines::Container_ptr container,
+                         const char *instanceName, const char *interfaceName);
+    virtual ~ADAO_GUI_COMPONENT_i();
+
+    void destroy();
+    CORBA::Boolean init_service(const char * service_name);
+
+    virtual void print_ping();
+};
+
+extern "C"
+{
+    PortableServer::ObjectId * ADAOEngine_factory(CORBA::ORB_ptr orb,
+                                                  PortableServer::POA_ptr poa,
+                                                  PortableServer::ObjectId * contId,
+                                                  const char *instanceName,
+                                                  const char *interfaceName);
+}
+#endif
+