]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: transfer Python interface from DSC_User/Datastream/Calcium to DSC_Python
authorcaremoli <caremoli>
Tue, 26 Jun 2007 09:15:35 +0000 (09:15 +0000)
committercaremoli <caremoli>
Tue, 26 Jun 2007 09:15:35 +0000 (09:15 +0000)
src/DSC/DSC_Python/Makefile.am [new file with mode: 0644]
src/DSC/DSC_Python/calcium.i [new file with mode: 0644]
src/DSC/DSC_Python/dsccalcium.py [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/Makefile.am
src/DSC/DSC_User/Datastream/Calcium/calcium.i [deleted file]
src/DSC/DSC_User/Datastream/Calcium/dsccalcium.py [deleted file]
src/DSC/DSC_User/Makefile.am
src/DSC/Makefile.am

diff --git a/src/DSC/DSC_Python/Makefile.am b/src/DSC/DSC_Python/Makefile.am
new file mode 100644 (file)
index 0000000..48ed93f
--- /dev/null
@@ -0,0 +1,79 @@
+#  Copyright (C) 2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#
+#
+#  File   : Makefile.am
+#  Author : André RIBES (EDF), Eric Fayolle (EDF)
+#  Module : KERNEL
+#
+
+include $(top_srcdir)/salome_adm/unix/make_common_starter.am
+
+# ===============================================================
+# Local definitions
+# ===============================================================
+#
+
+# This local variable defines the list of CPPFLAGS common to all target in this package.
+COMMON_CPPFLAGS= -I$(top_srcdir)/src/DSC/DSC_User \
+                -I$(top_srcdir)/src/DSC/DSC_User/Datastream \
+                -I$(top_srcdir)/src/DSC/DSC_User/Datastream/Palm \
+                -I$(top_srcdir)/src/DSC/DSC_User/Datastream/Calcium \
+                -I$(top_srcdir)/src/DSC/DSC_User/Basic \
+                -I$(top_srcdir)/src/DSC/DSC_Basic \
+                -I$(top_srcdir)/src/SALOMELocalTrace \
+                -I$(top_srcdir)/src/Basics \
+                -I$(top_srcdir)/src/Utils \
+                -I$(top_srcdir)/src/Container \
+                -I$(top_srcdir)/src/Notification \
+                -I$(top_builddir)/salome_adm/unix \
+                -I$(top_builddir)/idl \
+                @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @BOOST_CPPFLAGS@
+
+# This local variable defines the list of dependant libraries common to all target in this package.
+COMMON_LIBS = @CORBA_LIBS@
+
+#
+# ===============================================================
+# Libraries targets
+# ===============================================================
+#
+
+AM_CFLAGS         = -fexceptions
+pkgpython_PYTHON = calcium.py dsccalcium.py
+pkgpyexec_LTLIBRARIES = _calcium.la
+SWIG_FLAGS= -python -c++ -noexcept
+SWIG_SRC=calcium.i
+_calcium_la_SOURCES = calcium_wrap.cpp
+_calcium_la_LDFLAGS = -module
+_calcium_la_LIBADD = ../DSC_User/Datastream/Calcium/libCalciumC.la \
+                                                                                ../DSC_User/Datastream/libSalomeDatastream.la \
+                                                                                ../DSC_User/Basic/libSalomeDSCSupervBasic.la \
+                                                                                ../DSC_User/libSalomeDSCSuperv.la \
+                                                                                ../DSC_Basic/libSalomeDSCContainer.la \
+                                                                                ../../Container/libSalomeContainer.la 
+
+_calcium_la_CXXFLAGS = $(PYTHON_INCLUDES) $(COMMON_CPPFLAGS)
+
+calcium_wrap.cpp calcium.py:calcium.i
+       $(SWIG) $(SWIG_FLAGS) -o calcium_wrap.cpp $<
+
+CLEANFILES = calcium_wrap.cpp
+
diff --git a/src/DSC/DSC_Python/calcium.i b/src/DSC/DSC_Python/calcium.i
new file mode 100644 (file)
index 0000000..3c7c49a
--- /dev/null
@@ -0,0 +1,241 @@
+%define DOCSTRING
+"CALCIUM python wrapping : Superv_Component class
+"
+%enddef
+
+%module(docstring=DOCSTRING) calcium
+
+%feature("autodoc", "0");
+
+%{
+//C++ Includes 
+#include <Calcium.hxx>
+#include <calcium.h>
+#include <Superv_Component_i.hxx>
+#include <omniORB4/CORBA.h>
+
+//--- from omniORBpy.h (not present on Debian Sarge packages)
+
+struct omniORBpyAPI {
+
+  PyObject* (*cxxObjRefToPyObjRef)(const CORBA::Object_ptr cxx_obj,
+           CORBA::Boolean hold_lock);
+  // Convert a C++ object reference to a Python object reference.
+  // If <hold_lock> is true, caller holds the Python interpreter lock.
+
+  CORBA::Object_ptr (*pyObjRefToCxxObjRef)(PyObject* py_obj,
+             CORBA::Boolean hold_lock);
+  // Convert a Python object reference to a C++ object reference.
+  // Raises BAD_PARAM if the Python object is not an object reference.
+  // If <hold_lock> is true, caller holds the Python interpreter lock.
+
+
+  omniORBpyAPI();
+  // Constructor for the singleton. Sets up the function pointers.
+};
+
+  omniORBpyAPI* api;
+
+%}
+
+%init
+%{
+  // init section
+
+  PyObject* omnipy = PyImport_ImportModule((char*)"_omnipy");
+  if (!omnipy)
+  {
+    PyErr_SetString(PyExc_ImportError,
+        (char*)"Cannot import _omnipy");
+    return;
+  }
+  PyObject* pyapi = PyObject_GetAttrString(omnipy, (char*)"API");
+  api = (omniORBpyAPI*)PyCObject_AsVoidPtr(pyapi);
+  Py_DECREF(pyapi);
+%}
+
+%include "carrays.i" 
+%include "cpointer.i"
+
+/* Wrap a class interface around an "int *" */
+%pointer_class(int, intp);
+/* Wrap a class interface around an "float *" */
+%pointer_class(float, floatp);
+/* Wrap a class interface around an "double *" */
+%pointer_class(double, doublep);
+
+%array_class(int, intArray);
+%array_class(float, floatArray);
+%array_class(double, doubleArray);
+
+%typemap(python,in) CORBA::Boolean
+{
+  $1=(CORBA::Boolean)PyInt_AsLong($input);
+}
+
+%typemap(python,in) CORBA::ORB_ptr 
+{
+  try {
+     CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
+     $1 = CORBA::ORB::_narrow(obj);
+  }
+  catch (...) {
+     PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
+  }
+}
+%typemap(python,in) PortableServer::POA_ptr
+{
+  try {
+     CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
+     $1 = PortableServer::POA::_narrow(obj);
+  }
+  catch (...) {
+     PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
+  }
+}
+
+%typemap(python,in) Engines::Container_ptr
+{
+  try {
+     CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
+     $1 = Engines::Container::_narrow(obj);
+  }
+  catch (...) {
+     PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
+  }
+}
+%typemap(python,in) Ports::Port_ptr
+{
+  try {
+     CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
+     $1 = Ports::Port::_narrow(obj);
+  }
+  catch (...) {
+     PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
+  }
+}
+
+%typemap(python,out) Ports::Port_ptr , Ports::PortProperties_ptr
+{
+  $result = api->cxxObjRefToPyObjRef($1, 1);
+}
+
+/*
+ * Exception section
+ */
+// a general exception handler
+%exception {
+   try {
+      $action
+   } catch(Engines::DSC::PortNotDefined& _e) {
+      PyErr_SetString(PyExc_ValueError,"Port not defined");
+      return NULL;
+   } catch(Engines::DSC::PortNotConnected& _e) {
+      PyErr_SetString(PyExc_ValueError,"Port not connected");
+      return NULL;
+   } catch(Engines::DSC::BadPortType& _e) {
+      PyErr_SetString(PyExc_ValueError,"Bad port type");
+      return NULL;
+   } catch(...) {
+      PyErr_SetString(PyExc_ValueError,"Unknown exception");
+      return NULL;
+   }
+}
+
+/*
+ * End of Exception section
+ */
+namespace Engines
+{
+class DSC
+{
+  public:
+    enum Message { AddingConnection, RemovingConnection, ApplicationError };
+};
+}
+
+class PySupervCompo:public Superv_Component_i
+{
+  public:
+
+    PySupervCompo(CORBA::ORB_ptr orb,
+         PortableServer::POA_ptr poa,
+         Engines::Container_ptr contai,
+         const char *instanceName,
+         const char *interfaceName);
+
+    virtual ~PySupervCompo();
+    CORBA::Boolean init_service(const char * service_name){return true;};
+    virtual provides_port * create_provides_data_port(const char* port_fab_type)
+        throw (BadFabType);
+    virtual uses_port * create_uses_data_port(const char* port_fab_type)
+        throw (BadFabType);
+    virtual void add_port(const char * port_fab_type,
+        const char * port_type,
+        const char * port_name)
+        throw (PortAlreadyDefined, BadFabType, BadType, BadProperty);
+    template < typename SpecificPortType >
+    SpecificPortType * add_port(const char * port_fab_type,
+            const char * port_type,
+            const char * port_name)
+          throw (PortAlreadyDefined, BadFabType, BadType, BadCast, BadProperty);
+    virtual void add_port(provides_port * port,
+          const char* provides_port_name)
+          throw (PortAlreadyDefined, NilPort, BadProperty);
+    virtual void add_port(uses_port * port,
+          const char* uses_port_name)
+          throw (PortAlreadyDefined, NilPort, BadProperty);
+    template <typename SpecificPortType >
+    SpecificPortType * get_port( const char * port_name)
+          throw (PortNotDefined, PortNotConnected, BadCast, UnexpectedState);
+    virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
+              const CORBA::Boolean connection_error)
+              throw (Engines::DSC::PortNotDefined,
+                     Engines::DSC::PortNotConnected,
+                     Engines::DSC::BadPortType);
+    virtual void connect_uses_port(const char* uses_port_name,
+                         Ports::Port_ptr provides_port_ref)
+              throw (Engines::DSC::PortNotDefined,
+                     Engines::DSC::BadPortType,
+                     Engines::DSC::NilPort);
+    virtual void connect_provides_port(const char* provides_port_name)
+              throw (Engines::DSC::PortNotDefined);
+    virtual void disconnect_provides_port(const char* provides_port_name,
+              const Engines::DSC::Message message)
+              throw (Engines::DSC::PortNotDefined,
+                     Engines::DSC::PortNotConnected);
+
+    virtual void disconnect_uses_port(const char* uses_port_name,
+                  Ports::Port_ptr provides_port_ref,
+                  const Engines::DSC::Message message)
+              throw (Engines::DSC::PortNotDefined,
+                     Engines::DSC::PortNotConnected,
+                     Engines::DSC::BadPortReference);
+
+    virtual Ports::PortProperties_ptr get_port_properties(const char* port_name);
+
+    %extend
+      {
+       //To get the address of the component
+        long ptr()
+        {
+          return (long)self;
+        }
+      }
+};
+
+extern "C" void create_port(Superv_Component_i* compo,char* name,char* type,char *mode,char* depend);
+
+#define   CP_TEMPS    40
+#define   CP_ITERATION    41
+#define   CP_SEQUENTIEL   42
+#define   CP_CONT    20
+#define   CP_ARRET   21
+
+int cp_een(void *component,int dep,float t,int n,char *nom,int nval,int *val);
+int cp_edb(void *component,int dep,double t,int n,char *nom,int nval,double *val);
+
+int cp_len(void *component,int dep,float *INOUT,float *INPUT,int *INOUT,char *nom,int nmax,int *OUTPUT,int *val);
+int cp_ldb(void *component,int dep,double *INOUT,double *INPUT,int *INOUT,char *nom,int nmax,int *OUTPUT,double *val);
+int cp_fin(void *component,int cp_end);
+
diff --git a/src/DSC/DSC_Python/dsccalcium.py b/src/DSC/DSC_Python/dsccalcium.py
new file mode 100644 (file)
index 0000000..c96fdc1
--- /dev/null
@@ -0,0 +1,53 @@
+import calcium
+import SALOME_ComponentPy
+import SALOME_DriverPy
+import Engines
+
+class PyDSCComponent(SALOME_ComponentPy.SALOME_ComponentPy_i,
+                     SALOME_DriverPy.SALOME_DriverPy_i):
+  """
+     A Python SALOME component is implemented by a Python class that has
+     the name of the component and is located in a python module that has the
+     name of the component.
+
+     This class is a base class for Python DSC components.
+
+     You must derive it and implement init_service and those methods
+     that are services of the component.
+  """
+  def __init__ ( self, orb, poa, contID, containerName, instanceName, interfaceName ):
+    SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa,
+                    contID, containerName, instanceName, interfaceName, 0)
+    SALOME_DriverPy.SALOME_DriverPy_i.__init__(self, interfaceName)
+    # create the DSC proxy
+    self.proxy=calcium.PySupervCompo(orb,poa,contID,instanceName,interfaceName )
+    # Store a reference on naming service in _naming_service attribute 
+    self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
+
+  def init_service(self,service):
+    return True
+
+  enums={Engines.DSC.RemovingConnection:calcium.DSC.RemovingConnection,
+         Engines.DSC.AddingConnection:calcium.DSC.AddingConnection,
+         Engines.DSC.ApplicationError:calcium.DSC.ApplicationError,
+        }
+  def get_provides_port(self,name,error):
+    return self.proxy.get_provides_port(name,error)
+
+  def connect_uses_port(self,name,port):
+    self.proxy.connect_uses_port(name,port)
+
+  def connect_provides_port(self,name):
+    self.proxy.connect_provides_port(name)
+
+  def disconnect_provides_port(self,name,message):
+    self.proxy.disconnect_provides_port(name,message._v)
+    #self.proxy.disconnect_provides_port(name,self.enums[message])
+
+  def disconnect_uses_port(self,name,port,message):
+    self.proxy.disconnect_uses_port(name,port,message._v)
+    #self.proxy.disconnect_uses_port(name,port,self.enums[message])
+
+  def get_port_properties(self,name):
+    return self.proxy.get_port_properties(name)
+
index ee7064940be723110f996adea2f52bcc32b943ec..6f829cd01992be4acbf424aebe714ae7249a18b4 100644 (file)
@@ -109,26 +109,6 @@ lib_LTLIBRARIES = libCalciumC.la
 libCalciumC_la_SOURCES = Calcium.c Calcium.cxx calciumf.c
 libCalciumC_la_CXXFLAGS = $(COMMON_CPPFLAGS)
 
