From: asl Date: Mon, 23 Jan 2017 13:10:42 +0000 (+0300) Subject: porting interpolz GUI on PyQt5 X-Git-Tag: Salome_8_3_Hydro_2_0rc1~31^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3dd1acf49d088cb3c5a5fad35a637fa9c9f610f6;p=modules%2Fhydrosolver.git porting interpolz GUI on PyQt5 --- diff --git a/src/salome_hydro/interpolz_gui.py b/src/salome_hydro/interpolz_gui.py index 6fa168a..69f63c8 100644 --- a/src/salome_hydro/interpolz_gui.py +++ b/src/salome_hydro/interpolz_gui.py @@ -22,17 +22,22 @@ salome_gui = libSALOME_Swig.SALOMEGUI_Swig() 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 @@ -62,7 +67,7 @@ def get_selected_calc_case(): 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 @@ -95,16 +100,16 @@ class InterpolzDlg( QDialog ): 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()) ) @@ -112,7 +117,7 @@ class InterpolzDlg( QDialog ): 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 ):