EDIT_MASCARET_CASE_ID = 943
SHOW_LOG_ID = 944
CREATE_TELEMAC2D_CASE_ID = 945
- RUN_TELEMAC2D_ID = 946
- EDIT_TELEMAC2D_CASE_ID = 947
OPEN_SCHEMA_IN_YACS_ID = 950
CREATE_PYTEL_CASE_ID = 951
RUN_PYTEL_ID = 952
sgPyQt.createAction( GUIcontext.GEN_TELEMAC2D_YACS_ID, "Generate YACS script",
"Generate YACS script",
"Generate a YACS script from the eficas date" )
- sgPyQt.createAction( GUIcontext.RUN_TELEMAC2D_ID, "Compute case", "Compute case",
- "Run Telemac2D solver to compute the case" )
- sgPyQt.createAction( GUIcontext.EDIT_TELEMAC2D_CASE_ID, "Edit case", "Edit case",
- "Edit the selected Telemac2D case" )
sgPyQt.createAction( GUIcontext.RUN_PYTEL_ID, "Compute case", "Compute case",
"Run Pytel launcher to compute the case" )
popup.addAction(sgPyQt.action(GUIcontext.EDIT_MASCARET_CASE_ID))
popup.addAction(sgPyQt.action(GUIcontext.RUN_MASCARET_ID))
elif selectedType == hydro_study.TELEMAC2D_CASE_TYPE_ID:
- popup.addAction(sgPyQt.action(GUIcontext.EDIT_TELEMAC2D_CASE_ID))
- popup.addAction(sgPyQt.action(GUIcontext.RUN_TELEMAC2D_ID))
popup.addAction(sgPyQt.action(GUIcontext.GEN_TELEMAC2D_PYTHON_ID))
popup.addAction(sgPyQt.action(GUIcontext.GEN_TELEMAC2D_YACS_ID))
elif selectedType == hydro_study.LOG_TYPE_ID:
def edit_telemac2d_case():
EficasForTelemac2DAppli(get_and_check_selected_file_path())
-# Run Telemac2D on selected case
-def run_telemac2d():
- engine = None
- try:
- with wait_cursor:
- ed = hydro_study.HydroStudyEditor()
- entry = salome.sg.getSelected(0)
- engine = salome.lcc.FindOrLoadComponent("Telemac2DContainer", "TELEMAC2D")
- engine.Compute(ed.editor.studyId, entry)
- # Stop container after execution so that we can use another fortran user file in the next run
- engine.GetContainerRef().Shutdown()
- except SALOME.SALOME_Exception, exc:
- if engine is not None:
- engine.GetContainerRef().Shutdown()
- msg = unicode(QApplication.translate("run_telemac2d",
- "An error happened while trying to run Telemac2D:"))
- msg += "\n" + exc.details.text
- raise HSGUIException(msg)
- except Exception, exc:
- logger.exception("An error happened in the computation (Telemac2D probably crashed).")
- try:
- engine.GetContainerRef().Shutdown()
- except:
- pass
- msg = unicode(QApplication.translate("run_telemac2d",
- "An error happened in the computation (Telemac2D probably crashed, "
- "see logs and listing files for more details):"))
- msg += "\n" + unicode(exc)
- raise HSGUIException(msg)
-
###
# Generate a python script from the eficas file
###
GUIcontext.EDIT_MASCARET_CASE_ID: edit_mascaret_case,
GUIcontext.SHOW_LOG_ID: show_log,
GUIcontext.CREATE_TELEMAC2D_CASE_ID: create_telemac2d_case,
- GUIcontext.RUN_TELEMAC2D_ID: run_telemac2d,
GUIcontext.GEN_TELEMAC2D_PYTHON_ID: generate_telemac2d_python,
GUIcontext.GEN_TELEMAC2D_YACS_ID: generate_telemac2d_yacs,
- GUIcontext.EDIT_TELEMAC2D_CASE_ID: edit_telemac2d_case,
GUIcontext.OPEN_SCHEMA_IN_YACS_ID: open_schema_in_yacs,
GUIcontext.CREATE_PYTEL_CASE_ID: create_case_pytel,
GUIcontext.RUN_PYTEL_ID: run_selected_case_pytel,