Реализован расчёт растворителя в матрице планирования
This commit is contained in:
Binary file not shown.
@@ -270,7 +270,6 @@ class MainWindow(QMainWindow):
|
||||
)
|
||||
self.info_label.setText(solvent_text)
|
||||
self.info_label.setStyleSheet("background-color: #d5f5e3; padding: 8px; border-radius: 5px;")
|
||||
print(result)
|
||||
# Сохраняем результаты для передачи в DoE
|
||||
self.last_medium_result = result
|
||||
|
||||
@@ -572,19 +571,23 @@ class MainWindow(QMainWindow):
|
||||
n_exp = len(design)
|
||||
n_factors = len(factors)
|
||||
n_i_factors = len(i_factors)
|
||||
solvent_name = self.exp_solvent.text()
|
||||
total_volume = self.exp_total_volume.value()
|
||||
solvent_unit = self.exp_volume_unit.currentText()
|
||||
self.design_matrix.setRowCount(n_exp)
|
||||
self.design_matrix.setColumnCount(n_factors + 3)
|
||||
headers = [f['name'] for f in factors] + [f['name'] for f in i_factors] + ["Растворитель"] +["Тип"] +["Отклик"]
|
||||
self.design_matrix.setColumnCount(n_factors + 4)
|
||||
headers = [f['name'] for f in factors] + [f['name'] for f in i_factors] + [solvent_name] +["Тип"] +["Отклик"]
|
||||
self.design_matrix.setHorizontalHeaderLabels(headers)
|
||||
|
||||
for exp_idx, exp in enumerate(design):
|
||||
|
||||
solvent = convert_units(total_volume,solvent_unit)
|
||||
for f_idx in range(n_factors):
|
||||
key = f"Фактор_{f_idx+1}"
|
||||
if key not in exp:
|
||||
continue
|
||||
value = exp[key]['natural']
|
||||
unit = factors[f_idx]['unit']
|
||||
solvent -= convert_units(value,unit)
|
||||
display = self._format_number(value)
|
||||
if unit:
|
||||
display += f" {unit}"
|
||||
@@ -604,13 +607,18 @@ class MainWindow(QMainWindow):
|
||||
|
||||
item.setBackground(QColor(255, 255, 200))
|
||||
self.design_matrix.setItem(exp_idx, n_factors + f_idx, item)
|
||||
|
||||
solvent = convert_units(solvent, "мкл", solvent_unit)
|
||||
display = self._format_number(solvent)
|
||||
if solvent_unit:
|
||||
display += f" {solvent_unit}"
|
||||
item = QTableWidgetItem(display)
|
||||
self.design_matrix.setItem(exp_idx, n_factors+n_i_factors, item)
|
||||
if exp.get('is_center', False):
|
||||
type_item = QTableWidgetItem(f"Центр #{exp['center_num']}")
|
||||
type_item.setBackground(QColor(255, 255, 200))
|
||||
else:
|
||||
type_item = QTableWidgetItem("Факторная")
|
||||
self.design_matrix.setItem(exp_idx, n_factors+n_i_factors, type_item)
|
||||
self.design_matrix.setItem(exp_idx, n_factors+n_i_factors + 1, type_item)
|
||||
|
||||
self.design_matrix.resizeColumnsToContents()
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"""
|
||||
Биохимический помощник - точка входа в приложение
|
||||
TODO:
|
||||
- Добавить информацию о количестве раствора в DOE
|
||||
- Добавить информацию о количестве раствора в DOE ОК
|
||||
- Не считать фактор, если его шаг 0 ОК
|
||||
- Добавить столбец в матрицу планирования с информацией о количестве добавленного растворителя, учитывая все реагенты
|
||||
- Начать делать анализ
|
||||
|
||||
Reference in New Issue
Block a user