195 return srm_to_ebc(kw_to_srm($colormethod, $c)); |
195 return srm_to_ebc(kw_to_srm($colormethod, $c)); |
196 } |
196 } |
197 |
197 |
198 |
198 |
199 |
199 |
200 function calc_IBU($useat, $form, $sg, $volume, $mass, $boiltime, $alpha, $method) { |
200 function calc_IBU($useat, $form, $sg, $volume, $mass, $boiltime, $alpha, $method) |
|
201 { |
|
202 global $my_factor_mashhop; |
|
203 global $my_factor_fwh; |
|
204 global $my_factor_pellet; |
|
205 global $my_factor_plug; |
201 |
206 |
202 $fmoment = 1.0; |
207 $fmoment = 1.0; |
203 if (($useat == "Dry Hop") || ($useat == "Dry hop") || ($useat == "Whirlpool") || ($useat == "Aroma")) { |
208 if (($useat == "Dry Hop") || ($useat == "Dry hop") || ($useat == "Whirlpool") || ($useat == "Aroma")) { |
204 $fmoment = 0.0; |
209 $fmoment = 0.0; |
205 } else if ($useat == "Mash") { |
210 } else if ($useat == "Mash") { |
206 $fmoment += /* Settings.MashHopFactor.Value = -30% */ -30 / 100; // Brouwhulp |
211 $fmoment += $my_factor_mashhop / 100; // Brouwhulp |
207 } else if (($useat == "First Wort") || ($useat == "First wort")) { |
212 } else if (($useat == "First Wort") || ($useat == "First wort")) { |
208 $fmoment += /* Settings.FWHFactor.Value = 10% */ 10 / 100; // Brouwhulp, Louis, Ozzie |
213 $fmoment += $my_factor_fwh / 100; // Brouwhulp, Louis, Ozzie |
209 } |
214 } |
210 |
215 |
211 $pfactor = 1.0; |
216 $pfactor = 1.0; |
212 if ($form == "Pellet") { |
217 if ($form == "Pellet") { |
213 $pfactor += /* Settings.PelletFactor.Value = 10% */ 10 / 100; |
218 $pfactor += $my_factor_pellet / 100; |
214 } |
219 } |
215 if ($form == "Plug") { |
220 if ($form == "Plug") { |
216 $pfactor += /* Settings.PlugFactor.Value = 2% */ 2 / 100; |
221 $pfactor += $my_factor_plug / 100; |
217 } |
222 } |
218 |
223 |
219 $ibu = 0; |
224 $ibu = 0; |
220 if (($method == "Tinseth") || ($method == "Garetz")) { // For Garetz, we need the $ibu |
225 if (($method == "Tinseth") || ($method == "Garetz")) { // For Garetz, we need the $ibu |
221 $AddedAlphaAcids = (($alpha / 100) * $mass * 1000) / $volume; |
226 $AddedAlphaAcids = (($alpha / 100) * $mass * 1000) / $volume; |