Back to index

salome-med  6.5.0
TestMedCorba8.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 import os
00025 
00026 # import salome
00027 
00028 BASE = os.environ["MED_ROOT_DIR"]
00029 BASE = os.path.join( BASE, 'share', 'salome', 'resources', 'med' )
00030 
00031 fileName = os.path.join( BASE, 'pointe.med' )
00032 fileName = os.path.join( BASE, 'test_hydro_darcy1a_out.med' )
00033 fileName = os.path.join( BASE, 'carre_en_quad4_seg2.med' )
00034 
00035 
00036 from omniORB import CORBA
00037 from LifeCycleCORBA import *
00038 from libSALOME_Swig import *
00039 from libMEDClient import *
00040 
00041 orb = CORBA.ORB_init([''], CORBA.ORB_ID)
00042 lcc = LifeCycleCORBA(orb)
00043 
00044 C = lcc.FindOrLoadComponent("FactoryServerPy", "Compo1Py")
00045 
00046 print "ok"
00047 C.Initialise(fileName)
00048 
00049 mDistant = C.Calcul1()
00050 print mDistant
00051 mDistantCopy = MESHClient(mDistant)
00052 print mDistantCopy
00053 
00054 print "###################################"
00055 for i in xrange(10):
00056     print mDistantCopy.getName()
00057     
00058 for i in xrange(1):
00059     print "-"
00060     
00061 
00062 print
00063 print "All tests passed"