-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME SALOME_SWIG : binding of C++ implementation and Python
# File : salome_test.py
# Module : SALOME
smesh.Compute(mesh, box)
sg.updateObjBrowser(1);
+#####################################################################
# SUPERVISOR module is not available since SALOME 5.0 version
-defineSuperV = 0
-
-if (defineSuperV != 0) & (sys.platform != "win32"):
- print
- print "============= Test Supervisor ============================="
- print
-
+#####################################################################
+print
+print "============= Test Supervisor ============================="
+print
+import salome_version
+version = salome_version.getVersions("GUI")[0]
+if not version: version = salome_version.getVersions("KERNEL")[0]
+if version < 5:
+ # SUPERV module is avaiable
comp = catalog.GetComponent("SUPERV")
if comp is None:
raise RuntimeError,"Component SUPERV not found in Module Catalog."
sg.updateObjBrowser(1);
pass
+else:
+ # SUPERV module is NOT avaiable
+ print "WARNING! Supervisor is not avaiable in this version of SALOME!"
+ pass
print
print "============= Test VISU and MED ============================="
import visu_gui
medFileName = "pointe.med"
-medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFileName
+if sys.platform != "win32":
+ medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFileName
+else:
+ medFile = os.getenv('DATA_DIR') + '\\MedFiles\\' + medFileName
+ pass
print "Load ", medFile
studyCurrent = salome.myStudyName
if sys.platform != "win32":
tmpDir = "/tmp/"
else:
- tmpDir = os.getenv('TEMP') + '/'
+ tmpDir = os.getenv('TEMP') + '\\'
medFileNew = tmpDir + str(random.randint(0,1000000)) + "_" + medFileName
print " -- Copy " + medFile + " to " + medFileNew
os.system(copyCommand + " " + medFile + " " + medFileNew)
medFile = medFileNew
- os.system("chmod 755 " + medFile)
+ if sys.platform != "win32":
+ os.system("chmod 755 " + medFile)
+ pass
if os.access(medFile, os.W_OK) :
med_comp.readStructFileWithFieldType(medFile,studyCurrent)
med_obj = visu_gui.visu.getMedObjectFromStudy()
print "med_obj - ", med_obj
- myField1 = visu_gui.visu.getFieldObjectFromStudy(2,1)
+ myField1 = visu_gui.visu.getFieldObjectFromStudy(3,1)
aMeshName = "maa1"
anEntity = VISU.NODE
aTimeStampId = -1