Merged with divide branch

Mon, 28 Oct 2019 19:55:42 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 28 Oct 2019 19:55:42 +0100
changeset 542
dabe1c854a0f
parent 541
df678aa03f4a (diff)
parent 537
9dbce45f39b7 (current diff)
child 543
c062eb0dd7ce

Merged with divide branch

www/js/prod_edit.js file | annotate | diff | comparison | revisions
www/prod_forum.php file | annotate | diff | comparison | revisions
www/prod_print.php file | annotate | diff | comparison | revisions
--- a/www/includes/formulas.php	Fri Oct 25 10:12:24 2019 +0200
+++ b/www/includes/formulas.php	Mon Oct 28 19:55:42 2019 +0100
@@ -202,7 +202,7 @@
 
 
 
-function calc_IBU($useat, $form, $sg, $volume, $mass, $boiltime, $alpha, $method)
+function calc_IBU($useat, $form, $sg, $volume, $mass, $boiltime, $alpha, $method, $whirlpool9, $whirlpool7, $whirlpool6)
 {
 	global $my_factor_mashhop;
 	global $my_factor_fwh;
@@ -234,13 +234,23 @@
                 $pfactor += $my_factor_cryohop / 100;
         }
 
+	$whirlibus = 0;
+        if ($useat == 4) { // Any whirlpool
+		if ($whirlpool9)
+			$whirlibus += ($mass * ($alpha / 100) * 20) / $volume * $whirlpool9 / 50;
+		if ($whirlpool7)
+			$whirlibus += ($mass * ($alpha / 100) * 6) / $volume * $whirlpool7 / 50;
+		if ($whirlpool6)
+			$whirlibus += ($mass * ($alpha / 100) * 2) / $volume * $whirlpool6 / 50;
+	}
+
 	$ibu = 0;
 	if (($method == 0) || ($method == 3)) {	// Tinseth or Garetz // For Garetz, we need the $ibu
 		$AddedAlphaAcids = (($alpha / 100) * $mass * 1000) / $volume;
 		$Bigness_factor = 1.65 * pow( 0.000125, $sg - 1);
 		$BoilTime_factor = ((1 - exp(-0.04 * $boiltime)) / 4.15);
 		$utiisation = $Bigness_factor * $BoilTime_factor;
-		$ibu = (round($utiisation * $AddedAlphaAcids * $fmoment * $pfactor * 10) / 10.0);
+		$ibu = (round(($utiisation * $AddedAlphaAcids * $fmoment * $pfactor + $whirlibus) * 10) / 10.0);
 	}
 	if ($method == 2) {	// Daniels
 
@@ -252,7 +262,7 @@
 			$sgfactor = 0;
 		else
 			$sgfactor = (($sg * 1000) - 1050) / 200;
-		$ibu = $fmoment * (($mass * $alpha * $boilfactor * 0.1) / ($volume * (1 + $sgfactor)));
+		$ibu = $fmoment * (($mass * $alpha * $boilfactor * 0.1) / ($volume * (1 + $sgfactor))) + $whirlibus;
 	}
 	if ($method == 1) {	// Rager
 		$boilfactor = $fmoment * 18.11 + 13.86 * tanh(($boiltime * 31.32) / 18.27);
@@ -260,7 +270,7 @@
 			$sgfactor = 0;
 		else
 			$sgfactor = (($sg * 1000) - 1050) / 200;
-		$ibu = ($mass * $alpha * $boilfactor * 0.1) / ($volume * (1 + $sgfactor));
+		$ibu = ($mass * $alpha * $boilfactor * 0.1) / ($volume * (1 + $sgfactor)) + $whirlibus;
 	}
 	if ($method == 3) {	// Garetz, not in use.
 		/* Something is wrong, late hops and dryhops give negative results. */
--- a/www/js/global.js	Fri Oct 25 10:12:24 2019 +0200
+++ b/www/js/global.js	Mon Oct 28 19:55:42 2019 +0100
@@ -872,7 +872,7 @@
 /*
  * Berekeningen uit https://www.hobbybrouwen.nl/forum/index.php/topic,6079.msg69464.html#msg69464
  */
-function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method) {
+function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method, Whirlpool9, Whirlpool7, Whirlpool6) {
 
  var gravity, liters, alpha, mass, time, fmoment = 1.0, pfactor = 1.0, ibu = 0, boilfactor, sgfactor,
      AddedAlphaAcids, Bigness_factor, BoilTime_factor, utiisation;
@@ -901,13 +901,39 @@
   pfactor += my_factor_cryohop / 100;
  }
 
