The checklist now shows the pre-boil gravity.

Wed, 06 Feb 2019 20:38:14 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 06 Feb 2019 20:38:14 +0100
changeset 247
792b5ba77a1f
parent 246
8580a08cbaa7
child 248
cd98a44a9f1b

The checklist now shows the pre-boil gravity.

www/prod_print.php file | annotate | diff | comparison | revisions
--- a/www/prod_print.php	Wed Feb 06 19:29:45 2019 +0100
+++ b/www/prod_print.php	Wed Feb 06 20:38:14 2019 +0100
@@ -511,6 +511,7 @@
 
 		$this->Checkheader('Maischen');
 		$mvol = 0;
+		$msugars = 0;	// mash sugars
 		$grainabsortion = 0;
 		$arr = json_decode($row['json_mashs'], true);
 		if (count($arr) > 0) {
@@ -551,19 +552,18 @@
 				$loop++;
 			}
 			$est_mash_sg = 0;
-			$s = 0;
 			$ferms = json_decode($row['json_fermentables'], true);
 			foreach($ferms as $item) {
 				if ($item['f_added'] == 0) {
 					$d = $item['f_amount'] * ($item['f_yield'] / 100) * (1 - $item['f_moisture'] / 100);
 					$mvol += $item['f_amount'] * $item['f_moisture'] / 100;
 					$grainabsorbtion += $my_grain_absorbtion * $item['f_amount'];
-					$s += $d;
+					$msugars += $d;
 				}
 			}
 			$sugardensity = 1.611;
-			$v = $s / $sugardensity + $mvol;
-			$plato = 1000 * $s / ($v * 10);	// deg. Plato
+			$v = $msugars / $sugardensity + $mvol;
+			$plato = 1000 * $msugars / ($v * 10);	// deg. Plato
 			$mash_sg = plato_to_sg($plato);
 			$brix = $plato * $my_brix_correction;
 			$s = 'doel sg eind maischen: '.sprintf("%.3f",$mash_sg);
@@ -585,7 +585,11 @@
 		$s = 'doelvolume in kookketel: '.sprintf("%.1f",$row['boil_size'] * 1.04).' liter (';
 		$s .= sprintf("%.1f",kettle_cm($row['boil_size'] * 1.04,$row['eq_kettle_volume'],$row['eq_kettle_height'])).' cm onder de rand)';
 		$this->Checkline($s);
-// TODO: doel SG in kookketel: 1.053 SG (13.4 Brix, 13.0 P)
+		$pre_sg = estimate_sg($msugars * floatval($row['efficiency']) / 100,floatval($row['boil_size']));
+		$plato = sg_to_plato($pre_sg);
+		$brix = $plato * $my_brix_correction;
+		$s = 'doel SG in kookketel: '.sprintf("%.3f",$pre_sg).' SG ('.sprintf("%.1f",$brix).' '.DEG.'Brix, '.sprintf("%.1f",$plato).' '.DEG.'P)';
+		$this->Checkline($s);
 		$hops = json_decode($row['json_hops'], true);
 		foreach($hops as $item2) {
 			if ($item2['h_useat'] == 1) {
@@ -645,7 +649,7 @@
 		$plato = sg_to_plato($row['est_og']);
 		$brix = $plato * $my_brix_correction;
 		$s = 'doel SG einde koken: '.sprintf("%.3f",$row['est_og']).' SG (';
-		$s .= sprintf("%.1f",$brix).' '.DEG.'Brix, '.sprintf("%.1f",$plato).' '.DEG.'P)'.$this->GetY();
+		$s .= sprintf("%.1f",$brix).' '.DEG.'Brix, '.sprintf("%.1f",$plato).' '.DEG.'P)';
 		$this->Checkline($s);
 		if ($this->GetY() > 200)
 			$this->AddPage();

mercurial