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 )
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()