+ // Ideas from Zymurgy March-April 2018. These are not exact formulas!
+ whirlibus = 0;
+ if (Use == 3 || Use == 4) { // Flameout or any whirlpool
+  if (Whirlpool9) {
+   // 20 mg/l/50 min
+   whirlibus += (alpha * mass * 20) / liters * (Whirlpool9 / 50);
+   //console.log('Whirlpool9:' + alpha * mass * 20 + ' liter:' + liters + ' time:' + Whirlpool9 + ' ibu' + (alpha * mass * 20) / liters * (Whirlpool9 / 50));
+  } else {
+   if (Use == 3) // Flameout hops are 2 minutes in this range.
+    whirlibus += (alpha * mass * 20) / liters * (2 / 50);
+  }
+  if (Whirlpool7) {
+   // 6 mg/l/50 min
+   whirlibus += (alpha * mass * 6) / liters * (Whirlpool7 / 50);
+   //console.log('Whirlpool7:' + alpha * mass * 6 + ' liter:' + liters + ' time:' + Whirlpool7 + ' ibu' + (alpha * mass * 6) / liters * (Whirlpool7 / 50));
+  } else {
+   if (Use == 3) // Flameout hops are 4 minutes in this range.
+    whirlibus += (alpha * mass * 6) / liters * (4 / 50);
+  }
+  if (Whirlpool6) {
+   // 2 mg/l/50 min
+   whirlibus += (alpha * mass * 2) / liters * (Whirlpool6 / 50);
+   //console.log('Whirlpool6:' + alpha * mass * 2 + ' liter:' + liters + ' time:' + Whirlpool6 + ' ibu' + (alpha * mass * 2) / liters * (Whirlpool6 / 50));
+  }
+ }
+
  if (Method == 0) { // Tinseth
   /* http://realbeer.com/hops/research.html */
   AddedAlphaAcids = (alpha * mass * 1000) / liters;
   Bigness_factor = 1.65 * Math.pow(0.000125, gravity - 1);
   BoilTime_factor = ((1 - Math.exp(-0.04 * time)) / 4.15);
   utiisation = Bigness_factor * BoilTime_factor;
-  ibu = Round(utiisation * AddedAlphaAcids * fmoment * pfactor, 1);
+  ibu = Round(utiisation * AddedAlphaAcids * fmoment * pfactor + whirlibus, 1);
  }
  if (Method == 2) { // Daniels
   if (Form == 2) // Leaf
@@ -918,7 +944,7 @@
    sgfactor = 0;
   else
    sgfactor = (gravity - 1050) / 200;
-  ibu = Round(fmoment * ((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor))), 1);
+  ibu = Round(fmoment * ((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor))) + whirlibus, 1);
  }
  if (Method == 1) { // Rager
   boilfactor = fmoment * 18.11 + 13.86 * Math.tanh((time * 31.32) / 18.27);
@@ -926,10 +952,11 @@
    sgfactor = 0;
   else
    sgfactor = (gravity - 1050) / 200;
-  ibu = Round((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor)), 1);
+  ibu = Round((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor)) + whirlibus, 1);
  }
 
- //console.log("toIBU("+Use+","+Form+","+SG+","+Volume+","+Amount+","+Boiltime+","+Alpha+","+Method+"):"+ibu+" fm:"+fmoment+" pf:"+pfactor);
+// console.log('toIBU(' + Use + ',' + Form + ',' + SG + ',' + Volume + ',' + Amount + ',' + Boiltime + ',' +
+//             Alpha + ',' + Method + ',' + Whirlpool9 + ',' + Whirlpool7 + ',' + Whirlpool6 + '):' + ibu + ' fm:' + fmoment + ' pf:' + pfactor);
  return ibu;
 }
 
