Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.

Sun, 15 May 2022 23:10:15 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 15 May 2022 23:10:15 +0200
changeset 210
b45bd6da5220
parent 209
19c50b1f58d3
child 211
bec0386b1df1

Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.

src/EditProduct.cpp file | annotate | diff | comparison | revisions
src/EditProduct.h file | annotate | diff | comparison | revisions
src/EditProductTab1.cpp file | annotate | diff | comparison | revisions
src/EditProductTab9.cpp file | annotate | diff | comparison | revisions
ui/EditProduct.ui file | annotate | diff | comparison | revisions
--- a/src/EditProduct.cpp	Sun May 15 20:57:03 2022 +0200
+++ b/src/EditProduct.cpp	Sun May 15 23:10:15 2022 +0200
@@ -1094,6 +1094,18 @@
     connect(ui->brew_aboilphEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilph_changed);
     connect(ui->brew_aboilsgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilsg_changed);
     connect(ui->brew_aboilvolEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilvol_changed);
+    connect(ui->brew_coolwithEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::brew_cooling_method_changed);
+    connect(ui->brew_cooltoEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_cooling_to_changed);
+    connect(ui->brew_cooltimeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_cooling_time_changed);
+    connect(ui->brew_whirlpool9Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool9_changed);
+    connect(ui->brew_whirlpool7Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool7_changed);
+    connect(ui->brew_whirlpool6Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool6_changed);
+    connect(ui->brew_whirlpool2Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool2_changed);
+    connect(ui->brew_aerwithEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::brew_aerwith_changed);
+    connect(ui->brew_aerspeedEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aerspeed_changed);
+    connect(ui->brew_aertimeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aertime_changed);
+    connect(ui->brew_trublossEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_trubloss_changed);
+    connect(ui->brew_topupwaterEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_topupwater_changed);
 
     setStage();
 
--- a/src/EditProduct.h	Sun May 15 20:57:03 2022 +0200
+++ b/src/EditProduct.h	Sun May 15 23:10:15 2022 +0200
@@ -154,6 +154,18 @@
     void brew_aboilph_changed(double val);
     void brew_aboilsg_changed(double val);
     void brew_aboilvol_changed(double val);
+    void brew_cooling_method_changed(int val);
+    void brew_cooling_to_changed(double val);
+    void brew_cooling_time_changed(double val);
+    void brew_whirlpool9_changed(double val);
+    void brew_whirlpool7_changed(double val);
+    void brew_whirlpool6_changed(double val);
+    void brew_whirlpool2_changed(double val);
+    void brew_aerwith_changed(int val);
+    void brew_aerspeed_changed(double val);
+    void brew_aertime_changed(double val);
+    void brew_trubloss_changed(double val);
+    void brew_topupwater_changed(double val);
 
     /* Modified progress bars */
     void ferment_perc_mash_valueChanged(int value);
--- a/src/EditProductTab1.cpp	Sun May 15 20:57:03 2022 +0200
+++ b/src/EditProductTab1.cpp	Sun May 15 23:10:15 2022 +0200
@@ -315,16 +315,35 @@
         ui->brew_startButton2->show();
         ui->brew_startDate->setReadOnly(false);
 	ui->brew_startLabel2->show();
-        ui->brew_endLabel->show();
-        ui->brew_endLabel2->show();
-	ui->brew_endButton1->show();
-	ui->brew_startTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
-	ui->brew_startTime->show();
-	ui->brew_endDate->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
-        ui->brew_endDate->show();
-	ui->brew_endDate->setReadOnly(false);
-	ui->brew_endTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
-        ui->brew_endTime->show();
+
+	/*
+	 * Enable brew_end settings if it is the right date or later.
+	 * If some essential values are filled in.
+	 */
+	int brewTime = product->brew_date_start.date().daysTo(QDate::currentDate());
+
+	if ((brewTime >= 0) && (product->brew_cooling_method > 0) && (product->brew_cooling_time > 0) &&
+	    (product->brew_aboil_sg > 1.002) && (product->brew_aboil_volume > 0)) {
+            ui->brew_endLabel->show();
+	    ui->brew_startLabel2->show();
+            ui->brew_endLabel2->show();
+	    ui->brew_endButton1->show();
+	    ui->brew_startTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
+	    ui->brew_startTime->show();
+	    ui->brew_endDate->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
+            ui->brew_endDate->show();
+	    ui->brew_endDate->setReadOnly(false);
+	    ui->brew_endTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
+            ui->brew_endTime->show();
+	} else {
+	    ui->brew_endButton1->hide();
+            ui->brew_startLabel2->hide();
+            ui->brew_endLabel->hide();
+            ui->brew_endLabel2->hide();
+            ui->brew_startTime->hide();
+            ui->brew_endDate->hide();
+            ui->brew_endTime->hide();
+	}
     } else {
 	ui->brew_startButton1->hide();
         ui->brew_startButton2->hide();
--- a/src/EditProductTab9.cpp	Sun May 15 20:57:03 2022 +0200
+++ b/src/EditProductTab9.cpp	Sun May 15 23:10:15 2022 +0200
@@ -252,3 +252,90 @@
 }
 
 
+void EditProduct::brew_cooling_method_changed(int val)
+{
+    product->brew_cooling_method = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_cooling_to_changed(double val)
+{
+    product->brew_cooling_to = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_cooling_time_changed(double val)
+{
+    product->brew_cooling_time = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_whirlpool9_changed(double val)
+{
+    product->brew_whirlpool9 = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_whirlpool7_changed(double val)
+{
+    product->brew_whirlpool7 = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_whirlpool6_changed(double val)
+{
+    product->brew_whirlpool6 = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_whirlpool2_changed(double val)
+{
+    product->brew_whirlpool2 = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_aerwith_changed(int val)
+{
+    product->brew_aeration_type = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_aerspeed_changed(double val)
+{
+    product->brew_aeration_speed = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_aertime_changed(double val)
+{
+    product->brew_aeration_time = val;
+    is_changed();
+}
+
+
+void EditProduct::brew_trubloss_changed(double val)
+{
+    product->brew_fermenter_tcloss = val;
+    is_changed();
+    calcFermentables(); // This will also recalculate all volumes.
+    calcIBUs();
+}
+
+
+void EditProduct::brew_topupwater_changed(double val)
+{
+    product->brew_fermenter_extrawater = val;
+    is_changed();
+    calcFermentables(); // This will also recalculate all volumes.
+    calcIBUs();
+}
+
--- a/ui/EditProduct.ui	Sun May 15 20:57:03 2022 +0200
+++ b/ui/EditProduct.ui	Sun May 15 23:10:15 2022 +0200
@@ -7077,7 +7077,7 @@
           <double>100000.000000000000000</double>
          </property>
          <property name="singleStep">
-          <double>1.000000000000000</double>
+          <double>0.100000000000000</double>
          </property>
         </widget>
         <widget class="QDoubleSpinBox" name="brew_topupwaterEdit">
@@ -7105,7 +7105,7 @@
           <double>100000.000000000000000</double>
          </property>
          <property name="singleStep">
-          <double>1.000000000000000</double>
+          <double>0.100000000000000</double>
          </property>
         </widget>
         <widget class="QDoubleSpinBox" name="brew_tofermentEdit">

mercurial