From 9519d7ac02a6a8b34d49db6d66506ad232b8b466 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 18 Nov 2016 08:40:52 +0300 Subject: [PATCH] refs #1032: messages about state --- src/salome_hydro/interpolz_gui.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/salome_hydro/interpolz_gui.py b/src/salome_hydro/interpolz_gui.py index 6da5813..926029a 100644 --- a/src/salome_hydro/interpolz_gui.py +++ b/src/salome_hydro/interpolz_gui.py @@ -76,7 +76,8 @@ class InterpolzDlg( QtGui.QDialog ): self.connect( self.btnMEDFile, QtCore.SIGNAL( "clicked()" ), self.onMEDFile ) self.connect( self.CalcCase, QtCore.SIGNAL( "textChanged( const QString& )" ), self.onCalcCaseChanged ) self.connect( self.MEDFile, QtCore.SIGNAL( "textChanged( const QString& )" ), self.onMEDChanged ) - self.UndefZ.setText( "-9999" ) + self.UndefZ.setRange( -100000, 100000 ) + self.UndefZ.setValue( -9999 ) self.InterpMethod.addItem( "Interpolation at the nearest point" ) self.connect( self.ApplyClose, QtCore.SIGNAL( "clicked()" ), self.onApplyClose ) self.connect( self.Apply, QtCore.SIGNAL( "clicked()" ), self.onApply ) @@ -134,10 +135,28 @@ class InterpolzDlg( QtGui.QDialog ): for i in range( 0, self.Groups.rowCount() ): med_group = str( self.Groups.item( i, 0 ).text() ) hydro_reg = str( self.Groups.cellWidget( i, 1 ).currentText() ) - med_groups_regions[med_group] = hydro_reg - z_undef = int(str(self.UndefZ.text())) + if len(med_group)>0 and len(hydro_reg)>0: + med_groups_regions[med_group] = hydro_reg + z_undef = self.UndefZ.value() interp = str(self.InterpMethod.currentText()) - generate( path, calc_case, med_file, med_groups_regions, z_undef, interp ) + + msg = "" + if len(path)==0: + msg = "Please input the output path" + elif len(calc_case)==0: + msg = "Please choose the calculation case" + elif len(med_file)==0: + msg = "Please choose the MED file" + elif len(med_groups_regions)==0: + msg = "Please fill groups table" + elif len(interp)==0: + msg = "Please choose interpolation method" + + if len(msg)==0: + generate( path, calc_case, med_file, med_groups_regions, z_undef, interp ) + msg = "InterpolZ script is successfully generated" + + QtGui.QMessageBox.information( self, "", msg ) def onClose( self ): self.close() -- 2.39.2