# HG changeset patch # User Michiel Broek # Date 1658156642 -7200 # Node ID dfbb012c631c8f36f37579ae5e4ea409eb5c924e # Parent d89bc21e2f07a9a123be19e63979d7730032f240 Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value. diff -r d89bc21e2f07 -r dfbb012c631c src/EditProduct.cpp --- a/src/EditProduct.cpp Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditProduct.cpp Mon Jul 18 17:04:02 2022 +0200 @@ -59,10 +59,6 @@ ui->sp_acidtypeEdit->addItem(my_acids.at(i).name_en); } - ui->sp_sourceEdit->addItem(tr("Source 1")); - ui->sp_sourceEdit->addItem(tr("Source 2")); - ui->sp_sourceEdit->addItem(tr("Mixed")); - query.prepare("SELECT name FROM inventory_waters ORDER BY record"); query.exec(); ui->w1_nameEdit->addItem(""); @@ -109,6 +105,10 @@ ui->keg_sugarEdit->addItem(query.value(0).toString()); } + ui->spargeGroup->setId(ui->w1_spButton, 0); + ui->spargeGroup->setId(ui->w2_spButton, 1); + ui->spargeGroup->setId(ui->wg_spButton, 2); + if (id >= 0) { if (! DB_product::load(product, this, id)) return; @@ -405,7 +405,7 @@ ui->w1_volEdit->setValue(product->w1_amount); ui->w1_caEdit->setValue(product->w1_calcium); ui->w1_mgEdit->setValue(product->w1_magnesium); - ui->w1_hco3Edit->setValue(product->w1_total_alkalinity * 1.22); + ui->w1_hco3Edit->setValue(Utils::Bicarbonate(product->w1_total_alkalinity, product->w1_ph)); ui->w1_caco3Edit->setValue(product->w1_total_alkalinity); ui->w1_naEdit->setValue(product->w1_sodium); ui->w1_clEdit->setValue(product->w1_chloride); @@ -441,7 +441,7 @@ ui->w2_volEdit->setValue(product->w2_amount); ui->w2_caEdit->setValue(product->w2_calcium); ui->w2_mgEdit->setValue(product->w2_magnesium); - ui->w2_hco3Edit->setValue(product->w2_total_alkalinity * 1.22); + ui->w2_hco3Edit->setValue(Utils::Bicarbonate(product->w2_total_alkalinity, product->w2_ph)); ui->w2_caco3Edit->setValue(product->w2_total_alkalinity); ui->w2_naEdit->setValue(product->w2_sodium); ui->w2_clEdit->setValue(product->w2_chloride); @@ -452,11 +452,12 @@ ui->mw_phEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); ui->mw_acidvolEdit->setReadOnly(product->calc_acid); ui->mw_acidvolEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); - + ui->sp_phEdit->setReadOnly(! product->calc_acid); + ui->sp_phEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); + ui->sp_acidvolEdit->setReadOnly(product->calc_acid); + ui->sp_acidvolEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->sp_volEdit->setValue(product->sparge_volume); - ui->sp_tempEdit->setValue(product->sparge_temp); ui->sp_phEdit->setValue(product->sparge_ph); - ui->sp_sourceEdit->setCurrentIndex(product->sparge_source); ui->sp_acidtypeEdit->setCurrentIndex(product->sparge_acid_type); ui->sp_acidpercEdit->setValue(product->sparge_acid_perc); ui->sp_acidvolEdit->setValue(product->sparge_acid_amount); @@ -469,7 +470,7 @@ ui->brew_mashsgEdit->setValue(product->brew_mash_sg); ui->brew_mashsgShow->setValue(0); ui->brew_masheffShow->setValue(product->brew_mash_efficiency); - ui->brew_spargetempShow->setValue(product->sparge_temp); + ui->brew_spargetempEdit->setValue(product->sparge_temp); ui->brew_spargevolShow->setValue(product->sparge_volume); ui->brew_spargeestShow->setValue(product->brew_sparge_est); ui->brew_spargephEdit->setValue(product->brew_sparge_ph); @@ -618,6 +619,11 @@ connect(ui->bs_mgcl2Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_mgcl2_changed); connect(ui->bs_nahco3Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_nahco3_changed); connect(ui->bs_caco3Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_caco3_changed); + connect(ui->ss_cacl2Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_cacl2_changed); + connect(ui->ss_caso4Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_caso4_changed); + connect(ui->ss_mgso4Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_mgso4_changed); + connect(ui->ss_naclEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_nacl_changed); + connect(ui->ss_mgcl2Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_mgcl2_changed); connect(ui->mw_autoEdit, &QCheckBox::stateChanged, this, &EditProduct::mw_calc_acid_clicked); connect(ui->mw_phEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::mw_ph_changed); connect(ui->mw_acidvolEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::mw_acid_changed); @@ -627,10 +633,10 @@ connect(ui->w2_nameEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditProduct::w2_name_changed); connect(ui->w2_volEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::w2_volume_changed); connect(ui->sp_volEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_volume_changed); - connect(ui->sp_tempEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_temp_changed); - connect(ui->sp_sourceEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditProduct::sp_source_changed); + connect(ui->spargeGroup, SIGNAL(buttonClicked(int)), this, SLOT(sp_group_changed(int))); connect(ui->sp_acidtypeEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditProduct::sp_type_changed); connect(ui->sp_phEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_ph_changed); + connect(ui->sp_acidvolEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_acid_changed); /* All signals from tab Brewday */ calcEfficiencyBeforeBoil(); @@ -646,6 +652,7 @@ connect(ui->brew_mashphEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_mashph_changed); connect(ui->brew_mashsgEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_mashsg_changed); connect(ui->brew_spargephEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_spargeph_changed); + connect(ui->brew_spargetempEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_temp_changed); connect(ui->brew_preboilphEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_preboilph_changed); connect(ui->brew_preboilsgEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_preboilsg_changed); connect(ui->brew_preboilvolEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_preboilvol_changed); diff -r d89bc21e2f07 -r dfbb012c631c src/EditProduct.h --- a/src/EditProduct.h Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditProduct.h Mon Jul 18 17:04:02 2022 +0200 @@ -128,6 +128,11 @@ void wb_mgcl2_changed(double val); void wb_nahco3_changed(double val); void wb_caco3_changed(double val); + void sp_cacl2_changed(double val); + void sp_caso4_changed(double val); + void sp_mgso4_changed(double val); + void sp_nacl_changed(double val); + void sp_mgcl2_changed(double val); void mw_calc_acid_clicked(); void wt_target_changed(int val); void mw_ph_changed(double val); @@ -135,9 +140,10 @@ void mw_type_changed(int val); void sp_volume_changed(double val); void sp_temp_changed(double val); - void sp_source_changed(int val); + void sp_group_changed(int val); void sp_type_changed(int val); void sp_ph_changed(double val); + void sp_acid_changed(double val); void step_name_changed(QString val); void step_type_changed(int val); void step_temp_changed(double val); @@ -278,8 +284,8 @@ void showEquipment(); void initEquipment(); void setStage(); - void brewing_salt_sub(QString salt, double val); - void set_brewing_salt(QString salt, double val); + void brewing_salt_sub(QString salt, double val, int use); + void set_brewing_salt(QString salt, double val, int use); void calcMiscs(); void calcFermentables(); void calcFermentablesFromOG(double og); diff -r d89bc21e2f07 -r dfbb012c631c src/EditProductTab1.cpp --- a/src/EditProductTab1.cpp Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditProductTab1.cpp Mon Jul 18 17:04:02 2022 +0200 @@ -290,7 +290,6 @@ ui->mash_pickEdit->setDisabled(stage > PROD_STAGE_BREW); /* Tab 8, water */ - ui->sp_sourceEdit->setDisabled(stage > PROD_STAGE_BREW); ui->wt_sourceEdit->setDisabled(stage > PROD_STAGE_BREW); ui->w1_nameEdit->setDisabled(stage > PROD_STAGE_BREW); ui->w2_nameEdit->setDisabled(stage > PROD_STAGE_BREW); @@ -298,10 +297,8 @@ ui->sp_acidtypeEdit->setDisabled(stage > PROD_STAGE_BREW); ui->w2_volEdit->setReadOnly(stage > PROD_STAGE_BREW); ui->w2_volEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); - ui->sp_phEdit->setReadOnly(stage > PROD_STAGE_BREW); - ui->sp_phEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); - ui->sp_tempEdit->setReadOnly(stage > PROD_STAGE_BREW); - ui->sp_tempEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); + //ui->sp_tempEdit->setReadOnly(stage > PROD_STAGE_BREW); + //ui->sp_tempEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->sp_volEdit->setReadOnly(stage > PROD_STAGE_BREW); ui->sp_volEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->bs_cacl2Edit->setReadOnly(stage > PROD_STAGE_BREW); @@ -323,11 +320,22 @@ ui->mw_phEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); ui->mw_acidvolEdit->setReadOnly(true); ui->mw_acidvolEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); + ui->sp_phEdit->setReadOnly(true); + ui->sp_phEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); + ui->sp_acidvolEdit->setReadOnly(true); + ui->sp_acidvolEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); + ui->w1_spButton->setDisabled(true); + ui->w2_spButton->setDisabled(true); + ui->wg_spButton->setDisabled(true); } else { ui->mw_phEdit->setReadOnly(! product->calc_acid); ui->mw_phEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); ui->mw_acidvolEdit->setReadOnly(product->calc_acid); ui->mw_acidvolEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); + ui->sp_phEdit->setReadOnly(! product->calc_acid); + ui->sp_phEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); + ui->sp_acidvolEdit->setReadOnly(product->calc_acid); + ui->sp_acidvolEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); } ui->mw_autoEdit->setDisabled(stage > PROD_STAGE_BREW); @@ -418,6 +426,8 @@ ui->brew_mashsgEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->brew_spargephEdit->setReadOnly(stage > PROD_STAGE_BREW); ui->brew_spargephEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); + ui->brew_spargetempEdit->setReadOnly(stage > PROD_STAGE_BREW); + ui->brew_spargetempEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->brew_preboilphEdit->setReadOnly(stage > PROD_STAGE_BREW); ui->brew_preboilphEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->brew_preboilsgEdit->setReadOnly(stage > PROD_STAGE_BREW); diff -r d89bc21e2f07 -r dfbb012c631c src/EditProductTab5.cpp --- a/src/EditProductTab5.cpp Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditProductTab5.cpp Mon Jul 18 17:04:02 2022 +0200 @@ -65,6 +65,13 @@ const QSignalBlocker blocker7(ui->bs_caco3Edit); const QSignalBlocker blocker8(ui->mw_acidPick); const QSignalBlocker blocker9(ui->mw_acidvolEdit); + const QSignalBlocker blocker10(ui->ss_cacl2Edit); + const QSignalBlocker blocker11(ui->ss_caso4Edit); + const QSignalBlocker blocker12(ui->ss_mgso4Edit); + const QSignalBlocker blocker13(ui->ss_naclEdit); + const QSignalBlocker blocker14(ui->ss_mgcl2Edit); + const QSignalBlocker blocker15(ui->sp_acidtypeEdit); + const QSignalBlocker blocker16(ui->sp_acidvolEdit); const QStringList labels({tr("Ingredient"), tr("Type"), tr("Use at"), tr("Time"), tr("Amount"), tr("Stock"), tr("Delete"), tr("Edit") }); @@ -179,7 +186,7 @@ /* * Update the water agents. */ - if (product->miscs.at(i).type == MISC_TYPES_WATER_AGENT) { + if (product->miscs.at(i).type == MISC_TYPES_WATER_AGENT && product->miscs.at(i).use_use == MISC_USES_MASH) { if (product->miscs.at(i).name == "CaCl2") { ui->bs_cacl2Edit->setValue(product->miscs.at(i).amount * 1000.0); } else if (product->miscs.at(i).name == "CaSO4") { @@ -219,7 +226,43 @@ ui->mw_acidpercEdit->setValue(my_acids.at(3).AcidPrc); ui->mw_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); } - } + } else if (product->miscs.at(i).type == MISC_TYPES_WATER_AGENT && product->miscs.at(i).use_use == MISC_USES_SPARGE) { + if (product->miscs.at(i).name == "CaCl2") { + ui->ss_cacl2Edit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "CaSO4") { + ui->ss_caso4Edit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "MgSO4") { + ui->ss_mgso4Edit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "NaCl") { + ui->ss_naclEdit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "MgCl2") { + ui->ss_mgcl2Edit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "Melkzuur" || product->miscs.at(i).name == "Lactic") { + product->sparge_acid_type = 0; + product->sparge_acid_perc = my_acids.at(0).AcidPrc; + ui->sp_acidtypeEdit->setCurrentIndex(0); + ui->sp_acidpercEdit->setValue(my_acids.at(0).AcidPrc); + ui->sp_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "Zoutzuur" || product->miscs.at(i).name == "Hydrochloric") { + product->sparge_acid_type = 1; + product->sparge_acid_perc = my_acids.at(1).AcidPrc; + ui->sp_acidtypeEdit->setCurrentIndex(1); + ui->sp_acidpercEdit->setValue(my_acids.at(1).AcidPrc); + ui->sp_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "Fosforzuur" || product->miscs.at(i).name == "Phosphoric") { + product->sparge_acid_type = 2; + product->sparge_acid_perc = my_acids.at(2).AcidPrc; + ui->sp_acidtypeEdit->setCurrentIndex(2); + ui->sp_acidpercEdit->setValue(my_acids.at(2).AcidPrc); + ui->sp_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "Zwavelzuur" || product->miscs.at(i).name == "Sulfuric") { + product->sparge_acid_type = 3; + product->sparge_acid_perc = my_acids.at(3).AcidPrc; + ui->sp_acidtypeEdit->setCurrentIndex(3); + ui->sp_acidpercEdit->setValue(my_acids.at(3).AcidPrc); + ui->sp_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); + } + } } } @@ -229,6 +272,7 @@ product->miscs_ok = true; for (int i = 0; i < product->miscs.size(); i++) { if ((((product->inventory_reduced <= PROD_STAGE_BREW) && (product->miscs.at(i).use_use <= MISC_USES_BOIL)) || // Starter, Mash, Boil + ((product->inventory_reduced <= PROD_STAGE_BREW) && (product->miscs.at(i).use_use == MISC_USES_SPARGE)) || ((product->inventory_reduced <= PROD_STAGE_PRIMARY) && (product->miscs.at(i).use_use == MISC_USES_PRIMARY)) || ((product->inventory_reduced <= PROD_STAGE_TERTIARY) && (product->miscs.at(i).use_use == MISC_USES_SECONDARY)) || ((product->inventory_reduced <= PROD_STAGE_PACKAGE) && (product->miscs.at(i).use_use == MISC_USES_BOTTLING))) && @@ -242,7 +286,7 @@ /* * Manipulate the memory array and update the miscs table. */ -void EditProduct::brewing_salt_sub(QString salt, double val) +void EditProduct::brewing_salt_sub(QString salt, double val, int use) { QTableWidgetItem *item; @@ -252,8 +296,8 @@ * Remove this salt if it is in the table. */ for (int i = 0; i < product->miscs.size(); i++) { - if (salt.contains(product->miscs.at(i).name)) { - qDebug() << " brewing_salt_sub delete" << salt; + if (salt.contains(product->miscs.at(i).name) && product->miscs.at(i).use_use == use) { + qDebug() << " brewing_salt_sub delete" << salt << use; product->miscs.removeAt(i); refreshMiscs(); return; @@ -268,7 +312,7 @@ * If it is, update the amount. */ for (int i = 0; i < product->miscs.size(); i++) { - if (salt.contains(product->miscs.at(i).name)) { + if (salt.contains(product->miscs.at(i).name) && product->miscs.at(i).use_use == use) { product->miscs[i].amount = val / 1000.0; if (product->miscs.at(i).amount_is_weight) item = new QTableWidgetItem(QString("%1 gr").arg(val, 3, 'f', 2, '0')); @@ -294,7 +338,7 @@ m.name = query.value(1).toString(); m.amount = val / 1000.0; m.type = query.value(2).toInt(); - m.use_use = query.value(3).toInt(); + m.use_use = use; m.time = query.value(4).toDouble(); m.amount_is_weight = query.value(5).toInt() ? true:false; m.cost = query.value(10).toDouble(); @@ -305,18 +349,18 @@ } } - qDebug() << "brewing_salt_sub, nothing done." << salt << val; + qDebug() << "brewing_salt_sub, nothing done." << salt << val << use; } /* * Edit brewing salt and recalculate. */ -void EditProduct::set_brewing_salt(QString salt, double val) +void EditProduct::set_brewing_salt(QString salt, double val, int use) { val = round(val * 100.0) / 100.0; - qDebug() << "set_brewing_salt" << salt << val; - brewing_salt_sub(salt, val); + qDebug() << "set_brewing_salt" << salt << val << use; + brewing_salt_sub(salt, val, use); calcWater(); is_changed(); } @@ -677,6 +721,7 @@ useatEdit->addItem(tr("Primary")); useatEdit->addItem(tr("Secondary")); useatEdit->addItem(tr("Bottling")); + useatEdit->addItem(tr("Sparge")); useatEdit->setCurrentIndex(product->miscs.at(product->miscs_row).use_use); minstockEdit = new QCheckBox(dialog); @@ -737,6 +782,11 @@ const QSignalBlocker blocker6(ui->bs_nahco3Edit); const QSignalBlocker blocker7(ui->bs_caco3Edit); const QSignalBlocker blocker9(ui->mw_acidvolEdit); + const QSignalBlocker blocker10(ui->ss_cacl2Edit); + const QSignalBlocker blocker11(ui->ss_caso4Edit); + const QSignalBlocker blocker12(ui->ss_mgso4Edit); + const QSignalBlocker blocker13(ui->ss_naclEdit); + const QSignalBlocker blocker14(ui->ss_mgcl2Edit); for (int i = 0; i < product->miscs.size(); i++) { amount = product->miscs.at(i).amount * factor; @@ -745,7 +795,7 @@ /* * Update the water agents. */ - if (product->miscs.at(i).type == MISC_TYPES_WATER_AGENT) { + if (product->miscs.at(i).type == MISC_TYPES_WATER_AGENT && product->miscs.at(i).use_use == MISC_USES_MASH) { if (product->miscs.at(i).name == "CaCl2") { ui->bs_cacl2Edit->setValue(product->miscs.at(i).amount * 1000.0); } else if (product->miscs.at(i).name == "CaSO4") { @@ -769,6 +819,26 @@ } else if (product->miscs.at(i).name == "Zwavelzuur" || product->miscs.at(i).name == "Sulfuric") { ui->mw_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); } + } else if (product->miscs.at(i).type == MISC_TYPES_WATER_AGENT && product->miscs.at(i).use_use == MISC_USES_SPARGE) { + if (product->miscs.at(i).name == "CaCl2") { + ui->ss_cacl2Edit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "CaSO4") { + ui->ss_caso4Edit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "MgSO4") { + ui->ss_mgso4Edit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "NaCl") { + ui->ss_naclEdit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "MgCl2") { + ui->ss_mgcl2Edit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "Melkzuur" || product->miscs.at(i).name == "Lactic") { + ui->sp_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "Zoutzuur" || product->miscs.at(i).name == "Hydrochloric") { + ui->sp_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "Fosforzuur" || product->miscs.at(i).name == "Phosphoric") { + ui->sp_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); + } else if (product->miscs.at(i).name == "Zwavelzuur" || product->miscs.at(i).name == "Sulfuric") { + ui->sp_acidvolEdit->setValue(product->miscs.at(i).amount * 1000.0); + } } } } diff -r d89bc21e2f07 -r dfbb012c631c src/EditProductTab8.cpp --- a/src/EditProductTab8.cpp Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditProductTab8.cpp Mon Jul 18 17:04:02 2022 +0200 @@ -161,7 +161,7 @@ qDebug() << "calcWater()"; ui->w1_hardnessEdit->setValue(Utils::Hardness(product->w1_calcium, product->w1_magnesium)); - ui->w1_raEdit->setValue(Utils::RA_ppm(product->w1_total_alkalinity, product->w1_calcium, product->w1_magnesium)); + ui->w1_raEdit->setValue(Utils::ResidualAlkalinity(product->w1_total_alkalinity, product->w1_calcium, product->w1_magnesium)); /* * If there is a dilute water source, mix the waters. @@ -176,7 +176,7 @@ total_alkalinity = Utils::mix(product->w1_amount, product->w2_amount, product->w1_total_alkalinity, product->w2_total_alkalinity); ph = -log10(((pow(10, -product->w1_ph) * product->w1_amount) + (pow(10, -product->w2_ph) * product->w2_amount)) / liters); ui->w2_hardnessEdit->setValue(Utils::Hardness(product->w2_calcium, product->w2_magnesium)); - ui->w2_raEdit->setValue(Utils::RA_ppm(product->w2_total_alkalinity, product->w2_calcium, product->w2_magnesium)); + ui->w2_raEdit->setValue(Utils::ResidualAlkalinity(product->w2_total_alkalinity, product->w2_calcium, product->w2_magnesium)); } else { liters = product->w1_amount; calcium = product->w1_calcium; @@ -197,18 +197,18 @@ product->wg_total_alkalinity = round(total_alkalinity * 10.0) / 10.0; product->wg_ph = ph; + bicarbonate = Utils::Bicarbonate(total_alkalinity, ph); ui->wg_volEdit->setValue(liters); ui->wg_caEdit->setValue(calcium); ui->wg_mgEdit->setValue(magnesium); - ui->wg_hco3Edit->setValue(total_alkalinity * 1.22); + ui->wg_hco3Edit->setValue(bicarbonate); ui->wg_caco3Edit->setValue(total_alkalinity); ui->wg_naEdit->setValue(sodium); ui->wg_clEdit->setValue(chloride); ui->wg_so4Edit->setValue(sulfate); ui->wg_phEdit->setValue(ph); ui->wg_hardnessEdit->setValue(Utils::Hardness(calcium, magnesium)); - ui->wg_raEdit->setValue(Utils::RA_ppm(total_alkalinity, calcium, magnesium)); - bicarbonate = total_alkalinity * 1.22; + ui->wg_raEdit->setValue(Utils::ResidualAlkalinity(total_alkalinity, calcium, magnesium)); /* Save mixed water ions for later */ double wg_calcium = calcium; @@ -265,10 +265,17 @@ Acidmg = Acid; Acid = Acid / my_acids[AT].AcidSG; Acid = round((Acid / (product->wa_acid_perc / 100.0)) * 100.0) / 100.0; + qDebug() << " Mash auto Acid final old ml:" << Acid; + Acid = Acidmg; + + double RealSG = round(((my_acids[AT].AcidSG - 1000) * (product->wa_acid_perc / 100)) + 1000); + Acid /= RealSG; + Acid /= my_acids[AT].AcidPrc / 100; + Acid = round(Acid * 100.0) / 100.0; qDebug() << " Mash auto Acid final ml:" << Acid; QString w = my_acids[AT].name_en + ' ' + my_acids[AT].name_nl; - brewing_salt_sub(w, Acid); + brewing_salt_sub(w, Acid, MISC_USES_MASH); ui->mw_acidvolEdit->setValue(Acid); bicarbonate = bicarbonate - protonDeficit * frac / liters; @@ -282,17 +289,19 @@ * Manual adjust acid, calculate resulting pH. */ double pHa = ph; // Mixed water pH. + double RealSG = round(((my_acids[AT].AcidSG - 1000) * (product->wa_acid_perc / 100)) + 1000); // Then calculate the new pH with added acids and malts qDebug() << " Mash pH:" << pHa; - Acid = my_acids[AT].AcidSG * (product->wa_acid_perc / 100.0); // ml + Acid = RealSG; Acid *= ui->mw_acidvolEdit->value(); + Acid *= my_acids[AT].AcidPrc / 100; Acid /= my_acids[AT].MolWt; // mg; Acidmg = Acid; //find the pH where the protondeficit = protondeficit by the acid frac = Utils::CalcFrac(pHa, my_acids[AT].pK1, my_acids[AT].pK2, my_acids[AT].pK3); protonDeficit = Acid * frac; - //qDebug() << " protonDeficit Acid:" << protonDeficit << "frac:" << frac << "pH:" << pHa; + qDebug() << " Acid:" << Acid << "protonDeficit:" << protonDeficit << "frac:" << frac << "pH:" << pHa; double deltapH = 0.001; double deltapd = 0.1; @@ -308,7 +317,7 @@ protonDeficit = Acid * frac; pd = ProtonDeficit(pHa); } - //qDebug() << " n:" << n << "pd:" << pd << "protonDeficit:" << protonDeficit << "frac:" << frac << "pHa:" << pHa; + qDebug() << " n:" << n << "pd:" << pd << "protonDeficit:" << protonDeficit << "frac:" << frac << "pHa:" << pHa; bicarbonate = wg_bicarbonate - protonDeficit * frac / liters; total_alkalinity = bicarbonate * 50 / 61; @@ -383,7 +392,7 @@ ui->wb_clEdit->setValue(chloride); ui->wb_so4Edit->setValue(sulfate); ui->wb_hardnessEdit->setValue(Utils::Hardness(calcium, magnesium)); - ui->wb_raEdit->setValue(Utils::RA_ppm(total_alkalinity, calcium, magnesium)); + ui->wb_raEdit->setValue(Utils::ResidualAlkalinity(total_alkalinity, calcium, magnesium)); ui->wb_caEdit->setStyleSheet((calcium < 40 || calcium > 150) ? "background-color: red":"background-color: green"); ui->wb_mgEdit->setStyleSheet((magnesium < 5 || magnesium > 40) ? "background-color: red":"background-color: green"); @@ -420,80 +429,130 @@ qDebug() << "calcSparge()"; - const QSignalBlocker blocker1(ui->sp_sourceEdit); + const QSignalBlocker blocker2(ui->w1_spButton); + const QSignalBlocker blocker3(ui->w2_spButton); + const QSignalBlocker blocker4(ui->wg_spButton); // Select watersource or fallback to the first source. if (product->sparge_source == 1) { // Source 2 if (product->w2_ph > 0.0 && product->w2_amount > 0) { Source_pH = product->w2_ph; Source_alkalinity = product->w2_total_alkalinity; + ui->sp_caEdit->setValue(product->w2_calcium); + ui->sp_mgEdit->setValue(product->w2_magnesium); + ui->sp_hco3Edit->setValue(Utils::Bicarbonate(product->w2_total_alkalinity, product->w2_ph)); + ui->sp_caco3Edit->setValue(product->w2_total_alkalinity); + ui->sp_naEdit->setValue(product->w2_sodium); + ui->sp_clEdit->setValue(product->w2_chloride); + ui->sp_so4Edit->setValue(product->w2_sulfate); + ui->sp_phShow->setValue(product->w2_ph); + ui->sp_hardnessEdit->setValue(Utils::Hardness(product->w2_calcium, product->w2_magnesium)); + ui->sp_raEdit->setValue(Utils::ResidualAlkalinity(product->w2_total_alkalinity, product->w2_calcium, product->w2_magnesium)); + ui->w2_spButton->setChecked(true); } else { - product->sparge_source = 0; // Source 1 - ui->sp_sourceEdit->setCurrentIndex(0); + product->sparge_source = 0; // Fallback to source 1 + ui->w1_spButton->setChecked(true); } } else if (product->sparge_source == 2) { // Mixed if (product->w2_ph > 0.0 && product->w2_amount > 0) { Source_pH = product->wg_ph; Source_alkalinity = product->wg_total_alkalinity; + ui->sp_caEdit->setValue(product->wg_calcium); + ui->sp_mgEdit->setValue(product->wg_magnesium); + ui->sp_hco3Edit->setValue(Utils::Bicarbonate(product->wg_total_alkalinity, product->wg_ph)); + ui->sp_caco3Edit->setValue(product->wg_total_alkalinity); + ui->sp_naEdit->setValue(product->wg_sodium); + ui->sp_clEdit->setValue(product->wg_chloride); + ui->sp_so4Edit->setValue(product->wg_sulfate); + ui->sp_phShow->setValue(product->wg_ph); + ui->sp_hardnessEdit->setValue(Utils::Hardness(product->wg_calcium, product->wg_magnesium)); + ui->sp_raEdit->setValue(Utils::ResidualAlkalinity(product->wg_total_alkalinity, product->wg_calcium, product->wg_magnesium)); + ui->wg_spButton->setChecked(true); } else { - product->sparge_source = 0; // Source 1 - ui->sp_sourceEdit->setCurrentIndex(0); + product->sparge_source = 0; // Fallback to source 1 + ui->w1_spButton->setChecked(true); } } + if (product->sparge_source == 0) { + ui->sp_caEdit->setValue(product->w1_calcium); + ui->sp_mgEdit->setValue(product->w1_magnesium); + ui->sp_hco3Edit->setValue(Utils::Bicarbonate(product->w1_total_alkalinity, product->w1_ph)); + ui->sp_caco3Edit->setValue(product->w1_total_alkalinity); + ui->sp_naEdit->setValue(product->w1_sodium); + ui->sp_clEdit->setValue(product->w1_chloride); + ui->sp_so4Edit->setValue(product->w1_sulfate); + ui->sp_phShow->setValue(product->w1_ph); + ui->sp_hardnessEdit->setValue(Utils::Hardness(product->w1_calcium, product->w1_magnesium)); + ui->sp_raEdit->setValue(Utils::ResidualAlkalinity(product->w1_total_alkalinity, product->w1_calcium, product->w1_magnesium)); + ui->w1_spButton->setChecked(true); + } + // The spargewater is set. + + int AT = product->sparge_acid_type; + if (AT < 0 || AT >= my_acids.size()) { + AT = 0; + product->sparge_acid_type = 0; + ui->sp_acidtypeEdit->setCurrentIndex(0); + product->sparge_acid_perc = my_acids[0].AcidPrc; + ui->sp_acidpercEdit->setValue(product->sparge_acid_perc); + } - // Step 1: Compute the mole fractions of carbonic (f1o), bicarbonate (f2o) and carbonate(f3o) at the water pH - double r1 = pow(10, Source_pH - 6.35); - double r2 = pow(10, Source_pH - 10.33); - double d = 1 + r1 + r1 * r2; - double f1 = 1 / d; - double f3 = r1 * r2 / d; + /* + * Auto calculate the required acid + */ + if (product->calc_acid) { + // Step 1: Compute the mole fractions of carbonic (f1o), bicarbonate (f2o) and carbonate(f3o) at the water pH + double r1 = pow(10, Source_pH - 6.35); + double r2 = pow(10, Source_pH - 10.33); + double d = 1 + r1 + r1 * r2; + double f1 = 1 / d; + double f3 = r1 * r2 / d; - // Step 2. Compute the mole fractions at pH = 4.3 (the pH which defines alkalinity) - double r143 = pow(10, 4.3 - 6.35); - double r243 = pow(10, 4.3 - 10.33); - double d43 = 1 + r143 + r143 * r243; - double f143 = 1 / d43; - double f343 = r143 * r243 / d43; + // Step 2. Compute the mole fractions at pH = 4.3 (the pH which defines alkalinity) + double r143 = pow(10, 4.3 - 6.35); + double r243 = pow(10, 4.3 - 10.33); + double d43 = 1 + r143 + r143 * r243; + double f143 = 1 / d43; + double f343 = r143 * r243 / d43; - // Step 4. Solve - //double Ct = (Source_alkalinity - 1000 * (pow(10, -4.3) - pow(10, -Source_pH))) / ((f143 - f1) + (f3 - f343)); - double Ct = Source_alkalinity / 50 / ((f143 - f1) + (f3 - f343)); + // Step 4. Solve + double Ct = Source_alkalinity / 50 / ((f143 - f1) + (f3 - f343)); - // Step 5. Compute mole fractions at desired pH - double r1g = pow(10, TargetpH - 6.35); - double r2g = pow(10, TargetpH - 10.33); - double dg = 1 + r1g + r1g * r2g; - double f1g = 1 / dg; - double f3g = r1g * r2g / dg; + // Step 5. Compute mole fractions at desired pH + double r1g = pow(10, TargetpH - 6.35); + double r2g = pow(10, TargetpH - 10.33); + double dg = 1 + r1g + r1g * r2g; + double f1g = 1 / dg; + double f3g = r1g * r2g / dg; - // Step 6. Use these to compute the milliequivalents acid required per liter (mEq/L) - double Acid = Ct * ((f1g - f1) + (f3 - f3g)) + pow(10, -TargetpH) - pow(10, -Source_pH); //mEq/l - Acid += 0.01; // Add acid that would be required for distilled water. + // Step 6. Use these to compute the milliequivalents acid required per liter (mEq/L) + double Acid = Ct * ((f1g - f1) + (f3 - f3g)) + pow(10, -TargetpH) - pow(10, -Source_pH); //mEq/l + Acid += 0.01; // Add acid that would be required for distilled water. + + // Step 7. There is no step 7. + + // Step 8. Get the acid data. + double fract = Utils::CalcFrac(TargetpH, my_acids[AT].pK1, my_acids[AT].pK2, my_acids[AT].pK3); + + // Step 9. Now divide the mEq required by the "fraction". This is the required number of moles of acid. + Acid /= fract; - //Step 8. Get the acid data. - int AT = product->sparge_acid_type; - if (AT < 0 || AT >= my_acids.size()) { - AT = 0; - product->sparge_acid_type = 0; - ui->sp_acidtypeEdit->setCurrentIndex(0); - product->sparge_acid_perc = my_acids[0].AcidPrc; - ui->sp_acidpercEdit->setValue(product->sparge_acid_perc); + // Step 10. Multiply by molecular weight of the acid + Acid *= my_acids[AT].MolWt; //mg + + // Step 11. Divide by Specific Gravity and Percentage to get the final ml. + double RealSG = round(((my_acids[AT].AcidSG - 1000) * (product->sparge_acid_perc / 100)) + 1000); + Acid = Acid / RealSG; //ml + Acid *= product->sparge_volume; //ml acid total at 100% + Acid /= my_acids[AT].AcidPrc / 100; //ml acid at supplied strength + Acid = round(Acid * 100.0) / 100.0; + product->sparge_acid_amount = Acid / 1000; + QString w = my_acids[AT].name_en + ' ' + my_acids[AT].name_nl; + brewing_salt_sub(w, Acid, MISC_USES_SPARGE); // Put it in the miscs table. + ui->sp_acidvolEdit->setValue(Acid); } - double fract = Utils::CalcFrac(TargetpH, my_acids[AT].pK1, my_acids[AT].pK2, my_acids[AT].pK3); - // Step 9. Now divide the mEq required by the "fraction". This is the required number of moles of acid. - Acid /= fract; - - // Step 10. Multiply by molecular weight of the acid - Acid *= my_acids[AT].MolWt; //mg - - // Step 11. Divide by Specific Gravity and Percentage to get the final ml. - Acid = Acid / my_acids[AT].AcidSG / (product->sparge_acid_perc / 100); //ml - Acid *= product->sparge_volume; //ml acid total - Acid = round(Acid * 100.0) / 100.0; - product->sparge_acid_amount = Acid / 1000; - ui->sp_acidvolEdit->setValue(Acid); - + ui->sp_phShow->setValue(product->sparge_ph); // Finally calculate the estimate preboil pH product->est_preboil_ph = -log10(((pow(10, -product->mash_ph) * product->wg_amount) + (pow(10, -product->sparge_ph) * product->brew_sparge_est)) / (product->wg_amount + product->brew_sparge_est)); @@ -502,11 +561,13 @@ } -void EditProduct::sp_source_changed(int val) +void EditProduct::sp_group_changed(int val) { - product->sparge_source = val; - calcSparge(); - is_changed(); + if (val != product->sparge_source) { + product->sparge_source = val; + calcSparge(); + is_changed(); + } } @@ -522,7 +583,6 @@ void EditProduct::sp_temp_changed(double val) { product->sparge_temp = val; - ui->brew_spargetempShow->setValue(val); calcSparge(); is_changed(); } @@ -530,9 +590,23 @@ void EditProduct::sp_type_changed(int val) { + if (val == product->sparge_acid_type) + return; + + qDebug() << "sp_type_changed" << val << "old" << product->sparge_acid_type; + /* + * First remove current acid. + */ + QString w = my_acids[product->sparge_acid_type].name_en + ' ' + my_acids[product->sparge_acid_type].name_nl; + brewing_salt_sub(w, 0, MISC_USES_SPARGE); + product->sparge_acid_type = val; + w = my_acids[product->sparge_acid_type].name_en + ' ' + my_acids[product->sparge_acid_type].name_nl; + product->sparge_acid_perc = my_acids[val].AcidPrc; ui->sp_acidpercEdit->setValue(product->sparge_acid_perc); + brewing_salt_sub(w, ui->sp_acidvolEdit->value(), MISC_USES_SPARGE); // For now, set old amount. + calcSparge(); is_changed(); } @@ -547,6 +621,116 @@ } +void EditProduct::sp_acid_changed(double val) +{ + if (product->calc_acid) + return; + + qDebug() << "sp_acid_changed" << val << product->sparge_acid_amount * 1000.0; + + double TargetpH = product->sparge_ph; + double Source_pH = product->w1_ph; + double Source_alkalinity = product->w1_total_alkalinity; + + if (product->sparge_source == 1) { // Source 2 + if (product->w2_ph > 0.0 && product->w2_amount > 0) { + Source_pH = product->w2_ph; + Source_alkalinity = product->w2_total_alkalinity; + } + } else if (product->sparge_source == 2) { // Mixed + if (product->w2_ph > 0.0 && product->w2_amount > 0) { + Source_pH = product->wg_ph; + Source_alkalinity = product->wg_total_alkalinity; + } + } + + int AT = product->sparge_acid_type; + if (AT < 0 || AT >= my_acids.size()) { + AT = 0; + product->sparge_acid_type = 0; + ui->sp_acidtypeEdit->setCurrentIndex(0); + product->sparge_acid_perc = my_acids[0].AcidPrc; + ui->sp_acidpercEdit->setValue(product->sparge_acid_perc); + } + + bool go_up = (val < (product->sparge_acid_amount * 1000.0)); + bool loop = true; + + while (loop) { + + if (go_up) + TargetpH += 0.001; + else + TargetpH -= 0.001; + //qDebug() << " TargetpH" << TargetpH << "up" << go_up; + + // Step 1: Compute the mole fractions of carbonic (f1o), bicarbonate (f2o) and carbonate(f3o) at the water pH + double r1 = pow(10, Source_pH - 6.35); + double r2 = pow(10, Source_pH - 10.33); + double d = 1 + r1 + r1 * r2; + double f1 = 1 / d; + double f3 = r1 * r2 / d; + + // Step 2. Compute the mole fractions at pH = 4.3 (the pH which defines alkalinity) + double r143 = pow(10, 4.3 - 6.35); + double r243 = pow(10, 4.3 - 10.33); + double d43 = 1 + r143 + r143 * r243; + double f143 = 1 / d43; + double f343 = r143 * r243 / d43; + + // Step 4. Solve + double Ct = Source_alkalinity / 50 / ((f143 - f1) + (f3 - f343)); + + // Step 5. Compute mole fractions at desired pH + double r1g = pow(10, TargetpH - 6.35); + double r2g = pow(10, TargetpH - 10.33); + double dg = 1 + r1g + r1g * r2g; + double f1g = 1 / dg; + double f3g = r1g * r2g / dg; + + // Step 6. Use these to compute the milliequivalents acid required per liter (mEq/L) + double Acid = Ct * ((f1g - f1) + (f3 - f3g)) + pow(10, -TargetpH) - pow(10, -Source_pH); //mEq/l + Acid += 0.01; // Add acid that would be required for distilled water. + + // Step 7. There is no step 7. + + // Step 8. Get the acid data. + double fract = Utils::CalcFrac(TargetpH, my_acids[AT].pK1, my_acids[AT].pK2, my_acids[AT].pK3); + + // Step 9. Now divide the mEq required by the "fraction". This is the required number of moles of acid. + Acid /= fract; + + // Step 10. Multiply by molecular weight of the acid + Acid *= my_acids[AT].MolWt; //mg + + // Step 11. Divide by Specific Gravity and Percentage to get the final ml. + double RealSG = round(((my_acids[AT].AcidSG - 1000) * (product->sparge_acid_perc / 100)) + 1000); + Acid = Acid / RealSG; //ml + Acid *= product->sparge_volume; //ml acid total at 100% + Acid /= my_acids[AT].AcidPrc / 100; //ml acid at supplied strength + Acid = round(Acid * 100.0) / 100.0; + product->sparge_acid_amount = Acid / 1000; + //qDebug() << " acid" << product->sparge_acid_amount; + + if (go_up && (val > (product->sparge_acid_amount * 1000.0))) + loop = false; + else if (! go_up && (val < (product->sparge_acid_amount * 1000.0))) + loop = false; + + //qDebug() << " test" << loop << go_up << val << product->sparge_acid_amount * 1000.0; + } + + const QSignalBlocker blocker1(ui->sp_phEdit); + product->sparge_ph = round(TargetpH * 100) / 100; + ui->sp_phEdit->setValue(product->sparge_ph); + ui->sp_phShow->setValue(product->sparge_ph); + + QString w = my_acids[AT].name_en + ' ' + my_acids[AT].name_nl; + set_brewing_salt(w, val, MISC_USES_SPARGE); + //qDebug() << " new" << product->sparge_ph << val; +} + + double EditProduct::GetBUGU() { double gu = (product->est_og - 1) * 1000; @@ -575,6 +759,10 @@ ui->mw_phEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); ui->mw_acidvolEdit->setReadOnly(product->calc_acid); ui->mw_acidvolEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); + ui->sp_phEdit->setReadOnly(! product->calc_acid); + ui->sp_phEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); + ui->sp_acidvolEdit->setReadOnly(product->calc_acid); + ui->sp_acidvolEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); is_changed(); calcWater(); } @@ -601,7 +789,7 @@ qDebug() << "on_mw_acid_changed" << val; QString w = my_acids[product->wa_acid_name].name_en + ' ' + my_acids[product->wa_acid_name].name_nl; - set_brewing_salt(w, val); + set_brewing_salt(w, val, MISC_USES_MASH); } @@ -615,14 +803,14 @@ * First remove current acid. */ QString w = my_acids[product->wa_acid_name].name_en + ' ' + my_acids[product->wa_acid_name].name_nl; - brewing_salt_sub(w, 0); + brewing_salt_sub(w, 0, MISC_USES_MASH); product->wa_acid_name = val; w = my_acids[product->wa_acid_name].name_en + ' ' + my_acids[product->wa_acid_name].name_nl; product->wa_acid_perc = my_acids.at(val).AcidPrc; ui->mw_acidpercEdit->setValue(my_acids.at(val).AcidPrc); - brewing_salt_sub(w, ui->mw_acidvolEdit->value()); // For now, set old amount. + brewing_salt_sub(w, ui->mw_acidvolEdit->value(), MISC_USES_MASH); // For now, set old amount. is_changed(); calcWater(); @@ -684,7 +872,16 @@ product->waters_ok = false; qDebug() << "w2_amount too low"; } + ui->w2_spButton->setEnabled(true); + ui->wg_spButton->setEnabled(true); } + } else { + /* + * Block selecting sparge water 2 and mixed water. + */ + ui->w2_spButton->setEnabled(false); + ui->wg_spButton->setEnabled(false); + product->sparge_source = 0; // Only water source 1 } } @@ -722,14 +919,14 @@ ui->w1_caEdit->setValue(product->w1_calcium); ui->w1_mgEdit->setValue(product->w1_magnesium); - ui->w1_hco3Edit->setValue(product->w1_total_alkalinity * 1.22); + ui->w1_hco3Edit->setValue(Utils::Bicarbonate(product->w1_total_alkalinity, product->w1_ph)); ui->w1_caco3Edit->setValue(product->w1_total_alkalinity); ui->w1_naEdit->setValue(product->w1_sodium); ui->w1_clEdit->setValue(product->w1_chloride); ui->w1_so4Edit->setValue(product->w1_sulfate); ui->w1_phEdit->setValue(product->w1_ph); ui->w1_hardnessEdit->setValue(Utils::Hardness(product->w1_calcium, product->w1_magnesium)); - ui->w1_raEdit->setValue(Utils::RA_ppm(product->w1_total_alkalinity, product->w1_calcium, product->w1_magnesium)); + ui->w1_raEdit->setValue(Utils::ResidualAlkalinity(product->w1_total_alkalinity, product->w1_calcium, product->w1_magnesium)); check_waters(); is_changed(); @@ -774,13 +971,13 @@ product->w2_sulfate = query.value(5).toDouble(); product->w2_ph = query.value(9).toDouble(); hardness = Utils::Hardness(product->w2_calcium, product->w2_magnesium); - ra_ppm = Utils::RA_ppm(product->w2_total_alkalinity, product->w2_calcium, product->w2_magnesium); + ra_ppm = Utils::ResidualAlkalinity(product->w2_total_alkalinity, product->w2_calcium, product->w2_magnesium); } ui->w1_volEdit->setValue(product->w1_amount); ui->w2_volEdit->setValue(product->w2_amount); ui->w2_caEdit->setValue(product->w2_calcium); ui->w2_mgEdit->setValue(product->w2_magnesium); - ui->w2_hco3Edit->setValue(product->w2_total_alkalinity * 1.22); + ui->w2_hco3Edit->setValue(Utils::Bicarbonate(product->w2_total_alkalinity, product->w2_ph)); ui->w2_caco3Edit->setValue(product->w2_total_alkalinity); ui->w2_naEdit->setValue(product->w2_sodium); ui->w2_clEdit->setValue(product->w2_chloride); @@ -825,7 +1022,7 @@ ui->wt_clEdit->setValue(query.value("chloride").toDouble()); ui->wt_so4Edit->setValue(query.value("sulfate").toDouble()); ui->wt_hardnessEdit->setValue(Utils::Hardness(query.value("calcium").toDouble(), query.value("magnesium").toDouble())); - ui->wt_raEdit->setValue(Utils::RA_ppm(query.value("total_alkalinity").toDouble(), query.value("calcium").toDouble(), query.value("magnesium").toDouble())); + ui->wt_raEdit->setValue(Utils::ResidualAlkalinity(query.value("total_alkalinity").toDouble(), query.value("calcium").toDouble(), query.value("magnesium").toDouble())); } calcWater(); } @@ -868,12 +1065,16 @@ } -void EditProduct::wb_cacl2_changed(double val) { set_brewing_salt("CaCl2", val); } -void EditProduct::wb_caso4_changed(double val) { set_brewing_salt("CaSO4", val); } -void EditProduct::wb_mgso4_changed(double val) { set_brewing_salt("MgSO4", val); } -void EditProduct::wb_nacl_changed(double val) { set_brewing_salt("NaCl", val); } -void EditProduct::wb_mgcl2_changed(double val) { set_brewing_salt("MgCl2", val); } -void EditProduct::wb_nahco3_changed(double val) { set_brewing_salt("NaHCO3", val); } -void EditProduct::wb_caco3_changed(double val) { set_brewing_salt("CaCO3", val); } +void EditProduct::wb_cacl2_changed(double val) { set_brewing_salt("CaCl2", val, MISC_USES_MASH); } +void EditProduct::wb_caso4_changed(double val) { set_brewing_salt("CaSO4", val, MISC_USES_MASH); } +void EditProduct::wb_mgso4_changed(double val) { set_brewing_salt("MgSO4", val, MISC_USES_MASH); } +void EditProduct::wb_nacl_changed(double val) { set_brewing_salt("NaCl", val, MISC_USES_MASH); } +void EditProduct::wb_mgcl2_changed(double val) { set_brewing_salt("MgCl2", val, MISC_USES_MASH); } +void EditProduct::wb_nahco3_changed(double val) { set_brewing_salt("NaHCO3", val, MISC_USES_MASH); } +void EditProduct::wb_caco3_changed(double val) { set_brewing_salt("CaCO3", val, MISC_USES_MASH); } +void EditProduct::sp_cacl2_changed(double val) { set_brewing_salt("CaCl2", val, MISC_USES_SPARGE); } +void EditProduct::sp_caso4_changed(double val) { set_brewing_salt("CaSO4", val, MISC_USES_SPARGE); } +void EditProduct::sp_mgso4_changed(double val) { set_brewing_salt("MgSO4", val, MISC_USES_SPARGE); } +void EditProduct::sp_nacl_changed(double val) { set_brewing_salt("NaCl", val, MISC_USES_SPARGE); } +void EditProduct::sp_mgcl2_changed(double val) { set_brewing_salt("MgCl2", val, MISC_USES_SPARGE); } - diff -r d89bc21e2f07 -r dfbb012c631c src/EditRecipe.cpp --- a/src/EditRecipe.cpp Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditRecipe.cpp Mon Jul 18 17:04:02 2022 +0200 @@ -56,10 +56,6 @@ ui->sp_acidtypeEdit->addItem(my_acids.at(i).name_en); } - ui->sp_sourceEdit->addItem(tr("Source 1")); - ui->sp_sourceEdit->addItem(tr("Source 2")); - ui->sp_sourceEdit->addItem(tr("Mixed")); - query.prepare("SELECT name FROM inventory_waters ORDER BY record"); query.exec(); query.first(); @@ -94,6 +90,10 @@ query.next(); } + ui->spargeGroup->setId(ui->w1_spButton, 0); + ui->spargeGroup->setId(ui->w2_spButton, 1); + ui->spargeGroup->setId(ui->wg_spButton, 2); + if (id >= 0) { if (! DB_recipe::load(recipe, this, id)) return; @@ -333,10 +333,12 @@ ui->mw_acidvolEdit->setReadOnly(recipe->calc_acid); ui->mw_acidvolEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); + ui->sp_phEdit->setReadOnly(! recipe->calc_acid); + ui->sp_phEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); + ui->sp_acidvolEdit->setReadOnly(recipe->calc_acid); + ui->sp_acidvolEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->sp_volEdit->setValue(recipe->sparge_volume); - ui->sp_tempEdit->setValue(recipe->sparge_temp); ui->sp_phEdit->setValue(recipe->sparge_ph); - ui->sp_sourceEdit->setCurrentIndex(recipe->sparge_source); ui->sp_acidtypeEdit->setCurrentIndex(recipe->sparge_acid_type); ui->sp_acidpercEdit->setValue(recipe->sparge_acid_perc); ui->sp_acidvolEdit->setValue(recipe->sparge_acid_amount); @@ -392,6 +394,11 @@ connect(ui->bs_mgcl2Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::wb_mgcl2_changed); connect(ui->bs_nahco3Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::wb_nahco3_changed); connect(ui->bs_caco3Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::wb_caco3_changed); + connect(ui->ss_cacl2Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_cacl2_changed); + connect(ui->ss_caso4Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_caso4_changed); + connect(ui->ss_mgso4Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_mgso4_changed); + connect(ui->ss_naclEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_nacl_changed); + connect(ui->ss_mgcl2Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_mgcl2_changed); connect(ui->mw_autoEdit, &QCheckBox::stateChanged, this, &EditRecipe::mw_calc_acid_clicked); connect(ui->mw_phEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::mw_ph_changed); connect(ui->mw_acidvolEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::mw_acid_changed); @@ -400,10 +407,10 @@ connect(ui->w1_nameEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditRecipe::w1_name_changed); connect(ui->w2_nameEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditRecipe::w2_name_changed); connect(ui->w2_volEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::w2_volume_changed); - connect(ui->sp_sourceEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditRecipe::sp_source_changed); + connect(ui->spargeGroup, SIGNAL(buttonClicked(int)), this, SLOT(sp_group_changed(int))); connect(ui->sp_acidtypeEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditRecipe::sp_type_changed); connect(ui->sp_phEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_ph_changed); - + connect(ui->sp_acidvolEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_acid_changed); setLocked(recipe->locked); ui->saveButton->setEnabled(false); diff -r d89bc21e2f07 -r dfbb012c631c src/EditRecipe.h --- a/src/EditRecipe.h Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditRecipe.h Mon Jul 18 17:04:02 2022 +0200 @@ -107,14 +107,20 @@ void wb_mgcl2_changed(double val); void wb_nahco3_changed(double val); void wb_caco3_changed(double val); + void sp_cacl2_changed(double val); + void sp_caso4_changed(double val); + void sp_mgso4_changed(double val); + void sp_nacl_changed(double val); + void sp_mgcl2_changed(double val); void mw_calc_acid_clicked(); void wt_target_changed(int val); void mw_ph_changed(double val); void mw_acid_changed(double val); void mw_type_changed(int val); - void sp_source_changed(int val); + void sp_group_changed(int val); void sp_type_changed(int val); void sp_ph_changed(double val); + void sp_acid_changed(double val); void step_name_changed(QString val); void step_type_changed(int val); void step_temp_changed(double val); @@ -158,8 +164,8 @@ static bool yeast_sort_test(const Yeasts &D1, const Yeasts &D2); void WindowTitle(); void setLocked(bool val); - void brewing_salt_sub(QString salt, double val); - void set_brewing_salt(QString salt, double val); + void brewing_salt_sub(QString salt, double val, int use); + void set_brewing_salt(QString salt, double val, int use); void calcFermentables(); void calcFermentablesFromOG(double og); void calcIBUs(); diff -r d89bc21e2f07 -r dfbb012c631c src/EditRecipeTab1.cpp --- a/src/EditRecipeTab1.cpp Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditRecipeTab1.cpp Mon Jul 18 17:04:02 2022 +0200 @@ -222,7 +222,6 @@ ui->mash_pickEdit->setDisabled(val); /* Tab 7, water */ - ui->sp_sourceEdit->setDisabled(val); ui->wt_sourceEdit->setDisabled(val); ui->w1_nameEdit->setDisabled(val); ui->w2_nameEdit->setDisabled(val); @@ -230,10 +229,6 @@ ui->sp_acidtypeEdit->setDisabled(val); ui->w2_volEdit->setReadOnly(val); ui->w2_volEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); - ui->sp_phEdit->setReadOnly(val); - ui->sp_phEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); - ui->sp_tempEdit->setReadOnly(val); - ui->sp_tempEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->sp_volEdit->setReadOnly(val); ui->sp_volEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); ui->bs_cacl2Edit->setReadOnly(val); @@ -255,11 +250,22 @@ ui->mw_phEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); ui->mw_acidvolEdit->setReadOnly(true); ui->mw_acidvolEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); + ui->sp_phEdit->setReadOnly(true); + ui->sp_phEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); + ui->sp_acidvolEdit->setReadOnly(true); + ui->sp_acidvolEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); + ui->w1_spButton->setDisabled(true); + ui->w2_spButton->setDisabled(true); + ui->wg_spButton->setDisabled(true); } else { ui->mw_phEdit->setReadOnly(! recipe->calc_acid); ui->mw_phEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); ui->mw_acidvolEdit->setReadOnly(recipe->calc_acid); ui->mw_acidvolEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); + ui->sp_phEdit->setReadOnly(! recipe->calc_acid); + ui->sp_phEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); + ui->sp_acidvolEdit->setReadOnly(recipe->calc_acid); + ui->sp_acidvolEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); } ui->mw_autoEdit->setDisabled(val); } diff -r d89bc21e2f07 -r dfbb012c631c src/EditRecipeTab4.cpp --- a/src/EditRecipeTab4.cpp Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditRecipeTab4.cpp Mon Jul 18 17:04:02 2022 +0200 @@ -51,6 +51,13 @@ const QSignalBlocker blocker7(ui->bs_caco3Edit); const QSignalBlocker blocker8(ui->mw_acidPick); const QSignalBlocker blocker9(ui->mw_acidvolEdit); + const QSignalBlocker blocker10(ui->ss_cacl2Edit); + const QSignalBlocker blocker11(ui->ss_caso4Edit); + const QSignalBlocker blocker12(ui->ss_mgso4Edit); + const QSignalBlocker blocker13(ui->ss_naclEdit); + const QSignalBlocker blocker14(ui->ss_mgcl2Edit); + const QSignalBlocker blocker15(ui->sp_acidtypeEdit); + const QSignalBlocker blocker16(ui->sp_acidvolEdit); const QStringList labels({tr("Ingredient"), tr("Type"), tr("Use at"), tr("Time"), tr("Amount"), tr("Delete"), tr("Edit") }); @@ -141,7 +148,7 @@ /* * Update the water agents. */ - if (recipe->miscs.at(i).type == MISC_TYPES_WATER_AGENT) { + if (recipe->miscs.at(i).type == MISC_TYPES_WATER_AGENT && recipe->miscs.at(i).use_use == MISC_USES_MASH) { if (recipe->miscs.at(i).name == "CaCl2") { ui->bs_cacl2Edit->setValue(recipe->miscs.at(i).amount * 1000.0); } else if (recipe->miscs.at(i).name == "CaSO4") { @@ -181,6 +188,42 @@ ui->mw_acidpercEdit->setValue(my_acids.at(3).AcidPrc); ui->mw_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); } + } else if (recipe->miscs.at(i).type == MISC_TYPES_WATER_AGENT && recipe->miscs.at(i).use_use == MISC_USES_SPARGE) { + if (recipe->miscs.at(i).name == "CaCl2") { + ui->ss_cacl2Edit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "CaSO4") { + ui->ss_caso4Edit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "MgSO4") { + ui->ss_mgso4Edit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "NaCl") { + ui->ss_naclEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "MgCl2") { + ui->ss_mgcl2Edit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "Melkzuur" || recipe->miscs.at(i).name == "Lactic") { + recipe->sparge_acid_type = 0; + recipe->sparge_acid_perc = my_acids.at(0).AcidPrc; + ui->sp_acidtypeEdit->setCurrentIndex(0); + ui->sp_acidpercEdit->setValue(my_acids.at(0).AcidPrc); + ui->sp_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "Zoutzuur" || recipe->miscs.at(i).name == "Hydrochloric") { + recipe->sparge_acid_type = 1; + recipe->sparge_acid_perc = my_acids.at(1).AcidPrc; + ui->sp_acidtypeEdit->setCurrentIndex(1); + ui->sp_acidpercEdit->setValue(my_acids.at(1).AcidPrc); + ui->sp_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "Fosforzuur" || recipe->miscs.at(i).name == "Phosphoric") { + recipe->sparge_acid_type = 2; + recipe->sparge_acid_perc = my_acids.at(2).AcidPrc; + ui->sp_acidtypeEdit->setCurrentIndex(2); + ui->sp_acidpercEdit->setValue(my_acids.at(2).AcidPrc); + ui->sp_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "Zwavelzuur" || recipe->miscs.at(i).name == "Sulfuric") { + recipe->sparge_acid_type = 3; + recipe->sparge_acid_perc = my_acids.at(3).AcidPrc; + ui->sp_acidtypeEdit->setCurrentIndex(3); + ui->sp_acidpercEdit->setValue(my_acids.at(3).AcidPrc); + ui->sp_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } } } } @@ -189,7 +232,7 @@ /* * Manipulate the memory array and update the miscs table. */ -void EditRecipe::brewing_salt_sub(QString salt, double val) +void EditRecipe::brewing_salt_sub(QString salt, double val, int use) { QTableWidgetItem *item; @@ -199,8 +242,8 @@ * Remove this salt if it is in the table. */ for (int i = 0; i < recipe->miscs.size(); i++) { - if (salt.contains(recipe->miscs.at(i).name)) { - qDebug() << " brewing_salt_sub delete" << salt; + if (salt.contains(recipe->miscs.at(i).name) && recipe->miscs.at(i).use_use == use) { + qDebug() << " brewing_salt_sub delete" << salt << use; recipe->miscs.removeAt(i); refreshMiscs(); return; @@ -214,7 +257,7 @@ * If it is, update the amount. */ for (int i = 0; i < recipe->miscs.size(); i++) { - if (salt.contains(recipe->miscs.at(i).name)) { + if (salt.contains(recipe->miscs.at(i).name) && recipe->miscs.at(i).use_use == use) { recipe->miscs[i].amount = val / 1000.0; if (recipe->miscs.at(i).amount_is_weight) item = new QTableWidgetItem(QString("%1 gr").arg(val, 3, 'f', 2, '0')); @@ -240,7 +283,7 @@ m.name = query.value(1).toString(); m.amount = val / 1000.0; m.type = query.value(2).toInt(); - m.use_use = query.value(3).toInt(); + m.use_use = use; m.time = query.value(4).toDouble(); m.amount_is_weight = query.value(5).toInt() ? true:false; m.cost = query.value(10).toDouble(); @@ -250,18 +293,18 @@ } } - qDebug() << "brewing_salt_sub, nothing done." << salt << val; + qDebug() << "brewing_salt_sub, nothing done." << salt << val << use; } /* * Edit brewing salt and recalculate. */ -void EditRecipe::set_brewing_salt(QString salt, double val) +void EditRecipe::set_brewing_salt(QString salt, double val, int use) { val = round(val * 100.0) / 100.0; - qDebug() << "set_brewing_salt" << salt << val; - brewing_salt_sub(salt, val); + qDebug() << "set_brewing_salt" << salt << val << use; + brewing_salt_sub(salt, val, use); calcWater(); is_changed(); } @@ -612,6 +655,7 @@ useatEdit->addItem(tr("Primary")); useatEdit->addItem(tr("Secondary")); useatEdit->addItem(tr("Bottling")); + useatEdit->addItem(tr("Sparge")); useatEdit->setCurrentIndex(recipe->miscs.at(recipe->miscs_row).use_use); minstockEdit = new QCheckBox(dialog); @@ -672,6 +716,11 @@ const QSignalBlocker blocker6(ui->bs_nahco3Edit); const QSignalBlocker blocker7(ui->bs_caco3Edit); const QSignalBlocker blocker9(ui->mw_acidvolEdit); + const QSignalBlocker blocker10(ui->ss_cacl2Edit); + const QSignalBlocker blocker11(ui->ss_caso4Edit); + const QSignalBlocker blocker12(ui->ss_mgso4Edit); + const QSignalBlocker blocker13(ui->ss_naclEdit); + const QSignalBlocker blocker14(ui->ss_mgcl2Edit); for (int i = 0; i < recipe->miscs.size(); i++) { amount = recipe->miscs.at(i).amount * factor; @@ -680,7 +729,7 @@ /* * Update the water agents. */ - if (recipe->miscs.at(i).type == MISC_TYPES_WATER_AGENT) { + if (recipe->miscs.at(i).type == MISC_TYPES_WATER_AGENT && recipe->miscs.at(i).use_use == MISC_USES_MASH) { if (recipe->miscs.at(i).name == "CaCl2") { ui->bs_cacl2Edit->setValue(recipe->miscs.at(i).amount * 1000.0); } else if (recipe->miscs.at(i).name == "CaSO4") { @@ -704,6 +753,26 @@ } else if (recipe->miscs.at(i).name == "Zwavelzuur" || recipe->miscs.at(i).name == "Sulfuric") { ui->mw_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); } + } else if (recipe->miscs.at(i).type == MISC_TYPES_WATER_AGENT && recipe->miscs.at(i).use_use == MISC_USES_SPARGE) { + if (recipe->miscs.at(i).name == "CaCl2") { + ui->ss_cacl2Edit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "CaSO4") { + ui->ss_caso4Edit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "MgSO4") { + ui->ss_mgso4Edit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "NaCl") { + ui->ss_naclEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "MgCl2") { + ui->ss_mgcl2Edit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "Melkzuur" || recipe->miscs.at(i).name == "Lactic") { + ui->sp_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "Zoutzuur" || recipe->miscs.at(i).name == "Hydrochloric") { + ui->sp_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "Fosforzuur" || recipe->miscs.at(i).name == "Phosphoric") { + ui->sp_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } else if (recipe->miscs.at(i).name == "Zwavelzuur" || recipe->miscs.at(i).name == "Sulfuric") { + ui->sp_acidvolEdit->setValue(recipe->miscs.at(i).amount * 1000.0); + } } } } diff -r d89bc21e2f07 -r dfbb012c631c src/EditRecipeTab7.cpp --- a/src/EditRecipeTab7.cpp Sun Jul 17 22:18:48 2022 +0200 +++ b/src/EditRecipeTab7.cpp Mon Jul 18 17:04:02 2022 +0200 @@ -265,10 +265,17 @@ Acidmg = Acid; Acid = Acid / my_acids[AT].AcidSG; Acid = round((Acid / (recipe->wa_acid_perc / 100.0)) * 100.0) / 100.0; + qDebug() << " Mash auto Acid final old ml:" << Acid; + Acid = Acidmg; + + double RealSG = round(((my_acids[AT].AcidSG - 1000) * (recipe->wa_acid_perc / 100)) + 1000); + Acid /= RealSG; + Acid /= my_acids[AT].AcidPrc / 100; + Acid = round(Acid * 100.0) / 100.0; qDebug() << " Mash auto Acid final ml:" << Acid; QString w = my_acids[AT].name_en + ' ' + my_acids[AT].name_nl; - brewing_salt_sub(w, Acid); + brewing_salt_sub(w, Acid, MISC_USES_MASH); ui->mw_acidvolEdit->setValue(Acid); bicarbonate = bicarbonate - protonDeficit * frac / liters; @@ -282,10 +289,12 @@ * Manual adjust acid, calculate resulting pH. */ double pHa = ph; // Mixed water pH. + double RealSG = round(((my_acids[AT].AcidSG - 1000) * (recipe->wa_acid_perc / 100)) + 1000); // Then calculate the new pH with added acids and malts qDebug() << " Mash pH:" << pHa; - Acid = my_acids[AT].AcidSG * (recipe->wa_acid_perc / 100.0); // ml + Acid = RealSG; Acid *= ui->mw_acidvolEdit->value(); + Acid *= my_acids[AT].AcidPrc / 100; Acid /= my_acids[AT].MolWt; // mg; Acidmg = Acid; @@ -420,80 +429,128 @@ qDebug() << "calcSparge()"; - const QSignalBlocker blocker1(ui->sp_sourceEdit); + const QSignalBlocker blocker2(ui->w1_spButton); + const QSignalBlocker blocker3(ui->w2_spButton); + const QSignalBlocker blocker4(ui->wg_spButton); // Select watersource or fallback to the first source. if (recipe->sparge_source == 1) { // Source 2 if (recipe->w2_ph > 0.0 && recipe->w2_amount > 0) { Source_pH = recipe->w2_ph; Source_alkalinity = recipe->w2_total_alkalinity; + ui->sp_caEdit->setValue(recipe->w2_calcium); + ui->sp_mgEdit->setValue(recipe->w2_magnesium); + ui->sp_hco3Edit->setValue(Utils::Bicarbonate(recipe->w2_total_alkalinity, recipe->w2_ph)); + ui->sp_caco3Edit->setValue(recipe->w2_total_alkalinity); + ui->sp_naEdit->setValue(recipe->w2_sodium); + ui->sp_clEdit->setValue(recipe->w2_chloride); + ui->sp_so4Edit->setValue(recipe->w2_sulfate); + ui->sp_phShow->setValue(recipe->w2_ph); + ui->sp_hardnessEdit->setValue(Utils::Hardness(recipe->w2_calcium, recipe->w2_magnesium)); + ui->sp_raEdit->setValue(Utils::ResidualAlkalinity(recipe->w2_total_alkalinity, recipe->w2_calcium, recipe->w2_magnesium)); + ui->w2_spButton->setChecked(true); } else { - recipe->sparge_source = 0; // Source 1 - ui->sp_sourceEdit->setCurrentIndex(0); + recipe->sparge_source = 0; // Fallback to source 1 + ui->w1_spButton->setChecked(true); } } else if (recipe->sparge_source == 2) { // Mixed if (recipe->w2_ph > 0.0 && recipe->w2_amount > 0) { Source_pH = recipe->wg_ph; Source_alkalinity = recipe->wg_total_alkalinity; + ui->sp_caEdit->setValue(recipe->wg_calcium); + ui->sp_mgEdit->setValue(recipe->wg_magnesium); + ui->sp_hco3Edit->setValue(Utils::Bicarbonate(recipe->wg_total_alkalinity, recipe->wg_ph)); + ui->sp_caco3Edit->setValue(recipe->wg_total_alkalinity); + ui->sp_naEdit->setValue(recipe->wg_sodium); + ui->sp_clEdit->setValue(recipe->wg_chloride); + ui->sp_so4Edit->setValue(recipe->wg_sulfate); + ui->sp_phShow->setValue(recipe->wg_ph); + ui->sp_hardnessEdit->setValue(Utils::Hardness(recipe->wg_calcium, recipe->wg_magnesium)); + ui->sp_raEdit->setValue(Utils::ResidualAlkalinity(recipe->wg_total_alkalinity, recipe->wg_calcium, recipe->wg_magnesium)); + ui->wg_spButton->setChecked(true); } else { - recipe->sparge_source = 0; // Source 1 - ui->sp_sourceEdit->setCurrentIndex(0); + recipe->sparge_source = 0; // Fallback to source 1 + ui->w1_spButton->setChecked(true); } } + if (recipe->sparge_source == 0) { + ui->sp_caEdit->setValue(recipe->w1_calcium); + ui->sp_mgEdit->setValue(recipe->w1_magnesium); + ui->sp_hco3Edit->setValue(Utils::Bicarbonate(recipe->w1_total_alkalinity, recipe->w1_ph)); + ui->sp_caco3Edit->setValue(recipe->w1_total_alkalinity); + ui->sp_naEdit->setValue(recipe->w1_sodium); + ui->sp_clEdit->setValue(recipe->w1_chloride); + ui->sp_so4Edit->setValue(recipe->w1_sulfate); + ui->sp_phShow->setValue(recipe->w1_ph); + ui->sp_hardnessEdit->setValue(Utils::Hardness(recipe->w1_calcium, recipe->w1_magnesium)); + ui->sp_raEdit->setValue(Utils::ResidualAlkalinity(recipe->w1_total_alkalinity, recipe->w1_calcium, recipe->w1_magnesium)); + ui->w1_spButton->setChecked(true); + } + // The spargewater is set. + + int AT = recipe->sparge_acid_type; + if (AT < 0 || AT >= my_acids.size()) { + AT = 0; + recipe->sparge_acid_type = 0; + ui->sp_acidtypeEdit->setCurrentIndex(0); + recipe->sparge_acid_perc = my_acids[0].AcidPrc; + ui->sp_acidpercEdit->setValue(recipe->sparge_acid_perc); + } - // Step 1: Compute the mole fractions of carbonic (f1o), bicarbonate (f2o) and carbonate(f3o) at the water pH - double r1 = pow(10, Source_pH - 6.35); - double r2 = pow(10, Source_pH - 10.33); - double d = 1 + r1 + r1 * r2; - double f1 = 1 / d; - double f3 = r1 * r2 / d; + /* + * Auto calculate the required acid + */ + if (recipe->calc_acid) { + // Step 1: Compute the mole fractions of carbonic (f1o), bicarbonate (f2o) and carbonate(f3o) at the water pH + double r1 = pow(10, Source_pH - 6.35); + double r2 = pow(10, Source_pH - 10.33); + double d = 1 + r1 + r1 * r2; + double f1 = 1 / d; + double f3 = r1 * r2 / d; - // Step 2. Compute the mole fractions at pH = 4.3 (the pH which defines alkalinity) - double r143 = pow(10, 4.3 - 6.35); - double r243 = pow(10, 4.3 - 10.33); - double d43 = 1 + r143 + r143 * r243; - double f143 = 1 / d43; - double f343 = r143 * r243 / d43; + // Step 2. Compute the mole fractions at pH = 4.3 (the pH which defines alkalinity) + double r143 = pow(10, 4.3 - 6.35); + double r243 = pow(10, 4.3 - 10.33); + double d43 = 1 + r143 + r143 * r243; + double f143 = 1 / d43; + double f343 = r143 * r243 / d43; - // Step 4. Solve - //double Ct = (Source_alkalinity - 1000 * (pow(10, -4.3) - pow(10, -Source_pH))) / ((f143 - f1) + (f3 - f343)); - double Ct = Source_alkalinity / 50 / ((f143 - f1) + (f3 - f343)); - - // Step 5. Compute mole fractions at desired pH - double r1g = pow(10, TargetpH - 6.35); - double r2g = pow(10, TargetpH - 10.33); - double dg = 1 + r1g + r1g * r2g; - double f1g = 1 / dg; - double f3g = r1g * r2g / dg; + // Step 4. Solve + double Ct = Source_alkalinity / 50 / ((f143 - f1) + (f3 - f343)); - // Step 6. Use these to compute the milliequivalents acid required per liter (mEq/L) - double Acid = Ct * ((f1g - f1) + (f3 - f3g)) + pow(10, -TargetpH) - pow(10, -Source_pH); //mEq/l - Acid += 0.01; // Add acid that would be required for distilled water. + // Step 5. Compute mole fractions at desired pH + double r1g = pow(10, TargetpH - 6.35); + double r2g = pow(10, TargetpH - 10.33); + double dg = 1 + r1g + r1g * r2g; + double f1g = 1 / dg; + double f3g = r1g * r2g / dg; + + // Step 6. Use these to compute the milliequivalents acid required per liter (mEq/L) + double Acid = Ct * ((f1g - f1) + (f3 - f3g)) + pow(10, -TargetpH) - pow(10, -Source_pH); //mEq/l + Acid += 0.01; // Add acid that would be required for distilled water. + + // Step 8. Get the acid data. + double fract = Utils::CalcFrac(TargetpH, my_acids[AT].pK1, my_acids[AT].pK2, my_acids[AT].pK3); - //Step 8. Get the acid data. - int AT = recipe->sparge_acid_type; - if (AT < 0 || AT >= my_acids.size()) { - AT = 0; - recipe->sparge_acid_type = 0; - ui->sp_acidtypeEdit->setCurrentIndex(0); - recipe->sparge_acid_perc = my_acids[0].AcidPrc; - ui->sp_acidpercEdit->setValue(recipe->sparge_acid_perc); + // Step 9. Now divide the mEq required by the "fraction". This is the required number of moles of acid. + Acid /= fract; + + // Step 10. Multiply by molecular weight of the acid + Acid *= my_acids[AT].MolWt; //mg + + // Step 11. Divide by Specific Gravity and Percentage to get the final ml. + double RealSG = round(((my_acids[AT].AcidSG - 1000) * (recipe->sparge_acid_perc / 100)) + 1000); + Acid = Acid / RealSG; //ml + Acid *= recipe->sparge_volume; //ml acid total at 100% + Acid /= my_acids[AT].AcidPrc / 100; //ml acid at supplied strength + Acid = round(Acid * 100.0) / 100.0; + recipe->sparge_acid_amount = Acid / 1000; + QString w = my_acids[AT].name_en + ' ' + my_acids[AT].name_nl; + brewing_salt_sub(w, Acid, MISC_USES_SPARGE); // Put it in the miscs table. + ui->sp_acidvolEdit->setValue(Acid); } - double fract = Utils::CalcFrac(TargetpH, my_acids[AT].pK1, my_acids[AT].pK2, my_acids[AT].pK3); - // Step 9. Now divide the mEq required by the "fraction". This is the required number of moles of acid. - Acid /= fract; - - // Step 10. Multiply by molecular weight of the acid - Acid *= my_acids[AT].MolWt; //mg - - // Step 11. Divide by Specific Gravity and Percentage to get the final ml. - Acid = Acid / my_acids[AT].AcidSG / (recipe->sparge_acid_perc / 100); //ml - Acid *= recipe->sparge_volume; //ml acid total - Acid = round(Acid * 100.0) / 100.0; - recipe->sparge_acid_amount = Acid / 1000; - ui->sp_acidvolEdit->setValue(Acid); - + ui->sp_phShow->setValue(recipe->sparge_ph); // Finally calculate the estimate preboil pH recipe->preboil_ph = -log10(((pow(10, -recipe->mash_ph) * recipe->wg_amount) + (pow(10, -recipe->sparge_ph) * recipe->sparge_volume)) / (recipe->wg_amount + recipe->sparge_volume)); @@ -501,19 +558,36 @@ } -void EditRecipe::sp_source_changed(int val) +void EditRecipe::sp_group_changed(int val) { - recipe->sparge_source = val; - calcSparge(); - is_changed(); + if (val != recipe->sparge_source) { + qDebug() << "sp_group_changed" << val; + recipe->sparge_source = val; + calcSparge(); + is_changed(); + } } void EditRecipe::sp_type_changed(int val) { + if (val == recipe->sparge_acid_type) + return; + + qDebug() << "sp_type_changed" << val << "old" << recipe->sparge_acid_type; + /* + * First remove current acid. + */ + QString w = my_acids[recipe->sparge_acid_type].name_en + ' ' + my_acids[recipe->sparge_acid_type].name_nl; + brewing_salt_sub(w, 0, MISC_USES_SPARGE); + recipe->sparge_acid_type = val; + w = my_acids[recipe->sparge_acid_type].name_en + ' ' + my_acids[recipe->sparge_acid_type].name_nl; + recipe->sparge_acid_perc = my_acids[val].AcidPrc; ui->sp_acidpercEdit->setValue(recipe->sparge_acid_perc); + brewing_salt_sub(w, ui->sp_acidvolEdit->value(), MISC_USES_SPARGE); // For now, set old amount. + calcSparge(); is_changed(); } @@ -527,6 +601,116 @@ } +void EditRecipe::sp_acid_changed(double val) +{ + if (recipe->calc_acid) + return; + + qDebug() << "sp_acid_changed" << val << recipe->sparge_acid_amount * 1000.0; + + double TargetpH = recipe->sparge_ph; + double Source_pH = recipe->w1_ph; + double Source_alkalinity = recipe->w1_total_alkalinity; + + if (recipe->sparge_source == 1) { // Source 2 + if (recipe->w2_ph > 0.0 && recipe->w2_amount > 0) { + Source_pH = recipe->w2_ph; + Source_alkalinity = recipe->w2_total_alkalinity; + } + } else if (recipe->sparge_source == 2) { // Mixed + if (recipe->w2_ph > 0.0 && recipe->w2_amount > 0) { + Source_pH = recipe->wg_ph; + Source_alkalinity = recipe->wg_total_alkalinity; + } + } + + int AT = recipe->sparge_acid_type; + if (AT < 0 || AT >= my_acids.size()) { + AT = 0; + recipe->sparge_acid_type = 0; + ui->sp_acidtypeEdit->setCurrentIndex(0); + recipe->sparge_acid_perc = my_acids[0].AcidPrc; + ui->sp_acidpercEdit->setValue(recipe->sparge_acid_perc); + } + + bool go_up = (val < (recipe->sparge_acid_amount * 1000.0)); + bool loop = true; + + while (loop) { + + if (go_up) + TargetpH += 0.001; + else + TargetpH -= 0.001; + //qDebug() << " TargetpH" << TargetpH << "up" << go_up; + + // Step 1: Compute the mole fractions of carbonic (f1o), bicarbonate (f2o) and carbonate(f3o) at the water pH + double r1 = pow(10, Source_pH - 6.35); + double r2 = pow(10, Source_pH - 10.33); + double d = 1 + r1 + r1 * r2; + double f1 = 1 / d; + double f3 = r1 * r2 / d; + + // Step 2. Compute the mole fractions at pH = 4.3 (the pH which defines alkalinity) + double r143 = pow(10, 4.3 - 6.35); + double r243 = pow(10, 4.3 - 10.33); + double d43 = 1 + r143 + r143 * r243; + double f143 = 1 / d43; + double f343 = r143 * r243 / d43; + + // Step 4. Solve + double Ct = Source_alkalinity / 50 / ((f143 - f1) + (f3 - f343)); + + // Step 5. Compute mole fractions at desired pH + double r1g = pow(10, TargetpH - 6.35); + double r2g = pow(10, TargetpH - 10.33); + double dg = 1 + r1g + r1g * r2g; + double f1g = 1 / dg; + double f3g = r1g * r2g / dg; + + // Step 6. Use these to compute the milliequivalents acid required per liter (mEq/L) + double Acid = Ct * ((f1g - f1) + (f3 - f3g)) + pow(10, -TargetpH) - pow(10, -Source_pH); //mEq/l + Acid += 0.01; // Add acid that would be required for distilled water. + + // Step 7. There is no step 7. + + // Step 8. Get the acid data. + double fract = Utils::CalcFrac(TargetpH, my_acids[AT].pK1, my_acids[AT].pK2, my_acids[AT].pK3); + + // Step 9. Now divide the mEq required by the "fraction". This is the required number of moles of acid. + Acid /= fract; + + // Step 10. Multiply by molecular weight of the acid + Acid *= my_acids[AT].MolWt; //mg + + // Step 11. Divide by Specific Gravity and Percentage to get the final ml. + double RealSG = round(((my_acids[AT].AcidSG - 1000) * (recipe->sparge_acid_perc / 100)) + 1000); + Acid = Acid / RealSG; //ml + Acid *= recipe->sparge_volume; //ml acid total at 100% + Acid /= my_acids[AT].AcidPrc / 100; //ml acid at supplied strength + Acid = round(Acid * 100.0) / 100.0; + recipe->sparge_acid_amount = Acid / 1000; + //qDebug() << " acid" << recipe->sparge_acid_amount; + + if (go_up && (val > (recipe->sparge_acid_amount * 1000.0))) + loop = false; + else if (! go_up && (val < (recipe->sparge_acid_amount * 1000.0))) + loop = false; + + //qDebug() << " test" << loop << go_up << val << recipe->sparge_acid_amount * 1000.0; + } + + const QSignalBlocker blocker1(ui->sp_phEdit); + recipe->sparge_ph = round(TargetpH * 100) / 100; + ui->sp_phEdit->setValue(recipe->sparge_ph); + ui->sp_phShow->setValue(recipe->sparge_ph); + + QString w = my_acids[AT].name_en + ' ' + my_acids[AT].name_nl; + set_brewing_salt(w, val, MISC_USES_SPARGE); + //qDebug() << " new" << recipe->sparge_ph << val; +} + + double EditRecipe::GetBUGU() { double gu = (recipe->est_og - 1) * 1000; @@ -555,6 +739,10 @@ ui->mw_phEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); ui->mw_acidvolEdit->setReadOnly(recipe->calc_acid); ui->mw_acidvolEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); + ui->sp_phEdit->setReadOnly(! recipe->calc_acid); + ui->sp_phEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); + ui->sp_acidvolEdit->setReadOnly(recipe->calc_acid); + ui->sp_acidvolEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); is_changed(); calcWater(); } @@ -581,7 +769,7 @@ qDebug() << "on_mw_acid_changed" << val; QString w = my_acids[recipe->wa_acid_name].name_en + ' ' + my_acids[recipe->wa_acid_name].name_nl; - set_brewing_salt(w, val); + set_brewing_salt(w, val, MISC_USES_MASH); } @@ -595,14 +783,14 @@ * First remove current acid. */ QString w = my_acids[recipe->wa_acid_name].name_en + ' ' + my_acids[recipe->wa_acid_name].name_nl; - brewing_salt_sub(w, 0); + brewing_salt_sub(w, 0, MISC_USES_MASH); recipe->wa_acid_name = val; w = my_acids[recipe->wa_acid_name].name_en + ' ' + my_acids[recipe->wa_acid_name].name_nl; recipe->wa_acid_perc = my_acids.at(val).AcidPrc; ui->mw_acidpercEdit->setValue(my_acids.at(val).AcidPrc); - brewing_salt_sub(w, ui->mw_acidvolEdit->value()); // For now, set old amount. + brewing_salt_sub(w, ui->mw_acidvolEdit->value(), MISC_USES_MASH); // For now, set old amount. is_changed(); calcWater(); @@ -812,12 +1000,17 @@ } -void EditRecipe::wb_cacl2_changed(double val) { set_brewing_salt("CaCl2", val); } -void EditRecipe::wb_caso4_changed(double val) { set_brewing_salt("CaSO4", val); } -void EditRecipe::wb_mgso4_changed(double val) { set_brewing_salt("MgSO4", val); } -void EditRecipe::wb_nacl_changed(double val) { set_brewing_salt("NaCl", val); } -void EditRecipe::wb_mgcl2_changed(double val) { set_brewing_salt("MgCl2", val); } -void EditRecipe::wb_nahco3_changed(double val) { set_brewing_salt("NaHCO3", val); } -void EditRecipe::wb_caco3_changed(double val) { set_brewing_salt("CaCO3", val); } +void EditRecipe::wb_cacl2_changed(double val) { set_brewing_salt("CaCl2", val, MISC_USES_MASH); } +void EditRecipe::wb_caso4_changed(double val) { set_brewing_salt("CaSO4", val, MISC_USES_MASH); } +void EditRecipe::wb_mgso4_changed(double val) { set_brewing_salt("MgSO4", val, MISC_USES_MASH); } +void EditRecipe::wb_nacl_changed(double val) { set_brewing_salt("NaCl", val, MISC_USES_MASH); } +void EditRecipe::wb_mgcl2_changed(double val) { set_brewing_salt("MgCl2", val, MISC_USES_MASH); } +void EditRecipe::wb_nahco3_changed(double val) { set_brewing_salt("NaHCO3", val, MISC_USES_MASH); } +void EditRecipe::wb_caco3_changed(double val) { set_brewing_salt("CaCO3", val, MISC_USES_MASH); } +void EditRecipe::sp_cacl2_changed(double val) { set_brewing_salt("CaCl2", val, MISC_USES_SPARGE); } +void EditRecipe::sp_caso4_changed(double val) { set_brewing_salt("CaSO4", val, MISC_USES_SPARGE); } +void EditRecipe::sp_mgso4_changed(double val) { set_brewing_salt("MgSO4", val, MISC_USES_SPARGE); } +void EditRecipe::sp_nacl_changed(double val) { set_brewing_salt("NaCl", val, MISC_USES_SPARGE); } +void EditRecipe::sp_mgcl2_changed(double val) { set_brewing_salt("MgCl2", val, MISC_USES_SPARGE); } diff -r d89bc21e2f07 -r dfbb012c631c ui/EditProduct.ui --- a/ui/EditProduct.ui Sun Jul 17 22:18:48 2022 +0200 +++ b/ui/EditProduct.ui Mon Jul 18 17:04:02 2022 +0200 @@ -95,7 +95,7 @@ QTabWidget::Rounded - 0 + 7 Qt::ElideNone @@ -3794,1662 +3794,12 @@ Water - - - - 10 - 0 - 1101 - 221 - - - - false - - - Water overview - - - false - - - false - - - false - - - - - 300 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 860 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 1000.000000000000000 - - - - - - 780 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 540 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 460 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 380 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 20 - 71 - 21 - - - - Ca - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 380 - 20 - 71 - 21 - - - - Mg - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 460 - 20 - 71 - 21 - - - - HCO3 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 540 - 20 - 71 - 21 - - - - CaCO3 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 620 - 20 - 71 - 21 - - - - Na - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 700 - 20 - 71 - 21 - - - - Cl - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 780 - 20 - 71 - 21 - - - - SO4 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 860 - 20 - 71 - 21 - - - - pH - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 200 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - false - - - 2 - - - 100000.000000000000000 - - - - - - 200 - 20 - 71 - 21 - - - - Volume - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 460 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 860 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 1000.000000000000000 - - - - - - 540 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 780 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 200 - 80 - 85 - 24 - - - - The division between the main and dilution water. The total volume does not change. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - QAbstractSpinBox::UpDownArrows - - - true - - - 2 - - - 100000.000000000000000 - - - 0.500000000000000 - - - - - - 380 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 460 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 860 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 1000.000000000000000 - - - - - - 540 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 780 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 200 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 100000.000000000000000 - - - - - - 380 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 460 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 860 - 140 - 71 - 24 - - - - Mash pH should be between 5.2 and 5.6. Use 5.2 for light and 5.5 for dark beers. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 1000.000000000000000 - - - - - - 540 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 780 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 380 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 380 - 140 - 71 - 24 - - - - The ideal amount of Magnesium is between 5 and 40. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 460 - 140 - 71 - 24 - - - - 0 to 50 for light beers, 50 to 150 for amber beers, 150 to 250 for dark beers. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 780 - 140 - 71 - 24 - - - - The ideal Sulfate amount should be between 50 and 400. -Together with Chloride it must be below 500. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 140 - 71 - 24 - - - - The ideal amount of Calcium is between 40 and 150. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 140 - 71 - 24 - - - - The ideal Chloride amount is between 50 and 150. -Together with Sulfate it must be below 500. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 540 - 140 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 140 - 71 - 24 - - - - The ideal amount of Natrium should be below 150. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 10 - 20 - 171 - 21 - - - - Water profile - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 10 - 50 - 181 - 23 - - - - The main brewing water - - - - - - Choose water - - - - - - 10 - 80 - 181 - 23 - - - - Optional dilution water - - - Choose dilution - - - - - - 10 - 180 - 181 - 23 - - - - If needed, choose a target water profile. - - - Choose example water - - - - - - 10 - 110 - 171 - 21 - - - - Mixed water - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 10 - 140 - 171 - 21 - - - - Treated water - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 1020 - 140 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 1020 - 20 - 71 - 21 - - - - RA - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 1020 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 1020 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 1020 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 940 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 940 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 940 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 940 - 20 - 71 - 21 - - - - Hardness - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 940 - 140 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 1020 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 940 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - 10 - 230 - 271 + 220 + 291 241 @@ -5461,7 +3811,7 @@ 10 20 - 151 + 71 20 @@ -5480,7 +3830,7 @@ 10 50 - 151 + 71 20 @@ -5499,7 +3849,7 @@ 10 80 - 151 + 71 20 @@ -5518,7 +3868,7 @@ 10 110 - 151 + 71 20 @@ -5537,7 +3887,7 @@ 10 140 - 151 + 71 20 @@ -5556,7 +3906,7 @@ 10 170 - 151 + 71 20 @@ -5575,7 +3925,7 @@ 10 200 - 151 + 71 20 @@ -5592,7 +3942,7 @@ - 170 + 90 20 91 24 @@ -5624,7 +3974,7 @@ - 170 + 90 50 91 24 @@ -5656,7 +4006,7 @@ - 170 + 90 80 91 24 @@ -5687,7 +4037,7 @@ - 170 + 90 110 91 24 @@ -5719,7 +4069,7 @@ - 170 + 90 140 91 24 @@ -5750,7 +4100,7 @@ - 170 + 90 170 91 24 @@ -5781,7 +4131,7 @@ - 170 + 90 200 91 24 @@ -5809,30 +4159,188 @@ 0.100000000000000 + + + + 190 + 50 + 91 + 24 + + + + Gypsum to change the water profile. This adds Calcium and Sulfate. +To improve bitter beers. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + gr + + + 2 + + + 1000.000000000000000 + + + 0.100000000000000 + + + + + + 190 + 80 + 91 + 24 + + + + Epsom salt to change the water profile. Use with caution! + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + gr + + + 2 + + + 1000.000000000000000 + + + 0.100000000000000 + + + + + + 190 + 110 + 91 + 24 + + + + Table salt to change the water profile. This adds Sodium and Chloride. +Improves the sweetness of the beer. The beer will become salty at high doses. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + gr + + + 2 + + + 1000.000000000000000 + + + 0.100000000000000 + + + + + + 190 + 20 + 91 + 24 + + + + To change the water profile. This adds Calcium and Chloride. +To improve sweet style beers. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + gr + + + 2 + + + 1000.000000000000000 + + + 0.100000000000000 + + + + + + 190 + 140 + 91 + 24 + + + + Magnesium Chloride + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + gr + + + 2 + + + 1000.000000000000000 + + + 0.100000000000000 + + - 350 - 230 - 421 - 91 + 780 + 220 + 331 + 241 - Mash water + Acid Additions 10 - 20 - 111 - 20 - - - - Desired pH: + 50 + 131 + 20 + + + + Desired mash pH: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -5841,9 +4349,9 @@ - 235 + 10 20 - 141 + 131 20 @@ -5858,8 +4366,8 @@ 10 - 50 - 111 + 80 + 131 20 @@ -5873,8 +4381,8 @@ - 130 - 50 + 150 + 80 101 23 @@ -5883,8 +4391,8 @@ - 130 - 20 + 150 + 50 101 24 @@ -5911,8 +4419,8 @@ - 240 - 50 + 260 + 80 61 24 @@ -5945,8 +4453,8 @@ - 310 - 50 + 150 + 110 89 24 @@ -5973,200 +4481,35 @@ - 385 + 150 20 16 21 - - - - - 840 - 230 - 271 - 241 - - - - Sparge water - - - - - 10 - 20 - 151 - 20 - - - - Sparge water supply: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 50 - 151 - 20 - - - - Sparge temperature: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 80 - 151 - 20 - - - - Water source: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - 10 - 110 - 151 - 20 - - - - Desired pH: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 140 - 151 - 20 - - - - Acid type: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 170 - 151 - 20 - - - - Acid strength: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 200 - 151 - 20 - - - - Acid needed: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 170 - 20 - 91 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - L - - - 1 - - - 100000.000000000000000 - - - 0.500000000000000 - - - - - - 170 - 50 - 91 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - °C - - - 1 - - - 100.000000000000000 - - - 0.500000000000000 + 131 + 20 + + + + Desired sparge pH: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - 170 - 110 - 91 + 150 + 140 + 101 24 @@ -6186,12 +4529,38 @@ 0.100000000000000 + + + + 10 + 170 + 131 + 20 + + + + Acid type: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 150 + 170 + 101 + 23 + + + - 170 + 260 170 - 91 + 61 24 @@ -6223,9 +4592,9 @@ - 170 + 150 200 - 91 + 89 24 @@ -6233,13 +4602,13 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - true + false - QAbstractSpinBox::NoButtons + QAbstractSpinBox::UpDownArrows - false + true ml @@ -6251,35 +4620,47 @@ 10000.000000000000000 - 0.100000000000000 - - - - - - 170 - 80 - 91 - 23 - - - - - - - 170 - 140 - 91 - 23 - + 0.010000000000000 + + + + + + 10 + 110 + 131 + 20 + + + + Acid amount: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 200 + 131 + 20 + + + + Acid amount: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - 290 - 340 + 310 + 240 181 20 @@ -6294,8 +4675,8 @@ - 480 - 340 + 500 + 240 71 24 @@ -6325,9 +4706,9 @@ - 560 - 340 - 211 + 580 + 240 + 191 20 @@ -6346,8 +4727,8 @@ - 290 - 370 + 310 + 270 181 20 @@ -6362,8 +4743,8 @@ - 480 - 370 + 500 + 270 71 24 @@ -6393,9 +4774,9 @@ - 560 - 370 - 211 + 580 + 270 + 191 20 @@ -6414,8 +4795,8 @@ - 290 - 400 + 311 + 300 181 20 @@ -6430,8 +4811,8 @@ - 480 - 400 + 501 + 300 71 24 @@ -6461,9 +4842,9 @@ - 559 - 400 - 211 + 580 + 300 + 191 20 @@ -6471,8 +4852,8 @@ - 290 - 430 + 311 + 330 181 20 @@ -6487,8 +4868,136 @@ - 480 - 430 + 501 + 330 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 720 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 640 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 560 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 880 + 180 71 24 @@ -6509,6 +5018,1897 @@ 1000.000000000000000 + + + + 800 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 400 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 480 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 230 + 180 + 81 + 24 + + + + The total prepared amount of sparge water + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + L + + + 2 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 960 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 10 + 150 + 181 + 23 + + + + If needed, choose a target water profile. + + + Choose example water + + + + + + 960 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 640 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 560 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 720 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 400 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 480 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 480 + 120 + 71 + 24 + + + + 0 to 50 for light beers, 50 to 150 for amber beers, 150 to 250 for dark beers. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 960 + 120 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 10 + 120 + 171 + 21 + + + + Treated mash water + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 880 + 120 + 71 + 24 + + + + Mash pH should be between 5.2 and 5.6. Use 5.2 for light and 5.5 for dark beers. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 640 + 120 + 71 + 24 + + + + The ideal amount of Natrium should be below 150. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 560 + 120 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 720 + 120 + 71 + 24 + + + + The ideal Chloride amount is between 50 and 150. +Together with Sulfate it must be below 500. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 120 + 71 + 24 + + + + The ideal amount of Calcium is between 40 and 150. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 120 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 400 + 120 + 71 + 24 + + + + The ideal amount of Magnesium is between 5 and 40. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 120 + 71 + 24 + + + + The ideal Sulfate amount should be between 50 and 400. +Together with Chloride it must be below 500. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 480 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 10 + 90 + 171 + 21 + + + + Mixed water + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 320 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 960 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 230 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + L + + + 2 + + + 100000.000000000000000 + + + + + + 640 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 720 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 400 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 560 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 880 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 1040 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 320 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 400 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 880 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 960 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 230 + 60 + 85 + 24 + + + + The division between the main and dilution water. The total volume does not change. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + QAbstractSpinBox::UpDownArrows + + + true + + + L + + + 2 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 640 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 720 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 10 + 60 + 181 + 23 + + + + Optional dilution water + + + Choose dilution + + + + + + 560 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 480 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 400 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 480 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 960 + 10 + 71 + 20 + + + + Hardness + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 880 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 400 + 10 + 71 + 20 + + + + Mg + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 880 + 10 + 71 + 20 + + + + pH + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 1040 + 10 + 71 + 20 + + + + + 50 + false + false + false + false + + + + QFrame::NoFrame + + + RA + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 960 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 230 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + L + + + 2 + + + 100000.000000000000000 + + + + + + 800 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 560 + 10 + 71 + 20 + + + + CaCO3 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 560 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 10 + 30 + 181 + 23 + + + + The main brewing water + + + + + + Choose water + + + + + + 720 + 10 + 71 + 20 + + + + Cl + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 640 + 10 + 71 + 20 + + + + Na + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 320 + 10 + 71 + 20 + + + + Ca + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 800 + 10 + 71 + 20 + + + + SO4 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 240 + 10 + 61 + 20 + + + + Volume + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 480 + 10 + 71 + 20 + + + + HCO3 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 10 + 171 + 20 + + + + Water profile + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 720 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 640 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 200 + 30 + 21 + 21 + + + + Sparge water source 1 + + + true + + + spargeGroup + + + + + false + + + + 200 + 60 + 21 + 21 + + + + Sparge water source 2 + + + spargeGroup + + + + + false + + + + 200 + 90 + 21 + 21 + + + + Sparge water mixed + + + spargeGroup + + + + + + 180 + 10 + 61 + 20 + + + + Sparge + + + Qt::AlignCenter + + + + + + 10 + 180 + 171 + 21 + + + + Treated sparge water + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + @@ -6861,7 +7261,7 @@ 200000.000000000000000 - + 160 @@ -6874,10 +7274,13 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - true + false - QAbstractSpinBox::NoButtons + QAbstractSpinBox::UpDownArrows + + + true °C @@ -6888,6 +7291,9 @@ 200.000000000000000 + + 0.500000000000000 + @@ -11117,51 +11523,6 @@ mash_timeEdit addMash mashsTable - w1_nameEdit - w1_volEdit - w1_caEdit - w1_mgEdit - w1_hco3Edit - w1_caco3Edit - w1_naEdit - w1_clEdit - w1_so4Edit - w1_phEdit - w2_nameEdit - w2_volEdit - w2_caEdit - w2_mgEdit - w2_hco3Edit - w2_caco3Edit - w2_naEdit - w2_clEdit - w2_so4Edit - w2_phEdit - wg_volEdit - wg_caEdit - wg_mgEdit - wg_hco3Edit - wg_caco3Edit - wg_naEdit - wg_clEdit - wg_so4Edit - wg_phEdit - wb_caEdit - wb_mgEdit - wb_hco3Edit - wb_caco3Edit - wb_naEdit - wb_clEdit - wb_so4Edit - wb_phEdit - wt_sourceEdit - wt_caEdit - wt_mgEdit - wt_hco3Edit - wt_caco3Edit - wt_naEdit - wt_clEdit - wt_so4Edit bs_cacl2Edit bs_caso4Edit bs_mgso4Edit @@ -11174,13 +11535,6 @@ mw_acidPick mw_acidpercEdit mw_acidvolEdit - sp_volEdit - sp_tempEdit - sp_sourceEdit - sp_phEdit - sp_acidtypeEdit - sp_acidpercEdit - sp_acidvolEdit buguEdit so4clEdit cur_so4clEdit @@ -11198,7 +11552,7 @@ brew_mashsgEdit brew_mashsgShow brew_masheffShow - brew_spargetempShow + brew_spargetempEdit brew_spargevolShow brew_spargeestShow brew_spargephEdit @@ -11306,4 +11660,7 @@ + + + diff -r d89bc21e2f07 -r dfbb012c631c ui/EditRecipe.ui --- a/ui/EditRecipe.ui Sun Jul 17 22:18:48 2022 +0200 +++ b/ui/EditRecipe.ui Mon Jul 18 17:04:02 2022 +0200 @@ -95,7 +95,7 @@ QTabWidget::Rounded - 0 + 6 Qt::ElideNone @@ -2425,1662 +2425,12 @@ Water - - - - 10 - 0 - 1101 - 221 - - - - false - - - Water overview - - - false - - - false - - - false - - - - - 300 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 860 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 1000.000000000000000 - - - - - - 780 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 540 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 460 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 380 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 20 - 71 - 21 - - - - Ca - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 380 - 20 - 71 - 21 - - - - Mg - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 460 - 20 - 71 - 21 - - - - HCO3 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 540 - 20 - 71 - 21 - - - - CaCO3 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 620 - 20 - 71 - 21 - - - - Na - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 700 - 20 - 71 - 21 - - - - Cl - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 780 - 20 - 71 - 21 - - - - SO4 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 860 - 20 - 71 - 21 - - - - pH - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 200 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - false - - - 2 - - - 100000.000000000000000 - - - - - - 200 - 20 - 71 - 21 - - - - Volume - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 460 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 860 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 1000.000000000000000 - - - - - - 540 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 780 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 200 - 80 - 85 - 24 - - - - The division between the main and dilution water. The total volume does not change. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - QAbstractSpinBox::UpDownArrows - - - true - - - 2 - - - 100000.000000000000000 - - - 0.500000000000000 - - - - - - 380 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 460 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 860 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 1000.000000000000000 - - - - - - 540 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 780 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 200 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 100000.000000000000000 - - - - - - 380 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 460 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 860 - 140 - 71 - 24 - - - - Mash pH should be between 5.2 and 5.6. Use 5.2 for light and 5.5 for dark beers. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 2 - - - 1000.000000000000000 - - - - - - 540 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 780 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 380 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 380 - 140 - 71 - 24 - - - - The ideal amount of Magnesium is between 5 and 40. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 460 - 140 - 71 - 24 - - - - 0 to 50 for light beers, 50 to 150 for amber beers, 150 to 250 for dark beers. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 780 - 140 - 71 - 24 - - - - The ideal Sulfate amount should be between 50 and 400. -Together with Chloride it must be below 500. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 300 - 140 - 71 - 24 - - - - The ideal amount of Calcium is between 40 and 150. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 700 - 140 - 71 - 24 - - - - The ideal Chloride amount is between 50 and 150. -Together with Sulfate it must be below 500. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 540 - 140 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 620 - 140 - 71 - 24 - - - - The ideal amount of Natrium should be below 150. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 10 - 20 - 171 - 21 - - - - Water profile - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 10 - 50 - 181 - 23 - - - - The main brewing water - - - - - - Choose water - - - - - - 10 - 80 - 181 - 23 - - - - Optional dilution water - - - Choose dilution - - - - - - 10 - 180 - 181 - 23 - - - - If needed, choose a target water profile. - - - Choose example water - - - - - - 10 - 110 - 171 - 21 - - - - Mixed water - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 10 - 140 - 171 - 21 - - - - Treated water - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 1020 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 940 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 1020 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 940 - 180 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 940 - 80 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 1020 - 110 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 940 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 1020 - 50 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 1020 - 20 - 71 - 21 - - - - RA - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 1020 - 140 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - - - - 940 - 140 - 71 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - QAbstractSpinBox::NoButtons - - - 1 - - - 1000.000000000000000 - - - - - - 940 - 20 - 71 - 21 - - - - Hardness - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 10 - 230 - 271 + 220 + 291 241 @@ -4092,7 +2442,7 @@ 10 20 - 151 + 71 20 @@ -4111,7 +2461,7 @@ 10 50 - 151 + 71 20 @@ -4130,7 +2480,7 @@ 10 80 - 151 + 71 20 @@ -4149,7 +2499,7 @@ 10 110 - 151 + 71 20 @@ -4168,7 +2518,7 @@ 10 140 - 151 + 71 20 @@ -4187,7 +2537,7 @@ 10 170 - 151 + 71 20 @@ -4206,7 +2556,7 @@ 10 200 - 151 + 71 20 @@ -4223,7 +2573,7 @@ - 170 + 90 20 91 24 @@ -4255,7 +2605,7 @@ - 170 + 90 50 91 24 @@ -4287,7 +2637,7 @@ - 170 + 90 80 91 24 @@ -4318,7 +2668,7 @@ - 170 + 90 110 91 24 @@ -4350,7 +2700,7 @@ - 170 + 90 140 91 24 @@ -4381,7 +2731,7 @@ - 170 + 90 170 91 24 @@ -4412,7 +2762,7 @@ - 170 + 90 200 91 24 @@ -4440,88 +2790,18 @@ 0.100000000000000 - - - - - 350 - 230 - 421 - 91 - - - - Mash water - - - - - 10 - 20 - 111 - 20 - - - - Desired pH: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - + - 235 + 190 20 - 141 - 20 - - - - Auto calculate: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 50 - 111 - 20 - - - - Acid to use: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 130 - 50 - 101 - 23 - - - - - - - 130 - 20 - 101 + 91 24 - Mash pH should be between 5.2 and 5.6. Use 5.2 for light and 5.5 for dark beers. + To change the water profile. This adds Calcium and Chloride. +To improve sweet style beers. Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -4529,59 +2809,63 @@ true + + gr + 2 - 14.000000000000000 + 1000.000000000000000 0.100000000000000 - + - 240 - 50 - 61 + 190 + 80 + 91 24 + + Epsom salt to change the water profile. Use with caution! + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + true - - QAbstractSpinBox::NoButtons - - - false - - % + gr - 0 + 2 - 100.000000000000000 + 1000.000000000000000 - 1.000000000000000 + 0.100000000000000 - + - 310 - 50 - 89 + 190 + 110 + 91 24 + + Table salt to change the water profile. This adds Sodium and Chloride. +Improves the sweetness of the beer. The beer will become salty at high doses. + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -4589,100 +2873,105 @@ true - ml + gr 2 - 10000.000000000000000 + 1000.000000000000000 0.100000000000000 - + - 385 - 20 - 16 - 21 + 190 + 50 + 91 + 24 + + Gypsum to change the water profile. This adds Calcium and Sulfate. +To improve bitter beers. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + gr + + + 2 + + + 1000.000000000000000 + + + 0.100000000000000 + + + + + + 190 + 140 + 91 + 24 + + + + Magnesium Chloride + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + gr + + + 2 + + + 1000.000000000000000 + + + 0.100000000000000 + - 840 - 230 - 271 + 780 + 220 + 331 241 - Sparge water - - + Acid Additions + + 10 - 20 - 151 + 140 + 131 20 - Sparge water supply: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 50 - 151 - 20 - - - - Sparge temperature: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 80 - 151 - 20 - - - - Water source: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 110 - 151 - 20 - - - - Desired pH: + Desired sparge pH: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -4692,8 +2981,8 @@ 10 - 140 - 151 + 170 + 131 20 @@ -4704,94 +2993,28 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - 10 - 170 - 151 - 20 - - - - Acid strength: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - 10 200 - 151 + 131 20 - Acid needed: + Acid amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - 170 - 20 - 91 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - 1 - - - 100000.000000000000000 - - - 0.500000000000000 - - - - - - 170 - 50 - 91 - 24 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - 1 - - - 100.000000000000000 - - - 0.500000000000000 - - - 170 - 110 - 91 + 150 + 140 + 101 24 @@ -4814,9 +3037,9 @@ - 170 + 260 170 - 91 + 61 24 @@ -4848,9 +3071,97 @@ - 170 + 150 200 - 91 + 89 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + QAbstractSpinBox::UpDownArrows + + + true + + + ml + + + 2 + + + 10000.000000000000000 + + + 0.100000000000000 + + + + + + 150 + 170 + 101 + 23 + + + + + + + 150 + 110 + 89 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + ml + + + 2 + + + 10000.000000000000000 + + + 0.100000000000000 + + + + + + 10 + 110 + 131 + 20 + + + + Acid amount: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 260 + 80 + 61 24 @@ -4867,35 +3178,111 @@ false - ml + % + + + 0 + + + 100.000000000000000 + + + 1.000000000000000 + + + + + + 150 + 80 + 101 + 23 + + + + + + + 10 + 80 + 131 + 20 + + + + Acid to use: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 150 + 50 + 101 + 24 + + + + Mash pH should be between 5.2 and 5.6. Use 5.2 for light and 5.5 for dark beers. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true 2 - 10000.000000000000000 + 14.000000000000000 0.100000000000000 - + + + + 10 + 50 + 131 + 20 + + + + Desired mash pH: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + - 170 - 80 - 91 - 23 + 0 + 20 + 141 + 20 + + Auto calculate: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - + - 170 - 140 - 91 - 23 + 150 + 20 + 16 + 21 @@ -4903,8 +3290,8 @@ - 290 - 340 + 310 + 240 181 20 @@ -4919,8 +3306,8 @@ - 480 - 340 + 500 + 240 71 24 @@ -4950,9 +3337,9 @@ - 560 - 340 - 211 + 580 + 240 + 191 20 @@ -4971,8 +3358,8 @@ - 290 - 370 + 310 + 270 181 20 @@ -4987,8 +3374,8 @@ - 480 - 370 + 500 + 270 71 24 @@ -5018,9 +3405,9 @@ - 560 - 370 - 211 + 580 + 270 + 191 20 @@ -5039,8 +3426,8 @@ - 290 - 400 + 310 + 300 181 20 @@ -5055,8 +3442,8 @@ - 480 - 400 + 500 + 300 71 24 @@ -5086,9 +3473,9 @@ - 559 - 400 - 211 + 579 + 300 + 191 20 @@ -5096,8 +3483,8 @@ - 290 - 430 + 310 + 330 181 20 @@ -5112,8 +3499,972 @@ + 500 + 330 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 640 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + 480 - 430 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 10 + 150 + 181 + 23 + + + + If needed, choose a target water profile. + + + Choose example water + + + + + + 1040 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 720 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 960 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 400 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 560 + 150 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 560 + 120 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 120 + 71 + 24 + + + + The ideal Sulfate amount should be between 50 and 400. +Together with Chloride it must be below 500. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 120 + 71 + 24 + + + + The ideal amount of Calcium is between 40 and 150. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 480 + 120 + 71 + 24 + + + + 0 to 50 for light beers, 50 to 150 for amber beers, 150 to 250 for dark beers. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 960 + 120 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 720 + 120 + 71 + 24 + + + + The ideal Chloride amount is between 50 and 150. +Together with Sulfate it must be below 500. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 880 + 120 + 71 + 24 + + + + Mash pH should be between 5.2 and 5.6. Use 5.2 for light and 5.5 for dark beers. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 1040 + 120 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 400 + 120 + 71 + 24 + + + + The ideal amount of Magnesium is between 5 and 40. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 10 + 120 + 171 + 21 + + + + Treated mash water + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 640 + 120 + 71 + 24 + + + + The ideal amount of Natrium should be below 150. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 10 + 90 + 171 + 21 + + + + Mixed water + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 480 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 230 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 100000.000000000000000 + + + + + + 480 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 720 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 960 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 230 + 60 + 85 + 24 + + + + The division between the main and dilution water. The total volume does not change. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + QAbstractSpinBox::UpDownArrows + + + true + + + 2 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 960 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 560 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 640 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 640 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 880 + 60 71 24 @@ -5134,6 +4485,1040 @@ 1000.000000000000000 + + + + 400 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 720 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 880 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 560 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 400 + 60 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 90 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 10 + 60 + 181 + 23 + + + + Optional dilution water + + + Choose dilution + + + + + + 800 + 10 + 71 + 20 + + + + SO4 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 30 + 181 + 23 + + + + The main brewing water + + + + + + Choose water + + + + + + 720 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 960 + 10 + 71 + 20 + + + + Hardness + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 560 + 10 + 71 + 20 + + + + CaCO3 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 320 + 10 + 71 + 20 + + + + Ca + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 480 + 10 + 71 + 20 + + + + HCO3 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 800 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 640 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 880 + 10 + 71 + 20 + + + + pH + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 10 + 171 + 20 + + + + Water profile + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 480 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 230 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + false + + + 2 + + + 100000.000000000000000 + + + + + + 230 + 10 + 71 + 20 + + + + Volume + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 960 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 320 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 400 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 880 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 640 + 10 + 71 + 20 + + + + Na + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 1040 + 10 + 71 + 20 + + + + RA + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 720 + 10 + 71 + 20 + + + + Cl + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 400 + 10 + 71 + 20 + + + + Mg + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 560 + 30 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 1040 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + + + + 320 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 10 + 180 + 171 + 21 + + + + Treated sparge water + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 400 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 640 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 480 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 800 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 960 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 230 + 180 + 81 + 24 + + + + The total prepared amount of sparge water + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + L + + + 2 + + + 100000.000000000000000 + + + 0.500000000000000 + + + + + + 560 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 880 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 2 + + + 1000.000000000000000 + + + + + + 720 + 180 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + 1 + + + 1000.000000000000000 + + + + + + 180 + 10 + 61 + 20 + + + + Sparge + + + Qt::AlignCenter + + + + + false + + + + 200 + 90 + 21 + 21 + + + + Sparge water mixed + + + spargeGroup + + + + + + 200 + 30 + 21 + 21 + + + + Sparge water source 1 + + + true + + + spargeGroup + + + + + false + + + + 200 + 60 + 21 + 21 + + + + Sparge water source 2 + + + spargeGroup + + @@ -5190,4 +5575,7 @@ + + +