Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.

Sun, 15 May 2022 09:57:32 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 15 May 2022 09:57:32 +0200
changeset 207
3b164a0aea90
parent 206
83ae8ac83f51
child 208
615afedbcd25

Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.

src/EditProduct.cpp file | annotate | diff | comparison | revisions
src/EditProduct.h file | annotate | diff | comparison | revisions
src/EditProductTab9.cpp file | annotate | diff | comparison | revisions
--- a/src/EditProduct.cpp	Fri May 13 22:03:35 2022 +0200
+++ b/src/EditProduct.cpp	Sun May 15 09:57:32 2022 +0200
@@ -1083,6 +1083,11 @@
     connect(ui->brew_startButton1, SIGNAL(clicked()), this, SLOT(brew_date_today()));
     connect(ui->brew_startButton2, SIGNAL(clicked()), this, SLOT(brew_date_clear()));
     connect(ui->brew_startDate, &QDateEdit::dateChanged, this, &EditProduct::brew_start_date_changed);
+    connect(ui->brew_mashphEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_mashph_changed);
+    connect(ui->brew_mashsgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_mashsg_changed);
+    connect(ui->brew_spargephEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_spargeph_changed);
+    connect(ui->brew_preboilphEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_preboilph_changed);
+    connect(ui->brew_aboilphEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilph_changed);
 
     setStage();
 
@@ -1190,7 +1195,7 @@
 		"brew_sparge_volume=:brew_sparge_volume, brew_sparge_est=:brew_sparge_est, brew_sparge_ph=:brew_sparge_ph, "
 		"brew_preboil_volume=:brew_preboil_volume, brew_preboil_sg=:brew_preboil_sg, brew_preboil_ph=:brew_preboil_ph, "
 		"brew_preboil_efficiency=:brew_preboil_efficiency, brew_aboil_volume=:brew_aboil_volume, "
-		"brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph:=brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_efficiency, "
+		"brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph=:brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_efficiency, "
 		"brew_cooling_method=:brew_cooling_method, brew_cooling_time=:brew_cooling_time, brew_cooling_to=:brew_cooling_to, "
 		"brew_whirlpool9=:brew_whirlpool9, brew_whirlpool7=:brew_whirlpool7, brew_whirlpool6=:brew_whirlpool6, "
 		"brew_whirlpool2=:brew_whirlpool2, brew_fermenter_volume=:brew_fermenter_volume, "
@@ -1262,7 +1267,7 @@
                 "brew_sparge_volume=:brew_sparge_volume, brew_sparge_est=:brew_sparge_est, brew_sparge_ph=:brew_sparge_ph, "
                 "brew_preboil_volume=:brew_preboil_volume, brew_preboil_sg=:brew_preboil_sg, brew_preboil_ph=:brew_preboil_ph, "
                 "brew_preboil_efficiency=:brew_preboil_efficiency, brew_aboil_volume=:brew_aboil_volume, "
-                "brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph:=brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_efficiency, "
+                "brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph=:brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_efficiency, "
                 "brew_cooling_method=:brew_cooling_method, brew_cooling_time=:brew_cooling_time, brew_cooling_to=:brew_cooling_to, "
                 "brew_whirlpool9=:brew_whirlpool9, brew_whirlpool7=:brew_whirlpool7, brew_whirlpool6=:brew_whirlpool6, "
                 "brew_whirlpool2=:brew_whirlpool2, brew_fermenter_volume=:brew_fermenter_volume, "
--- a/src/EditProduct.h	Fri May 13 22:03:35 2022 +0200
+++ b/src/EditProduct.h	Sun May 15 09:57:32 2022 +0200
@@ -145,6 +145,11 @@
     void brew_start_date_changed(QDate val);
     void brew_end_today();
     void brew_end_date_changed(QDate val);
+    void brew_mashph_changed(double val);
+    void brew_mashsg_changed(double val);
+    void brew_spargeph_changed(double val);
+    void brew_preboilph_changed(double val);
+    void brew_aboilph_changed(double val);
 
     /* Modified progress bars */
     void ferment_perc_mash_valueChanged(int value);
--- a/src/EditProductTab9.cpp	Fri May 13 22:03:35 2022 +0200
+++ b/src/EditProductTab9.cpp	Sun May 15 09:57:32 2022 +0200
@@ -64,6 +64,7 @@
     product->brew_date_start.setDate(ui->brew_startDate->nullDate());
     qDebug() << "brew_start_date_changed" << product->brew_date_start.date();
     updateBrewday();
+    is_changed();
 }
 
 
@@ -78,3 +79,70 @@
 }
 
 
+void EditProduct::brew_mashph_changed(double val)
+{
+    if (product->brew_mash_ph == 0) {
+	product->brew_mash_ph = 4.8;
+	const QSignalBlocker blocker1(ui->brew_mashphEdit);
+	ui->brew_mashphEdit->setValue(4.8);
+    } else {
+    	product->brew_mash_ph = val;
+    }
+    is_changed();
+}
+
+
+void EditProduct::brew_mashsg_changed(double val)
+{
+    product->brew_mash_sg = val;
+    double c = Utils::sg_to_plato(product->est_mash_sg);
+    double m = Utils::sg_to_plato(val);
+
+    if (c > 0.5)
+	product->brew_mash_efficiency = 100 * m / c;
+    else
+	product->brew_mash_efficiency = 0;
+    ui->brew_masheffShow->setValue(product->brew_mash_efficiency);
+    is_changed();
+}
+
+
+void EditProduct::brew_spargeph_changed(double val)
+{
+    if (product->brew_sparge_ph == 0) {
+        product->brew_sparge_ph = 4.8;
+        const QSignalBlocker blocker1(ui->brew_spargephEdit);
+        ui->brew_spargephEdit->setValue(4.8);
+    } else {
+    	product->brew_sparge_ph = val;
+    }
+    is_changed();
+}
+
+
+void EditProduct::brew_preboilph_changed(double val)
+{
+    if (product->brew_preboil_ph == 0) {
+        product->brew_preboil_ph = 4.8;
+        const QSignalBlocker blocker1(ui->brew_preboilphEdit);
+        ui->brew_preboilphEdit->setValue(4.8);
+    } else {
+        product->brew_preboil_ph = val;
+    }
+    is_changed();
+}
+
+
+void EditProduct::brew_aboilph_changed(double val)
+{
+    if (product->brew_aboil_ph == 0) {
+        product->brew_aboil_ph = 4.8;
+        const QSignalBlocker blocker1(ui->brew_aboilphEdit);
+        ui->brew_aboilphEdit->setValue(4.8);
+    } else {
+        product->brew_aboil_ph = val;
+    }
+    is_changed();
+}
+
+

mercurial