From: Paul RASCLE Date: Tue, 4 Apr 2017 19:30:56 +0000 (+0200) Subject: fix test boundary condition dialog X-Git-Tag: Salome_8_3_Hydro_2_0rc1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=21ad1888f08ac4ce3e27106d1fdf983e83b08ca4;p=modules%2Fhydrosolver.git fix test boundary condition dialog --- diff --git a/src/HYDROGUI/BndConditionsDialog.py b/src/HYDROGUI/BndConditionsDialog.py index 81884e8..d885d92 100755 --- a/src/HYDROGUI/BndConditionsDialog.py +++ b/src/HYDROGUI/BndConditionsDialog.py @@ -385,31 +385,32 @@ class BoundaryConditionsDialog(QDialog): """Check if the input data is valid""" def is_valid(self): - is_ok = False + is_ok = True if self.boundaryConditionsTable.rowCount() < 1: QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Boundary conditions list is empty.")) elif len(self.get_output_path())==0: QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Output file path is empty.")) else: - has_empty_cells = True for row_nb in xrange(0, self.boundaryConditionsTable.rowCount()): + has_empty_cells = True lihbor = str(self.boundaryConditionsTable.item(row_nb, 1).text()) liubor = str(self.boundaryConditionsTable.item(row_nb, 2).text()) livbor = str(self.boundaryConditionsTable.item(row_nb, 3).text()) litbor = str(self.boundaryConditionsTable.item(row_nb, 4).text()) - #print "valid: ", lihbor, liubor, livbor, litbor - if lihbor and liubor and livbor and litbor: + #print "test valid: ", lihbor, liubor, livbor, litbor + if (lihbor != '') and (liubor != '') and (livbor != '') and (litbor != '') : has_empty_cells = False # Full lines are OK #print "valid: full line" - if (not lihbor) and (not liubor) and (not livbor) and (not litbor): + if (lihbor == '') and (liubor == '') and (livbor == '') and (litbor == ''): has_empty_cells = False # Empty lines are OK #print "valid: empty line" - if has_empty_cells: - QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Table has empty cell(s).")) - else: - is_ok = True + if has_empty_cells: + #print "not valid!" + QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Table has empty cell(s).")) + is_ok = False + break return is_ok