Prepared for new yeast types.

Thu, 27 Jun 2019 13:50:27 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 27 Jun 2019 13:50:27 +0200
changeset 429
0d2cf505957c
parent 428
a5d4467c9201
child 430
6fa1d64f7f16

Prepared for new yeast types.

README.design file | annotate | diff | comparison | revisions
www/js/global.js file | annotate | diff | comparison | revisions
www/prod_beerxml.php file | annotate | diff | comparison | revisions
www/rec_beerxml.php file | annotate | diff | comparison | revisions
--- a/README.design	Fri Jun 21 16:55:36 2019 +0200
+++ b/README.design	Thu Jun 27 13:50:27 2019 +0200
@@ -13,8 +13,31 @@
 
 Extra:
 
-Gisten diastaticus bit toevoegen.
-Gist typen: kveik en brett? Apart of niet.
+Gisten: = Cultures?
+Extra vlaggen:
+  POF+ (Phenolic Off Flavor Positive) (Ferulic acid to 4-vinyl-guaiacol)
+  glucoamlylase+
+  zymocide+ (K1,K2,K28 or Klus)  (killer yeast gen) (Alleen in wijngist?)
+  sta1 (diastatic)
+  beta glucosidase
+Gist typen: Brettanomyces, Wild yeast, Kviek, Spontaneous.
+
+
+Recept/Product: toevoegen final pH.
+
+Toevoegen Barrel/Oak aging vergisting stap. Wort souring stap.
+
+Add dry-hop toevoegen moment.
+
+Split batch.
+
+Miscs type: add wood.
+
+Hop types: Extract, powder
+
 
 Popups in de editors met rekenhulpjes.
 
+
+https://github.com/beerjson/beerjson
+
--- a/www/js/global.js	Fri Jun 21 16:55:36 2019 +0200
+++ b/www/js/global.js	Thu Jun 27 13:50:27 2019 +0200
@@ -148,6 +148,11 @@
 	{ id: 2, en: 'Wheat',     nl: 'Tarwegist' },
 	{ id: 3, en: 'Wine',      nl: 'Wijngist' },
 	{ id: 4, en: 'Champagne', nl: 'Champagnegist' }
