Added Cryo Hops type.

Wed, 21 Aug 2019 16:28:54 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 21 Aug 2019 16:28:54 +0200
changeset 446
ee7bcfb8e270
parent 445
bcba4f17703f
child 447
91c3d2f6de88

Added Cryo Hops type.

www/includes/db_setup.php file | annotate | diff | comparison | revisions
www/includes/formulas.php file | annotate | diff | comparison | revisions
www/includes/global.inc.php file | annotate | diff | comparison | revisions
www/js/global.js file | annotate | diff | comparison | revisions
www/js/profile_setup.js file | annotate | diff | comparison | revisions
www/profile_setup.php file | annotate | diff | comparison | revisions
--- a/www/includes/db_setup.php	Wed Aug 21 14:03:08 2019 +0200
+++ b/www/includes/db_setup.php	Wed Aug 21 16:28:54 2019 +0200
@@ -28,6 +28,7 @@
 	$sql .= "', factor_pellet='" . $_POST['factor_pellet'];
 	$sql .= "', factor_plug='" . $_POST['factor_plug'];
 	$sql .= "', factor_wethop='" . $_POST['factor_wethop'];
+	$sql .= "', factor_cryohop='" . $_POST['factor_cryohop'];
 	$sql .= "', color_method='" . $_POST['color_method'];
 	$sql .= "', ibu_method='" . $_POST['ibu_method'];
 	$sql .= "', brix_correction='" . $_POST['brix_correction'];
@@ -58,6 +59,7 @@
 		$data .= ',"factor_pellet":' . $row['factor_pellet'];
 		$data .= ',"factor_plug":' . $row['factor_plug'];
 		$data .= ',"factor_wethop":' . $row['factor_wethop'];
+		$data .= ',"factor_cryohop":' . $row['factor_cryohop'];
 		$data .= ',"ibu_method":' . $row['ibu_method'];
 		$data .= ',"color_method":' . $row['color_method'];
 		$data .= ',"brix_correction":' . floatval($row['brix_correction']);
--- a/www/includes/formulas.php	Wed Aug 21 14:03:08 2019 +0200
+++ b/www/includes/formulas.php	Wed Aug 21 16:28:54 2019 +0200
@@ -208,6 +208,8 @@
 	global $my_factor_fwh;
 	global $my_factor_pellet;
 	global $my_factor_plug;
