]> SALOME platform Git repositories - modules/hydrosolver.git/commitdiff
Salome HOME
Merge branch 'BR_PY3'
authorYoann AUDOUIN <B61570@dsp0851742.postes.calibre.edf.fr>
Tue, 3 Mar 2020 08:24:28 +0000 (09:24 +0100)
committerYoann AUDOUIN <B61570@dsp0851742.postes.calibre.edf.fr>
Tue, 3 Mar 2020 08:24:28 +0000 (09:24 +0100)
1  2 
src/HYDROGUI/BndConditionsDialog.py

index 7c393be0ea271af339b916881b6370b3288e368b,474b4be4f3ae3bb33ba13868d161f3fee4b72720..b9c3924c6c06ab46f3f96a8c4270c55c77721176
mode 100644,100755..100755
@@@ -266,27 -270,35 +270,35 @@@ class BoundaryConditionsDialog(QDialog)
                  liubor = values[1]
                  livbor = values[2]
                  litbor = values[3]
-                 
-                 if lihbor:
-                     self.boundaryConditionsTable.item(row_nb, 1).setText(str(lihbor))
-                     
-                 if liubor:
-                     self.boundaryConditionsTable.item(row_nb, 2).setText(str(liubor))    
-                     
-                 if livbor:
-                     self.boundaryConditionsTable.item(row_nb, 3).setText(str(livbor))    
-                     
-                 if litbor:
-                     self.boundaryConditionsTable.item(row_nb, 4).setText(str(litbor))    
-         
+                 #print "on_preset_changed ", preset, lihbor, liubor, livbor, litbor
+                 #if lihbor is not None:
+                 self.boundaryConditionsTable.item(row_nb, 1).setText(str(lihbor))
+                 #if liubor is not None:
+                 self.boundaryConditionsTable.item(row_nb, 2).setText(str(liubor))
+                 #if livbor is not None:
+                 self.boundaryConditionsTable.item(row_nb, 3).setText(str(livbor))
+                 #if litbor is not None:
+                 self.boundaryConditionsTable.item(row_nb, 4).setText(str(litbor))
 -                
++
+         if isinstance(combo, QComboBox):
+             ind = combo.findText(preset)
+             if ind >= 0:
+                 combo.setCurrentIndex(ind)
      """Define result file path"""
      def on_result_file_browse(self):
-         file_path = QtGui.QFileDialog.getSaveFileName(self, self.tr("Select output file path"))
+         file_path, filt = QFileDialog.getSaveFileName(self, self.tr("Select output file path"))
+         #print file_path
          if file_path:
              self.resultBndConditionsFileEdit.setText(file_path)
-     
      """Set groups list"""
      def set_groups(self, groups):
+         #print "set_groups"
          self.boundaryConditionsTable.setRowCount(0)
          for group in groups:
              # Add row
              font = item.font()
              font.setBold(True)
              item.setFont(font)
-             item.setFlags(QtCore.Qt.ItemIsEnabled)
+             item.setFlags(Qt.ItemIsEnabled)
              self.boundaryConditionsTable.setItem(row_nb, 5, item)
-         
          self.update_table()
-     
      """Update conditions data in the table from the conditions input file"""
      def update_table(self):
+         #print "update_table"
          is_updated = False
-     
-         nb_rows = self.boundaryConditionsTable.rowCount()   
-         for row_nb in xrange(0, nb_rows):
+         nb_rows = self.boundaryConditionsTable.rowCount()
+         for row_nb in range(0, nb_rows):
              group_name = str(self.boundaryConditionsTable.item(row_nb, 5).text())
-             if self.input_conditions.has_key(group_name):
+             if group_name in self.input_conditions:
 -                
++
                  values = self.input_conditions[group_name]
-                 
+                 #print values
                  lihbor = str(values[0])
                  liubor = str(values[1])
                  livbor = str(values[2])