+//	{ id: 5, en: 'Brett',     nl: 'Brett' },
+//	{ id: 6, en: 'Kveik',     nl: 'Kveik' },
+//	{ id: 7, en: 'Mixed',     nl: 'Mixed' },
+//      { id: 8, en: 'Spontaneous', nl: 'Spontaan' },
+//	{ id: 9, en: 'Other',       nl: 'Overig' }
 ];
 var YeastTypeSource = {
 	localdata: YeastTypeData,
@@ -772,20 +777,17 @@
 /*
  * Alcohol By Volume
  */
-function abvol(og, fg) {
+function abvol(og,fg){
 
-	if (((og - fg) < 0) || (fg < 0.9))
+	if(((og-fg)<0)||(fg<0.9))
 		return 0;
 
 	/*
 	 * Formule van Hans Halberstadt. De constante factor is afhankelijk van de
 	 * zwaarte van het wort.
 	 */
-	var factor = og * 3157 * Math.pow(10, -5) + 9.716 * Math.pow(10, -2);
-	var result = (og * 1000 - fg * 1000) * factor;
-
-	console.log("HH abvol("+ og * 1000 + ", "+ fg * 1000 + ") factor:" + factor + " abv:" + result);
-	return result;
+	var factor=og*3157*Math.pow(10,-5)+9.716*Math.pow(10,-2);
+	return (og*1000-fg*1000)*factor;
 
 	/*
 	 * Dit lijkt goed en wordt in veel moderne software gebruikt, maar...
@@ -806,23 +808,22 @@
  * Kleurwerking naar SRM. Niet voor Halberstadt, Naudts
  */
 function kw_to_srm(colormethod, c) {
-
-	if (colormethod == 0)	// Morey
-		return 1.4922 * Math.pow(c, 0.6859);
-	if (colormethod == 1)	// Mosher
-		return 0.3 * c + 4.7;
-	if (colormethod == 2)	// Daniels
-		return 0.2 * c + 8.4;
-	if (colormethod == 3)	// Halberstadt
+	if(colormethod==0)// Morey
+		return 1.4922*Math.pow(c,0.6859);
+	if(colormethod==1)// Mosher
+		return 0.3*c+4.7;
+	if(colormethod==2)// Daniels
+		return 0.2*c+8.4;
+	if(colormethod==3)// Halberstadt
 		return 0;
-	if (colormethod == 4)
+	if(colormethod==4)// Naudts
 		return 0;
 }
 
 
 
 function kw_to_ebc(colormethod, c) {
-	return srm_to_ebc(kw_to_srm(colormethod, c));
+	return srm_to_ebc(kw_to_srm(colormethod,c));
 }
 
 
@@ -1039,10 +1040,17 @@
 	if (attenuation < 30)
 		attenuation = 77;
 
+	// 0.00825 Attenuation factor yeast
+	// 0.00817 Attenuation factor water/grain ration
+	// -0.00684 Attenuation factor mash temperature
+	// 0.00026 Attenuation factor total mash time  (at some places this is 0.0026 this is wrong!)
+	// -0.00356 Attenuation factor percentage crystal malt
+	// 0.00553 Attenuation factor percentage simple sugars
+	// 0.547 Attenuation factor constant
 	var AttBeer = 0.00825 * attenuation + 0.00817 * BD - 0.00684 * Temp + 0.00026 * TotTme - 0.00356 * percCara + 0.00553 * percSugar + 0.547;
 	var fg = Math.round((1 + (1 - AttBeer) * (og - 1)) * 10000) / 10000;
 
-	//console.log("estimate_fg("+percSugar+","+percCara+","+BD+","+TotTme+","+Temp+","+attenuation+","+og+") :"+fg);
+	console.log("estimate_fg("+percSugar+","+percCara+","+BD+","+TotTme+","+Temp+","+attenuation+","+og+") AttBeer:"+AttBeer+" fg:"+fg);
 	return fg;
 }
 
--- a/www/prod_beerxml.php	Fri Jun 21 16:55:36 2019 +0200
+++ b/www/prod_beerxml.php	Thu Jun 27 13:50:27 2019 +0200
@@ -30,7 +30,7 @@
 $hopuse = array( 'Mash', 'First wort', 'Boil', 'Aroma', 'Whirlpool', 'Dry hop' );
 $fermentabletype = array( 'Grain', 'Sugar', 'Extract', 'Dry extract', 'Adjunct' );
 $graintype = array( 'Base', 'Roast', 'Crystal', 'Kilned', 'Sour malt', 'Special', 'No malt' );
-$yeasttype = array( 'Lager', 'Ale', 'Wheat', 'Wine', 'Champagne' );
+$yeasttype = array( 'Lager', 'Ale', 'Wheat', 'Wine', 'Champagne', 'Other', 'Other', 'Other', 'Other', 'Other' );
 $yeastform = array( 'Liquid', 'Dry', 'Slant', 'Culture', 'Frozen', 'Bottle' );
 $yeastuse = array( 'Primary', 'Secondary', 'Tertiary', 'Bottle' );
 $misctype = array( 'Spice', 'Herb', 'Flavor', 'Fining', 'Water agent', 'Yeast nutrient', 'Other' );
--- a/www/rec_beerxml.php	Fri Jun 21 16:55:36 2019 +0200
+++ b/www/rec_beerxml.php	Thu Jun 27 13:50:27 2019 +0200
@@ -30,7 +30,7 @@
 $hopuse = array( 'Mash', 'First wort', 'Boil', 'Aroma', 'Whirlpool', 'Dry hop' );
 $fermentabletype = array( 'Grain', 'Sugar', 'Extract', 'Dry extract', 'Adjunct' );
 $graintype = array( 'Base', 'Roast', 'Crystal', 'Kilned', 'Sour malt', 'Special', 'No malt' );
-$yeasttype = array( 'Lager', 'Ale', 'Wheat', 'Wine', 'Champagne' );
+$yeasttype = array( 'Lager', 'Ale', 'Wheat', 'Wine', 'Champagne', 'Other', 'Other', 'Other', 'Other', 'Other' );
 $yeastform = array( 'Liquid', 'Dry', 'Slant', 'Culture', 'Frozen', 'Bottle' );
 $yeastuse = array( 'Primary', 'Secondary', 'Tertiary', 'Bottle' );
 $misctype = array( 'Spice', 'Herb', 'Flavor', 'Fining', 'Water agent', 'Yeast nutrient', 'Other' );

mercurial