Added brewday mash results box.

Sun, 01 May 2022 10:31:31 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 01 May 2022 10:31:31 +0200
changeset 182
545d31130844
parent 181
14a1f7bca79b
child 183
bce87b8b604b

Added brewday mash results box.

src/EditProduct.cpp file | annotate | diff | comparison | revisions
src/EditProductTab3.cpp file | annotate | diff | comparison | revisions
src/global.h file | annotate | diff | comparison | revisions
ui/EditProduct.ui file | annotate | diff | comparison | revisions
--- a/src/EditProduct.cpp	Sat Apr 30 20:36:30 2022 +0200
+++ b/src/EditProduct.cpp	Sun May 01 10:31:31 2022 +0200
@@ -902,6 +902,13 @@
     ui->sp_acidvolEdit->setValue(product->sparge_acid_amount);
 
     // Tab brewday.
+    ui->brew_startEdit->setText(product->brew_date_start.toString("dd MMM yyyy  hh:mm"));
+    ui->brew_endEdit->setText(product->brew_date_end.toString("dd MMM yyyy  hh:mm"));
+    ui->brew_mashphEdit->setValue(product->brew_mash_ph);
+    ui->brew_mashphShow->setValue(product->mash_ph);
+    ui->brew_mashsgEdit->setValue(product->brew_mash_sg);
+    ui->brew_mashsgShow->setValue(0);
+    ui->brew_masheffShow->setValue(product->brew_mash_efficiency);
 
     // Tab fermentation.
 
--- a/src/EditProductTab3.cpp	Sat Apr 30 20:36:30 2022 +0200
+++ b/src/EditProductTab3.cpp	Sun May 01 10:31:31 2022 +0200
@@ -262,6 +262,11 @@
     qDebug() << "  psugar" << psugar << "pcara" << pcara << "mvol" << mvol;
     qDebug() << "  sugarsf" << sugarsf << "sugarsm" << sugarsm;
 
+    double v = s / sugardensity + mvol;
+    s = 1000 * s / (v * 10); //deg. Plato
+    product->est_mash_sg = Utils::plato_to_sg(s);
+    ui->brew_mashsgShow->setValue(product->est_mash_sg);
+
     double og = Utils::estimate_sg(sugarsf + addedS, product->batch_size);
     qDebug() << "  OG" << ui->est_ogEdit->value() << og;
     product->est_og = og;
--- a/src/global.h	Sat Apr 30 20:36:30 2022 +0200
+++ b/src/global.h	Sun May 01 10:31:31 2022 +0200
@@ -530,6 +530,7 @@
     int		mashs_row;
     double	mashs_kg;		///< Kg fermentables in the mash.
     int		mashs_time;		///< Total mash time.
+    double	est_mash_sg;
     double	preboil_sg;
 };
 
--- a/ui/EditProduct.ui	Sat Apr 30 20:36:30 2022 +0200
+++ b/ui/EditProduct.ui	Sun May 01 10:31:31 2022 +0200
@@ -95,7 +95,7 @@
        <enum>QTabWidget::Rounded</enum>
       </property>
       <property name="currentIndex">
-       <number>0</number>
+       <number>8</number>
       </property>
       <property name="elideMode">
        <enum>Qt::ElideNone</enum>
@@ -5937,6 +5937,272 @@
        <attribute name="title">
         <string>Brewday</string>
        </attribute>
