src/EditProductTab8.cpp

changeset 274
33b5a9a42370
parent 264
67b5c00dd23c
child 283
242a68fa7186
--- a/src/EditProductTab8.cpp	Thu Jun 09 15:59:04 2022 +0200
+++ b/src/EditProductTab8.cpp	Fri Jun 10 10:53:59 2022 +0200
@@ -63,21 +63,21 @@
 
     if ((F.f_di_ph != 5.7) && ((F.f_acid_to_ph_57 < - 0.1) || (F.f_acid_to_ph_57 > 0.1))) {
 	C1 = F.f_acid_to_ph_57 / (F.f_di_ph - 5.7);
-     } else {
+    } else {
 	/*
 	 * If the acid_to_ph_5.7 is unknown from the maltster, guess the required acid.
 	 */
 	switch (F.f_graintype) {
-	   case 0:					// Base, Special, Kilned
-	   case 3:
-	   case 5:	C1 = 0.014 * F.f_color - 34.192;
-			break;
-	   case 2:	C1 = -0.0597 * F.f_color - 32.457;	// Crystal
-			break;
-	   case 1:	C1 = 0.0107 * F.f_color - 54.768;	// Roast
-			break;
-	   case 4:	C1 = -149;                      // Sour malt
-			break;
+	   case FERMENTABLE_GRAINTYPE_BASE:
+	   case FERMENTABLE_GRAINTYPE_KILNED:
+	   case FERMENTABLE_GRAINTYPE_SPECIAL:		C1 = 0.014 * F.f_color - 34.192;
+							break;
+	   case FERMENTABLE_GRAINTYPE_CRYSTAL:		C1 = -0.0597 * F.f_color - 32.457;
+							break;
+	   case FERMENTABLE_GRAINTYPE_ROAST:		C1 = 0.0107 * F.f_color - 54.768;
+							break;
+	   case FERMENTABLE_GRAINTYPE_SOUR_MALT:	C1 = -149;
+							break;
 	}
     }
     return C1;
@@ -105,7 +105,7 @@
     if (product->fermentables.size()) {
 	for (i = 0; i < product->fermentables.size(); i++) {
 	    F = product->fermentables.at(i);
-	    if (F.f_added == 0 && F.f_graintype != 6) { // Added == Mash && graintype != No Malt
+	    if (F.f_added == FERMENTABLE_ADDED_MASH && F.f_graintype != FERMENTABLE_GRAINTYPE_NO_MALT) {
 		x = AcidRequired(pHZ, F) * F.f_amount;
 		Result += x;
 	    }

mercurial