]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Python dump and scripts: removal of references to study, debug print instructions
authorPaul RASCLE <paul.rascle@edf.fr>
Thu, 23 May 2019 08:30:38 +0000 (10:30 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Thu, 23 May 2019 11:34:51 +0000 (13:34 +0200)
27 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
doc/salome/examples/h019_normalCaseManualInterpolZStrickler.py
doc/salome/tutorial/interpolZ.py
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROData/HYDROData_Document.cxx
src/HYDRO_tests/reference_data/linux/lc_dump.py
src/HYDRO_tests/reference_data/linux/st_dump.py
src/HYDRO_tests/reference_data/win32/lc_dump.py
src/HYDRO_tests/reference_data/win32/st_dump.py

index 9b6bb3518f0db989b78160e474264baa6e51b460..7783a6980b68539c40b9f78fccf0d49c0bcb4dcb 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 from HYDROPy import *
 from PyQt5.QtCore import *
index 52d94fa7eaa3e26fc0e72b259791cc60d9af0fac..24ba410fff9b5e6175289433bb2a3c3f24085985 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 from HYDROPy import *
 from PyQt5.QtCore import *
index 3fff5a702b7e4bd07fe4c520b6fd7e5144e66da9..27413ddf8c790b4fe63e5dbb0969c25aebf641a3 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 from HYDROPy import *
 from PyQt5.QtCore import *
index 79a96e4c790431f631e46f8de9a56bd3c64cd1e0..895693ec5a6885d3aa948f400e1d057f06cdaab4 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 from HYDROPy import *
 from PyQt5.QtCore import *
index 9a271c5e500246d3265bd8dad3db5c76d66f80c0..5e42fc647c850e289c5ccf7ed32996f0c76e383a 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 from HYDROPy import *
 from PyQt5.QtCore import *
index 88d3418d7b3c5f039723cd63d6838d98083fbc9d..e1c09f4f2391c64b391d7567b63f246d938dfc9f 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 from HYDROPy import *
 from PyQt5.QtCore import *
index c3896b68d16507a4e63f18ba2a280a29102e8095..6061752abc02b46006c3508190b4af55fdb3d690 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 from HYDROPy import *
 from PyQt5.QtCore import *
index fa21720e77bff30ed8bcb8e3ad7c9f5e2f1517e4..93cc139be41a793e93db91f3a77c4090c15d4bba 100644 (file)
@@ -4,7 +4,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index 11c19003c6f0e9eb05f1cc0abd78197136e17471..b0fd629c608fc67ae7b20571f4975d5c844662fc 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index cda2c4ea9418498bdc4cd4163324018d0d4d2045..afc987013443baee89ba23461e8d06f3c4de5a4f 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index 8ac73adcca93348a2351b9519786f41add0d17b3..c00a2558cbc38b604802967f835d46299ded30a7 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index b33e6c3eb4d5177c310cea8bc023c8a25de72371..c7d457e58e6ff9aa3668e9c267692ad783c308cb 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index a21a2800d574d766f8787bb4e33ef3a9950c9d59..2299dc9ec7a3fbce1e67be11dcc554f1135b6478 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index 8f24d1dca84cb2223a513649def09d33c68ce21c..6dcc84a44f8291fedfd670197be2e6886633c519 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index 66c70caddbc3e6ece6c000749adde0f9f6d4ce10..24041dcfd58121540a1b111ecbb3bd52de7d6bca 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index 33b1e29e83ea8151c4cf356a42aaf297f7875cd6..f3d83999bfd5fc616f1837d1c84064a842fbff9d 100644 (file)
@@ -11,7 +11,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 ###
 ### HYDRO component
index 647a3d28be22905475336eef81732a9a2b6b8d62..6f093e68f2b488ec1c33713b82af940404f225ee 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 ###
 ### HYDRO component
index 490f667d5ded7c8259dc6c5146731e29580b3177..7294842118162cdc6705b22e051a774cae3d251d 100644 (file)
@@ -11,7 +11,6 @@ HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYD
 
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index bc63856b629273170fb7b746ccf9f5b1777fa12c..f21324a9f78a7e60bc33eb7aebabf1f737baf807 100644 (file)
@@ -7,7 +7,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 #----------------------
 # --- HYDRO
index 728286bbd9f34abd2b589d47d31cf7d202aa7209..7bc2afe4d431844b4766d2e5d7c5289333d81d7d 100644 (file)
@@ -31,8 +31,6 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
-theStudyId = salome.myStudyId
 
 from salome.hydrotools.interpolZ import interpolZ
 
index 5b291318997f504cdc958227fe59ba12368573f7..3014494d979d8199dbcbf25505f2137994e394d9 100755 (executable)
@@ -212,29 +212,27 @@ QStringList HYDROData_CalculationCase::DumpToPython( const QString&       thePyS
   // Export calculation case
   aResList << QString( "" );
   aResList << "# Export of the calculation case";
-  QString aStudyName = "theStudy";
   QString anEntryVar = aCalculName + "_entry";
-  aResList << QString( "%1 = %2.Export( %3._get_StudyId() )" ).arg( anEntryVar ).arg( aCalculName ).arg( aStudyName );
+  aResList << QString( "%1 = %2.Export()" ).arg( anEntryVar ).arg( aCalculName );
 
   // Get geometry object and print debug information
   aResList << "";
   aResList << "# Get geometry shape and print debug information";
   aResList << "import GEOM";
-  aResList << QString( "print \"Entry:\", %1" ).arg( anEntryVar );
+  aResList << QString( "print (\"Entry:\", %1)" ).arg( anEntryVar );
   QString aGeomShapeName = aCalculName + "_geom";
   aResList << QString( "HYDRO_%1 = salome.IDToObject( str( %2 ) )" ).arg( GetName() ).arg( anEntryVar );
-  aResList << QString( "print \"Geom shape:\", HYDRO_%1" ).arg( GetName() );
-  aResList << QString( "print \"Geom shape name:\", HYDRO_%1.GetName()" ).arg( GetName() );
+  aResList << QString( "print (\"Geom shape:\", HYDRO_%1)" ).arg( GetName() );
+  aResList << QString( "print (\"Geom shape name:\", HYDRO_%1.GetName())" ).arg( GetName() );
 
 
-  //DumpSampleMeshing( aResList, aStudyName, aGeomShapeName, aCalculName+"_mesh" );
+  //DumpSampleMeshing( aResList, aGeomShapeName, aCalculName+"_mesh" );
 
   aResList << QString( "" );
   return aResList;
 }
 
 void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
-                                                   const QString& theStudyName,
                                                    const QString& theGeomShapeName,
                                                    const QString& theMeshName ) const
 {
@@ -244,7 +242,7 @@ void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
   theResList << "from salome.smesh import smeshBuilder";
   theResList << "from salome.geom import geomBuilder";
 
-  theResList << QString( "smesh = smeshBuilder.New( %1 )" ).arg( theStudyName );
+  theResList << QString( "smesh = smeshBuilder.New()" );
   theResList << QString( "%1 = smesh.Mesh( %2 )" ).arg( theMeshName ).arg( theGeomShapeName );
   theResList << QString( "MEFISTO_2D = %1.Triangle( algo=smeshBuilder.MEFISTO )" ).arg( theMeshName );
   theResList << "Max_Element_Area_1 = MEFISTO_2D.MaxElementArea( 10 )";
@@ -262,13 +260,13 @@ void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
 
   theResList << "";
   theResList << "# Greate SMESH groups";
-  theResList << QString( "geompy = geomBuilder.New( %1 )" ).arg( theStudyName );
+  theResList << QString( "geompy = geomBuilder.New()" );
   theResList << QString( "geom_groups = geompy.GetGroups( %1 )" ).arg( theGeomShapeName );
   theResList << QString( "for group in geom_groups:" );
   theResList << QString( "    smesh_group = %1.GroupOnGeom(group, group.GetName(), SMESH.EDGE)" )
                 .arg( theMeshName );
   theResList << QString( "    smesh.SetName(smesh_group, group.GetName())" );
-  theResList << QString( "    print \"SMESH group '%s': %s\" % (smesh_group.GetName(), smesh_group)" );
+  theResList << QString( "    print (\"SMESH group '%s': %s)\" % (smesh_group.GetName(), smesh_group)" );
 }
 
 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetAllReferenceObjects() const