--- a/www/js/prod_edit.js	Fri Oct 25 10:12:24 2019 +0200
+++ b/www/js/prod_edit.js	Mon Oct 28 19:55:42 2019 +0100
@@ -814,7 +814,7 @@
     { name: 'h_type', type: 'int' },
     { name: 'h_form', type: 'int' },
     { name: 'h_useat', type: 'int' },
-    { name: 'h_time', type: 'float' },
+    { name: 'h_time', type: 'int' },
     { name: 'h_alpha', type: 'float' },
     { name: 'h_beta', type: 'float' },
     { name: 'h_hsi', type: 'float' },
@@ -827,15 +827,12 @@
     { name: 'h_avail', type: 'int' }
    ],
    addrow: function(rowid, rowdata, position, commit) {
-    console.log('hop addrow ' + rowid);
     commit(true);
    },
    deleterow: function(rowid, commit) {
-    console.log('hop deleterow ' + rowid);
     commit(true);
    },
    updaterow: function(rowid, rowdata, commit) {
-    console.log('hop updaterow ' + rowid);
     commit(true);
    }
   },
@@ -917,6 +914,7 @@
     });
    },
    ready: function() {
+    whirlpoolHops();
     calcIBUs();
     $('#jqxTabs').jqxTabs('next');
    },
@@ -955,7 +953,8 @@
     { text: 'IBU', datafield: 'ibu', width: 80, align: 'right',
      cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
       var ibu = toIBU(rowdata.h_useat, rowdata.h_form, preboil_sg, parseFloat($('#batch_size').jqxNumberInput('decimal')),
-                parseFloat(rowdata.h_amount), parseFloat(rowdata.h_time), parseFloat(rowdata.h_alpha), $('#ibu_method').val());
+                parseFloat(rowdata.h_amount), parseFloat(rowdata.h_time), parseFloat(rowdata.h_alpha), $('#ibu_method').val(),
+                dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6);
       return '<span style="margin: 4px; margin-top: 6px; float: right;">' + dataAdapter.formatNumber(ibu, 'f1') + '</span>';
      }
     },
@@ -996,7 +995,8 @@
        $('#wh_name').val(hopData.h_name);
        $('#wh_amount').val(hopData.h_amount * 1000);
        var ibu = toIBU(hopData.h_useat, hopData.h_form, preboil_sg, parseFloat($('#batch_size').jqxNumberInput('decimal')),
-                 parseFloat(hopData.h_amount), parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val());
+                 parseFloat(hopData.h_amount), parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val(),
+                 dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6);
        $('#wh_ibu').val(ibu);
        if (hopData.h_useat == 5) // Dry hop
         $('#wh_time').val(hopData.h_time / 1440);
@@ -1031,15 +1031,12 @@
     { name: 'm_avail', type: 'int' }
    ],
    addrow: function(rowid, rowdata, position, commit) {
-    console.log('misc addrow ' + rowid);
     commit(true);
    },
    deleterow: function(rowid, commit) {
-    console.log('misc deleterow ' + rowid);
     commit(true);
    },
    updaterow: function(rowid, rowdata, commit) {
-    console.log('misc updaterow ' + rowid);
     commit(true);
    }
   },
@@ -1992,6 +1989,8 @@
  function hopFlavourContribution(bt, vol, use, amount) {
   var result;
 
+  if (use == 4 || use == 5) // Whirlpool or Dry-hop
+   return 0;
   if (use == 1) { // First wort
    result = 0.15;          // assume 15% flavourcontribution for fwh
   } else if (bt > 50) {
@@ -2007,8 +2006,12 @@
  function hopAromaContribution(bt, vol, use, amount) {
   var result = 0;
 
-  if (use == 5) {         // Dry hop
+  if (use == 5) { // Dry hop
    result = 1.33;
+  } else if (use == 4) { // Whirlpool
+   if (bt > 30)
+    bt = 30; // Max 30 minutes
+   result = 0.62 * bt / 30;
   } else if (bt > 20) {
    result = 0;
   } else if (bt > 7.5) {
@@ -2017,10 +2020,8 @@
    result = 1;
   } else if (use == 3) {  // Aroma
    result = 1.2;
-  } else if (use == 4) {  // Whirlpool
-   result = 1.2;
   }
-   return (result * amount * 1000) / vol;
+  return (result * amount * 1000) / vol;
  }
 
  function calcIBUs() {
@@ -2033,10 +2034,12 @@
   for (i = 0; i < rows.length; i++) {
    row = rows[i];
    total_ibus += toIBU(row.h_useat, row.h_form, preboil_sg, parseFloat(dataRecord.batch_size),
-                       parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method);
+                       parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method,
+                       dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6);
    ferm_ibus += toIBU(row.h_useat, row.h_form, preboil_sg,
                       parseFloat(dataRecord.brew_fermenter_volume) + parseFloat(dataRecord.brew_fermenter_tcloss),
-                      parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method);
+                      parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method,
+                      dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6);
    hop_flavour += hopFlavourContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size),
                                         row.h_useat, parseFloat(row.h_amount));
    hop_aroma += hopAromaContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size),
