Calculate and show estimated preboil pH

Tue, 12 Jul 2022 12:10:20 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 12 Jul 2022 12:10:20 +0200
changeset 349
f05aeee71a14
parent 348
c5318497a0b6
child 350
37b3c690b02c

Calculate and show estimated preboil pH

src/EditProductTab8.cpp file | annotate | diff | comparison | revisions
src/global.h file | annotate | diff | comparison | revisions
ui/EditProduct.ui file | annotate | diff | comparison | revisions
--- 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);
 }
 
 
--- 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;
--- 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 @@
        <widget class="QGroupBox" name="waterviewBox">
         <property name="geometry">
          <rect>
-          <x>170</x>
+          <x>50</x>
           <y>0</y>
-          <width>941</width>
+          <width>1021</width>
           <height>221</height>
          </rect>
         </property>
@@ -5143,6 +5143,51 @@
           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
          </property>
         </widget>
+        <widget class="QDoubleSpinBox" name="wb_raEdit">
+         <property name="geometry">
+          <rect>
+           <x>940</x>
+           <y>140</y>
+           <width>71</width>
+           <height>24</height>
+          </rect>
+         </property>
+         <property name="toolTip">
+          <string>The ideal Sulfate amount should be between 50 and 400.
+Together with Chloride it must be below 500.</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="readOnly">
+          <bool>true</bool>
+         </property>
+         <property name="buttonSymbols">
+          <enum>QAbstractSpinBox::NoButtons</enum>
+         </property>
+         <property name="decimals">
+          <number>1</number>
+         </property>
+         <property name="maximum">
+          <double>1000.000000000000000</double>
+         </property>
+        </widget>
+        <widget class="QLabel" name="raLabel">
+         <property name="geometry">
+          <rect>
+           <x>940</x>
+           <y>20</y>
+           <width>71</width>
+           <height>21</height>
+          </rect>
+         </property>
+         <property name="text">
+          <string>RA</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+        </widget>
        </widget>
        <widget class="QGroupBox" name="brewsaltsBox">
         <property name="geometry">
@@ -6168,6 +6213,50 @@
          </rect>
         </property>
        </widget>
+       <widget class="QLabel" name="preboil_phLabel">
+        <property name="geometry">
+         <rect>
+          <x>290</x>
+          <y>430</y>
+          <width>181</width>
+          <height>20</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>Estimate pre boil pH:</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+       <widget class="QDoubleSpinBox" name="preboil_phEdit">
+        <property name="geometry">
+         <rect>
+          <x>480</x>
+          <y>430</y>
+          <width>71</width>
+          <height>24</height>
+         </rect>
+        </property>
+        <property name="toolTip">
+         <string>Mash pH should be between 5.2 and 5.6. Use 5.2 for light and 5.5 for dark beers.</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="readOnly">
+         <bool>true</bool>
+        </property>
+        <property name="buttonSymbols">
+         <enum>QAbstractSpinBox::NoButtons</enum>
+        </property>
+        <property name="decimals">
+         <number>2</number>
+        </property>
+        <property name="maximum">
+         <double>1000.000000000000000</double>
+        </property>
+       </widget>
       </widget>
       <widget class="QWidget" name="brewday">
        <attribute name="title">
@@ -6817,6 +6906,25 @@
            <normaloff>:/icons/silk/pencil.png</normaloff>:/icons/silk/pencil.png</iconset>
          </property>
         </widget>
+        <widget class="QDoubleSpinBox" name="brew_preboilphShow">
+         <property name="geometry">
+          <rect>
+           <x>240</x>
+           <y>20</y>
+           <width>71</width>
+           <height>24</height>
+          </rect>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="readOnly">
+          <bool>true</bool>
+         </property>
+         <property name="buttonSymbols">
+          <enum>QAbstractSpinBox::NoButtons</enum>
+         </property>
+        </widget>
        </widget>
        <widget class="QGroupBox" name="whirlpoolBox">
         <property name="geometry">

mercurial