From 83f18708c1744600faa02288f6b0e28429dd4e9c Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Tue, 7 Feb 2017 15:02:46 +0100 Subject: [PATCH] appel d eficas for telemac2d --- src/HYDROGUI/HYDROSOLVERGUI.py | 44 ++++++++++++++++++-------- src/salome_hydro/pytel/eficas/appli.py | 3 +- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/HYDROGUI/HYDROSOLVERGUI.py b/src/HYDROGUI/HYDROSOLVERGUI.py index 2821d4c..d0d6cb8 100755 --- a/src/HYDROGUI/HYDROSOLVERGUI.py +++ b/src/HYDROGUI/HYDROSOLVERGUI.py @@ -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, } diff --git a/src/salome_hydro/pytel/eficas/appli.py b/src/salome_hydro/pytel/eficas/appli.py index b1189a5..06e8753 100755 --- a/src/salome_hydro/pytel/eficas/appli.py +++ b/src/salome_hydro/pytel/eficas/appli.py @@ -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) -- 2.39.2