From: mzn Date: Thu, 24 Nov 2016 13:52:47 +0000 (+0300) Subject: Lot 6: add main menu "Generate interpolz.py" X-Git-Tag: v1.6~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=71cb3aac494137e1e38170452ef18ae299ec4c0c;p=modules%2Fhydrosolver.git Lot 6: add main menu "Generate interpolz.py" --- diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index f849c1a..171f3eb 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -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 index 0000000..7dbf960 Binary files /dev/null and b/resources/generate_interpolz_py.png differ diff --git a/src/HYDROGUI/HYDROSOLVERGUI.py b/src/HYDROGUI/HYDROSOLVERGUI.py index 0b4d508..133e55c 100644 --- a/src/HYDROGUI/HYDROSOLVERGUI.py +++ b/src/HYDROGUI/HYDROSOLVERGUI.py @@ -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, }