Fri, 18 Jun 2021 21:26:28 +0200
Added a empty second water source to the dropdown for water 2. When the empty water is selected, all volumes are reset to a single water source. Don't show the second water in the printed recipe and checklist if there is only one water source.
11 | 1 | <?php |
2 | ||
83
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
3 | define('EURO', chr(128)); |
243
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
4 | define('DEG', chr(176)); |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
5 | |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
6 | define('SUGARDENSITY', '1.611'); |
83
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
7 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
8 | define('MMCa', '40.048'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
9 | define('MMMg', '24.305'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
10 | define('MMNa', '22.98976928'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
11 | define('MMCl', '35.453'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
12 | define('MMSO4', '96.0626'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
13 | define('MMCO3', '60.01684'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
14 | define('MMHCO3', '61.01684'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
15 | define('MMCaSO4', '172.171'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
16 | define('MMCaCl2', '147.015'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
17 | define('MMCaCO3', '100.087'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
18 | define('MMMgSO4', '246.475'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
19 | define('MMNaHCO3', '84.007'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
20 | define('MMNa2CO3', '105.996'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
21 | define('MMNaCl', '58.443'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
22 | define('MMCaOH2', '74.06268'); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
23 | |
11 | 24 | |
25 | function ebc_to_srm($ebc) | |
26 | { | |
100
08c92cb740b9
Fix for missing coor info on fermentables during recipes import. Log when srm or ebc values are negatie during conversions. Load setup record in global.inc.php and make some variables available for PHP and JS.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
27 | $srm = -1.32303E-12 * pow($ebc, 4) - 0.00000000291515 * pow($ebc, 3) + 0.00000818515 * pow($ebc, 2) + 0.372038 * $ebc + 0.596351; |
08c92cb740b9
Fix for missing coor info on fermentables during recipes import. Log when srm or ebc values are negatie during conversions. Load setup record in global.inc.php and make some variables available for PHP and JS.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
28 | if (($ebc < 0) || ($srm < 0)) |
08c92cb740b9
Fix for missing coor info on fermentables during recipes import. Log when srm or ebc values are negatie during conversions. Load setup record in global.inc.php and make some variables available for PHP and JS.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
29 | syslog(LOG_NOTICE, "ebc_to_srm(".$ebc.") = ".$srm); |
08c92cb740b9
Fix for missing coor info on fermentables during recipes import. Log when srm or ebc values are negatie during conversions. Load setup record in global.inc.php and make some variables available for PHP and JS.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
30 | return $srm; |
11 | 31 | } |
32 | ||
33 | ||
83
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
34 | |
11 | 35 | function srm_to_ebc($srm) |
36 | { | |
37 | // Formule van Adrie Otten. brouwhulp. | |
100
08c92cb740b9
Fix for missing coor info on fermentables during recipes import. Log when srm or ebc values are negatie during conversions. Load setup record in global.inc.php and make some variables available for PHP and JS.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
38 | $ebc = round( 0.000000000176506 * pow($srm, 4) + 0.000000154529 * pow($srm, 3) - 0.000159428 * pow($srm, 2) + 2.68837 * $srm - 1.6004 ); |
08c92cb740b9
Fix for missing coor info on fermentables during recipes import. Log when srm or ebc values are negatie during conversions. Load setup record in global.inc.php and make some variables available for PHP and JS.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
39 | if (($ebc < 0) || ($srm < 0)) |
08c92cb740b9
Fix for missing coor info on fermentables during recipes import. Log when srm or ebc values are negatie during conversions. Load setup record in global.inc.php and make some variables available for PHP and JS.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
40 | syslog(LOG_NOTICE, "srm_to_ebc(".$srm.") = ".$ebc); |
08c92cb740b9
Fix for missing coor info on fermentables during recipes import. Log when srm or ebc values are negatie during conversions. Load setup record in global.inc.php and make some variables available for PHP and JS.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
41 | return $ebc; |
11 | 42 | } |
43 | ||
44 | ||
83
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
45 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
46 | function ebc_to_color($ebc) |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
47 | { |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
48 | return srm_to_color(ebc_to_srm($ebc)); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
49 | } |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
50 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
51 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
52 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
53 | function srm_to_color($srm) |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
54 | { |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
55 | $i = abs($srm * 10); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
56 | if ($i < 0) { |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
57 | $i = 0; |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
58 | } |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
59 | if ($i > 299) { |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
60 | $i = 299; |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
61 | } |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
62 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
63 | /* Table copied from Brouwhulp/BrewBuddy */ |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
64 | $R = array( 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, // 0 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
65 | 250, 250, 250, 250, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, // 2 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
66 | 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, // 4 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
67 | 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 200, 199, 199, 198, 198, // 6 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
68 | 197, 197, 196, 196, 195, 195, 194, 194, 193, 193, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, // 8 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
69 | 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, // 10 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
70 | 192, 192, 192, 192, 192, 192, 192, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, // 12 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
71 | 179, 178, 177, 175, 174, 172, 171, 169, 168, 167, 195, 164, 162, 161, 159, 158, 157, 155, 154, 152, // 14 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
72 | 151, 149, 148, 147, 145, 144, 142, 141, 139, 138, 137, 135, 134, 132, 131, 129, 128, 127, 125, 124, // 16 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
73 | 122, 121, 119, 118, 117, 115, 114, 112, 111, 109, 108, 107, 105, 104, 102, 101, 99, 98, 97, 95, // 18 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
74 | 94, 92, 91, 89, 88, 87, 85, 84, 82, 81, 79, 78, 77, 75, 74, 72, 71, 69, 68, 67, // 20 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
75 | 65, 64, 62, 61, 59, 58, 57, 55, 54, 52, 51, 49, 48, 47, 45, 44, 43, 41, 39, 38, // 22 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
76 | 37, 37, 36, 36, 35, 35, 34, 34, 33, 33, 32, 32, 31, 31, 30, 30, 29, 29, 28, 28, // 24 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
77 | 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 22, 21, 21, 20, 20, 19, 19, 18, 18, // 26 |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
78 | 17, 17, 16, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8 ); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
79 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
80 | $G = array( 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
81 | 250, 250, 250, 250, 250, 250, 249, 248, 247, 246, 245, 244, 242, 240, 238, 236, 234, 232, 230, 228, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
82 | 226, 224, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 198, 196, 194, 192, 190, 188, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
83 | 186, 184, 182, 180, 178, 176, 174, 172, 170, 168, 166, 164, 162, 160, 158, 156, 154, 152, 150, 148, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
84 | 146, 144, 142, 141, 140, 139, 139, 138, 137, 136, 136, 135, 134, 133, 133, 132, 131, 130, 130, 129, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
85 | 128, 127, 127, 126, 125, 124, 124, 123, 122, 121, 121, 120, 119, 118, 118, 117, 116, 115, 115, 114, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
86 | 113, 112, 112, 111, 110, 109, 109, 108, 107, 106, 106, 105, 104, 103, 103, 102, 101, 100, 100, 99, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
87 | 98, 97, 97, 96, 95, 94, 94, 93, 92, 91, 91, 90, 89, 88, 88, 87, 86, 85, 85, 84, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
88 | 83, 82, 82, 81, 80, 79, 78, 77, 76, 75, 75, 74, 73, 72, 72, 71, 70, 69, 69, 68, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
89 | 67, 66, 66, 65, 64, 63, 63, 62, 61, 60, 60, 59, 58, 57, 57, 56, 55, 54, 54, 53, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
90 | 52, 51, 51, 50, 49, 48, 48, 47, 46, 45, 45, 44, 43, 42, 42, 41, 40, 39, 39, 38, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
91 | 37, 36, 36, 35, 34, 33, 33, 32, 31, 30, 30, 29, 28, 27, 27, 26, 25, 24, 24, 23, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
92 | 22, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 16, 16, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
93 | 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
94 | 9, 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3 ); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
95 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
96 | $B = array( 210, 204, 199, 193, 188, 182, 177, 171, 166, 160, 155, 149, 144, 138, 133, 127, 122, 116, 111, 105, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
97 | 100, 94, 89, 83, 78, 72, 67, 61, 56, 50, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
98 | 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
99 | 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
100 | 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
101 | 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
102 | 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
103 | 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
104 | 51, 51, 51, 50, 50, 50, 50, 49, 49, 48, 47, 47, 46, 45, 45, 44, 43, 43, 42, 41, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
105 | 41, 40, 39, 39, 38, 37, 37, 36, 35, 34, 33, 32, 31, 29, 28, 27, 26, 25, 24, 23, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
106 | 21, 20, 19, 18, 17, 16, 15, 13, 12, 11, 10, 9, 8, 9, 9, 10, 10, 11, 11, 12, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
107 | 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
108 | 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 17, 16, 16, 15, 15, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
109 | 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, 9, 9, 8, |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
110 | 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2 ); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
111 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
112 | return array($R[$i],$G[$i],$B[$i]); |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
113 | } |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
114 | |
85521c6e0022
Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
115 | |
85
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
116 | |
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
117 | function sg_to_plato($sg) { |
653
aa25efa1d629
Changed the sg/plato formulas in the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
118 | // if ($sg > 0.5) |
aa25efa1d629
Changed the sg/plato formulas in the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
119 | // return 259 - 259 / $sg; |
aa25efa1d629
Changed the sg/plato formulas in the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
120 | // return 0; |
aa25efa1d629
Changed the sg/plato formulas in the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
121 | return -668.962 + (1262.45 * $sg) - (776.43 * $sg * $sg) + (182.94 * $sg * $sg * $sg); |
85
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
122 | } |
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
123 | |
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
124 | |
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
125 | |
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
126 | function plato_to_sg($plato) { |
653
aa25efa1d629
Changed the sg/plato formulas in the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
127 | // if ($plato < 259) |
aa25efa1d629
Changed the sg/plato formulas in the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
128 | // return 259 / (259 - $plato); |
aa25efa1d629
Changed the sg/plato formulas in the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
129 | // return 1.000; |
aa25efa1d629
Changed the sg/plato formulas in the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
544
diff
changeset
|
130 | return 1.00001 + (0.0038661 * $plato) + (1.3488e-5 * $plato * $plato) + (4.3074e-8 * $plato * $plato * $plato); |
85
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
131 | } |
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
132 | |
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
133 | |
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
134 | |
655
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
653
diff
changeset
|
135 | function calc_svg($og, $fg) { |
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
653
diff
changeset
|
136 | $oe = sg_to_plato($og); |
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
653
diff
changeset
|
137 | $ae = sg_to_plato($fg); |
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
653
diff
changeset
|
138 | return ($oe - $ae) / $oe * 100; |
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
653
diff
changeset
|
139 | } |
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
653
diff
changeset
|
140 | |
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
653
diff
changeset
|
141 | |
f4e00869f39f
Calculate the svg using Brew by the Numbers, Micahel L. Hall.
Michiel Broek <mbroek@mbse.eu>
parents:
653
diff
changeset
|
142 | |
85
ca7a37586551
Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
83
diff
changeset
|
143 | /* |
87
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
144 | * sugars is the total extract weight of sugars. |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
145 | */ |
96
107c12c3e49d
Renamed estimate_og() to estimate_sg() formula. Updated the formulas in javascript. The calcFermenter() function now only calculates the gravities. The colors still need to be added. When a recept is loaded in the editor, all tabs are selected once to load all subgrid data. Ugly and slow but it at least it works.
Michiel Broek <mbroek@mbse.eu>
parents:
94
diff
changeset
|
146 | function estimate_sg($sugars, $batch_size) { |
87
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
147 | $plato = 100 * $sugars / $batch_size; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
148 | $sg = plato_to_sg($plato); |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
149 | |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
150 | /* Average loops, HansH 5x. Brouwhulp 20x, about 10x is enough so keep 20. */ |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
151 | for ($i = 0; $i < 20; $i++) { |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
152 | if ($sg > 0) |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
153 | $plato = 100 * $sugars / ($batch_size * $sg); |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
154 | $sg = plato_to_sg($plato); |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
155 | } |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
156 | return $sg; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
157 | } |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
158 | |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
159 | |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
160 | |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
161 | function estimate_fg($percSugar, $percCara, $WGratio, $TotTme, $Temp, $attenuation, $og) { |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
162 | if ($percSugar > 40) |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
163 | $percSugar = 0; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
164 | if ($percCara > 50) |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
165 | $percCara = 0; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
166 | if (($WGratio > 0) && ($TotTme > 0)) { |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
167 | $BD = $WGratio; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
168 | $BD = max(2, min(5.5, $BD)); |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
169 | $Temp = max(60, min(72, $Temp)); |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
170 | } else { |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
171 | $BD = 3.5; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
172 | $Temp = 67; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
173 | $TotTme = 75; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
174 | } |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
175 | if ($attenuation < 30) |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
176 | $attenuation = 77; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
177 | |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
178 | $AttBeer = 0.00825 * $attenuation + 0.00817 * $BD - 0.00684 * $Temp + 0.00026 * $TotTme - 0.00356 * $percCara + 0.00553 * $percSugar + 0.547; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
179 | $fg = 1 + (1 - $AttBeer) * ($og - 1); |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
180 | return $fg; |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
181 | } |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
182 | |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
183 | |
7f1d0abe5571
OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents:
85
diff
changeset
|
184 | |
88 | 185 | function abvol($og, $fg) { |
328
019736440468
The abvol calculation uses the formule by Hans Halberstadt.
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
186 | $factor = $og * 3157 * pow(10, -5) + 9.716 * pow(10, -2); |
019736440468
The abvol calculation uses the formule by Hans Halberstadt.
Michiel Broek <mbroek@mbse.eu>
parents:
243
diff
changeset
|
187 | return ($og * 1000 - $fg * 1000) * $factor; |
88 | 188 | } |
189 | ||
190 | ||
89
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
191 | /* |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
192 | * Kleurwerking naar SRM |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
193 | */ |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
194 | function kw_to_srm($colormethod, $c) { |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
195 | |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
196 | if ($colormethod == 0) // Morey |
91
44981507b781
Morey color method more precise.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
197 | return 1.4922 * pow($c, 0.6859); |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
198 | if ($colormethod == 1) // Mosher |
89
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
199 | return 0.3 * $c + 4.7; |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
200 | if ($colormethod == 2) // Daniels |
89
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
201 | return 0.2 * $c + 8.4; |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
202 | } |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
203 | |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
204 | |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
205 | |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
206 | function kw_to_ebc($colormethod, $c) { |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
207 | return srm_to_ebc(kw_to_srm($colormethod, $c)); |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
208 | } |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
209 | |
082c23b26055
Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents:
88
diff
changeset
|
210 | |
88 | 211 | |
539
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
212 | function calc_IBU($useat, $form, $sg, $volume, $mass, $boiltime, $alpha, $method, $whirlpool9, $whirlpool7, $whirlpool6) |
101
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
213 | { |
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
214 | global $my_factor_mashhop; |
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
215 | global $my_factor_fwh; |
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
216 | global $my_factor_pellet; |
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
217 | global $my_factor_plug; |
446 | 218 | global $my_factor_wethop; |
219 | global $my_factor_cryohop; | |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
220 | |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
221 | $fmoment = 1.0; |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
222 | if (($useat == 5) || ($useat == 4) || ($useat == 3)) { // Dry hop, Whirlpool or Aroma |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
223 | $fmoment = 0.0; |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
224 | } else if ($useat == 0) { // Mash |
101
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
225 | $fmoment += $my_factor_mashhop / 100; // Brouwhulp |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
226 | } else if ($useat == 1) { // First wort |
101
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
227 | $fmoment += $my_factor_fwh / 100; // Brouwhulp, Louis, Ozzie |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
228 | } |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
229 | |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
230 | $pfactor = 1.0; |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
231 | if ($form == 0) { // Pellets |
101
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
232 | $pfactor += $my_factor_pellet / 100; |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
233 | } |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
234 | if ($form == 1) { // Plugs |
101
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
235 | $pfactor += $my_factor_plug / 100; |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
236 | } |
446 | 237 | if ($form == 3) { // Wet leaf |
238 | $pfactor += $my_factor_wethop / 100; | |
239 | } | |
240 | if ($form == 4) { // Cryo hop | |
241 | $pfactor += $my_factor_cryohop / 100; | |
242 | } | |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
243 | |
539
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
244 | $whirlibus = 0; |
544
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
245 | if ($useat == 3 || $useat == 4) { // Flameout or any whirlpool |
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
246 | if ($whirlpool9) { |
539
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
247 | $whirlibus += ($mass * ($alpha / 100) * 20) / $volume * $whirlpool9 / 50; |
544
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
248 | } else { |
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
249 | if ($useat == 3) // Flameout hops are 2 minutes in this range. |
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
250 | $whirlibus += ($mass * ($alpha / 100) * 20) / $volume * (2 / 50); |
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
251 | } |
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
252 | if ($whirlpool7) { |
539
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
253 | $whirlibus += ($mass * ($alpha / 100) * 6) / $volume * $whirlpool7 / 50; |
544
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
254 | } else { |
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
255 | if ($useat == 3) // Flameout hops are 4 minutes in this range. |
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
256 | $whirlibus += ($mass * ($alpha / 100) * 6) / $volume * (4 / 50); |
f3faa54581ff
Better way to show splitted batches. Added flameout calculations to the php scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
539
diff
changeset
|
257 | } |
539
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
258 | if ($whirlpool6) |
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
259 | $whirlibus += ($mass * ($alpha / 100) * 2) / $volume * $whirlpool6 / 50; |
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
260 | } |
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
261 | |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
262 | $ibu = 0; |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
263 | if (($method == 0) || ($method == 3)) { // Tinseth or Garetz // For Garetz, we need the $ibu |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
264 | $AddedAlphaAcids = (($alpha / 100) * $mass * 1000) / $volume; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
265 | $Bigness_factor = 1.65 * pow( 0.000125, $sg - 1); |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
266 | $BoilTime_factor = ((1 - exp(-0.04 * $boiltime)) / 4.15); |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
267 | $utiisation = $Bigness_factor * $BoilTime_factor; |
539
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
268 | $ibu = (round(($utiisation * $AddedAlphaAcids * $fmoment * $pfactor + $whirlibus) * 10) / 10.0); |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
269 | } |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
270 | if ($method == 2) { // Daniels |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
271 | |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
272 | if ($form == 2) // Leaf |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
273 | $boilfactor = -(0.0041*$boiltime*$boiltime)+(0.6162*$boiltime)+1.5779; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
274 | else |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
275 | $boilfactor = -(0.0051*$boiltime*$boiltime)+(0.7835*$boiltime)+1.9348; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
276 | if ($sg < 1.050) |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
277 | $sgfactor = 0; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
278 | else |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
279 | $sgfactor = (($sg * 1000) - 1050) / 200; |
539
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
280 | $ibu = $fmoment * (($mass * $alpha * $boilfactor * 0.1) / ($volume * (1 + $sgfactor))) + $whirlibus; |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
281 | } |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
282 | if ($method == 1) { // Rager |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
283 | $boilfactor = $fmoment * 18.11 + 13.86 * tanh(($boiltime * 31.32) / 18.27); |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
284 | if ($sg < 1.050) |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
285 | $sgfactor = 0; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
286 | else |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
287 | $sgfactor = (($sg * 1000) - 1050) / 200; |
539
fe9ac6d49c4f
Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents:
446
diff
changeset
|
288 | $ibu = ($mass * $alpha * $boilfactor * 0.1) / ($volume * (1 + $sgfactor)) + $whirlibus; |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
289 | } |
231
9881453a49b3
Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents:
164
diff
changeset
|
290 | if ($method == 3) { // Garetz, not in use. |
90
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
291 | /* Something is wrong, late hops and dryhops give negative results. */ |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
292 | $boilfactor = $fmoment * 6.03253 + 16.5289 * tanh(($boiltime - 19.17323) / 26.8013); |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
293 | $cfactor = $volume / (1.1 * $volume); // ConcentratieFactor = (Volume na koelen) / (Volume bij Koken) |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
294 | $kookdichtheid = ($cfactor * (($sg * 1000) - 1000) / 1000) + 1; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
295 | $sgfactor = ($kookdichtheid - 1.05) / 0.2 + 1; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
296 | $hopratefactor = (($cfactor * $ibu) / 260) + 1; // $ibu is Tinseth bitterness. Weird. |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
297 | $tempfactor = (32.8/550)*0.02+1; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
298 | $ibu = ($boilfactor * $alpha * $mass * 0.1) / ($volume * $sgfactor * $hopratefactor * $tempfactor); |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
299 | } |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
300 | return $ibu; |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
301 | } |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
302 | |
d4246abee34e
IBU calculation moved to formulas.php and added Daniels and Rager methods.
Michiel Broek <mbroek@mbse.eu>
parents:
89
diff
changeset
|
303 | |
94
295c3af2a421
Include boil_size field in the recipes table. Calculate pre-boil SG. Use that in the IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
91
diff
changeset
|
304 | |
243
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
305 | function kettle_cm($vol, $kettle_vol, $kettle_height) { |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
306 | |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
307 | if (($vol > 0) && ($kettle_vol > 0) && ($vol <= $kettle_vol)) |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
308 | return 100 * ((1 - $vol / $kettle_vol) * $kettle_height); |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
309 | return 0; |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
310 | } |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
311 | |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
312 | |
b43214d218c0
In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents:
231
diff
changeset
|
313 | |
392
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
314 | function density_str($sg) { |
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
315 | |
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
316 | global $my_brix_correction; |
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
317 | $plato = sg_to_plato(floatval($sg)); |
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
318 | $brix = $plato * $my_brix_correction; |
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
319 | return sprintf("%.3f", floatval($sg))." SG ".sprintf("%.1f",$brix).DEG.'Brix '.sprintf("%.1f",$plato).DEG.'P'; |
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
320 | } |
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
321 | |
544d7d0183b2
Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents:
328
diff
changeset
|
322 | |
11 | 323 | ?> |