- Create several SALOME modules containing at least one component for which the service(s) have CALCIUM ports.
Creating a SALOME module consists of structuring header, source, library and resource files in the form of a standard
-directory structure. It can be done from a model module (HELLO, PYHELLO), or from a module generator (for example :ref:`yacsgen`)
+directory structure. It can be done from a model module (HELLO, PYHELLO).
Customisation of the SALOME component for the use of CALCIUM ports consists of:
- creating CALCIUM ports used in the definition of a standard method called init_service,
- declaration of CALCIUM ports of the component(s) in the module catalog file.
-By using YACSGEN, the init_service method and the XML catalog of services provided by components are generated automatically.
-
The IDL declaration of components using CALCIUM ports
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Declaration of component resources (part 1)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
Components publish signatures of their services in an XML resource file called the module catalog (or components catalog).
-This file can be generated by YACSGEN.
Extract from the CALCIUM_TESTSCatalog.xml catalog concerning the ECODE component:
Extract from the implementation of the EcodeGo() (ECODE.cxx) service calling the ecode wrapped code (void* component)(Ecode.c):
-(This code can be generated by YACSGEN)
-
.. code-block:: cpp
-Generating a CALCIUM module with YACSGEN: example
------------------------------------------------------
-Complete YACSGEN script to create a generated CALCIUM_TESTS module:
-
-.. code-block:: python
-
- from module_generator import Generator,Module,Service
- from module_generator import PYComponent,CPPComponent,F77Component
- context={"update":1,
- "prerequisites":"/local/salome5/SALOME5/V5NoDebug/prerequis-V5NoDebug.sh",
- "kernel":"/local/salome5/SALOME5/V5NoDebug/DEV/INSTALL/KERNEL/"
- }
-
- c1=CPPComponent("ECODE",
- services=[
- Service("EcodeGo",
- instream=[
- ("ETP_EN","CALCIUM_integer","T"),
- ("ETP_RE","CALCIUM_real","T"),
- ("ETP_DB","CALCIUM_double","T"),
- ("ETP_CX","CALCIUM_complex","T"),
- ("ETP_CH","CALCIUM_string","T"),
- ("ETP_LQ","CALCIUM_logical","T"),
- ("EIP_EN","CALCIUM_integer","I"),
- ("EIP_DB","CALCIUM_double","I"),
- ("ETP_DB2","CALCIUM_double","T"),
- ("EIS_EN","CALCIUM_integer","I"),
- ("EIS_DB","CALCIUM_double","I"),
- ("ETS_EN","CALCIUM_integer","T"),
- ("ETS_DB","CALCIUM_double","T") ],
- outstream=[],
- defs="""extern "C" {
- int ecode(void *);
- }""",
- body="""
- ecode(component);
- """
- ,),
- ],
- libs="",
- rlibs=""
- )
-
- c2=CPPComponent("SCODE",
- services=[
- Service("ScodeGo",
- instream=[],
- outstream=[
- ("STP_EN","CALCIUM_integer","T"),
- ("STP_RE","CALCIUM_real","T"),
- ("STP_DB","CALCIUM_double","T"),
- ("STP_CX","CALCIUM_complex","T"),
- ("STP_CH","CALCIUM_string","T"),
- ("STP_LQ","CALCIUM_logical","T"),
- ("SIP_EN","CALCIUM_integer","I"),
- ("SIP_DB","CALCIUM_double","I"),
- ("STP_DB2","CALCIUM_double","T"),
- ("SIS_EN","CALCIUM_integer","I"),
- ("SIS_DB","CALCIUM_double","I"),
- ("STS_EN","CALCIUM_integer","T"),
- ("STS_DB","CALCIUM_double","T"),
- ("SIP_DB2","CALCIUM_double","I") ],
- defs="""extern "C" {
- int scode(void *);
- }""",
- body="""
- scode(component);
- """
- ,),
- ],
- libs="",
- rlibs=""
- )
-
- c3=CPPComponent("ESPION",
- services=[
- Service("EspionGo",
- instream=[
- ("SIP_DB2","CALCIUM_double","I"),
- ("EIP_DB","CALCIUM_double","I")],
- outstream=[
- ("STP_DB2","CALCIUM_double","T"),
- ("SIP_DB","CALCIUM_double","I") ],
- defs="""extern "C" {
- int espion(void *);
- }""",
- body="""
- espion(component);
- """
- ,),
- ],
- libs="",
- rlibs=""
- )
-
-
- m=Module("CALCIUM_TESTS",components=[c1,c2,c3],prefix="INSTALL")
-
- g=Generator(m,context)
- g.generate()
- ##g.bootstrap()
- ##g.configure()
- ##g.make()
- ##g.install()
- ##g.make_appli("appli",restrict=["KERNEL","GUI","YACS"])
.. [1] The CALCIUM library is shared between several components in a single container, therefore it needs a pointer to the component to identify the requested ports.