index 998f3f36af5722b221438cbe5150511d16fa1ab9..5ac3d069d3c1eb32dafee4faf8b8d4afbf69e631 100644 (file)
@@ -484,7 +484,6 @@ protected:
   HYDRODATA_EXPORT ~HYDROData_CalculationCase();
 
   void DumpSampleMeshing( QStringList& theScript,
-                          const QString& theStudyName,
                           const QString& theGeomShapeName,
                           const QString& theMeshName ) const;
 
index 3a5cd32ffe17a080891e14322cdd48ee2bb18db7..ddbc99338e9dc15e6a06fbe4a2698b2aaee90750 100644 (file)
@@ -359,13 +359,13 @@ QStringList HYDROData_Document::DumpToPython( const QString& thePyScriptPath,
   {
     aResScript << QString( "import salome" );
     aResScript << QString( "" );
-    aResScript << QString( "def RebuildData( theStudy ):" );
-    aResScript << QString( "  %1 = HYDROData_Document.Document( theStudy._get_StudyId() )" ).arg( aDocName );
+    aResScript << QString( "def RebuildData():" );
+    aResScript << QString( "  %1 = HYDROData_Document.Document()" ).arg( aDocName );
   }
   else
   {
     aResScript << QString( "" );
-    aResScript << QString( "%1 = HYDROData_Document.Document( theStudy._get_StudyId() )" ).arg( aDocName );
+    aResScript << QString( "%1 = HYDROData_Document.Document()" ).arg( aDocName );
   }
 
   return aResScript;
index 40b1f23391781d285feec53507c49319f0a139d8..7b4c802a1adcb0641fe1a68c8b3e722711429b8b 100644 (file)
@@ -8,10 +8,9 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
+notebook = salome_notebook.NoteBook()
 sys.path.insert( 0, r'D:/asl/hydro/studies')
 
 ###
@@ -22,7 +21,7 @@ from HYDROPy import *
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
 
-hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() );
+hydro_doc = HYDROData_Document.Document();
 
 hydro_doc.SetLocalCS( 0, 0 )
 
