Added kw_to_newebc function to debug EBC differences.

Wed, 27 Apr 2022 12:15:36 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 27 Apr 2022 12:15:36 +0200
changeset 168
4bc92122d001
parent 167
5093db5665c6
child 169
541ddf3edb10

Added kw_to_newebc function to debug EBC differences.

src/EditRecipeTab2.cpp file | annotate | diff | comparison | revisions
src/Utils.cpp file | annotate | diff | comparison | revisions
src/Utils.h file | annotate | diff | comparison | revisions
--- a/src/EditRecipeTab2.cpp	Wed Apr 27 11:26:10 2022 +0200
+++ b/src/EditRecipeTab2.cpp	Wed Apr 27 12:15:36 2022 +0200
@@ -279,6 +279,7 @@
     } else {
 	double cw = colort / recipe->batch_size * 8.34436;
 	color = Utils::kw_to_ebc(recipe->color_method, cw);
+	//qDebug() << "  oud EBC" << color << "new EBC" << Utils::kw_to_newebc(recipe->color_method, cw) << "SRM" << Utils::kw_to_srm(recipe->color_method, cw);
     }
     qDebug() << "  color" << ui->est_colorEdit->value() << color << recipe->est_color;
     recipe->est_color = color;
--- a/src/Utils.cpp	Wed Apr 27 11:26:10 2022 +0200
+++ b/src/Utils.cpp	Wed Apr 27 12:15:36 2022 +0200
@@ -324,6 +324,12 @@
 }
 
 
+double Utils::kw_to_newebc(int colormethod, double c)
+{
+    return 1.97 * kw_to_srm(colormethod, c);
+}
+
+
 double Utils::abvol(double og, double fg)
 {
     if (((og - fg) < 0) || (fg < 0.9))
--- a/src/Utils.h	Wed Apr 27 11:26:10 2022 +0200
+++ b/src/Utils.h	Wed Apr 27 12:15:36 2022 +0200
@@ -30,6 +30,7 @@
     double estimate_fg(double psugar, double pcara, double wgratio, double mashtime, double mashtemp, double svg, double og);
     double kw_to_srm(int colormethod, double c);
     double kw_to_ebc(int colormethod, double c);
+    double kw_to_newebc(int colormethod, double c);
     double abvol(double og, double fg);
     double toIBU(int Use, int Form, double SG, double Volume, double Amount, double Boiltime, double Alpha,
                  int Method, double Whirlpool9, double Whirlpool7, double Whirlpool6);

mercurial