Ignore mash steps above 75 degrees for estimate_fg calculation. If multiple yeasts for primary fermentation, ise the highest attenuation because that yeast usually wins.

Sun, 10 Feb 2019 16:36:25 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 10 Feb 2019 16:36:25 +0100
changeset 259
ffab9ba3f532
parent 258
943fbe0e9fd6
child 260
042fc9b3717b

Ignore mash steps above 75 degrees for estimate_fg calculation. If multiple yeasts for primary fermentation, ise the highest attenuation because that yeast usually wins.

www/js/prod_edit.js file | annotate | diff | comparison | revisions
--- a/www/js/prod_edit.js	Sun Feb 10 16:14:48 2019 +0100
+++ b/www/js/prod_edit.js	Sun Feb 10 16:36:25 2019 +0100
@@ -123,8 +123,10 @@
 				var row = rows[i];
 				if (row.step_type == 0) // Infusion
 					mvol += parseFloat(row.step_infuse_amount);
-				mashtime += row.step_time;
-				mashtemp += row.step_time * row.step_temp;
+				if (row.step_temp <= 75) { // Ignore mashout
+					mashtime += row.step_time;
+					mashtemp += row.step_time * row.step_temp;
+				}
 			}
 			mashtemp = mashtemp / mashtime;
 			console.log("mash time:"+mashtime+" temp:"+mashtemp);
@@ -252,13 +254,18 @@
 		calcStage();
 
 		// Calculate estimated svg.
-		svg = 77; // default.
+		svg = 0; // default.
 		var rows = $('#yeastGrid').jqxGrid('getrows');
 		for (var i = 0; i < rows.length; i++) {
 			var row = rows[i];
-			if (row.y_use == 0)     // Primary
-				svg = parseFloat(row.y_attenuation);
+			if (row.y_use == 0) {	// Primary
+				if (parseFloat(row.y_attenuation) > svg)
+					svg = parseFloat(row.y_attenuation);	// Take the highest if multiple yeasts.
+			}
+			// TODO: brett in secondary ??
 		}
+		if (svg == 0)
+			svg = 77;
 
 		if ((mashkg > 0) && (mash_infuse > 0) && (mashtime > 0) && (mashtemp > 0)) {
 			dataRecord.est_fg = estimate_fg(psugar, pcara, mash_infuse / mashkg, mashtime, mashtemp, svg, dataRecord.est_og);

mercurial