# HG changeset patch # User Michiel Broek # Date 1657620620 -7200 # Node ID f05aeee71a14809625ee6296d29fb7142ca8a35c # Parent c5318497a0b66f8e07b416aa4223c92a81963c16 Calculate and show estimated preboil pH diff -r c5318497a0b6 -r f05aeee71a14 src/EditProductTab8.cpp --- a/src/EditProductTab8.cpp Mon Jul 11 17:03:55 2022 +0200 +++ b/src/EditProductTab8.cpp Tue Jul 12 12:10:20 2022 +0200 @@ -484,6 +484,10 @@ Acid = round(Acid * 100.0) / 100.0; product->sparge_acid_amount = Acid / 1000; ui->sp_acidvolEdit->setValue(Acid); + + 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)); + ui->preboil_phEdit->setValue(product->est_preboil_ph); + ui->brew_preboilphShow->setValue(product->est_preboil_ph); } diff -r c5318497a0b6 -r f05aeee71a14 src/global.h --- a/src/global.h Mon Jul 11 17:03:55 2022 +0200 +++ b/src/global.h Tue Jul 12 12:10:20 2022 +0200 @@ -647,6 +647,7 @@ double mashs_kg; ///< Kg fermentables in the mash. int mashs_time; ///< Total mash time. double est_mash_sg; + double est_preboil_ph; double preboil_sg; double final_abv; /// ABV after dilution/infusion. double bottle_abv; diff -r c5318497a0b6 -r f05aeee71a14 ui/EditProduct.ui --- a/ui/EditProduct.ui Mon Jul 11 17:03:55 2022 +0200 +++ b/ui/EditProduct.ui Tue Jul 12 12:10:20 2022 +0200 @@ -3797,9 +3797,9 @@ - 170 + 50 0 - 941 + 1021 221 @@ -5143,6 +5143,51 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + 940 + 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 + + + + + + 940 + 20 + 71 + 21 + + + + RA + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + @@ -6168,6 +6213,50 @@ + + + + 290 + 430 + 181 + 20 + + + + Estimate pre boil pH: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 480 + 430 + 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 + + @@ -6817,6 +6906,25 @@ :/icons/silk/pencil.png:/icons/silk/pencil.png + + + + 240 + 20 + 71 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + +