Salome HOME
9d056ba6578ddfe7172476a6cb3a4263be69e7cd
[modules/med.git] / src / MEDCalc / tui / medcorba.py
1 # Copyright (C) 2015-2023  CEA, EDF
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # Initializing some CORBA stuff
21
22 # Remember SALOME definitions:
23 # ---------------------------
24 #
25 # componentName = Name of the component (a library lib<componentName>Engine
26 # should exist with a C function named <componentName>Engine_factory, and the
27 # component should be registered in the catalog MEDCatalog.xml).
28 #
29 # corbaModule = Name of the corba module that contains the IDL
30 # specifications of the component (name as defined in the idl file)
31 #
32 # containerType = Name of the container factory
33 #
34 factoryComponentName = "MEDFactory"
35 medComponentName = "FIELDS"
36 #corbaModule   = "MEDCALC"
37 containerType = "FactoryServer"
38
39 import salome
40 if salome.lcc is None:
41   salome.salome_init()
42   pass
43
44 import MEDCALC   # corbaModule
45 med_engine = salome.lcc.FindOrLoadComponent(containerType,medComponentName)
46 factory = salome.lcc.FindOrLoadComponent(containerType,factoryComponentName)
47 # The factory is not the main CORBA component of the SALOME module FIELDS
48 # (i.e. the engine associated to the study), but the CORBA
49 # entry point for MED fields operations (i.e. a CORBA component
50 # reachable through the LifeCycleCORBA). This entry point is used to
51 # get the other SALOME CORBA components required for MED field
52 # operations, in particular the dataManager and the calculator