+       <widget class="QLabel" name="brew_startLabel">
+        <property name="geometry">
+         <rect>
+          <x>0</x>
+          <y>10</y>
+          <width>131</width>
+          <height>20</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>Brewday start:</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+       <widget class="QLabel" name="brew_endLabel">
+        <property name="geometry">
+         <rect>
+          <x>570</x>
+          <y>10</y>
+          <width>131</width>
+          <height>20</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>Brewday end:</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+       <widget class="QLineEdit" name="brew_startEdit">
+        <property name="geometry">
+         <rect>
+          <x>140</x>
+          <y>10</y>
+          <width>141</width>
+          <height>23</height>
+         </rect>
+        </property>
+        <property name="readOnly">
+         <bool>true</bool>
+        </property>
+       </widget>
+       <widget class="QLineEdit" name="brew_endEdit">
+        <property name="geometry">
+         <rect>
+          <x>710</x>
+          <y>10</y>
+          <width>141</width>
+          <height>23</height>
+         </rect>
+        </property>
+        <property name="readOnly">
+         <bool>true</bool>
+        </property>
+       </widget>
+       <widget class="QToolButton" name="brew_startButton">
+        <property name="geometry">
+         <rect>
+          <x>290</x>
+          <y>10</y>
+          <width>28</width>
+          <height>22</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="icon">
+         <iconset resource="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc">
+          <normaloff>:/icons/silk/clock_edit.png</normaloff>:/icons/silk/clock_edit.png</iconset>
+        </property>
+       </widget>
+       <widget class="QToolButton" name="brew_endButton">
+        <property name="geometry">
+         <rect>
+          <x>860</x>
+          <y>10</y>
+          <width>28</width>
+          <height>22</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="icon">
+         <iconset resource="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc">
+          <normaloff>:/icons/silk/clock_edit.png</normaloff>:/icons/silk/clock_edit.png</iconset>
+        </property>
+       </widget>
+       <widget class="QGroupBox" name="brew_mashBox">
+        <property name="geometry">
+         <rect>
+          <x>0</x>
+          <y>40</y>
+          <width>321</width>
+          <height>121</height>
+         </rect>
+        </property>
+        <property name="title">
+         <string>Mashing</string>
+        </property>
+        <widget class="QLabel" name="brew_mashphLabel">
+         <property name="geometry">
+          <rect>
+           <x>10</x>
+           <y>20</y>
+           <width>121</width>
+           <height>20</height>
+          </rect>
+         </property>
+         <property name="text">
+          <string>Mash pH:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+        </widget>
+        <widget class="QDoubleSpinBox" name="brew_mashphEdit">
+         <property name="geometry">
+          <rect>
+           <x>140</x>
+           <y>20</y>
+           <width>81</width>
+           <height>24</height>
+          </rect>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="accelerated">
+          <bool>true</bool>
+         </property>
+         <property name="maximum">
+          <double>14.000000000000000</double>
+         </property>
+         <property name="singleStep">
+          <double>0.100000000000000</double>
+         </property>
+        </widget>
+        <widget class="QDoubleSpinBox" name="brew_mashphShow">
+         <property name="geometry">
+          <rect>
+           <x>230</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 class="QDoubleSpinBox" name="brew_mashsgEdit">
+         <property name="geometry">
+          <rect>
+           <x>140</x>
+           <y>50</y>
+           <width>81</width>
+           <height>24</height>
+          </rect>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="accelerated">
+          <bool>true</bool>
+         </property>
+         <property name="decimals">
+          <number>3</number>
+         </property>
+         <property name="singleStep">
+          <double>0.001000000000000</double>
+         </property>
+        </widget>
+        <widget class="QDoubleSpinBox" name="brew_mashsgShow">
+         <property name="geometry">
+          <rect>
+           <x>230</x>
+           <y>50</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>
+         <property name="decimals">
+          <number>3</number>
+         </property>
+        </widget>
+        <widget class="QDoubleSpinBox" name="brew_masheffShow">
+         <property name="geometry">
+          <rect>
+           <x>140</x>
+           <y>80</y>
+           <width>81</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>
+         <property name="suffix">
+          <string> %</string>
+         </property>
+         <property name="decimals">
+          <number>1</number>
+         </property>
+         <property name="maximum">
+          <double>200.000000000000000</double>
+         </property>
+        </widget>
+        <widget class="QLabel" name="brew_mashsgLabel">
+         <property name="geometry">
+          <rect>
+           <x>10</x>
+           <y>50</y>
+           <width>121</width>
+           <height>20</height>
+          </rect>
+         </property>
+         <property name="text">
+          <string>Mash SG:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+        </widget>
+        <widget class="QLabel" name="brew_masheffLabel">
+         <property name="geometry">
+          <rect>
+           <x>10</x>
+           <y>80</y>
+           <width>121</width>
+           <height>20</height>
+          </rect>
+         </property>
+         <property name="text">
+          <string>Efficiency:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+        </widget>
+       </widget>
       </widget>
       <widget class="QWidget" name="ferment">
        <attribute name="icon">

mercurial