src/EditProductTab9.cpp

changeset 207
3b164a0aea90
parent 205
ae6109192fb2
child 209
19c50b1f58d3
--- 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