]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
porting tutorial scripts on SALOME 8.2.0
authorasl <asl@opencascade.com>
Thu, 19 Jan 2017 07:44:25 +0000 (10:44 +0300)
committerasl <asl@opencascade.com>
Thu, 19 Jan 2017 07:44:25 +0000 (10:44 +0300)
20 files changed:
doc/salome/examples/h001_importImage.py
doc/salome/examples/h002_importImage.py
doc/salome/examples/h003_changeLCS.py
doc/salome/examples/h004_importBathyXYZ.py
doc/salome/examples/h005_importImageBad.py
doc/salome/examples/h006_importBathyXYZBad.py
doc/salome/examples/h007_createPolySplineClosed.py
doc/salome/examples/h008_simpleCase.py
doc/salome/examples/h009_normalCaseManual.py
doc/salome/examples/h010_normalCaseManualMesh.py
doc/salome/examples/h011_normalCaseManualInterpolZ.py
doc/salome/examples/h012_caseDigueManual.py
doc/salome/examples/h013_caseDigueManualMesh.py
doc/salome/examples/h014_caseDigueManualInterpolZ.py
doc/salome/examples/h015_normalCaseManualTelemac.py
doc/salome/examples/h016_pilesPontManualMesh.py
doc/salome/examples/h017_interpolationLineaire.py
doc/salome/examples/h018_streamInterpolation.py
src/HYDROTools/controls.py
src/HYDROTools/interpolZ.py

index 6c072bff8d083994e862f18001f0dcba1dbc7048..4c33e30ef300c1bb700d92e2f98dd083ab7f1a33 100644 (file)
@@ -10,8 +10,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index efa0ead52983d5e43fa3a7ceb87ba821a7c7a142..d67dc5a7a0bf81a2b4f1bb1f43c334a37f7f3e33 100644 (file)
@@ -10,8 +10,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index be02467ed9c8aa5d9a1e04a0c9263fa23b4a53c1..f7cf5285c3188f4e264819f2069bc0149822470e 100644 (file)
@@ -10,8 +10,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index 369a7e3712abbdda6ed2a908b0805c37cfb97235..c4041bc1fb5f4622417bc6515d60118e3329354a 100644 (file)
@@ -10,8 +10,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index d2e6887cef19c7fac7b3658ea8031667d12d7803..86340d7c4283658fe99e7bcadf8a98a3c83fbda6 100644 (file)
@@ -10,8 +10,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index d41226e452149eb8c73435373aab890847acb36f..a5dae4f55ff9447f523347eff97e13b8ffd02532 100644 (file)
@@ -10,8 +10,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index e79698846ab343f46eb87c388b6b50f5861790f1..c3e8c9b9029404024718772823d71b029d29a491 100644 (file)
@@ -7,8 +7,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index fb2bb0733f26757b64b0d79c5b04f3eaf4f53b6b..c714049ea03c659259bb0db4dca345bd3ec0a5b5 100644 (file)
@@ -11,8 +11,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index 5cf5c72f20c47d4862cc3e1a4068d65ed1002e5a..2efd145b9c60524ccbdc05c0a867888b503fde2c 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index db0e6ff5897960a510d9fcf5597515cdd0578c78..34fb00c58575e7160054bc471503de55203ac501 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index 647a8b203b3d5ae60e02cfd217f731e9996cd89d..4414c2c2e2de6d22ceba8874a8c182af3982d5ee 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index b4d120dce196790254a9b5f30bd72382e1bf4aef..8b5033158af89578acfcdc3d6e44417b53ccbae1 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index c19c290c797b5de6f684ab8ca07997000f78826e..2e6a6e2280e7fdea6783dda0e5e484c11fbf12e2 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index c5782efd2273f34713b0ff1bb9efbd48d2ce2fd8..cd48ecf046f6f940550fd82a83806d3a5a997297 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index 6c3fc2d9bf1d53cc1296181452c3182f2af40651..af484a0a89fb23cccb67706e0f03b636ab3fada0 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index 622a132c3b842f9e11e36eb76de66969f02c6637..cd432ccdd8cd778cced289091b9de631079815ec 100644 (file)
@@ -18,8 +18,8 @@ theStudy = salome.myStudy
 ###
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index 47ccfa5b3c8a87486ead342b2aec4a58ffc9531d..471471e1e7f91c506ccb3ad93bfa44920d2d533f 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 ###
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
index 600f51e7183b8028a7256a454b4d4cfd4bd0b1d5..827f7dda882c08102045b2bd5cceb7621b0a58ef 100644 (file)
@@ -6,21 +6,25 @@
 
 import sys
 import salome
