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
-#from salome.hydro.telemac2d.eficas.appli import EficasForTelemac2DAppli
-#from salome.hydro.coupling1d2d.eficas.appli import EficasForCoupling1D2DAppli
+from salome.hydro.mascaret.eficas.appli import EficasForMascaretAppli
+from salome.hydro.telemac2d.eficas.appli import EficasForTelemac2DAppli
+from salome.hydro.coupling1d2d.eficas.appli import EficasForCoupling1D2DAppli
#import salome.hydro.pytel.gui as pytel_gui
-#from salome.hydro.boundary_conditions.eficas.appli import EficasForBoundaryConditionsAppli
+from salome.hydro.boundary_conditions.eficas.appli import EficasForBoundaryConditionsAppli
import BndConditionsDialog
#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 )
Ui_TextDisplayDialog.__init__(self)
self.setupUi(self)
(self.closeButton.clicked.connect(self.close)
-
+
def set_log(self, log):
self.contentTextEdit.setPlainText(log)
self.setWindowTitle("Coupling log")
import sys, os
#sys.path.append(os.path.join(os.environ['MEDFILE_ROOT_DIR'], 'lib/python2.7/site-packages/med'))
-sys.path.append(os.path.join(os.environ['MEDFICHIER_INSTALL_DIR'], 'lib/python2.7/site-packages/med'))
+#sys.path.append(os.path.join(os.environ['MEDFICHIER_INSTALL_DIR'], 'lib/python2.7/site-packages/med'))
hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'salome', 'hydro')
-sys.path.append(hydro_solver_root)
+#sys.path.append(hydro_solver_root)
import salome
salome.salome_init()
for r in regions:
rname = r.GetName()
regions_names.append( str(rname) )
-
+
shape_groups = case.GetGeometryGroups()
for sg in shape_groups:
sgname = sg.GetName()
regions_names.append( sgname )
-
+
return regions_names
else:
return []
if isinstance(case, HYDROPy.HYDROData_CalculationCase):
return name
return None
-
+
class InterpolzDlg( QDialog ):
def __init__(self, parent = None):
QDialog.__init__( self, parent )
self.Apply.clicked.connect(self.onApply)
self.Close.clicked.connect(self.onClose)
self.Help.clicked.connect(self.onHelp)
-
+
def onSelectionChanged( self ):
calc_case_name = get_selected_calc_case()
if calc_case_name is not None:
self.CalcCase.setText( calc_case_name )
-
+
def onOutputFile( self ):
caption = "Python file"
mask = "*.py"
fname, filt = QFileDialog.getSaveFileName( self, caption, ".", mask )
if fname!=None and fname!="":
self.OutputPath.setText( fname )
-
+
def onMEDFile( self ):
caption = "MED file"
mask = "*.med"
fname, filt = QFileDialog.getOpenFileName( self, caption, ".", mask )
if fname!=None and fname!="":
self.MEDFile.setText( fname )
-
+
def onCalcCaseChanged( self ):
self.regions = get_hydro_regions( str(self.CalcCase.text()) )
self.onMEDChanged()
-
+
def onMEDChanged( self ):
self.med_groups = get_med_groups( str(self.MEDFile.text()) )
print self.med_groups
self.Groups.setItem( i, 0, QTableWidgetItem() )
self.Groups.setItem( i, 1, QTableWidgetItem() )
self.Groups.item( i, 0 ).setText( self.med_groups[i] )
-
+
cb = QComboBox( self.Groups )
for r in self.regions:
cb.addItem( r )
def onApplyClose( self ):
if self.onApply():
self.onClose()
-
+
def onApply( self ):
path = str(self.OutputPath.text())
calc_case = str(self.CalcCase.text())
med_groups_regions[med_group] = hydro_reg
z_undef = self.UndefZ.value()
interp = str(self.InterpMethod.currentText())
-
+
msg = ""
if len(path)==0:
msg = "Please input the output path"
msg = "Please fill groups table"
elif len(interp)==0:
msg = "Please choose interpolation method"
-
+
result = False
if len(msg)==0:
generate( path, calc_case, med_file, med_groups_regions, z_undef, interp )
msg = "InterpolZ script is successfully generated"
result = True
-
+
QMessageBox.information( self, "", msg )
return result
-
+
def onClose( self ):
- self.close()
+ self.close()
"""Shows help page"""
def onHelp( self ):