From: André Ribes Date: Wed, 22 Dec 2010 14:54:10 +0000 (+0100) Subject: Mise à jour de ADAO pour le GUI V6.x X-Git-Tag: V6_4_0rc3~106 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=161be210e348efd1c5607f9485af2ee4c26352a8;p=modules%2Fadao.git Mise à jour de ADAO pour le GUI V6.x Création d'un composant C++ Création d'un fichier ADAO.py pour éviter le warning lors du démarrage de SALOME --- diff --git a/Makefile.am b/Makefile.am index 6f72f7a..e3f2ab9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index b6bd102..1694365 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/idl/ADAO.idl b/idl/ADAO.idl index 11c9e09..533cc97 100644 --- a/idl/ADAO.idl +++ b/idl/ADAO.idl @@ -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 stringvec; -typedef sequence dblevec; -typedef sequence 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 index 0000000..e69de29 diff --git a/src/daSalome/daGUI/Makefile.am b/src/daSalome/daGUI/Makefile.am index 1718d77..cc18e66 100644 --- a/src/daSalome/daGUI/Makefile.am +++ b/src/daSalome/daGUI/Makefile.am @@ -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 index 0000000..f774010 --- /dev/null +++ b/src/daSalome/daGUI/daGuiComponent/Makefile.am @@ -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 index 0000000..ae1f507 --- /dev/null +++ b/src/daSalome/daGUI/daGuiComponent/adaogui_component.cxx @@ -0,0 +1,69 @@ +#include +#include +#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 index 0000000..6873bcb --- /dev/null +++ b/src/daSalome/daGUI/daGuiComponent/adaogui_component.hxx @@ -0,0 +1,36 @@ +#ifndef _ADAO_GUI_COMPONENT_HXX_ +#define _ADAO_GUI_COMPONENT_HXX_ + +#include +#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 +