Salome HOME
Lot 6: add main menu "Generate interpolz.py"
authormzn <mzn@opencascade.com>
Thu, 24 Nov 2016 13:52:47 +0000 (16:52 +0300)
committermzn <mzn@opencascade.com>
Thu, 24 Nov 2016 13:52:47 +0000 (16:52 +0300)
resources/CMakeLists.txt
resources/generate_interpolz_py.png [new file with mode: 0644]
src/HYDROGUI/HYDROSOLVERGUI.py

index f849c1a776539ba68b7c1195f3953ed1ebb60e0d..171f3eb2ecbaf18072a59fd1f88bc9428b099a06 100644 (file)
@@ -31,6 +31,7 @@ SET(HYDROSOLVER_RESOURCES_FILES
   case_pytel.png
   define_boundary_conditions.png
   edit_boundary_conditions_file.png
+  generate_interpolz_py.png
 )
 
 INSTALL(FILES ${HYDROSOLVER_RESOURCES_FILES} DESTINATION ${SALOME_HYDROSOLVER_INSTALL_RES_DATA})
diff --git a/resources/generate_interpolz_py.png b/resources/generate_interpolz_py.png
new file mode 100644 (file)
index 0000000..7dbf960
Binary files /dev/null and b/resources/generate_interpolz_py.png differ
index 0b4d5086220a375926e30885c70e50cbdb559d78..133e55cebb1b2db767ff334c1112d2f59ae09318 100644 (file)
@@ -33,6 +33,7 @@ logger = Logger("HYDROGUI", color = termcolor.BLUE)
 #logger.setLevel(logging.ERROR)
 
 import HYDROSOLVER_ORB
+from salome.hydro.interpolz_gui import InterpolzDlg
 from salome.hydro.gui_utils import HSGUIException, wait_cursor, get_and_check_selected_file_path
 import salome.hydro.study as hydro_study
 from salome.hydro.mascaret.eficas.appli import EficasForMascaretAppli
@@ -67,6 +68,7 @@ class GUIcontext:
     GENERATE_JOB = 954
     DEFINE_BOUNDARY_CONDITIONS_ID = 955
     EDIT_BOUNDARY_CONDITIONS_FILE_ID = 956
+    GENERATE_INTERPOLZ_PY_ID = 957
 
     def __init__( self ):
         # create top-level menu
@@ -117,6 +119,18 @@ class GUIcontext:
         a = sgPyQt.createAction( GUIcontext.CREATE_PYTEL_CASE_ID,
                                  "Create case for Pytel execution", "Create case for Pytel execution",
                                  "Create a new case for Pytel execution", "create_case_pytel.png" )
+       
+        sgPyQt.createMenu( a, mid )
+        sgPyQt.createTool( a, tid )
+
+        a = sgPyQt.createSeparator()
+        sgPyQt.createMenu( a, mid )
+        sgPyQt.createTool( a, tid )
+
+        a = sgPyQt.createAction( GUIcontext.GENERATE_INTERPOLZ_PY_ID,
+                                 "Generate interpolz.py", "Generate interpolz.py",
+                                 "Generate interpolation script from the template", "generate_interpolz_py.png" )
+
         sgPyQt.createMenu( a, mid )
         sgPyQt.createTool( a, tid )
 
@@ -429,9 +443,18 @@ def define_boundary_conditions():
 # Open dialog for boundary conditions edition
 ###
 def edit_boundary_conditions_file():
-    dlg = BndConditionsDialog.BoundaryConditionsDialog()
+    desktop = sgPyQt.getDesktop()
+    dlg = BndConditionsDialog.BoundaryConditionsDialog(desktop)
     dlg.exec_()
 
+###
+# Open dialog for interpolz.py script generation
+###
+def generate_interpolz_py():
+    desktop = sgPyQt.getDesktop()
+    dlg = InterpolzDlg(desktop)
+    dlg.show()
+
 ###
 # Commands dictionary
 ###
@@ -452,4 +475,5 @@ dict_command = {
     GUIcontext.GENERATE_JOB: pytel_gui.generate_job_for_selected_case,
     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,
     }