1 # Copyright (C) 2009-2021 EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #import context from ..
23 exec(compile(open("../context.py").read(), "../context.py", 'exec'))
25 from module_generator import *
36 #include "myinterface.idl"
40 import SALOME_DriverPy
43 class A(SALOME_DriverPy.SALOME_DriverPy_i):
45 SALOME_DriverPy.SALOME_DriverPy_i.__init__(self,"pycompos")
48 def createObject( self, study, name ):
52 builder = study.NewBuilder()
53 father = study.FindComponent( "pycompos" )
55 father = builder.NewComponent( "pycompos" )
56 attr = builder.FindOrCreateAttribute( father, "AttributeName" )
57 attr.SetValue( "pycompos" )
59 object = builder.NewObject( father )
60 attr = builder.FindOrCreateAttribute( object, "AttributeName" )
65 def DumpPython( self, study, isPublished ):
67 abuffer.append( "def RebuildData( theStudy ):" )
69 father = study.FindComponent( "pycompos" )
71 iter = study.NewChildIterator( father )
73 name = iter.Value().GetName()
74 if name: names.append( name )
79 abuffer += [ " from salome import lcc" ]
80 abuffer += [ " import pycompos_ORB" ]
82 abuffer += [ " compo = lcc.FindOrLoadComponent( 'FactoryServerPy', 'pycompos' )" ]
84 abuffer += [ " compo.createObject( theStudy, '%s' )" % name for name in names ]
88 return ("\n".join( abuffer ), 1)
92 c1=PYComponent("pycompos",services=[
93 Service("s1",inport=[("a","double"),("b","double")],
94 outport=[("c","double"),("d","double")],
99 interfacedefs=idldefs,
100 inheritedinterface="Idl_A",
105 modul=Module("pycompos",components=[c1],prefix="./install",
106 doc=["*.rst","*.png"],
107 gui=["pycomposGUI.py","demo.ui","*.png"],
110 g=Generator(modul,context)
112 #g.configure("-DTBB_INCLUDE_DIR=/opt/tbb/2018.u6/include -DTBB_ROOT=/opt/tbb/2018.u6/")
116 g.make_appli("appli", restrict=["KERNEL"], altmodules={"GUI":GUI_ROOT_DIR,
117 "YACS":YACS_ROOT_DIR}, sys_modules=SYS_MODULES)