+import os
+HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO")
+
+
 
 salome.salome_init()
 theStudy = salome.myStudy
 
 import salome_notebook
 notebook = salome_notebook.NoteBook(theStudy)
-sys.path.insert( 0, r'/local00/home/B27118/projets/salome_hydro/bugs/V780H2016')
+#sys.path.insert( 0, r'/local00/home/B27118/projets/salome_hydro/bugs/V780H2016')
 
 ###
 ### HYDRO component
 ###
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
@@ -243,7 +247,7 @@ bathyFlat = hydro_doc.CreateObject( KIND_BATHYMETRY )
 bathyFlat.SetName( "bathyFlat" )
 
 bathyFlat.SetAltitudesInverted( 0 )
-if not(bathyFlat.ImportFromFile( "/local00/home/B27118/projets/salome_hydro/bugs/V780H2016/bathyFlat.xyz" )):
+if not(bathyFlat.ImportFromFile( os.path.join(HYDRO_SAMPLES, "bathyFlat.xyz" ))):
   raise ValueError('problem while loading bathymetry')
 
 bathyFlat.Update()
@@ -252,7 +256,7 @@ profiles = hydro_doc.CreateObject( KIND_PROFILE )
 profiles.SetName( "profiles" )
 badProfilesIds=[]
 isToProject=True
-nbp = profiles.ImportFromFile(hydro_doc, "/local00/home/B27118/projets/salome_hydro/V780H2016/modules/src/HYDRO/doc/salome/examples/profilsStream.xyz", badProfilesIds, isToProject)
+nbp = profiles.ImportFromFile(hydro_doc, os.path.join(HYDRO_SAMPLES, "profilsStream.xyz"), badProfilesIds, isToProject)
 print "nombre profils: " , nbp
 if not(nbp):
   raise ValueError('problem while loading profiles')
@@ -431,7 +435,7 @@ sections_3 = plaine.GroupOnGeom(sections,'sections',SMESH.NODE)
 smesh.SetName(plaine, 'plaine')
 
 try:
-  plaine.ExportMED( r'/local00/home/B27118/projets/salome_hydro/bugs/V780H2016/plaine.med', 0, SMESH.MED_V2_2, 1, None ,1)
+  plaine.ExportMED( r'plaine.med', 0, SMESH.MED_V2_2, 1, None ,1)
 except:
   print 'ExportToMEDX() failed. Invalid file name?'
 
index a75fdc99dab5ed68a5013dc1b065576cdeca554a..13197b5fdf7a25b6f4a7d923f1c0da726e7d64c4 100644 (file)
@@ -79,7 +79,8 @@ def controlStatZ(statz,refstatz):
       print "value: ", vals, " reference: ", valsref
       raise ValueError("z interpolation error") 
   
-from MEDLoader import MEDLoader, MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh
+import MEDLoader
+from MEDLoader import MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh
 import os, time
 
 def controlTelemacResult(aMedFile, refs):
index 93daf47ba89e217ad2e0f9da190e8466626f74db..0321ca9db35f17528012804e09d9cad8567cf4f8 100644 (file)
@@ -109,7 +109,8 @@ def createZfield1(fichierMaillage):
 
 # -----------------------------------------------------------------------------
 
-from MEDLoader import MEDLoader, MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh
+import MEDLoader
+from MEDLoader import MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh
 
 def createZfield2(fichierMaillage):
   """