index 79ad0dda5ec5915ed6ba6d180e7f94cba57cba1b..2f43a59087983da9ba4183c1c05f30fb672683b7 100644 (file)
@@ -2,7 +2,7 @@ from HYDROPy import *
 from PyQt5.QtCore import *
 from PyQt5.QtGui import *
 
-hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
+hydro_doc = HYDROData_Document.Document()
 
 hydro_doc.SetLocalCS( 0.000, 0.000 )
 
index 40b1f23391781d285feec53507c49319f0a139d8..7b4c802a1adcb0641fe1a68c8b3e722711429b8b 100644 (file)
@@ -8,10 +8,9 @@ import sys
 import salome
 
 salome.salome_init()
-theStudy = salome.myStudy
 
 import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
+notebook = salome_notebook.NoteBook()
 sys.path.insert( 0, r'D:/asl/hydro/studies')
 
 ###
@@ -22,7 +21,7 @@ from HYDROPy import *
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
 
-hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() );
+hydro_doc = HYDROData_Document.Document();
 
 hydro_doc.SetLocalCS( 0, 0 )
 
index c306f4fc7180a3744ce035a43421ff32bfb4f190..f811142d8c29bd529214f771335eeb2c1cf99951 100644 (file)
@@ -2,7 +2,7 @@ from HYDROPy import *
 from PyQt5.QtCore import *
 from PyQt5.QtGui import *
 
-hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
+hydro_doc = HYDROData_Document.Document()
 
 hydro_doc.SetLocalCS( 0.000, 0.000 )