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