@@ -2412,6 +2415,21 @@
   }
  };
 
+ function whirlpoolHops() {
+  var row, i, time, rowscount;
+  if (!(rowscount = $('#hopGrid').jqxGrid('getdatainformation').rowscount))
+   return;
+  if (rowscount == 0)
+   return;
+  for (i = 0; i < rowscount; i++) {
+   row = $('#hopGrid').jqxGrid('getrowdata', i);
+   if (row.h_useat == 4) {
+    time = parseFloat(dataRecord.brew_whirlpool9) + parseFloat(dataRecord.brew_whirlpool7) + parseFloat(dataRecord.brew_whirlpool6);
+    $('#hopGrid').jqxGrid('setcellvalue', i, 'h_time', time);
+   }
+  }
+ };
+
  function calcMiscs() {
 
   ok_miscs = 1;
@@ -4066,6 +4084,21 @@
    dataRecord.fg = parseFloat(event.args.value);
    calcFermentation();
   });
+  $('#brew_whirlpool9').on('valueChanged', function(event) {
+   dataRecord.brew_whirlpool9 = event.args.value;
+   whirlpoolHops();
+   calcIBUs();
+  });
+  $('#brew_whirlpool7').on('valueChanged', function(event) {
+   dataRecord.brew_whirlpool7 = event.args.value;
+   whirlpoolHops();
+   calcIBUs();
+  });
+  $('#brew_whirlpool6').on('valueChanged', function(event) {
+   dataRecord.brew_whirlpool6 = event.args.value;
+   whirlpoolHops();
+   calcIBUs();
+  });
   $('#BLog').jqxButton({ disabled: (dataRecord.log_brew) ? false : true});
   $('#FLog').jqxButton({ disabled: (dataRecord.log_fermentation) ? false : true});
  }
@@ -5003,7 +5036,8 @@
   console.log('amount changed: ' + event.args.value + ' time:' + hopData.h_time + ' alpha:' + hopData.h_alpha);
   var ibu, amount = parseFloat(event.args.value) / 1000;
   ibu = toIBU(hopData.h_useat, hopData.h_form, preboil_sg, parseFloat($('#batch_size').jqxNumberInput('decimal')),
-   amount, parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val()
+   amount, parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val(),
+   dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6
   );
   hopData.h_amount = amount;
   $('#wh_ibu').val(ibu);
@@ -5019,12 +5053,6 @@
     $('#wh_time').val(newtime);
    }
    hopData.h_time = newtime;
-  } else if (hopData.h_useat == 4) { // Whirlpool
-   if (newtime > 120) {
-    newtime = 120;
-    $('#wh_time').val(newtime);
-   }
-   hopData.h_time = newtime;
   } else if (hopData.h_useat == 5) { // Dry hop
    if (newtime > 21) {
     newtime = 21;
@@ -5033,7 +5061,8 @@
    hopData.h_time = newtime * 1440;
   }
   ibu = toIBU(hopData.h_useat, hopData.h_form, preboil_sg, parseFloat($('#batch_size').jqxNumberInput('decimal')),
-    parseFloat(hopData.h_amount), parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val());
+    parseFloat(hopData.h_amount), parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val(),
+    dataRecord.brew_whirlpool9, dataRecord.brew_whirlpool7, dataRecord.brew_whirlpool6);
   // console.log("time changed: "+newtime+" final:"+hopData.h_time+" ibu:"+ibu);
   $('#wh_ibu').val(ibu);
  });
