# HG changeset patch # User Michiel Broek # Date 1549812985 -3600 # Node ID ffab9ba3f53261e9ff579e69350012d8b45397fc # Parent 943fbe0e9fd6c73278501d507e5def42d5c994ea 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. diff -r 943fbe0e9fd6 -r ffab9ba3f532 www/js/prod_edit.js --- 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);