Salome HOME
appel d eficas for telemac2d
authorpascale.noyret <pascale.noyret@edf.fr>
Tue, 7 Feb 2017 14:02:46 +0000 (15:02 +0100)
committerpascale.noyret <pascale.noyret@edf.fr>
Tue, 7 Feb 2017 14:02:46 +0000 (15:02 +0100)
src/HYDROGUI/HYDROSOLVERGUI.py
src/salome_hydro/pytel/eficas/appli.py

index 2821d4c41bade6da961d63f7ce49e4f3d0e09840..d0d6cb80456616c760dc52cb8ea0968262c91391 100755 (executable)
@@ -40,7 +40,8 @@ from salome.hydro.mascaret.eficas.appli import EficasForMascaretAppli
 from salome.hydro.telemac2d.eficas.appli import EficasForTelemac2DAppli
 from salome.hydro.coupling1d2d.eficas.appli import EficasForCoupling1D2DAppli
 from salome.hydro.pytel.gui import create_case_pytel,  run_selected_case_pytel, edit_selected_case_pytel,  generate_job_for_selected_case_pytel
-from salome.hydro.boundary_conditions.eficas.appli import EficasForBoundaryConditionsAppli
+#from salome.hydro.boundary_conditions.eficas.appli import EficasForBoundaryConditionsAppli
+from eficasSalome import runEficas
 
 import BndConditionsDialog
 
@@ -66,7 +67,8 @@ class GUIcontext:
     RUN_PYTEL_ID = 952
     EDIT_PYTEL_CASE_ID = 953
     GENERATE_JOB = 954
-    DEFINE_BOUNDARY_CONDITIONS_ID = 955
+    #DEFINE_BOUNDARY_CONDITIONS_ID = 955
+    DEFINE_CAS_FILE = 955
     EDIT_BOUNDARY_CONDITIONS_FILE_ID = 956
     GENERATE_INTERPOLZ_PY_ID = 957
 
@@ -76,10 +78,10 @@ class GUIcontext:
         # create toolbar
         tid = sgPyQt.createTool( "Hydro" )
         # create actions and fill menu and toolbar with actions
-        a = sgPyQt.createAction( GUIcontext.DEFINE_BOUNDARY_CONDITIONS_ID,
-                                 "Define boundary conditions", "Define boundary conditions",
-                                 "Define the boundary conditions for Telemac",
-                                 "define_boundary_conditions.png" )
+        #a = sgPyQt.createAction( GUIcontext.DEFINE_BOUNDARY_CONDITIONS_ID,
+        #                         "Define boundary conditions", "Define boundary conditions",
+        #                         "Define the boundary conditions for Telemac",
+        #                         "define_boundary_conditions.png" )
         sgPyQt.createMenu( a, mid )
         sgPyQt.createTool( a, tid )
 
@@ -90,9 +92,6 @@ class GUIcontext:
         sgPyQt.createMenu( a, mid )
         sgPyQt.createTool( a, tid )
 
-        a = sgPyQt.createSeparator()
-        sgPyQt.createMenu( a, mid )
-        sgPyQt.createTool( a, tid )
 
         a = sgPyQt.createAction( GUIcontext.CREATE_MASCARET_CASE_ID,
                                  "Create Mascaret case", "Create Mascaret case",
@@ -113,8 +112,6 @@ class GUIcontext:
         sgPyQt.createTool( a, tid )
 
         a = sgPyQt.createSeparator()
-        sgPyQt.createMenu( a, mid )
-        sgPyQt.createTool( a, tid )
 
         a = sgPyQt.createAction( GUIcontext.CREATE_PYTEL_CASE_ID,
                                 "Create case for Pytel execution", "Create case for Pytel execution",
@@ -134,6 +131,15 @@ class GUIcontext:
         sgPyQt.createMenu( a, mid )
         sgPyQt.createTool( a, tid )
 
+        a = sgPyQt.createSeparator()
+        a = sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE,
+                                 "Edit cas file", "Edit cas file",
+                                 "Create/edit a .cas file for Telemac",
+                                 "define_cas_file.png" )
+        sgPyQt.createMenu( a, mid )
+        sgPyQt.createTool( a, tid )
+
+
         # the following action are used in context popup
         sgPyQt.createAction( GUIcontext.RUN_MASCARET_ID, "Compute case", "Compute case",
                              "Run Mascaret solver to compute the case" )
@@ -159,6 +165,10 @@ class GUIcontext:
         sgPyQt.createAction( GUIcontext.GENERATE_JOB, "Generate batch job", "Generate batch job",
                              "Generate a batch job to run the selected case")
 
+        sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE, "Edit .cas file", "Edit .cas file",
+                             "Edit .cas file")
+
+
 ################################################
 # Global variables
 ################################################
@@ -436,8 +446,8 @@ def open_schema_in_yacs():
 ###
 # Open Eficas for boundary conditions definition
 ###
-def define_boundary_conditions():
-    EficasForBoundaryConditionsAppli()
+#def define_boundary_conditions():
+#    EficasForBoundaryConditionsAppli()
 
 ###
 # Open dialog for boundary conditions edition
@@ -456,6 +466,11 @@ def generate_interpolz_py():
     dlg.show()
 
 ###
+# Open dialog for boundary conditions edition
+###
+def eficas_for_cas_Telemac2D()
+   runEficas(code='TELEMAC')
+###
 # Commands dictionary
 ###
 dict_command = {
@@ -473,7 +488,8 @@ dict_command = {
     GUIcontext.RUN_PYTEL_ID: run_selected_case_pytel,
     GUIcontext.EDIT_PYTEL_CASE_ID: edit_selected_case_pytel,
     GUIcontext.GENERATE_JOB: generate_job_for_selected_case_pytel,
-    GUIcontext.DEFINE_BOUNDARY_CONDITIONS_ID: define_boundary_conditions,
+    #GUIcontext.DEFINE_BOUNDARY_CONDITIONS_ID: define_boundary_conditions,
     GUIcontext.EDIT_BOUNDARY_CONDITIONS_FILE_ID: edit_boundary_conditions_file,
     GUIcontext.GENERATE_INTERPOLZ_PY_ID: generate_interpolz_py,
+    GUIcontext.GUIcontext.DEFINE_CAS_FILE: eficas_for_cas_Telemac2D,
     }
index b1189a5f539f232d20cd3db8392bf3ed736cf634..06e875396dd10de799466e858abd354770a4d2b6 100755 (executable)
@@ -53,7 +53,8 @@ class EficasForPytelAppli(eficasSalome.MyEficas):
         gridLayout = QGridLayout(area)
         gridLayout.addWidget(self)
         area.setWidgetResizable(1)
-        self.fileNew()
+        if fichier == None : self.fileNew()
+        else : self.addJdcInSalome(fichier)
 
         sgPyQt.createView("Eficas Pytel", self)