@@ -5059,7 +5088,11 @@
     hopData.h_time = 0;
     $('#wh_time').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
     $('#wh_time').val(0);
-   } else {        // Boil, Whirlpool or Dry hop
+   } else if (index == 4) { // Whirlpool
+    hopData.h_time = (parseFloat(dataRecord.brew_whirlpool9) + parseFloat(dataRecord.brew_whirlpool7) + parseFloat(dataRecord.brew_whirlpool6));
+    $('#wh_time').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
+    $('#wh_time').val(hopData.h_time);
+   } else {        // Boil, Dry hop
     $('#wh_time').jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 });
    }
    if (index == 5) // Dry hop
--- a/www/js/rec_edit.js	Fri Oct 25 10:12:24 2019 +0200
+++ b/www/js/rec_edit.js	Mon Oct 28 19:55:42 2019 +0100
@@ -74,6 +74,8 @@
 function hopFlavourContribution(bt, vol, use, amount) {
  var result;
 
+ if (use == 4 || use == 5) // Whirlpool or Dry-hop
+  return 0;
  if (use == 1) {   // First wort
   result = 0.15;   // assume 15% flavourcontribution for fwh
  } else if (bt > 50) {
@@ -92,6 +94,10 @@
 
  if (use == 5) {         // Dry hop
   result = 1.33;
+ } else if (use == 4) { // Whirlpool
+   if (bt > 30)
+    bt = 30; // Max 30 minutes
+   result = 0.62 * bt / 30;
  } else if (bt > 20) {
   result = 0;
  } else if (bt > 7.5) {
@@ -100,8 +106,6 @@
   result = 1;
  } else if (use == 3) {  // Aroma
   result = 1.2;
- } else if (use == 4) {  // Whirlpool
-  result = 1.2;
  }
  return (result * amount * 1000) / vol;
 }
@@ -372,7 +376,7 @@
  for (i = 0; i < rows.length; i++) {
   row = rows[i];
   total_ibus += toIBU(row.h_useat, row.h_form, preboil_sg, parseFloat(dataRecord.batch_size),
-   parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method);
+   parseFloat(row.h_amount), parseFloat(row.h_time), parseFloat(row.h_alpha), dataRecord.ibu_method, 0, parseFloat(row.h_time), 0);
   hop_flavour += hopFlavourContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size), row.h_useat, parseFloat(row.h_amount));
   hop_aroma += hopAromaContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size), row.h_useat, parseFloat(row.h_amount));
  }
@@ -1226,7 +1230,7 @@
      cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
       var ibu = toIBU(rowdata.h_useat, rowdata.h_form, preboil_sg, parseFloat($('#batch_size').jqxNumberInput('decimal')),
                       parseFloat(rowdata.h_amount), parseFloat(rowdata.h_time),
-                      parseFloat(rowdata.h_alpha), $('#ibu_method').val());
+                      parseFloat(rowdata.h_alpha), $('#ibu_method').val(), 0, parseFloat(rowdata.h_time), 0);
       return '<span style="margin: 4px; margin-top: 6px; float: right;">' + dataAdapter.formatNumber(ibu, 'f1') + '</span>';
      }
     },
@@ -1260,7 +1264,8 @@
       var ibu = toIBU(hopData.h_useat, hopData.h_form, preboil_sg,
                 parseFloat($('#batch_size').jqxNumberInput('decimal')),
                 parseFloat(hopData.h_amount), parseFloat(hopData.h_time),
-                parseFloat(hopData.h_alpha), $('#ibu_method').val()
+                parseFloat(hopData.h_alpha), $('#ibu_method').val(),
+                0, parseFloat(hopData.h_time), 0
       );
       $('#wh_ibu').val(ibu);
       if (hopData.h_useat == 5)       // Dry hop
