1 # Copyright (C) 2012-2013 EDF
3 # This file is part of SALOME HYDRO module.
5 # SALOME HYDRO module is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # SALOME HYDRO module is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with SALOME HYDRO module. If not, see <http://www.gnu.org/licenses/>.
19 sgPyQt = SalomePyQt.SalomePyQt()
21 from salome.hydro.gui_utils import get_and_check_selected_file_path
22 from salome.hydro.study import jdc_to_dict
24 from salome.hydro.run_study.eficas.appli import EficasForRunStudyAppli
25 from launcher import run_study
26 from genjobwindow import GenJobDialog
28 from PyQt5.QtWidgets import QFileDialog
30 def create_case_study():
31 EficasForRunStudyAppli()
33 def edit_selected_case_study():
34 file=get_and_check_selected_file_path()
36 file, filt = QFileDialog.getOpenFileName(sgPyQt.getDesktop(), "Open study file", "", )
37 EficasForRunStudyAppli(fichier=file)
39 def get_params_from_selected_case():
41 Get the parameters dict from the selected case in Salome study
43 jdcpath = get_and_check_selected_file_path()
44 with open(jdcpath) as jdcfile:
46 param_dict = jdc_to_dict(jdc, ["RUN_STUDY", "_F"])
49 def run_selected_case_study():
50 param_dict = get_params_from_selected_case()
53 def generate_job_for_selected_case_study():
54 param_dict = get_params_from_selected_case()
55 dialog = GenJobDialog(sgPyQt.getDesktop(), param_dict)