]> SALOME platform Git repositories - modules/hydrosolver.git/commitdiff
Salome HOME
edit menus for Telemac2D case, option French or English
authorPaul RASCLE <paul.rascle@edf.fr>
Sun, 18 Jun 2017 11:22:39 +0000 (13:22 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Sun, 18 Jun 2017 15:31:14 +0000 (17:31 +0200)
src/HYDROGUI/HYDROSOLVERGUI.py
src/salome_hydro/telemac2d/eficas/appli.py

index b799e17519e82ae862867ccdb69817929721f050..389ed81e5debed72110d1610143b7163b8fd9417 100755 (executable)
@@ -68,11 +68,12 @@ class GUIcontext:
     EDIT_PYTEL_CASE_ID = 953
     GENERATE_JOB = 954
     #DEFINE_BOUNDARY_CONDITIONS_ID = 955
-    DEFINE_CAS_FILE = 955
+    DEFINE_CAS_FILE_EN = 955
     EDIT_BOUNDARY_CONDITIONS_FILE_ID = 956
     GENERATE_INTERPOLZ_PY_ID = 957
     GEN_TELEMAC2D_PYTHON_ID = 958
     GEN_TELEMAC2D_YACS_ID = 959
+    DEFINE_CAS_FILE_FR = 960
 
     def __init__( self ):
         # create top-level menu
@@ -132,9 +133,17 @@ class GUIcontext:
         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",
+        a = sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE_EN,
+                                 "Edit cas file (English)", "Edit cas file (English)",
+                                 "Create/edit a .cas file for Telemac (English)",
+                                 "define_cas_file.png" )
+        sgPyQt.createMenu( a, mid )
+        sgPyQt.createTool( a, tid )
+
+        a = sgPyQt.createSeparator()
+        a = sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE_FR,
+                                 "Edit cas file (French)", "Edit cas file (French)",
+                                 "Create/edit a .cas file for Telemac (French)",
                                  "define_cas_file.png" )
         sgPyQt.createMenu( a, mid )
         sgPyQt.createTool( a, tid )
@@ -171,8 +180,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",
+        sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE_EN, "Edit .cas file", "Edit .cas file",
                              "Edit .cas file")
+        sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE_FR, "Edit .cas file (French)", "Edit .cas file (French)",
+                             "Edit .cas file (French)")
 
 
 ################################################
@@ -508,8 +519,12 @@ def generate_interpolz_py():
 ###
 # Open dialog for boundary conditions edition
 ###
-def eficas_for_cas_Telemac2D():
-   runEficas(code='TELEMAC')
+def eficas_for_cas_Telemac2D_fr():
+   EficasForTelemac2DAppli(code='TELEMAC', lang = 'fr')
+
+def eficas_for_cas_Telemac2D_en():
+   EficasForTelemac2DAppli(code='TELEMAC', lang = 'en')
+   
 ###
 # Commands dictionary
 ###
@@ -533,5 +548,6 @@ dict_command = {
     #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.DEFINE_CAS_FILE: eficas_for_cas_Telemac2D,
+    GUIcontext.DEFINE_CAS_FILE_EN: eficas_for_cas_Telemac2D_en,
+    GUIcontext.DEFINE_CAS_FILE_FR: eficas_for_cas_Telemac2D_fr,
     }
index a7a69a58997cdefe43a0516e4254eaaf76e96390..156ab6239b5bfc1cc9beef0c52aea82a864487d0 100644 (file)
@@ -47,13 +47,13 @@ class EficasForTelemac2DAppli(eficasSalome.MyEficas):
     :param fichier: path of an Eficas file to open
 
     """
-    def __init__(self, fichier = None, version = None):
+    def __init__(self, code = "telemac2d", fichier = None, version = None, lang = None):
         self.ed = HydroStudyEditor()
         self.codedir = os.path.dirname(__file__)
         sys.path[:0] = [self.codedir]
         eficasSalome.MyEficas.__init__(self, sgPyQt.getDesktop(),
-                                       "telemac2d",
-                                       fichier, version = version)
+                                       code = code, fichier = fichier,
+                                       version = version, lang = lang)
         area = QScrollArea(SalomePyQt.SalomePyQt().getDesktop());
         gridLayout = QGridLayout(area)
         gridLayout.addWidget(self)