@@ -3302,7 +3307,7 @@
  $('#wh_amount').on('change', function(event) {
   var ibu, amount = parseFloat(event.args.value) / 1000;
   ibu = toIBU(hopData.h_useat, hopData.h_form, preboil_sg, parseFloat($('#batch_size').jqxNumberInput('decimal')),
-   amount, parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val());
+   amount, parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val(), 0, parseFloat(hopData.h_time), 0);
   hopData.h_amount = amount;
   console.log('amount changed: ' + event.args.value + ' time:' + hopData.h_time + ' alpha:' + hopData.h_alpha + ' IBU:' + ibu);
   $('#wh_ibu').val(ibu);
@@ -3332,7 +3337,7 @@
    hopData.h_time = newtime * 1440;
   }
   ibu = toIBU(hopData.h_useat, hopData.h_form, preboil_sg, parseFloat($('#batch_size').jqxNumberInput('decimal')),
-   parseFloat(hopData.h_amount), parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val());
+   parseFloat(hopData.h_amount), parseFloat(hopData.h_time), parseFloat(hopData.h_alpha), $('#ibu_method').val(), 0, parseFloat(hopData.h_time), 0);
   $('#wh_ibu').val(ibu);
  });
  $('#wh_useat').jqxDropDownList({
--- a/www/prod_forum.php	Fri Oct 25 10:12:24 2019 +0200
+++ b/www/prod_forum.php	Mon Oct 28 19:55:42 2019 +0100
@@ -129,7 +129,8 @@
 	$amount = floatval($item['h_amount']) * 1000;
 	$time   = floatval($item['h_time']);
         $alpha  = floatval($item['h_alpha']);
-	$ibu    = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $amount, $time, $alpha, $row['ibu_method']);
+	$ibu    = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $amount, $time, $alpha,
+		$row['ibu_method'], $row['brew_whirlpool9'], $row['brew_whirlpool7'], $row['brew_whirlpool6']);
 	$moment = $hopuse[$item['h_useat']];
         if (($item['h_useat'] == 2) || ($item['h_useat'] == 4)) {    // Boil or Whirlpool
         	$moment = $hopuse[$item['h_useat']].' '.$time." minuten";
--- a/www/prod_print.php	Fri Oct 25 10:12:24 2019 +0200
+++ b/www/prod_print.php	Mon Oct 28 19:55:42 2019 +0100
@@ -277,7 +277,8 @@
 			} else if ($item['h_useat'] == 5) {	// Dryhop
 				$moment = $hopuse[$item['h_useat']].' '.sprintf("%.0f", $time / 1440).' dagen';
 			}
-			$ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $mass, $time, $alpha, $row['ibu_method']);
+			$ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $mass, $time, $alpha,
+				$row['ibu_method'], $row['brew_whirlpool9'], $row['brew_whirlpool7'], $row['brew_whirlpool6']);
 			$total_ibus += $ibu;
 
 			if ($amount > 1)
--- a/www/rec_forum.php	Fri Oct 25 10:12:24 2019 +0200
+++ b/www/rec_forum.php	Mon Oct 28 19:55:42 2019 +0100
@@ -127,7 +127,8 @@
 	$amount = floatval($item['h_amount']) * 1000;
 	$time   = floatval($item['h_time']);
         $alpha  = floatval($item['h_alpha']);
-	$ibu    = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $amount, $time, $alpha, $row['ibu_method']);
+	$ibu    = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $amount, $time, $alpha,
+		$row['ibu_method'], $row['brew_whirlpool9'], $row['brew_whirlpool7'], $row['brew_whirlpool6']);
 	$moment = $hopuse[$item['h_useat']];
         if (($item['h_useat'] == 2) || ($item['h_useat'] == 4)) {    // Boil or Whirlpool
         	$moment = $hopuse[$item['h_useat']].' '.$time." minuten";
--- a/www/rec_print.php	Fri Oct 25 10:12:24 2019 +0200
+++ b/www/rec_print.php	Mon Oct 28 19:55:42 2019 +0100
@@ -230,7 +230,8 @@
 			} else if ($item['h_useat'] == 5) {	// Dryhop
 				$moment  = $hopuse[$item['h_useat']].' '.sprintf("%.0f", $time / 1440).' dagen';
 			}
-			$ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $mass, $time, $alpha, $row['ibu_method']);
+			$ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $mass, $time, $alpha,
+				$row['ibu_method'], $row['brew_whirlpool9'], $row['brew_whirlpool7'], $row['brew_whirlpool6']);
 			$total_ibus += $ibu;
 
 			if ($amount > 1)

mercurial