from generate_interpolz import generate
def get_med_groups( file_path ):
- #print "get_med_groups", file_path
+ print "get_med_groups", file_path
try:
- meshes = MEDLoader.MEDLoader_GetMeshNames(file_path)
+ meshes = MEDLoader.GetMeshNames(file_path)
except:
+ print 'No meshes found'
return []
if len(meshes)==0:
+ print 'No mesh found'
return []
mesh1 = meshes[0]
+ print 'Found mesh:', mesh1
try:
- groups = list(MEDLoader.MEDLoader_GetMeshGroupsNames(file_path, mesh1))
+ groups = list(MEDLoader.GetMeshGroupsNames(file_path, mesh1))
+ print 'Found groups:', groups
except:
+ print 'No groups found'
return []
return groups
doc = HYDROPy.HYDROData_Document.Document( aStudyId )
for i in ind:
if i.column()==0:
- name = i.data().toString()
+ name = str(i.data())
case = doc.FindObjectByName( name )
if isinstance(case, HYDROPy.HYDROData_CalculationCase):
return name
def onOutputFile( self ):
caption = "Python file"
mask = "*.py"
- f = QFileDialog.getSaveFileName( self, caption, ".", mask )
- if f!=None and f!="":
- self.OutputPath.setText( f )
+ fname, filt = QFileDialog.getSaveFileName( self, caption, ".", mask )
+ if fname!=None and fname!="":
+ self.OutputPath.setText( fname )
def onMEDFile( self ):
caption = "MED file"
mask = "*.med"
- f = QFileDialog.getOpenFileName( self, caption, ".", mask )
- if f!=None and f!="":
- self.MEDFile.setText( f )
+ 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()) )
def onMEDChanged( self ):
self.med_groups = get_med_groups( str(self.MEDFile.text()) )
- #print self.med_groups
+ print self.med_groups
n = len( self.med_groups )
self.Groups.setRowCount( n )
for i in range( 0, n ):