-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"])