Sun, 16 Dec 2018 12:40:04 +0100
Moved inventory dropdown lists to global.js
13 | 1 | /***************************************************************************** |
144
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
13 | 3 | * |
4 | * Michiel Broek <mbroek at mbse dot eu> | |
5 | * | |
6 | * This file is part of BrewCloud | |
7 | * | |
8 | * This is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public License as published by the | |
10 | * Free Software Foundation; either version 2, or (at your option) any | |
11 | * later version. | |
12 | * | |
13 | * BrewCloud is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
21 | *****************************************************************************/ | |
22 | ||
23 | ||
121
875aeb365e1c
Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
24 | var sugardensity = 1.611; //kg/l in solution |
875aeb365e1c
Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
25 | |
144
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
26 | // Styles dropdown list |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
27 | var stylesUrl = "includes/db_profile_styles.php"; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
28 | var stylesSource = { |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
29 | datatype: "json", |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
30 | datafields: [ |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
31 | { name: 'record', type: 'number' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
32 | { name: 'name', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
33 | { name: 'category', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
34 | { name: 'category_number', type: 'number' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
35 | { name: 'style_letter', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
36 | { name: 'style_guide', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
37 | { name: 'type', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
38 | { name: 'og_min', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
39 | { name: 'og_max', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
40 | { name: 'fg_min', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
41 | { name: 'fg_max', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
42 | { name: 'ibu_min', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
43 | { name: 'ibu_max', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
44 | { name: 'color_min', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
45 | { name: 'color_max', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
46 | { name: 'carb_min', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
47 | { name: 'carb_max', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
48 | { name: 'abv_min', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
49 | { name: 'abv_max', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
50 | { name: 'notes', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
51 | { name: 'profile', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
52 | { name: 'ingredients', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
53 | { name: 'examples', type: 'string' } |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
54 | ], |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
55 | url: stylesUrl, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
56 | async: true |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
57 | }; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
58 | var styleslist = new $.jqx.dataAdapter(stylesSource); |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
59 | |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
60 | // dropdownlist datasource from inventory_fermentables |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
61 | var fermentableUrl = "getfermentablesources.php"; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
62 | var fermentableInvSource = { |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
63 | datatype: "json", |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
64 | datafields: [ |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
65 | { name: 'record', type: 'number' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
66 | { name: 'name', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
67 | { name: 'type', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
68 | { name: 'yield', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
69 | { name: 'color', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
70 | { name: 'add_after_boil', type: 'bool' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
71 | { name: 'origin', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
72 | { name: 'supplier', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
73 | { name: 'coarse_fine_diff', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
74 | { name: 'moisture', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
75 | { name: 'diastatic_power', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
76 | { name: 'protein', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
77 | { name: 'max_in_batch', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
78 | { name: 'recommend_mash', type: 'bool' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
79 | { name: 'graintype', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
80 | { name: 'di_ph', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
81 | { name: 'inventory', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
82 | { name: 'cost', type: 'float' } |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
83 | ], |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
84 | url: fermentableUrl, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
85 | async: true |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
86 | }; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
87 | var fermentablelist = new $.jqx.dataAdapter(fermentableInvSource); |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
88 | |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
89 | // dropdownlist datasource from inventory_hops |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
90 | var hopUrl = "gethopsources.php"; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
91 | var hopInvSource = { |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
92 | datatype: "json", |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
93 | datafields: [ |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
94 | { name: 'record', type: 'number' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
95 | { name: 'name', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
96 | { name: 'origin', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
97 | { name: 'type', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
98 | { name: 'alpha', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
99 | { name: 'beta', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
100 | { name: 'humulene', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
101 | { name: 'caryophyllene', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
102 | { name: 'cohumulone', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
103 | { name: 'myrcene', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
104 | { name: 'hsi', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
105 | { name: 'useat', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
106 | { name: 'form', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
107 | { name: 'total_oil', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
108 | { name: 'cost', type: 'float' } |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
109 | ], |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
110 | url: hopUrl, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
111 | async: true |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
112 | }; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
113 | var hoplist = new $.jqx.dataAdapter(hopInvSource); |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
114 | |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
115 | // dropdownlist datasource from inventory_miscs |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
116 | var miscUrl = "getmiscsources.php"; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
117 | var miscInvSource = { |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
118 | datatype: "json", |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
119 | datafields: [ |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
120 | { name: 'record', type: 'number' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
121 | { name: 'name', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
122 | { name: 'type', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
123 | { name: 'use_use', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
124 | { name: 'amount_is_weight', type: 'bool' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
125 | { name: 'time', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
126 | { name: 'cost', type: 'float' } |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
127 | ], |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
128 | url: miscUrl, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
129 | async: true |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
130 | }; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
131 | var misclist = new $.jqx.dataAdapter(miscInvSource); |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
132 | |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
133 | // dropdownlist datasource from inventory_yeasts |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
134 | var yeastUrl = "getyeastsources.php"; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
135 | var yeastInvSource = { |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
136 | datatype: "json", |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
137 | datafields: [ |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
138 | { name: 'record', type: 'number' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
139 | { name: 'name', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
140 | { name: 'type', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
141 | { name: 'form', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
142 | { name: 'laboratory', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
143 | { name: 'product_id', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
144 | { name: 'min_temperature', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
145 | { name: 'max_temperature', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
146 | { name: 'attenuation', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
147 | { name: 'cost', type: 'float' } |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
148 | ], |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
149 | url: yeastUrl, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
150 | async: true |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
151 | }; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
152 | var yeastlist = new $.jqx.dataAdapter(yeastInvSource); |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
153 | |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
154 | // dropdownlist datasource from inventory_waters |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
155 | var waterUrl = "getwatersources.php"; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
156 | var waterInvSource = { |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
157 | datatype: "json", |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
158 | datafields: [ |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
159 | { name: 'record', type: 'number' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
160 | { name: 'name', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
161 | { name: 'unlimited_stock', type: 'bool' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
162 | { name: 'calcium', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
163 | { name: 'sulfate', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
164 | { name: 'chloride', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
165 | { name: 'sodium', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
166 | { name: 'magnesium', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
167 | { name: 'ph', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
168 | { name: 'total_alkalinity', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
169 | { name: 'cost', type: 'float' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
170 | ], |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
171 | url: waterUrl, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
172 | async: true |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
173 | }; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
174 | var waterlist = new $.jqx.dataAdapter(waterInvSource); |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
175 | |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
176 | // dropdownlist datasource from profile_mash |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
177 | var mashUrl = "include/db_profile_mash.php"; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
178 | var mashInvSource = { |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
179 | datatype: "json", |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
180 | datafields: [ |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
181 | { name: 'record', type: 'number' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
182 | { name: 'name', type: 'string' }, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
183 | { name: 'steps', type: 'array' } |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
184 | ], |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
185 | url: mashUrl, |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
186 | async: true |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
187 | }; |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
188 | var mashlist = new $.jqx.dataAdapter(mashInvSource); |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
189 | |
ae15cfe5f008
Moved inventory dropdown lists to global.js
Michiel Broek <mbroek@mbse.eu>
parents:
139
diff
changeset
|
190 | |
121
875aeb365e1c
Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
191 | |
13 | 192 | function getLocalization() { |
193 | var localizationobj = {}; | |
194 | localizationobj.pagerGoToPageString = "Gehe zu:"; | |
195 | localizationobj.pagerShowRowsString = "Zeige Zeile:"; | |
196 | localizationobj.pagerRangeString = " von "; | |
197 | localizationobj.pagerNextButtonString = "voriger"; | |
198 | localizationobj.pagerFirstButtonString = "first"; | |
199 | localizationobj.pagerLastButtonString = "last"; | |
200 | localizationobj.pagerPreviousButtonString = "nächster"; | |
201 | localizationobj.sortAscendingString = "Sortiere aufsteigend"; | |
202 | localizationobj.sortDescendingString = "Sortiere absteigend"; | |
203 | localizationobj.sortRemoveString = "Entferne Sortierung"; | |
204 | localizationobj.firstDay = 1; | |
205 | localizationobj.percentSymbol = "%"; | |
206 | localizationobj.currencySymbol = "€"; | |
207 | localizationobj.currencySymbolPosition = "after"; | |
208 | localizationobj.decimalSeparator = ","; | |
209 | localizationobj.thousandsSeparator = "."; | |
210 | var days = { | |
211 | // full day names | |
212 | names: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], | |
213 | // abbreviated day names | |
214 | namesAbbr: ["Sonn", "Mon", "Dien", "Mitt", "Donn", "Fre", "Sams"], | |
215 | // shortest day names | |
216 | namesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"] | |
217 | }; | |
218 | localizationobj.days = days; | |
219 | var months = { | |
220 | // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar) | |
221 | names: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""], | |
222 | // abbreviated month names | |
223 | namesAbbr: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dez", ""] | |
224 | }; | |
225 | var patterns = { | |
226 | d: "dd.MM.yyyy", | |
227 | D: "dddd, d. MMMM yyyy", | |
228 | t: "HH:mm", | |
229 | T: "HH:mm:ss", | |
230 | f: "dddd, d. MMMM yyyy HH:mm", | |
231 | F: "dddd, d. MMMM yyyy HH:mm:ss", | |
232 | M: "dd MMMM", | |
233 | Y: "MMMM yyyy" | |
234 | } | |
235 | localizationobj.patterns = patterns; | |
236 | localizationobj.months = months; | |
237 | return localizationobj; | |
238 | } | |
239 | ||
240 | ||
241 | ||
242 | $(document).ready(function () { | |
34 | 243 | |
13 | 244 | $("#jqxMenu").jqxMenu({ |
245 | width: 1280, | |
246 | height: '30px', | |
247 | theme: theme | |
248 | }); | |
249 | $("#jqxWidget").css('visibility', 'visible'); | |
250 | }); | |
251 | ||
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
252 | |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
253 | |
98
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
254 | function ebc_to_srm(ebc) { |
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:
98
diff
changeset
|
255 | var srm = -1.32303E-12 * Math.pow(ebc, 4) - 0.00000000291515 * Math.pow(ebc, 3) + 0.00000818515 * Math.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:
98
diff
changeset
|
256 | 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:
98
diff
changeset
|
257 | console.log("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:
98
diff
changeset
|
258 | return srm |
98
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
259 | } |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
260 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
261 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
262 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
263 | function srm_to_ebc(srm) |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
264 | { |
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:
98
diff
changeset
|
265 | var ebc = Math.round(0.000000000176506 * Math.pow(srm, 4) + 0.000000154529 * Math.pow(srm, 3) - 0.000159428 * Math.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:
98
diff
changeset
|
266 | 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:
98
diff
changeset
|
267 | console.log("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:
98
diff
changeset
|
268 | return ebc; |
98
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
269 | } |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
270 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
271 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
272 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
273 | /* |
133
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
274 | * Alcohol By Volume |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
275 | */ |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
276 | function abvol(og, fg) { |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
277 | |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
278 | if ((4.749804 - fg) != 0) |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
279 | return 486.8693 * (og - fg) / (4.749804 - fg); |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
280 | return 0; |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
281 | } |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
282 | |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
283 | |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
284 | |
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
285 | /* |
98
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
286 | * Kleurwerking naar SRM |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
287 | */ |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
288 | function kw_to_srm(colormethod, c) { |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
289 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
290 | if (colormethod == "Morey") |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
291 | return 1.4922 * Math.pow(c, 0.6859); |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
292 | if (colormethod == "Mosher") |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
293 | return 0.3 * c + 4.7; |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
294 | if (colormethod == "Daniels") |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
295 | return 0.2 * c + 8.4; |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
296 | } |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
297 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
298 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
299 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
300 | function kw_to_ebc(colormethod, c) { |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
301 | return srm_to_ebc(kw_to_srm(colormethod, c)); |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
302 | } |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
303 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
304 | |
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
305 | |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
306 | /* |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
307 | * Berekeningen uit https://www.hobbybrouwen.nl/forum/index.php/topic,6079.msg69464.html#msg69464 |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
308 | */ |
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
|
309 | function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method) |
5b6bb99bc52a
IBU calculations now use the setup values. All setup values are now global available.
Michiel Broek <mbroek@mbse.eu>
parents:
100
diff
changeset
|
310 | { |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
311 | var gravity = parseFloat(SG); |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
312 | var liters = parseFloat(Volume); |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
313 | var alpha = parseFloat(Alpha)/100; |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
314 | var mass = parseFloat(Amount) * 1000; |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
315 | var time = parseFloat(Boiltime); |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
316 | var fmoment = 1.0; |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
317 | var pfactor = 1.0; |
92
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
318 | var ibu = 0; |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
319 | |
92
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
320 | if ((Use == "Dry Hop") || (Use == "Dry hop") || (Use == "Whirlpool") || (Use == "Aroma")) { |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
321 | fmoment = 0.0; |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
322 | } else if (Use == "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
|
323 | fmoment += my_factor_mashhop / 100; // Brouwhulp |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
324 | } else if ((Use == "First Wort") || (Use == "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
|
325 | fmoment += my_factor_fwh / 100; // Brouwhulp, Louis, Ozzie |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
326 | } |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
327 | |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
328 | if (Form == "Pellet") { |
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
|
329 | pfactor += my_factor_pellet / 100; |
92
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
330 | } |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
331 | if (Form == "Plug" ) { |
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
|
332 | pfactor += my_factor_plug / 100; |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
333 | } |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
334 | |
92
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
335 | if (Method == "Tinseth") { |
98
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
336 | /* http://realbeer.com/hops/research.html */ |
92
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
337 | var AddedAlphaAcids = (alpha * mass * 1000) / liters; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
338 | var Bigness_factor = 1.65 * Math.pow( 0.000125, gravity - 1); |
98
92d6bc8a4cdd
Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
96
diff
changeset
|
339 | var BoilTime_factor = ((1 - Math.exp(-0.04 * time)) / 4.15); |
92
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
340 | var utiisation = Bigness_factor * BoilTime_factor; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
341 | ibu = Math.round(utiisation * AddedAlphaAcids * fmoment * pfactor * 10) / 10.0; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
342 | } |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
343 | if (Method == "Daniels") { |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
344 | var boilfactor; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
345 | var sgfactor; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
346 | if (Form == "Leaf") |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
347 | boilfactor = -(0.0041*time*time)+(0.6162*time)+1.5779; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
348 | else |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
349 | boilfactor = -(0.0051*time*time)+(0.7835*time)+1.9348; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
350 | if (gravity < 1050) |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
351 | sgfactor = 0; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
352 | else |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
353 | sgfactor = (gravity - 1050) / 200; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
354 | ibu = Math.round(fmoment * ((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor))) * 10) / 10; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
355 | } |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
356 | if (Method == "Rager") { |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
357 | var boilfactor; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
358 | var sgfactor; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
359 | boilfactor = fmoment * 18.11 + 13.86 * Math.tanh((time * 31.32) / 18.27); |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
360 | if (gravity < 1050) |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
361 | sgfactor = 0; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
362 | else |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
363 | sgfactor = (gravity - 1050) / 200; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
364 | ibu = Math.round((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor)) * 10) / 10; |
fab98e5c86fc
Added Rager and Daniels IBU calculations to javascript formula.
Michiel Broek <mbroek@mbse.eu>
parents:
70
diff
changeset
|
365 | } |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
366 | |
133
22d28dd9c041
Added ABV calculation. Added calculate fermentables from OG calculation. Scale fermentables when the OG changes.
Michiel Broek <mbroek@mbse.eu>
parents:
121
diff
changeset
|
367 | // console.log("toIBU("+Use+","+Form+","+SG+","+Volume+","+Amount+","+Boiltime+","+Alpha+","+Method+"):"+ibu+" fm:"+fmoment+" pf:"+pfactor); |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
368 | return ibu; |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
369 | } |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
370 | |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
371 | |
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
372 | |
139
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
373 | function ebc_to_color(ebc) { |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
374 | return srm_to_color(ebc_to_srm(ebc)); |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
375 | } |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
376 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
377 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
378 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
379 | function srm_to_color(srm) { |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
380 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
381 | i = Math.round(srm * 10); |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
382 | if (i < 0) { |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
383 | i = 0; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
384 | } |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
385 | if (i > 299) { |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
386 | i = 299; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
387 | } |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
388 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
389 | /* Table copied from Brouwhulp/BrewBuddy */ |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
390 | var R = [ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, // 0 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
391 | 250, 250, 250, 250, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, // 2 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
392 | 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, // 4 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
393 | 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 200, 199, 199, 198, 198, // 6 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
394 | 197, 197, 196, 196, 195, 195, 194, 194, 193, 193, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, // 8 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
395 | 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, // 10 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
396 | 192, 192, 192, 192, 192, 192, 192, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, // 12 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
397 | 179, 178, 177, 175, 174, 172, 171, 169, 168, 167, 195, 164, 162, 161, 159, 158, 157, 155, 154, 152, // 14 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
398 | 151, 149, 148, 147, 145, 144, 142, 141, 139, 138, 137, 135, 134, 132, 131, 129, 128, 127, 125, 124, // 16 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
399 | 122, 121, 119, 118, 117, 115, 114, 112, 111, 109, 108, 107, 105, 104, 102, 101, 99, 98, 97, 95, // 18 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
400 | 94, 92, 91, 89, 88, 87, 85, 84, 82, 81, 79, 78, 77, 75, 74, 72, 71, 69, 68, 67, // 20 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
401 | 65, 64, 62, 61, 59, 58, 57, 55, 54, 52, 51, 49, 48, 47, 45, 44, 43, 41, 39, 38, // 22 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
402 | 37, 37, 36, 36, 35, 35, 34, 34, 33, 33, 32, 32, 31, 31, 30, 30, 29, 29, 28, 28, // 24 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
403 | 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 22, 21, 21, 20, 20, 19, 19, 18, 18, // 26 |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
404 | 17, 17, 16, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8 ]; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
405 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
406 | var G = [ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
407 | 250, 250, 250, 250, 250, 250, 249, 248, 247, 246, 245, 244, 242, 240, 238, 236, 234, 232, 230, 228, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
408 | 226, 224, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 198, 196, 194, 192, 190, 188, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
409 | 186, 184, 182, 180, 178, 176, 174, 172, 170, 168, 166, 164, 162, 160, 158, 156, 154, 152, 150, 148, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
410 | 146, 144, 142, 141, 140, 139, 139, 138, 137, 136, 136, 135, 134, 133, 133, 132, 131, 130, 130, 129, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
411 | 128, 127, 127, 126, 125, 124, 124, 123, 122, 121, 121, 120, 119, 118, 118, 117, 116, 115, 115, 114, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
412 | 113, 112, 112, 111, 110, 109, 109, 108, 107, 106, 106, 105, 104, 103, 103, 102, 101, 100, 100, 99, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
413 | 98, 97, 97, 96, 95, 94, 94, 93, 92, 91, 91, 90, 89, 88, 88, 87, 86, 85, 85, 84, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
414 | 83, 82, 82, 81, 80, 79, 78, 77, 76, 75, 75, 74, 73, 72, 72, 71, 70, 69, 69, 68, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
415 | 67, 66, 66, 65, 64, 63, 63, 62, 61, 60, 60, 59, 58, 57, 57, 56, 55, 54, 54, 53, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
416 | 52, 51, 51, 50, 49, 48, 48, 47, 46, 45, 45, 44, 43, 42, 42, 41, 40, 39, 39, 38, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
417 | 37, 36, 36, 35, 34, 33, 33, 32, 31, 30, 30, 29, 28, 27, 27, 26, 25, 24, 24, 23, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
418 | 22, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 16, 16, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
419 | 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
420 | 9, 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3 ]; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
421 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
422 | var B = [ 210, 204, 199, 193, 188, 182, 177, 171, 166, 160, 155, 149, 144, 138, 133, 127, 122, 116, 111, 105, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
423 | 100, 94, 89, 83, 78, 72, 67, 61, 56, 50, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
424 | 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
425 | 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
426 | 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
427 | 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
428 | 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
429 | 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
430 | 51, 51, 51, 50, 50, 50, 50, 49, 49, 48, 47, 47, 46, 45, 45, 44, 43, 43, 42, 41, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
431 | 41, 40, 39, 39, 38, 37, 37, 36, 35, 34, 33, 32, 31, 29, 28, 27, 26, 25, 24, 23, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
432 | 21, 20, 19, 18, 17, 16, 15, 13, 12, 11, 10, 9, 8, 9, 9, 10, 10, 11, 11, 12, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
433 | 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
434 | 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 17, 16, 16, 15, 15, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
435 | 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, 9, 9, 8, |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
436 | 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2 ]; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
437 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
438 | var color = R[i] * 65536 + G[i] * 256 + B[i]; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
439 | var result = color.toString(16).toUpperCase(); |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
440 | if (result.length < 6) { |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
441 | result = '0' + result; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
442 | } |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
443 | result = '#' + result; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
444 | return result; |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
445 | } |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
446 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
447 | |
eb1ac7487710
Added EBC color examples. Added simple progessbars for hop flavour and aroma contribution. We need something better. In the fermentables tab, above the grid display the malt color and OG estimates. Display supplier as well in the fermentables grid.
Michiel Broek <mbroek@mbse.eu>
parents:
136
diff
changeset
|
448 | |
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
|
449 | function sg_to_plato(sg) { |
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
|
450 | if (sg > 0.5) |
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
|
451 | return 259 - 259 / sg; |
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
|
452 | return 0; |
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
|
453 | } |
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
|
454 | |
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
|
455 | |
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
|
456 | |
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
|
457 | function plato_to_sg(plato) { |
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
|
458 | if (plato < 259) |
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
|
459 | return 259 / (259 - plato); |
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
|
460 | return 1.000; |
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
|
461 | } |
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
|
462 | |
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
|
463 | |
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
|
464 | |
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
|
465 | function estimate_sg(sugars, batch_size) { |
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
|
466 | var plato = 100 * sugars / batch_size; |
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
|
467 | |
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
|
468 | var sg = plato_to_sg(plato); |
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
|
469 | for (var i = 0; i < 20; i++) { |
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
|
470 | if (sg > 0) |
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
|
471 | plato = 100 * sugars / (batch_size * sg); |
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
|
472 | sg = plato_to_sg(plato); |
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
|
473 | } |
121
875aeb365e1c
Added sparge pH during import. Added several calculations. Added calculated estimates to the brewday screen.
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
474 | // console.log("estimate_sg(" + sugars + "," + batch_size + ") : " + sg); |
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
|
475 | return sg; |
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
|
476 | } |
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
|
477 | |
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
|
478 | |
136
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
479 | |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
480 | function estimate_fg(percSugar, percCara, WGratio, TotTme, Temp, attenuation, og) { |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
481 | |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
482 | var BD; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
483 | |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
484 | console.log("estimate_fg("+percSugar+","+percCara+","+WGratio+","+TotTme+","+Temp+","+attenuation+","+og+")"); |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
485 | |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
486 | if (percSugar > 40) |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
487 | percSugar = 0; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
488 | if (percCara > 50) |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
489 | percCara = 0; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
490 | if ((WGratio > 0) && (TotTme > 0)) { |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
491 | BD = WGratio; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
492 | BD = max(2, min(5.5, BD)); |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
493 | Temp = max(60, min(72, Temp)); |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
494 | } else { |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
495 | BD = 3.5; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
496 | Temp = 67; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
497 | TotTme = 75; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
498 | } |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
499 | if (attenuation < 30) |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
500 | attenuation = 77; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
501 | |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
502 | var AttBeer = 0.00825 * attenuation + 0.00817 * BD - 0.00684 * Temp + 0.00026 * TotTme - 0.00356 * percCara + 0.00553 * percSugar + 0.547; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
503 | var fg = Math.round((1 + (1 - AttBeer) * (og - 1)) * 1000) / 1000; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
504 | console.log("fg:"+fg); |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
505 | return fg; |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
506 | } |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
507 | |
bcc4583fd013
Fixed estimate FG calculation during recipes import. Added estimate FG calculation in the recipe editor but do not yet update the recipe. Added SVG calculation to the recipes editor. Added calculations for hop aroma and flavour contribution.
Michiel Broek <mbroek@mbse.eu>
parents:
133
diff
changeset
|
508 | |
70
4da2414eabbc
Jqwidgets upgraded to version 6.0.6
Michiel Broek <mbroek@mbse.eu>
parents:
67
diff
changeset
|
509 | /* |
4da2414eabbc
Jqwidgets upgraded to version 6.0.6
Michiel Broek <mbroek@mbse.eu>
parents:
67
diff
changeset
|
510 | * Steinie: |
4da2414eabbc
Jqwidgets upgraded to version 6.0.6
Michiel Broek <mbroek@mbse.eu>
parents:
67
diff
changeset
|
511 | * |
4da2414eabbc
Jqwidgets upgraded to version 6.0.6
Michiel Broek <mbroek@mbse.eu>
parents:
67
diff
changeset
|
512 | * |
4da2414eabbc
Jqwidgets upgraded to version 6.0.6
Michiel Broek <mbroek@mbse.eu>
parents:
67
diff
changeset
|
513 | * HCO3 = CaCo3 x 1,22 |
4da2414eabbc
Jqwidgets upgraded to version 6.0.6
Michiel Broek <mbroek@mbse.eu>
parents:
67
diff
changeset
|
514 | * 1°F = 10mg/L CaCo3 |
4da2414eabbc
Jqwidgets upgraded to version 6.0.6
Michiel Broek <mbroek@mbse.eu>
parents:
67
diff
changeset
|
515 | */ |
59
ad28e09e3abd
Added Tinseth IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
516 |