-pkgpython_PYTHON = calcium.py dsccalcium.py
-pkgpyexec_LTLIBRARIES = _calcium.la
-SWIG_FLAGS= -python -c++ -noexcept
-SWIG_SRC=calcium.i
-_calcium_la_SOURCES = calcium_wrap.cpp
-_calcium_la_LDFLAGS = -module
-_calcium_la_LIBADD = libCalciumC.la \
-                                                                                ../libSalomeDatastream.la \
-                                                                                ../../Basic/libSalomeDSCSupervBasic.la \
-                                                                                ../../libSalomeDSCSuperv.la \
-                                                                                ../../../DSC_Basic/libSalomeDSCContainer.la \
-                                                                                ../../../../Container/libSalomeContainer.la 
-
-_calcium_la_CXXFLAGS = $(PYTHON_INCLUDES) $(COMMON_CPPFLAGS)
-
-calcium_wrap.cpp calcium.py:calcium.i
-       $(SWIG) $(SWIG_FLAGS) -o calcium_wrap.cpp $<
-
-CLEANFILES = calcium_wrap.cpp
-
 #
 # ===============================================================
 # Executables targets
diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium.i b/src/DSC/DSC_User/Datastream/Calcium/calcium.i
deleted file mode 100644 (file)
index 3c7c49a..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-%define DOCSTRING
-"CALCIUM python wrapping : Superv_Component class
-"
-%enddef
-
-%module(docstring=DOCSTRING) calcium
-
-%feature("autodoc", "0");
-
-%{
-//C++ Includes 
-#include <Calcium.hxx>
-#include <calcium.h>
-#include <Superv_Component_i.hxx>
-#include <omniORB4/CORBA.h>
-
-//--- from omniORBpy.h (not present on Debian Sarge packages)
-
-struct omniORBpyAPI {
-
-  PyObject* (*cxxObjRefToPyObjRef)(const CORBA::Object_ptr cxx_obj,
-           CORBA::Boolean hold_lock);
-  // Convert a C++ object reference to a Python object reference.
-  // If <hold_lock> is true, caller holds the Python interpreter lock.
-
-  CORBA::Object_ptr (*pyObjRefToCxxObjRef)(PyObject* py_obj,
-             CORBA::Boolean hold_lock);
-  // Convert a Python object reference to a C++ object reference.
-  // Raises BAD_PARAM if the Python object is not an object reference.
-  // If <hold_lock> is true, caller holds the Python interpreter lock.
-
-
-  omniORBpyAPI();
-  // Constructor for the singleton. Sets up the function pointers.
-};
-
-  omniORBpyAPI* api;
-
-%}
-
-%init
-%{
-  // init section
-
-  PyObject* omnipy = PyImport_ImportModule((char*)"_omnipy");
-  if (!omnipy)
-  {
-    PyErr_SetString(PyExc_ImportError,
-        (char*)"Cannot import _omnipy");
-    return;
-  }
-  PyObject* pyapi = PyObject_GetAttrString(omnipy, (char*)"API");
-  api = (omniORBpyAPI*)PyCObject_AsVoidPtr(pyapi);
-  Py_DECREF(pyapi);
-%}
-
-%include "carrays.i" 
-%include "cpointer.i"
-
-/* Wrap a class interface around an "int *" */
-%pointer_class(int, intp);
-/* Wrap a class interface around an "float *" */
-%pointer_class(float, floatp);
-/* Wrap a class interface around an "double *" */
-%pointer_class(double, doublep);
-
-%array_class(int, intArray);
-%array_class(float, floatArray);
-%array_class(double, doubleArray);
-
-%typemap(python,in) CORBA::Boolean
-{
-  $1=(CORBA::Boolean)PyInt_AsLong($input);
-}
-
-%typemap(python,in) CORBA::ORB_ptr 
-{
-  try {
-     CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
-     $1 = CORBA::ORB::_narrow(obj);
-  }
-  catch (...) {
-     PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
-  }
-}
-%typemap(python,in) PortableServer::POA_ptr
-{
-  try {
-     CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
-     $1 = PortableServer::POA::_narrow(obj);
-  }
-  catch (...) {
-     PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
-  }
-}
-
-%typemap(python,in) Engines::Container_ptr
-{
-  try {
-     CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
-     $1 = Engines::Container::_narrow(obj);
-  }
-  catch (...) {
-     PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
-  }
-}
-%typemap(python,in) Ports::Port_ptr
-{
-  try {
-     CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
-     $1 = Ports::Port::_narrow(obj);
-  }
-  catch (...) {
-     PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
-  }
-}
-
-%typemap(python,out) Ports::Port_ptr , Ports::PortProperties_ptr
-{
-  $result = api->cxxObjRefToPyObjRef($1, 1);
-}
-
-/*
- * Exception section
- */
-// a general exception handler
-%exception {
-   try {
-      $action
-   } catch(Engines::DSC::PortNotDefined& _e) {
-      PyErr_SetString(PyExc_ValueError,"Port not defined");
-      return NULL;
-   } catch(Engines::DSC::PortNotConnected& _e) {
-      PyErr_SetString(PyExc_ValueError,"Port not connected");
-      return NULL;
-   } catch(Engines::DSC::BadPortType& _e) {
-      PyErr_SetString(PyExc_ValueError,"Bad port type");
-      return NULL;
-   } catch(...) {
-      PyErr_SetString(PyExc_ValueError,"Unknown exception");
-      return NULL;
-   }
-}
-
-/*
- * End of Exception section
- */
-namespace Engines
-{
-class DSC
-{
-  public:
-    enum Message { AddingConnection, RemovingConnection, ApplicationError };
-};
-}
-
-class PySupervCompo:public Superv_Component_i
-{
-  public:
-
-    PySupervCompo(CORBA::ORB_ptr orb,
-         PortableServer::POA_ptr poa,
-         Engines::Container_ptr contai,
-         const char *instanceName,
-         const char *interfaceName);
-
-    virtual ~PySupervCompo();
-    CORBA::Boolean init_service(const char * service_name){return true;};
-    virtual provides_port * create_provides_data_port(const char* port_fab_type)
-        throw (BadFabType);
-    virtual uses_port * create_uses_data_port(const char* port_fab_type)
-        throw (BadFabType);
-    virtual void add_port(const char * port_fab_type,
-        const char * port_type,
-        const char * port_name)
-        throw (PortAlreadyDefined, BadFabType, BadType, BadProperty);
-    template < typename SpecificPortType >
-    SpecificPortType * add_port(const char * port_fab_type,
-            const char * port_type,
-            const char * port_name)
-          throw (PortAlreadyDefined, BadFabType, BadType, BadCast, BadProperty);
-    virtual void add_port(provides_port * port,
-          const char* provides_port_name)
-          throw (PortAlreadyDefined, NilPort, BadProperty);
-    virtual void add_port(uses_port * port,
-          const char* uses_port_name)
-          throw (PortAlreadyDefined, NilPort, BadProperty);
-    template <typename SpecificPortType >
-    SpecificPortType * get_port( const char * port_name)
-          throw (PortNotDefined, PortNotConnected, BadCast, UnexpectedState);
-    virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
-              const CORBA::Boolean connection_error)
-              throw (Engines::DSC::PortNotDefined,
-                     Engines::DSC::PortNotConnected,
-                     Engines::DSC::BadPortType);
-    virtual void connect_uses_port(const char* uses_port_name,
-                         Ports::Port_ptr provides_port_ref)
-              throw (Engines::DSC::PortNotDefined,
-                     Engines::DSC::BadPortType,
-                     Engines::DSC::NilPort);
-    virtual void connect_provides_port(const char* provides_port_name)
-              throw (Engines::DSC::PortNotDefined);
-    virtual void disconnect_provides_port(const char* provides_port_name,
-              const Engines::DSC::Message message)
-              throw (Engines::DSC::PortNotDefined,
-                     Engines::DSC::PortNotConnected);
-
-    virtual void disconnect_uses_port(const char* uses_port_name,
-                  Ports::Port_ptr provides_port_ref,
-                  const Engines::DSC::Message message)
-              throw (Engines::DSC::PortNotDefined,
-                     Engines::DSC::PortNotConnected,
-                     Engines::DSC::BadPortReference);
-
-    virtual Ports::PortProperties_ptr get_port_properties(const char* port_name);
-
-    %extend
-      {
-       //To get the address of the component
-        long ptr()
-        {
-          return (long)self;
-        }
-      }
-};
-
-extern "C" void create_port(Superv_Component_i* compo,char* name,char* type,char *mode,char* depend);
-
-#define   CP_TEMPS    40
-#define   CP_ITERATION    41
-#define   CP_SEQUENTIEL   42
-#define   CP_CONT    20
-#define   CP_ARRET   21
-
-int cp_een(void *component,int dep,float t,int n,char *nom,int nval,int *val);
-int cp_edb(void *component,int dep,double t,int n,char *nom,int nval,double *val);
-
-int cp_len(void *component,int dep,float *INOUT,float *INPUT,int *INOUT,char *nom,int nmax,int *OUTPUT,int *val);
-int cp_ldb(void *component,int dep,double *INOUT,double *INPUT,int *INOUT,char *nom,int nmax,int *OUTPUT,double *val);
-int cp_fin(void *component,int cp_end);
-
diff --git a/src/DSC/DSC_User/Datastream/Calcium/dsccalcium.py b/src/DSC/DSC_User/Datastream/Calcium/dsccalcium.py
deleted file mode 100644 (file)
index c96fdc1..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-import calcium
-import SALOME_ComponentPy
-import SALOME_DriverPy
-import Engines
-
-class PyDSCComponent(SALOME_ComponentPy.SALOME_ComponentPy_i,
-                     SALOME_DriverPy.SALOME_DriverPy_i):
-  """
-     A Python SALOME component is implemented by a Python class that has
-     the name of the component and is located in a python module that has the
-     name of the component.
-
-     This class is a base class for Python DSC components.
-
-     You must derive it and implement init_service and those methods
-     that are services of the component.
-  """
-  def __init__ ( self, orb, poa, contID, containerName, instanceName, interfaceName ):
-    SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa,
-                    contID, containerName, instanceName, interfaceName, 0)
-    SALOME_DriverPy.SALOME_DriverPy_i.__init__(self, interfaceName)
-    # create the DSC proxy
-    self.proxy=calcium.PySupervCompo(orb,poa,contID,instanceName,interfaceName )
-    # Store a reference on naming service in _naming_service attribute 
-    self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
-
-  def init_service(self,service):
-    return True
-
-  enums={Engines.DSC.RemovingConnection:calcium.DSC.RemovingConnection,
-         Engines.DSC.AddingConnection:calcium.DSC.AddingConnection,
-         Engines.DSC.ApplicationError:calcium.DSC.ApplicationError,
-        }
-  def get_provides_port(self,name,error):
-    return self.proxy.get_provides_port(name,error)
-
-  def connect_uses_port(self,name,port):
-    self.proxy.connect_uses_port(name,port)
-
-  def connect_provides_port(self,name):
-    self.proxy.connect_provides_port(name)
-
-  def disconnect_provides_port(self,name,message):
-    self.proxy.disconnect_provides_port(name,message._v)
-    #self.proxy.disconnect_provides_port(name,self.enums[message])
-
-  def disconnect_uses_port(self,name,port,message):
-    self.proxy.disconnect_uses_port(name,port,message._v)
-    #self.proxy.disconnect_uses_port(name,port,self.enums[message])
-
-  def get_port_properties(self,name):
-    return self.proxy.get_port_properties(name)
-
index ec9ce2fbc1206ede89fbb79a55304a6e9cf40935..37d753254fd695055a22e0866bc871592032a205 100644 (file)
@@ -23,7 +23,6 @@
 #  Author : André RIBES (EDF)
 #  Module : KERNEL
 
-SUBDIRS = Basic Datastream
 
 include $(top_srcdir)/salome_adm/unix/make_common_starter.am
 
@@ -93,3 +92,4 @@ test_DSC_Exception_CXXFLAGS = $(COMMON_CPPFLAGS)
 
 test_DSC_Exception_LDADD = $(top_builddir)/src/Utils/libOpUtil.la
 
+SUBDIRS = Basic Datastream
index fb949237fb297f6040df236a742be7e3a9eda6fb..edc4849c76517932bfcc91d8c4f86fd61ef70de3 100644 (file)
@@ -27,4 +27,4 @@ if WITH_PACO_PARALLEL
 SUBDIR_PAR = ParallelDSC
 endif
 
-SUBDIRS = DSC_Basic DSC_User $(SUBDIR_PAR)
+SUBDIRS = DSC_Basic DSC_User $(SUBDIR_PAR) DSC_Python