]> SALOME platform Git repositories - tools/yacsgen.git/blob - Examples/pyth2/components.py
Salome HOME
336c58ca1d3d7765e2ba5433c0806d7950b72146
[tools/yacsgen.git] / Examples / pyth2 / components.py
1 import os
2 from module_generator import Generator,Module,Service,PYComponent
3
4 context={'update':1,
5          "prerequisites":"/local/cchris/.packages.d/envSalome50",
6          "kernel":"/local/chris/SALOME2/RELEASES/Install/KERNEL_V5",
7         }
8
9 cwd=os.getcwd()
10
11
12 body="""
13       #b1
14       dep=calcium.CP_ITERATION
15       val=numpy.zeros(10,'d')
16       val[5]=a*b
17       nval=10
18       print "--------> Appel calcium.cp_edb"
19       info=calcium.cp_edb(component, dep, 0., 1, "ba", nval,val)
20       val=numpy.zeros(10,'d')
21       info,tt,ii,mval=calcium.cp_ldb(component, dep, 0.,1., 1, "aa", nval,val)
22       print mval,val
23       c=a+b
24       d=a-b
25       err=calcium.cp_fin(component,calcium.CP_ARRET)
26 """
27 c1=PYComponent("compo2",services=[
28           Service("s1",inport=[("a","double"),("b","double")],
29                        outport=[("c","double"),("d","double")],
30                        instream=[("aa","CALCIUM_double","I"),],
31                        outstream=[("ba","CALCIUM_double","I"),],
32                        defs="#def1",body=body,
33                  ),
34          ],
35          kind="exe",
36          )
37
38
39 g=Generator(Module("pycompos",components=[c1],prefix="./install"),context)
40 g.generate()
41 g.bootstrap()
42 g.configure()
43 g.make()
44 g.install()
45 g.make_appli("appli",restrict=["KERNEL","GUI","YACS"])
46