Salome HOME
Minor source update for OM compatibility
[modules/adao.git] / src / daSalome / daGUI / ADAO.py
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (C) 2008-2024 EDF R&D
4 #
5 # This file is part of SALOME ADAO module
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23 # Author: AndrĂ© Ribes, andre.ribes@edf.fr, EDF R&D
24
25 import ADAO_COMPONENT__POA
26 import SALOME_ComponentPy
27 import SALOME_DriverPy
28 import SALOME_Embedded_NamingService_ClientPy
29
30 from daUtils.adaoLogger import *
31
32 class ADAO(ADAO_COMPONENT__POA.ADAO_ENGINE,
33            SALOME_ComponentPy.SALOME_ComponentPy_i,
34            SALOME_DriverPy.SALOME_DriverPy_i):
35   """
36       Pour etre un composant SALOME cette classe Python
37       doit avoir le nom du composant et heriter de la
38       classe ADAO_COMPONENT issue de la compilation de l'idl
39       par omniidl et de la classe SALOME_ComponentPy_i
40       qui porte les services generaux d'un composant SALOME
41   """
42   def __init__ ( self, orb, poa, contID, containerName, instanceName,
43       interfaceName ):
44     debug("Creating ADAO component instance", "ENGINE")
45     SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa,
46         contID, containerName, instanceName, interfaceName)
47     SALOME_DriverPy.SALOME_DriverPy_i.__init__(self, interfaceName)
48
49     # On stocke dans l'attribut _naming_service, une ref sur le Naming Service
50     #
51     emb_ns = self._contId.get_embedded_NS_if_ssl()
52     import CORBA
53     if CORBA.is_nil(emb_ns):
54         self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
55     else:
56         self._naming_service = SALOME_Embedded_NamingService_ClientPy.SALOME_Embedded_NamingService_ClientPy(emb_ns)
57     #
58
59   def print_ping():
60     info("ADAO ENGINE Ping", "ENGINE")