+	global $my_factor_wethop;
+	global $my_factor_cryohop;
 
 	$fmoment  = 1.0;
 	if (($useat == 5) || ($useat == 4) || ($useat == 3)) {	// Dry hop, Whirlpool or Aroma
@@ -225,6 +227,12 @@
 	if ($form == 1) {	// Plugs
 		$pfactor += $my_factor_plug / 100;
 	}
+	if ($form == 3) {       // Wet leaf
+                $pfactor += $my_factor_wethop / 100;
+        }
+	if ($form == 4) {       // Cryo hop
+                $pfactor += $my_factor_cryohop / 100;
+        }
 
 	$ibu = 0;
 	if (($method == 0) || ($method == 3)) {	// Tinseth or Garetz // For Garetz, we need the $ibu
--- a/www/includes/global.inc.php	Wed Aug 21 14:03:08 2019 +0200
+++ b/www/includes/global.inc.php	Wed Aug 21 16:28:54 2019 +0200
@@ -1,6 +1,6 @@
 <?php
 /*****************************************************************************
- * Copyright (C) 2014-2018
+ * Copyright (C) 2014-2019
  *   
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -66,7 +66,7 @@
 }
 mysqli_set_charset($connect, "utf8" );
 $my_default_water = $my_brewery_name = $my_ibu_method = $my_color_method = '';
-$my_factor_mashhop = $my_factor_fwh = $my_factor_pellet = $my_factor_plug = $my_factor_wethop = 0;
+$my_factor_mashhop = $my_factor_fwh = $my_factor_pellet = $my_factor_plug = $my_factor_wethop = $my_factor_cryohop = 0;
 $my_brix_correction = $my_grain_absorbtion = 1.0;
 
 $result = mysqli_query($connect, "SELECT * FROM profile_setup WHERE record='1'") or die("SQL Error 1: " . mysqli_error($connect));
@@ -81,6 +81,7 @@
 	$my_factor_pellet= floatval($row['factor_pellet']);
 	$my_factor_plug= floatval($row['factor_plug']);
 	$my_factor_wethop = floatval($row['factor_wethop']);
+	$my_factor_cryohop = floatval($row['factor_cryohop']);
 	$my_ibu_method = $row['ibu_method'];
 	$my_color_method = $row['color_method'];
 	$my_brix_correction = floatval($row['brix_correction']);
@@ -104,6 +105,7 @@
 	global $my_factor_pellet;
 	global $my_factor_plug;
 	global $my_factor_wethop;
+	global $my_factor_cryohop;
 	global $my_ibu_method;
 	global $my_color_method;
 	global $my_brix_correction;
@@ -133,6 +135,7 @@
 	var my_factor_pellet = "<?php echo $my_factor_pellet; ?>";
 	var my_factor_plug = "<?php echo $my_factor_plug; ?>";
 	var my_factor_wethop = "<?php echo $my_factor_wethop; ?>";
+	var my_factor_cryohop = "<?php echo $my_factor_cryohop; ?>";
 	var my_ibu_method = "<?php echo $my_ibu_method; ?>";
 	var my_color_method = "<?php echo $my_color_method; ?>";
 	var my_brix_correction = "<?php echo $my_brix_correction; ?>";
--- a/www/js/global.js	Wed Aug 21 14:03:08 2019 +0200
+++ b/www/js/global.js	Wed Aug 21 16:28:54 2019 +0200
@@ -118,7 +118,8 @@
 	{ id: 0, en: 'Pellet',   nl: 'Pellets' },
 	{ id: 1, en: 'Plug',     nl: 'Plugs' },
 	{ id: 2, en: 'Leaf',     nl: 'Bloemen' },
-	{ id: 3, en: 'Leaf wet', nl: 'Hop nat' }
+	{ id: 3, en: 'Leaf wet', nl: 'Hop nat' },
+	{ id: 4, en: 'Cryo',     nl: 'Cryo' }
 ];
 var HopFormSource = {
 	localdata: HopFormData,
@@ -869,6 +870,9 @@
 if(Form==3){// Wet leaf
 pfactor+=my_factor_wethop/100;// From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py
 }
+if(Form==4){// Cryo hop
+pfactor+=my_factor_cryohop/100;
+}
 
 	if(Method==0){// Tinseth
 		/* http://realbeer.com/hops/research.html */
--- a/www/js/profile_setup.js	Wed Aug 21 14:03:08 2019 +0200
+++ b/www/js/profile_setup.js	Wed Aug 21 16:28:54 2019 +0200
@@ -46,6 +46,7 @@
 	$("#factor_pellet").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van hop pellets.' });
 	$("#factor_plug").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van hop plugs.' });
 	$("#factor_wethop").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van nat geplukte hop.' });
+	$("#factor_cryohop").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van Cryo Hop&reg;.' });
 	$("#brix_correction").jqxTooltip({ content: 'Omzettingsfactor voor Plato naar Brix' });
 	$("#grain_absorbtion").jqxTooltip({ content: 'Absorbtie van water door graan (L/Kg)' });
 
@@ -61,6 +62,7 @@
 			{ name: 'factor_pellet', type: 'number' },
 			{ name: 'factor_plug', type: 'number' },
 			{ name: 'factor_wethop', type: 'number' },
+			{ name: 'factor_cryohop', type: 'number' },
 			{ name: 'ibu_method', type: 'int' },
 			{ name: 'color_method', type: 'int' },
 			{ name: 'brix_correction', type: 'float' },
@@ -81,6 +83,7 @@
 			$("#factor_pellet").val(dataRecord.factor_pellet);
 			$("#factor_plug").val(dataRecord.factor_plug);
 			$("#factor_wethop").val(dataRecord.factor_wethop);
+			$("#factor_cryohop").val(dataRecord.factor_cryohop);
 			$("#color_method").val(dataRecord.color_method);
 			$("#ibu_method").val(dataRecord.ibu_method);
 			$("#brix_correction").val(dataRecord.brix_correction);
@@ -98,6 +101,7 @@
 	$("#factor_pellet").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right'  });
 	$("#factor_plug").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right'  });
 	$("#factor_wethop").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -98, max: -20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right'  });
+	$("#factor_cryohop").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -20, max: 150, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right'  });
 	$("#brix_correction").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1.00, max: 1.05, decimalDigits: 2, spinButtons: true });
 	$("#grain_absorbtion").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0.5, max: 1.1, decimalDigits: 2, spinButtons: true });
 	$("#color_method").jqxDropDownList({
@@ -139,6 +143,7 @@
 			factor_pellet: $("#factor_pellet").val(),
 			factor_plug: $("#factor_plug").val(),
 			factor_wethop: $("#factor_wethop").val(),
+			factor_cryohop: $("#factor_cryohop").val(),
 			color_method: $("#color_method").val(),
 			ibu_method: $("#ibu_method").val(),
 			brix_correction: parseFloat($("#brix_correction").jqxNumberInput('decimal')),
--- a/www/profile_setup.php	Wed Aug 21 14:03:08 2019 +0200
+++ b/www/profile_setup.php	Wed Aug 21 16:28:54 2019 +0200
@@ -21,30 +21,36 @@
       <tr>
        <td style="vertical-align: top; float: right; padding: 3px;">First Wort Hop factor:</td>
        <td style="padding: 3px;"><div id="factor_fwh"></div></td>
-       <td style="vertical-align: top; float: right; padding: 3px;">Maischhop factor:</td>
-       <td style="padding: 3px;"><div id="factor_mashhop"></div></td>
+       <td style="vertical-align: top; float: right; padding: 3px;">Graan absorbtie:</td>
+       <td style="padding: 3px;"><div id="grain_absorbtion"></div></td>
        <td style="vertical-align: top; float: right; padding: 3px;">Kleur methode:</td>
        <td style="padding: 3px;"><div style="float: left;" id="color_method"></div></td>
       </tr>
       <tr>
-       <td style="vertical-align: top; float: right; padding: 3px;">Pellet factor:</td>
-       <td style="padding: 3px;"><div id="factor_pellet"></div></td>
-       <td style="vertical-align: top; float: right; padding: 3px;">Plug factor:</td>
-       <td style="padding: 3px;"><div id="factor_plug"></div></td>
+       <td style="vertical-align: top; float: right; padding: 3px;">Maischhop factor:</td>
+       <td style="padding: 3px;"><div id="factor_mashhop"></div></td>
+       <td style="vertical-align: top; float: right; padding: 3px;">Brix correctie factor:</td>
+       <td style="padding: 3px;"><div id="brix_correction"></div></td>
        <td style="vertical-align: top; float: right; padding: 3px;">Bitterheid methode:</td>
        <td style="padding: 3px;"><div style="float: left;" id="ibu_method"></div></td>
       </tr>
       <tr>
-       <td style="vertical-align: top; float: right; padding: 3px;">Wet hop factor:</td>
-       <td style="padding: 3px;"><div id="factor_wethop"></div></td>
-       <td style="vertical-align: top; float: right; padding: 3px;">Graan absorbtie:</td>
-       <td style="padding: 3px;"><div id="grain_absorbtion"></div></td>
+       <td style="vertical-align: top; float: right; padding: 3px;">Pellet factor:</td>
+       <td colspan="3" style="padding: 3px;"><div id="factor_pellet"></div></td>
        <td style="vertical-align: top; float: right; padding: 3px;">Standaard water:</td>
        <td style="padding: 3px;"><div style="float: left;" id="default_water"></div></td>
       </tr>
       <tr>
-       <td style="vertical-align: top; float: right; padding: 3px;">Brix correctie factor:</td>
-       <td colspan="5" style="padding: 3px;"><div id="brix_correction"></div></td>
+       <td style="vertical-align: top; float: right; padding: 3px;">Hop plug factor:</td>
+       <td colspan="5" style="padding: 3px;"><div id="factor_plug"></div></td>
+      </tr>
+      <tr>
+       <td style="vertical-align: top; float: right; padding: 3px;">Wet hop factor:</td>
+       <td colspan="5" style="padding: 3px;"><div id="factor_wethop"></div></td>
+      </tr>
+      <tr>
+       <td style="vertical-align: top; float: right; padding: 3px;">Cryo Hop&reg; factor:</td>
+       <td colspan="5" style="padding: 3px;"><div id="factor_cryohop"></div></td>
       </tr>
      </table>
      <div style="float: right; margin-top: 330px; margin-bottom: 10px;">

mercurial