# HG changeset patch # User Michiel Broek # Date 1659723071 -7200 # Node ID 26ffc2fb0eafee94f26f1f4247afc94daa6bf422 # Parent 506246d65043fd18246af2f2f043ec938546e2c6 Fixed calculation of estimated fg and use the same method as in bmsapp. diff -r 506246d65043 -r 26ffc2fb0eaf www/js/prod_edit.js --- a/www/js/prod_edit.js Fri Aug 05 16:07:05 2022 +0200 +++ b/www/js/prod_edit.js Fri Aug 05 20:11:11 2022 +0200 @@ -1479,6 +1479,7 @@ addedS = 0, // Added sugars after boil addedmass = 0, // Added mass after boil mvol = 0, // mash volume + infuse = 0, // mash infuse volume colort = 0, // Colors srm * vol totals colorh = 0, // Colors ebc * vol * kt colorn = 0, // Colors ebc * pt * pct @@ -1503,14 +1504,15 @@ row = dataRecord.mashs[i]; if (parseFloat(row.step_type) == 0) // Infusion mvol += parseFloat(row.step_infuse_amount); - if (row.step_temp <= 75) { // Ignore mashout - timem = row.step_time + row.ramp_time; + if (row.step_temp <= 75 && row.step_temp >= 60) { // Ignore mashout + timem = row.step_time; + if (i > 0) + timem += row.ramp_time; mashtime += timem; mashtemp += timem * row.step_temp; } } - if (mashtime > 5) - mashtime -= 5; //Correct last ramp > 75 + infuse = mvol; mashtemp = Round(mashtemp / mashtime, 2); } else { console.log("calcFermentables() no mash steps"); @@ -1695,9 +1697,8 @@ calcSupplies(); 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); + if ((mashkg > 0) && (infuse > 0) && (mashtime > 0) && (mashtemp > 0)) { + dataRecord.est_fg = estimate_fg(psugar, pcara, infuse / mashkg, mashtime, mashtemp, svg, dataRecord.est_og); } else { dataRecord.est_fg = estimate_fg(psugar, pcara, 0, 0, 0, svg, dataRecord.est_og); }