34 { id: 7, en: "Carbonation", nl: "Hergisten" }, |
34 { id: 7, en: "Carbonation", nl: "Hergisten" }, |
35 { id: 8, en: "Mature", nl: "Rijpen" }, |
35 { id: 8, en: "Mature", nl: "Rijpen" }, |
36 { id: 9, en: "Taste", nl: "Proeven" }, |
36 { id: 9, en: "Taste", nl: "Proeven" }, |
37 { id: 10, en: "Ready", nl: "Gereed" }, |
37 { id: 10, en: "Ready", nl: "Gereed" }, |
38 { id: 11, en: "Closed", nl: "Afgesloten" } |
38 { id: 11, en: "Closed", nl: "Afgesloten" } |
39 ]; |
39 ], |
40 var StageSource = { |
40 StageSource = { |
41 localdata: StageData, |
41 localdata: StageData, |
42 datatype: "array", |
42 datatype: "array", |
43 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
43 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
44 }; |
44 }, |
45 var StageAdapter = new $.jqx.dataAdapter(StageSource); |
45 StageAdapter = new $.jqx.dataAdapter(StageSource), |
46 |
46 |
47 var MaterialData = [ |
47 MaterialData = [ |
48 { id: 0, en: "Stainless Steel", nl: "RVS", sh: 0.11 }, |
48 { id: 0, en: "Stainless Steel", nl: "RVS", sh: 0.11 }, |
49 { id: 1, en: "Aluminium", nl: "Aluminium", sh: 0.22 }, |
49 { id: 1, en: "Aluminium", nl: "Aluminium", sh: 0.22 }, |
50 { id: 2, en: "Plastics", nl: "Kunststof", sh: 0.46 }, |
50 { id: 2, en: "Plastics", nl: "Kunststof", sh: 0.46 }, |
51 { id: 3, en: "Copper", nl: "Koper", sh: 0.092 } |
51 { id: 3, en: "Copper", nl: "Koper", sh: 0.092 } |
52 ]; |
52 ], |
53 var MaterialSource = { |
53 MaterialSource = { |
54 localdata: MaterialData, |
54 localdata: MaterialData, |
55 datatype: "array", |
55 datatype: "array", |
56 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'sh' }] |
56 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'sh' }] |
57 }; |
57 }, |
58 var MaterialAdapter = new $.jqx.dataAdapter(MaterialSource); |
58 MaterialAdapter = new $.jqx.dataAdapter(MaterialSource), |
59 |
59 |
60 var FermentableTypeData = [ |
60 FermentableTypeData = [ |
61 { id: 0, en: 'Grain', nl: 'Mout' }, |
61 { id: 0, en: 'Grain', nl: 'Mout' }, |
62 { id: 1, en: 'Sugar', nl: 'Suiker' }, |
62 { id: 1, en: 'Sugar', nl: 'Suiker' }, |
63 { id: 2, en: 'Extract', nl: 'Vloeibaar extract' }, |
63 { id: 2, en: 'Extract', nl: 'Vloeibaar extract' }, |
64 { id: 3, en: 'Dry extract', nl: 'Droog extract' }, |
64 { id: 3, en: 'Dry extract', nl: 'Droog extract' }, |
65 { id: 4, en: 'Adjunct', nl: 'Ongemout graan' } |
65 { id: 4, en: 'Adjunct', nl: 'Ongemout graan' } |
66 ]; |
66 ], |
67 var FermentableTypeSource = { |
67 FermentableTypeSource = { |
68 localdata: FermentableTypeData, |
68 localdata: FermentableTypeData, |
69 datatype: "array", |
69 datatype: "array", |
70 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
70 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
71 }; |
71 }, |
72 var FermentableTypeAdapter = new $.jqx.dataAdapter(FermentableTypeSource); |
72 FermentableTypeAdapter = new $.jqx.dataAdapter(FermentableTypeSource), |
73 |
73 |
74 var GrainTypeData = [ |
74 GrainTypeData = [ |
75 { id: 0, en: 'Base', nl: 'Basismout' }, |
75 { id: 0, en: 'Base', nl: 'Basismout' }, |
76 { id: 1, en: 'Roast', nl: 'Geroosterde mout' }, |
76 { id: 1, en: 'Roast', nl: 'Geroosterde mout' }, |
77 { id: 2, en: 'Crystal', nl: 'Cara- of crystalmout' }, |
77 { id: 2, en: 'Crystal', nl: 'Cara- of crystalmout' }, |
78 { id: 3, en: 'Kilned', nl: 'Geëeste mout'}, |
78 { id: 3, en: 'Kilned', nl: 'Geëeste mout'}, |
79 { id: 4, en: 'Sour malt', nl: 'Zuurmout' }, |
79 { id: 4, en: 'Sour malt', nl: 'Zuurmout' }, |
80 { id: 5, en: 'Special', nl: 'Speciale mout' }, |
80 { id: 5, en: 'Special', nl: 'Speciale mout' }, |
81 { id: 6, en: 'No malt', nl: 'Geen mout' } |
81 { id: 6, en: 'No malt', nl: 'Geen mout' } |
82 ]; |
82 ], |
83 var GrainTypeSource = { |
83 GrainTypeSource = { |
84 localdata: GrainTypeData, |
84 localdata: GrainTypeData, |
85 datatype: "array", |
85 datatype: "array", |
86 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
86 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
87 }; |
87 }, |
88 var GrainTypeAdapter = new $.jqx.dataAdapter(GrainTypeSource); |
88 GrainTypeAdapter = new $.jqx.dataAdapter(GrainTypeSource), |
89 |
89 |
90 var AddedData = [ |
90 AddedData = [ |
91 { id: 0, en: 'Mash', nl: 'Maischen' }, |
91 { id: 0, en: 'Mash', nl: 'Maischen' }, |
92 { id: 1, en: 'Boil', nl: 'Koken' }, |
92 { id: 1, en: 'Boil', nl: 'Koken' }, |
93 { id: 2, en: 'Fermentation', nl: 'Vergisten' }, |
93 { id: 2, en: 'Fermentation', nl: 'Vergisten' }, |
94 { id: 3, en: 'Lagering', nl: 'Nagisten/lageren' }, |
94 { id: 3, en: 'Lagering', nl: 'Nagisten/lageren' }, |
95 { id: 4, en: 'Bottle', nl: 'Bottelen' }, |
95 { id: 4, en: 'Bottle', nl: 'Bottelen' }, |
96 { id: 5, en: 'Kegs', nl: 'Fust' } |
96 { id: 5, en: 'Kegs', nl: 'Fust' } |
97 ]; |
97 ], |
98 var AddedSource = { |
98 AddedSource = { |
99 localdata: AddedData, |
99 localdata: AddedData, |
100 datatype: "array", |
100 datatype: "array", |
101 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
101 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
102 }; |
102 }, |
103 var AddedAdapter = new $.jqx.dataAdapter(AddedSource); |
103 AddedAdapter = new $.jqx.dataAdapter(AddedSource), |
104 |
104 |
105 var HopTypeData = [ |
105 HopTypeData = [ |
106 { id: 0, en: 'Bittering', nl: 'Bitterhop' }, |
106 { id: 0, en: 'Bittering', nl: 'Bitterhop' }, |
107 { id: 1, en: 'Aroma', nl: 'Aromahop' }, |
107 { id: 1, en: 'Aroma', nl: 'Aromahop' }, |
108 { id: 2, en: 'Both', nl: 'Beide' } |
108 { id: 2, en: 'Both', nl: 'Beide' } |
109 ]; |
109 ], |
110 var HopTypeSource = { |
110 HopTypeSource = { |
111 localdata: HopTypeData, |
111 localdata: HopTypeData, |
112 datatype: "array", |
112 datatype: "array", |
113 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
113 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
114 }; |
114 }, |
115 var HopTypeAdapter = new $.jqx.dataAdapter(HopTypeSource); |
115 HopTypeAdapter = new $.jqx.dataAdapter(HopTypeSource), |
116 |
116 |
117 var HopFormData = [ |
117 HopFormData = [ |
118 { id: 0, en: 'Pellet', nl: 'Pellets' }, |
118 { id: 0, en: 'Pellet', nl: 'Pellets' }, |
119 { id: 1, en: 'Plug', nl: 'Plugs' }, |
119 { id: 1, en: 'Plug', nl: 'Plugs' }, |
120 { id: 2, en: 'Leaf', nl: 'Bloemen' }, |
120 { id: 2, en: 'Leaf', nl: 'Bloemen' }, |
121 { id: 3, en: 'Leaf wet', nl: 'Hop nat' }, |
121 { id: 3, en: 'Leaf wet', nl: 'Hop nat' }, |
122 { id: 4, en: 'Cryo', nl: 'Cryo' } |
122 { id: 4, en: 'Cryo', nl: 'Cryo' } |
123 ]; |
123 ], |
124 var HopFormSource = { |
124 HopFormSource = { |
125 localdata: HopFormData, |
125 localdata: HopFormData, |
126 datatype: "array", |
126 datatype: "array", |
127 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
127 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
128 }; |
128 }, |
129 var HopFormAdapter = new $.jqx.dataAdapter(HopFormSource); |
129 HopFormAdapter = new $.jqx.dataAdapter(HopFormSource), |
130 |
130 |
131 var HopUseData = [ |
131 HopUseData = [ |
132 { id: 0, en: 'Mash', nl: 'Maischhop' }, |
132 { id: 0, en: 'Mash', nl: 'Maischhop' }, |
133 { id: 1, en: 'First wort', nl: 'First wort hop' }, |
133 { id: 1, en: 'First wort', nl: 'First wort hop' }, |
134 { id: 2, en: 'Boil', nl: 'Koken' }, |
134 { id: 2, en: 'Boil', nl: 'Koken' }, |
135 { id: 3, en: 'Aroma', nl: 'Vlamuit' }, |
135 { id: 3, en: 'Aroma', nl: 'Vlamuit' }, |
136 { id: 4, en: 'Whirlpool', nl: 'Whirlpool' }, |
136 { id: 4, en: 'Whirlpool', nl: 'Whirlpool' }, |
137 { id: 5, en: 'Dry hop', nl: 'Koudhop' } |
137 { id: 5, en: 'Dry hop', nl: 'Koudhop' } |
138 ]; |
138 ], |
139 var HopUseSource = { |
139 HopUseSource = { |
140 localdata: HopUseData, |
140 localdata: HopUseData, |
141 datatype: "array", |
141 datatype: "array", |
142 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
142 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
143 }; |
143 }, |
144 var HopUseAdapter = new $.jqx.dataAdapter(HopUseSource); |
144 HopUseAdapter = new $.jqx.dataAdapter(HopUseSource), |
145 |
145 |
146 var YeastTypeData = [ |
146 YeastTypeData = [ |
147 { id: 0, en: 'Lager', nl: 'Ondergist' }, |
147 { id: 0, en: 'Lager', nl: 'Ondergist' }, |
148 { id: 1, en: 'Ale', nl: 'Bovengist' }, |
148 { id: 1, en: 'Ale', nl: 'Bovengist' }, |
149 { id: 2, en: 'Wheat', nl: 'Tarwegist' }, |
149 { id: 2, en: 'Wheat', nl: 'Tarwegist' }, |
150 { id: 3, en: 'Wine', nl: 'Wijngist' }, |
150 { id: 3, en: 'Wine', nl: 'Wijngist' }, |
151 { id: 4, en: 'Champagne', nl: 'Champagnegist' } |
151 { id: 4, en: 'Champagne', nl: 'Champagnegist' } |
152 // { id: 5, en: 'Brett', nl: 'Brett' }, |
152 // { id: 5, en: 'Brett', nl: 'Brett' }, |
153 // { id: 6, en: 'Kveik', nl: 'Kveik' }, |
153 // { id: 6, en: 'Kveik', nl: 'Kveik' }, |
154 // { id: 7, en: 'Mixed', nl: 'Mixed' }, |
154 // { id: 7, en: 'Mixed', nl: 'Mixed' }, |
155 // { id: 8, en: 'Spontaneous', nl: 'Spontaan' }, |
155 // { id: 8, en: 'Spontaneous', nl: 'Spontaan' }, |
156 // { id: 9, en: 'Other', nl: 'Overig' } |
156 // { id: 9, en: 'Other', nl: 'Overig' } |
157 ]; |
157 ], |
158 var YeastTypeSource = { |
158 YeastTypeSource = { |
159 localdata: YeastTypeData, |
159 localdata: YeastTypeData, |
160 datatype: "array", |
160 datatype: "array", |
161 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
161 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
162 }; |
162 }, |
163 var YeastTypeAdapter = new $.jqx.dataAdapter(YeastTypeSource); |
163 YeastTypeAdapter = new $.jqx.dataAdapter(YeastTypeSource), |
164 |
164 |
165 var YeastFormData = [ |
165 YeastFormData = [ |
166 { id: 0, en: 'Liquid', nl: 'Vloeibaar', cells: 100000000000 }, |
166 { id: 0, en: 'Liquid', nl: 'Vloeibaar', cells: 100000000000 }, |
167 { id: 1, en: 'Dry', nl: 'Korrel', cells: 15000000000 }, |
167 { id: 1, en: 'Dry', nl: 'Korrel', cells: 15000000000 }, |
168 { id: 2, en: 'Slant', nl: 'Schuine buis', cells: 1700000000 }, |
168 { id: 2, en: 'Slant', nl: 'Schuine buis', cells: 1700000000 }, |
169 { id: 3, en: 'Culture', nl: 'Slurry', cells: 1700000000 }, |
169 { id: 3, en: 'Culture', nl: 'Slurry', cells: 1700000000 }, |
170 { id: 4, en: 'Frozen', nl: 'Ingevroren', cells: 1700000000 }, |
170 { id: 4, en: 'Frozen', nl: 'Ingevroren', cells: 1700000000 }, |
171 { id: 5, en: 'Bottle', nl: 'Depot', cells: 1700000000 } |
171 { id: 5, en: 'Bottle', nl: 'Depot', cells: 1700000000 } |
172 ]; |
172 ], |
173 var YeastFormSource = { |
173 YeastFormSource = { |
174 localdata: YeastFormData, |
174 localdata: YeastFormData, |
175 datatype: "array", |
175 datatype: "array", |
176 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'cells' }] |
176 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'cells' }] |
177 }; |
177 }, |
178 var YeastFormAdapter = new $.jqx.dataAdapter(YeastFormSource); |
178 YeastFormAdapter = new $.jqx.dataAdapter(YeastFormSource), |
179 |
179 |
180 var YeastUseData = [ |
180 YeastUseData = [ |
181 { id: 0, en: 'Primary', nl: 'Hoofdgisting' }, |
181 { id: 0, en: 'Primary', nl: 'Hoofdgisting' }, |
182 { id: 1, en: 'Secondary', nl: 'Nagisting' }, |
182 { id: 1, en: 'Secondary', nl: 'Nagisting' }, |
183 { id: 2, en: 'Tertiary', nl: 'Lagering' }, |
183 { id: 2, en: 'Tertiary', nl: 'Lagering' }, |
184 { id: 3, en: 'Bottle', nl: 'Bottelen' } |
184 { id: 3, en: 'Bottle', nl: 'Bottelen' } |
185 ]; |
185 ], |
186 var YeastUseSource = { |
186 YeastUseSource = { |
187 localdata: YeastUseData, |
187 localdata: YeastUseData, |
188 datatype: "array", |
188 datatype: "array", |
189 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'cells' }] |
189 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }, { name: 'cells' }] |
190 }; |
190 }, |
191 var YeastUseAdapter = new $.jqx.dataAdapter(YeastUseSource); |
191 YeastUseAdapter = new $.jqx.dataAdapter(YeastUseSource), |
192 |
192 |
193 var FlocculationData = [ |
193 FlocculationData = [ |
194 { id: 0, en: 'Low', nl: 'Laag' }, |
194 { id: 0, en: 'Low', nl: 'Laag' }, |
195 { id: 1, en: 'Medium', nl: 'Medium' }, |
195 { id: 1, en: 'Medium', nl: 'Medium' }, |
196 { id: 2, en: 'High', nl: 'Hoog' }, |
196 { id: 2, en: 'High', nl: 'Hoog' }, |
197 { id: 3, en: 'Very high', nl: 'Zeer hoog' } |
197 { id: 3, en: 'Very high', nl: 'Zeer hoog' } |
198 ]; |
198 ], |
199 var FlocculationSource = { |
199 FlocculationSource = { |
200 localdata: FlocculationData, |
200 localdata: FlocculationData, |
201 datatype: "array", |
201 datatype: "array", |
202 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
202 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
203 }; |
203 }, |
204 var FlocculationAdapter = new $.jqx.dataAdapter(FlocculationSource); |
204 FlocculationAdapter = new $.jqx.dataAdapter(FlocculationSource), |
205 |
205 |
206 var StarterTypeData = [ |
206 StarterTypeData = [ |
207 { id: 0, en: 'Stirred', nl: 'Geroerd' }, |
207 { id: 0, en: 'Stirred', nl: 'Geroerd' }, |
208 { id: 1, en: 'Shaken', nl: 'Geschud' }, |
208 { id: 1, en: 'Shaken', nl: 'Geschud' }, |
209 { id: 2, en: 'Simple', nl: 'Simpel' } |
209 { id: 2, en: 'Simple', nl: 'Simpel' } |
210 ]; |
210 ], |
211 var StarterTypeSource = { |
211 StarterTypeSource = { |
212 localdata: StarterTypeData, |
212 localdata: StarterTypeData, |
213 datatype: "array", |
213 datatype: "array", |
214 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
214 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
215 }; |
215 }, |
216 var StarterTypeAdapter = new $.jqx.dataAdapter(StarterTypeSource); |
216 StarterTypeAdapter = new $.jqx.dataAdapter(StarterTypeSource), |
217 |
217 |
218 var MiscTypeData = [ |
218 MiscTypeData = [ |
219 { id: 0, en: 'Spice', nl: 'Specerij' }, |
219 { id: 0, en: 'Spice', nl: 'Specerij' }, |
220 { id: 1, en: 'Herb', nl: 'Kruid' }, |
220 { id: 1, en: 'Herb', nl: 'Kruid' }, |
221 { id: 2, en: 'Flavor', nl: 'Smaakstof' }, |
221 { id: 2, en: 'Flavor', nl: 'Smaakstof' }, |
222 { id: 3, en: 'Fining', nl: 'Klaringsmiddel' }, |
222 { id: 3, en: 'Fining', nl: 'Klaringsmiddel' }, |
223 { id: 4, en: 'Water agent', nl: 'Brouwzout' }, |
223 { id: 4, en: 'Water agent', nl: 'Brouwzout' }, |
224 { id: 5, en: 'Yeast nutrient', nl: 'Gistvoeding' }, |
224 { id: 5, en: 'Yeast nutrient', nl: 'Gistvoeding' }, |
225 { id: 6, en: 'Other', nl: 'Overig' } |
225 { id: 6, en: 'Other', nl: 'Overig' } |
226 ]; |
226 ], |
227 var MiscTypeSource = { |
227 MiscTypeSource = { |
228 localdata: MiscTypeData, |
228 localdata: MiscTypeData, |
229 datatype: "array", |
229 datatype: "array", |
230 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
230 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
231 }; |
231 }, |
232 var MiscTypeAdapter = new $.jqx.dataAdapter(MiscTypeSource); |
232 MiscTypeAdapter = new $.jqx.dataAdapter(MiscTypeSource), |
233 |
233 |
234 var MiscUseData = [ |
234 MiscUseData = [ |
235 { id: 0, en: 'Starter', nl: 'Starter' }, |
235 { id: 0, en: 'Starter', nl: 'Starter' }, |
236 { id: 1, en: 'Mash', nl: 'Maischen' }, |
236 { id: 1, en: 'Mash', nl: 'Maischen' }, |
237 { id: 2, en: 'Boil', nl: 'Koken' }, |
237 { id: 2, en: 'Boil', nl: 'Koken' }, |
238 { id: 3, en: 'Primary', nl: 'Hoofdvergisting' }, |
238 { id: 3, en: 'Primary', nl: 'Hoofdvergisting' }, |
239 { id: 4, en: 'Secondary', nl: 'Nagisting/lagering' }, |
239 { id: 4, en: 'Secondary', nl: 'Nagisting/lagering' }, |
240 { id: 5, en: 'Bottling', nl: 'Bottelen' } |
240 { id: 5, en: 'Bottling', nl: 'Bottelen' } |
241 ]; |
241 ], |
242 var MiscUseSource = { |
242 MiscUseSource = { |
243 localdata: MiscUseData, |
243 localdata: MiscUseData, |
244 datatype: "array", |
244 datatype: "array", |
245 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
245 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
246 }; |
246 }, |
247 var MiscUseAdapter = new $.jqx.dataAdapter(MiscUseSource); |
247 MiscUseAdapter = new $.jqx.dataAdapter(MiscUseSource), |
248 |
248 |
249 var StyleTypeData = [ |
249 StyleTypeData = [ |
250 { id: 0, en: 'Lager', nl: 'Ondergistend bier' }, |
250 { id: 0, en: 'Lager', nl: 'Ondergistend bier' }, |
251 { id: 1, en: 'Ale', nl: 'Bovengistend bier' }, |
251 { id: 1, en: 'Ale', nl: 'Bovengistend bier' }, |
252 { id: 2, en: 'Mead', nl: 'Mede' }, |
252 { id: 2, en: 'Mead', nl: 'Mede' }, |
253 { id: 3, en: 'Wheat', nl: 'Tarwebier' }, |
253 { id: 3, en: 'Wheat', nl: 'Tarwebier' }, |
254 { id: 4, en: 'Mixed', nl: 'Gemengd' }, |
254 { id: 4, en: 'Mixed', nl: 'Gemengd' }, |
255 { id: 5, en: 'Cider', nl: 'Cider' } |
255 { id: 5, en: 'Cider', nl: 'Cider' } |
256 ]; |
256 ], |
257 var StyleTypeSource = { |
257 StyleTypeSource = { |
258 localdata: StyleTypeData, |
258 localdata: StyleTypeData, |
259 datatype: "array", |
259 datatype: "array", |
260 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
260 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
261 }; |
261 }, |
262 var StyleTypeAdapter = new $.jqx.dataAdapter(StyleTypeSource); |
262 StyleTypeAdapter = new $.jqx.dataAdapter(StyleTypeSource), |
263 |
263 |
264 var MashStepTypeData = [ |
264 MashStepTypeData = [ |
265 { id: 0, en: 'Infusion', nl: 'Infusie' }, |
265 { id: 0, en: 'Infusion', nl: 'Infusie' }, |
266 { id: 1, en: 'Temperature', nl: 'Verwarming' }, |
266 { id: 1, en: 'Temperature', nl: 'Verwarming' }, |
267 { id: 2, en: 'Decoction', nl: 'Decoctie' } |
267 { id: 2, en: 'Decoction', nl: 'Decoctie' } |
268 ]; |
268 ], |
269 var MashStepTypeSource = { |
269 MashStepTypeSource = { |
270 localdata: MashStepTypeData, |
270 localdata: MashStepTypeData, |
271 datatype: "array", |
271 datatype: "array", |
272 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
272 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
273 }; |
273 }, |
274 var MashStepTypeAdapter = new $.jqx.dataAdapter(MashStepTypeSource); |
274 MashStepTypeAdapter = new $.jqx.dataAdapter(MashStepTypeSource), |
275 |
275 |
276 var RecipeTypeData = [ |
276 RecipeTypeData = [ |
277 { id: 0, en: 'Extract', nl: 'Extract' }, |
277 { id: 0, en: 'Extract', nl: 'Extract' }, |
278 { id: 1, en: 'Partial Mash', nl: 'Deelmaisch' }, |
278 { id: 1, en: 'Partial Mash', nl: 'Deelmaisch' }, |
279 { id: 2, en: 'All Grain', nl: 'Mout' } |
279 { id: 2, en: 'All Grain', nl: 'Mout' } |
280 ]; |
280 ], |
281 var RecipeTypeSource = { |
281 RecipeTypeSource = { |
282 localdata: RecipeTypeData, |
282 localdata: RecipeTypeData, |
283 datatype: "array", |
283 datatype: "array", |
284 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
284 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
285 }; |
285 }, |
286 var RecipeTypeAdapter = new $.jqx.dataAdapter(RecipeTypeSource); |
286 RecipeTypeAdapter = new $.jqx.dataAdapter(RecipeTypeSource), |
287 |
287 |
288 var IBUmethodData = [ |
288 IBUmethodData = [ |
289 { id: 0, en: 'Tinseth', nl: 'Tinseth' }, |
289 { id: 0, en: 'Tinseth', nl: 'Tinseth' }, |
290 { id: 1, en: 'Rager', nl: 'Rager' }, |
290 { id: 1, en: 'Rager', nl: 'Rager' }, |
291 { id: 2, en: 'Daniels', nl: 'Daniels' } |
291 { id: 2, en: 'Daniels', nl: 'Daniels' } |
292 // { id: 3, en: 'Garetz', nl: 'Garetz' }, // Not yet supported. |
292 // { id: 3, en: 'Garetz', nl: 'Garetz' }, // Not yet supported. |
293 // { id: 4, en: 'Mosher', nl: 'Mosher' }, |
293 // { id: 4, en: 'Mosher', nl: 'Mosher' }, |
294 // { id: 5, en: 'Noonan', nl: 'Noonan' } |
294 // { id: 5, en: 'Noonan', nl: 'Noonan' } |
295 ]; |
295 ], |
296 var IBUmethodSource = { |
296 IBUmethodSource = { |
297 localdata: IBUmethodData, |
297 localdata: IBUmethodData, |
298 datatype: "array", |
298 datatype: "array", |
299 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
299 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
300 }; |
300 }, |
301 var IBUmethodAdapter = new $.jqx.dataAdapter(IBUmethodSource); |
301 IBUmethodAdapter = new $.jqx.dataAdapter(IBUmethodSource), |
302 |
302 |
303 var ColorMethodData = [ |
303 ColorMethodData = [ |
304 { id: 0, en: 'Morey', nl: 'Morey' }, |
304 { id: 0, en: 'Morey', nl: 'Morey' }, |
305 { id: 1, en: 'Mosher', nl: 'Mosher' }, |
305 { id: 1, en: 'Mosher', nl: 'Mosher' }, |
306 { id: 2, en: 'Daniels', nl: 'Daniels' }, |
306 { id: 2, en: 'Daniels', nl: 'Daniels' }, |
307 { id: 3, en: 'Halberstadt', nl: 'Halberstadt' }, |
307 { id: 3, en: 'Halberstadt', nl: 'Halberstadt' }, |
308 { id: 4, en: 'Naudts', nl: 'Naudts' } |
308 { id: 4, en: 'Naudts', nl: 'Naudts' } |
309 ]; |
309 ], |
310 var ColorMethodSource = { |
310 ColorMethodSource = { |
311 localdata: ColorMethodData, |
311 localdata: ColorMethodData, |
312 datatype: "array", |
312 datatype: "array", |
313 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
313 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
314 }; |
314 }, |
315 var ColorMethodAdapter = new $.jqx.dataAdapter(ColorMethodSource); |
315 ColorMethodAdapter = new $.jqx.dataAdapter(ColorMethodSource), |
316 |
316 |
317 var CoolingTypeData = [ |
317 CoolingTypeData = [ |
318 { id: 0, en: '-', nl: '-' }, |
318 { id: 0, en: '-', nl: '-' }, |
319 { id: 1, en: 'Emersion chiller', nl: 'Dompelkoeler' }, |
319 { id: 1, en: 'Emersion chiller', nl: 'Dompelkoeler' }, |
320 { id: 2, en: 'Counterflow chiller', nl: 'Tegenstroomkoeler' }, |
320 { id: 2, en: 'Counterflow chiller', nl: 'Tegenstroomkoeler' }, |
321 { id: 3, en: 'Au bain marie', nl: 'Au bain marie' }, |
321 { id: 3, en: 'Au bain marie', nl: 'Au bain marie' }, |
322 { id: 4, en: 'Natural', nl: 'Laten afkoelen' } |
322 { id: 4, en: 'Natural', nl: 'Laten afkoelen' } |
323 ]; |
323 ], |
324 var CoolingTypeSource = { |
324 CoolingTypeSource = { |
325 localdata: CoolingTypeData, |
325 localdata: CoolingTypeData, |
326 datatype: "array", |
326 datatype: "array", |
327 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
327 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
328 }; |
328 }, |
329 var CoolingTypeAdapter = new $.jqx.dataAdapter(CoolingTypeSource); |
329 CoolingTypeAdapter = new $.jqx.dataAdapter(CoolingTypeSource), |
330 |
330 |
331 var AerationTypeData = [ |
331 AerationTypeData = [ |
332 { id: 0, en: 'None', nl: 'Geen' }, |
332 { id: 0, en: 'None', nl: 'Geen' }, |
333 { id: 1, en: 'Air', nl: 'Lucht' }, |
333 { id: 1, en: 'Air', nl: 'Lucht' }, |
334 { id: 2, en: 'Oxygen', nl: 'Zuurstof' } |
334 { id: 2, en: 'Oxygen', nl: 'Zuurstof' } |
335 ]; |
335 ], |
336 var AerationTypeSource = { |
336 AerationTypeSource = { |
337 localdata: AerationTypeData, |
337 localdata: AerationTypeData, |
338 datatype: "array", |
338 datatype: "array", |
339 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
339 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
340 }; |
340 }, |
341 var AerationTypeAdapter = new $.jqx.dataAdapter(AerationTypeSource); |
341 AerationTypeAdapter = new $.jqx.dataAdapter(AerationTypeSource), |
342 |
342 |
343 var AcidTypeData = [ |
343 AcidTypeData = [ |
344 { id: 0, en: 'Lactic', nl: 'Melkzuur' }, |
344 { id: 0, en: 'Lactic', nl: 'Melkzuur' }, |
345 { id: 1, en: 'Hydrochloric', nl: 'Zoutzuur' }, |
345 { id: 1, en: 'Hydrochloric', nl: 'Zoutzuur' }, |
346 { id: 2, en: 'Phosphoric', nl: 'Fosforzuur' }, |
346 { id: 2, en: 'Phosphoric', nl: 'Fosforzuur' }, |
347 { id: 3, en: 'Sulfuric', nl: 'Zwavelzuur' } |
347 { id: 3, en: 'Sulfuric', nl: 'Zwavelzuur' } |
348 ]; |
348 ], |
349 var AcidTypeSource = { |
349 AcidTypeSource = { |
350 localdata: AcidTypeData, |
350 localdata: AcidTypeData, |
351 datatype: "array", |
351 datatype: "array", |
352 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
352 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
353 }; |
353 }, |
354 var AcidTypeAdapter = new $.jqx.dataAdapter(AcidTypeSource); |
354 AcidTypeAdapter = new $.jqx.dataAdapter(AcidTypeSource), |
355 |
355 |
356 var BaseTypeData = [ |
356 BaseTypeData = [ |
357 { id: 0, en: 'Sodiumbicarbonate', nl: 'NaHCO3' }, |
357 { id: 0, en: 'Sodiumbicarbonate', nl: 'NaHCO3' }, |
358 { id: 1, en: 'Sodiumcarbonate', nl: 'Na2CO3' }, |
358 { id: 1, en: 'Sodiumcarbonate', nl: 'Na2CO3' }, |
359 { id: 2, en: 'Calciumcarbonate', nl: 'CaCO3' }, |
359 { id: 2, en: 'Calciumcarbonate', nl: 'CaCO3' }, |
360 { id: 3, en: 'Calciumhydroxide', nl: 'Ca(OH)2' } |
360 { id: 3, en: 'Calciumhydroxide', nl: 'Ca(OH)2' } |
361 ]; |
361 ], |
362 var BaseTypeSource = { |
362 BaseTypeSource = { |
363 localdata: BaseTypeData, |
363 localdata: BaseTypeData, |
364 datatype: "array", |
364 datatype: "array", |
365 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
365 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
366 }; |
366 }, |
367 var BaseTypeAdapter = new $.jqx.dataAdapter(BaseTypeSource); |
367 BaseTypeAdapter = new $.jqx.dataAdapter(BaseTypeSource), |
368 |
368 |
369 var SpargeSourceData = [ |
369 SpargeSourceData = [ |
370 { id: 0, en: 'Source 1', nl: 'Bron 1' }, |
370 { id: 0, en: 'Source 1', nl: 'Bron 1' }, |
371 { id: 1, en: 'Source 2', nl: 'Bron 2' }, |
371 { id: 1, en: 'Source 2', nl: 'Bron 2' }, |
372 { id: 2, en: 'Mixed', nl: 'Gemengd' } |
372 { id: 2, en: 'Mixed', nl: 'Gemengd' } |
373 ]; |
373 ], |
374 var SpargeSourceSource = { |
374 SpargeSourceSource = { |
375 localdata: SpargeSourceData, |
375 localdata: SpargeSourceData, |
376 datatype: "array", |
376 datatype: "array", |
377 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
377 datafields: [{ name: 'id' }, { name: 'en' }, { name: 'nl' }] |
378 }; |
378 }, |
379 var SpargeSourceAdapter = new $.jqx.dataAdapter(SpargeSourceSource); |
379 SpargeSourceAdapter = new $.jqx.dataAdapter(SpargeSourceSource), |
380 |
380 |
381 |
381 |
382 // options for editors |
382 // options for editors |
383 |
383 |
384 var Show1wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }; |
384 Show1wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }, |
385 var Show2wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 2, readOnly: true }; |
385 Show2wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 2, readOnly: true }, |
386 var Show3wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 3, readOnly: true }; |
386 Show3wat = { inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 3, readOnly: true }, |
387 var Smal0dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }; |
387 Smal0dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }, |
388 var Smal1dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }; |
388 Smal1dec = { inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }, |
389 var Show0dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 0 }; |
389 Show0dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 0 }, |
390 var Show1dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 1 }; |
390 Show1dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 1 }, |
391 var Show2dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 2 }; |
391 Show2dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 2 }, |
392 var Show3dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 3 }; |
392 Show3dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 3 }, |
393 var SGopts = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0.990, max: 1.199, decimalDigits: 3, spinButtons: true }; |
393 SGopts = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0.990, max: 1.199, decimalDigits: 3, spinButtons: true }, |
394 var Spin1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 1, spinButtons: true }; |
394 Spin1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 1, spinButtons: true }, |
395 var Spin2dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 2, spinButtons: true }; |
395 Spin2dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 2, spinButtons: true }, |
396 var Spin3dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 3, spinButtons: true }; |
396 Spin3dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 3, spinButtons: true }, |
397 var SpinpH = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1, max: 14, decimalDigits: 1, spinButtons: true }; |
397 SpinpH = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1, max: 14, decimalDigits: 1, spinButtons: true }, |
398 var Spin2pH = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1, max: 14, decimalDigits: 2, spinButtons: true }; |
398 Spin2pH = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1, max: 14, decimalDigits: 2, spinButtons: true }, |
399 var YeastT = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true }; |
399 YeastT = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true }, |
400 var PosInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 0, spinButtons: true }; |
400 PosInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 0, spinButtons: true }, |
401 var Perc1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 1, spinButtons: true }; |
401 Perc1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 1, spinButtons: true }, |
402 var Perc0 = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true }; |
402 Perc0 = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true }, |
403 var Dateopts = { |
403 Dateopts = { |
404 theme: theme, width: 150, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true, |
404 theme: theme, width: 150, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true, |
405 formatString: 'yyyy-MM-dd', enableBrowserBoundsDetection: true |
405 formatString: 'yyyy-MM-dd', enableBrowserBoundsDetection: true |
406 }; |
406 }, |
407 var DateTimeopts = { |
407 DateTimeopts = { |
408 theme: theme, width: 230, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true, |
408 theme: theme, width: 230, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true, |
409 formatString: 'yyyy-MM-dd HH:mm:ss', enableBrowserBoundsDetection: true, showTimeButton: true |
409 formatString: 'yyyy-MM-dd HH:mm:ss', enableBrowserBoundsDetection: true, showTimeButton: true |
410 }; |
410 }, |
411 |
411 |
412 |
412 |
413 var sugardensity = 1.611; //kg/l in solution |
413 sugardensity = 1.611, //kg/l in solution |
414 |
414 |
415 // Styles dropdown list |
415 // Styles dropdown list |
416 var stylesUrl = "includes/db_profile_styles.php"; |
416 stylesUrl = "includes/db_profile_styles.php", |
417 var stylesSource = { |
417 stylesSource = { |
418 datatype: "json", |
418 datatype: "json", |
419 datafields: [ |
419 datafields: [ |
420 { name: 'record', type: 'number' }, |
420 { name: 'record', type: 'number' }, |
421 { name: 'name', type: 'string' }, |
421 { name: 'name', type: 'string' }, |
422 { name: 'category', type: 'string' }, |
422 { name: 'category', type: 'string' }, |
692 { name: 'magnesium', type: 'float' }, |
693 { name: 'magnesium', type: 'float' }, |
693 { name: 'ph', type: 'float' }, |
694 { name: 'ph', type: 'float' }, |
694 { name: 'total_alkalinity', type: 'float' }, |
695 { name: 'total_alkalinity', type: 'float' }, |
695 ], |
696 ], |
696 url: "includes/db_profile_water.php" |
697 url: "includes/db_profile_water.php" |
697 }; |
698 }, |
698 var waterprofiles = new $.jqx.dataAdapter(waterProfileSource); |
699 waterprofiles = new $.jqx.dataAdapter(waterProfileSource), |
699 |
700 |
700 // dropdownlist datasource from profile_mash |
701 // dropdownlist datasource from profile_mash |
701 var mashProfileSource = { |
702 mashProfileSource = { |
702 datatype: "json", |
703 datatype: "json", |
703 datafields: [ |
704 datafields: [ |
704 { name: 'record', type: 'number' }, |
705 { name: 'record', type: 'number' }, |
705 { name: 'name', type: 'string' }, |
706 { name: 'name', type: 'string' }, |
706 { name: 'steps', type: 'array' } |
707 { name: 'steps', type: 'array' } |
707 ], |
708 ], |
708 url: "includes/db_profile_mash.php" |
709 url: "includes/db_profile_mash.php" |
709 }; |
710 }, |
710 var mashlist = new $.jqx.dataAdapter(mashProfileSource); |
711 mashlist = new $.jqx.dataAdapter(mashProfileSource), |
711 |
712 |
712 |
|
713 |
|
714 |
|
715 $(document).ready(function(){ |
|
716 $("#jqxMenu").jqxMenu({width:1280,height:'30px',autoOpen:false,clickToOpen:true,theme:theme}); |
|
717 $("#jqxWidget").css('visibility','visible'); |
|
718 }); |
|
719 |
|
720 |
|
721 |
|
722 function Round(n,d){for(var i=0,m=1;i<d;i++,m*=10);return Math.round(n*m)/m;} |
|
723 |
713 |
724 |
714 |
725 /* |
715 /* |
726 * From "Rekenen aan bier" by Hans Halberstadt. |
716 * From "Rekenen aan bier" by Hans Halberstadt. |
727 */ |
717 */ |
728 var K1s = 0.384; |
718 K1s = 0.384, K1a = -0.177, K1e = 0.241, K1g = 0.247, Ks = 0.1415, Ka1 = 0.058, Ka2 = 0.078, Ke = 0.174, Kg = 0.109; |
729 var K1a = -0.177; |
|
730 var K1e = 0.241; |
|
731 var K1g = 0.247; |
|
732 var Ks = 0.1415; |
|
733 var Ka1 = 0.058; |
|
734 var Ka2 = 0.078; |
|
735 var Ke = 0.174; |
|
736 var Kg = 0.109; |
|
737 |
719 |
738 // =E2/E6+(E3/E6)*$B$24/$B$23+(E3/E6)*(E3/E6)*$B$25/$B$23+E4/E6*$B$26/$B$23+E5/E6*$B$27/$B$23 |
720 // =E2/E6+(E3/E6)*$B$24/$B$23+(E3/E6)*(E3/E6)*$B$25/$B$23+E4/E6*$B$26/$B$23+E5/E6*$B$27/$B$23 |
739 // For Brix |
721 // For Brix |
740 function A(sugar, volume, alc, eiwit, glycerol) { |
722 function A(sugar, volume, alc, eiwit, glycerol) { |
741 |
723 |
742 var vol = volume * 1000; |
724 var vol, A; |
743 var A = sugar/vol + (alc/vol)*Ka1/Ks + (alc/vol)*(alc/vol) * Ka2/Ks + eiwit/vol * Ke/Ks + glycerol/vol * Kg/Ks; |
725 |
744 |
726 vol = volume * 1000; |
|
727 A = sugar/vol + (alc/vol)*Ka1/Ks + (alc/vol)*(alc/vol) * Ka2/Ks + eiwit/vol * Ke/Ks + glycerol/vol * Kg/Ks; |
745 console.log("A("+sugar+"."+volume+","+alc+","+eiwit+","+glycerol+"):"+A); |
728 console.log("A("+sugar+"."+volume+","+alc+","+eiwit+","+glycerol+"):"+A); |
746 return A; |
729 return A; |
747 } |
730 } |
748 |
731 |
749 // =E2/E6+(E3/E6)*$B$20/$B$19+E4/E6*$B$21/$B$19+E5/E6*$B$22/$B$19 |
732 // =E2/E6+(E3/E6)*$B$20/$B$19+E4/E6*$B$21/$B$19+E5/E6*$B$22/$B$19 |
750 // for Plato |
733 // for Plato |
751 function B(sugar, volume, alc, eiwit, glycerol) { |
734 function B(sugar, volume, alc, eiwit, glycerol) { |
752 |
735 |
753 var vol = volume * 1000; |
736 var vol, B; |
754 var B = sugar/vol + (alc/vol)*K1a/K1s + eiwit/vol*K1e/K1s + glycerol/vol*K1g/K1s; |
737 |
755 |
738 vol = volume * 1000; |
|
739 B = sugar/vol + (alc/vol)*K1a/K1s + eiwit/vol*K1e/K1s + glycerol/vol*K1g/K1s; |
756 console.log("B("+sugar+"."+volume+","+alc+","+eiwit+","+glycerol+"):"+B); |
740 console.log("B("+sugar+"."+volume+","+alc+","+eiwit+","+glycerol+"):"+B); |
757 return B; |
741 return B; |
758 } |
742 } |
759 |
743 |
760 |
744 |
|
745 |
|
746 $(document).ready(function(){ |
|
747 |
|
748 $("#jqxMenu").jqxMenu({ |
|
749 width:1280, |
|
750 height:'30px', |
|
751 autoOpen:false, |
|
752 clickToOpen:true, |
|
753 theme:theme |
|
754 }); |
|
755 $("#jqxWidget").css('visibility','visible'); |
|
756 }); |
|
757 |
|
758 |
|
759 |
|
760 function Round(n,d){ |
|
761 |
|
762 for (var i=0,m=1; i<d; i++,m*=10); |
|
763 return Math.round(n*m)/m; |
|
764 } |
|
765 |
|
766 |
|
767 |
761 function ebc_to_srm(ebc){ |
768 function ebc_to_srm(ebc){ |
762 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; |
769 |
763 if(srm<0)srm=0;return srm; |
770 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; |
764 } |
771 if(srm<0) |
|
772 srm=0; |
|
773 return srm; |
|
774 } |
|
775 |
|
776 |
|
777 |
765 function srm_to_ebc(srm){ |
778 function srm_to_ebc(srm){ |
766 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); |
779 |
767 if(ebc<0)ebc=0;return ebc; |
780 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); |
|
781 if(ebc<0) |
|
782 ebc=0; |
|
783 return ebc; |
768 } |
784 } |
769 |
785 |
770 |
786 |
771 |
787 |
772 /* Return incremented color by the boil and yeast. |
788 /* Return incremented color by the boil and yeast. |
773 * https://www.hobbybrouwen.nl/forum/index.php/topic,19020.msg281132.html#msg281132 */ |
789 * https://www.hobbybrouwen.nl/forum/index.php/topic,19020.msg281132.html#msg281132 */ |
774 function get_kt(ebc){ |
790 function get_kt(ebc){ |
775 var kt=1; |
791 |
776 if(ebc<3)kt=3.5;else if(ebc<6)kt=3;else if(ebc<8)kt=2.75;else if(ebc<10)kt=2.5;else if(ebc<20)kt=1.8; |
792 var kt=1; |
777 else if(ebc<30)kt=1.6;else if(ebc<60)kt=1.3;else if(ebc<100)kt=1.2;else if(ebc<300)kt=1.1;return kt; |
793 if(ebc<3) |
778 } |
794 kt=3.5; |
|
795 else if(ebc<6) |
|
796 kt=3; |
|
797 else if(ebc<8) |
|
798 kt=2.75; |
|
799 else if(ebc<10) |
|
800 kt=2.5; |
|
801 else if(ebc<20) |
|
802 kt=1.8; |
|
803 else if(ebc<30) |
|
804 kt=1.6; |
|
805 else if(ebc<60) |
|
806 kt=1.3; |
|
807 else if(ebc<100) |
|
808 kt=1.2; |
|
809 else if(ebc<300) |
|
810 kt=1.1; |
|
811 return kt; |
|
812 } |
|
813 |
|
814 |
|
815 |
779 function abvol(og,fg){ |
816 function abvol(og,fg){ |
780 if(((og-fg)<0)||(fg<0.9))return 0; |
817 |
781 var factor=og*3157*Math.pow(10,-5)+9.716*Math.pow(10,-2); |
818 if(((og-fg)<0)||(fg<0.9)) |
782 return (og*1000-fg*1000)*factor; |
819 return 0; |
|
820 var factor = og*3157*Math.pow(10,-5) + 9.716*Math.pow(10,-2); |
|
821 return (og*1000-fg*1000)*factor; |
783 } |
822 } |
784 |
823 |
785 |
824 |
786 |
825 |
787 /* Kleurwerking naar SRM. Niet voor Halberstadt, Naudts */ |
826 /* Kleurwerking naar SRM. Niet voor Halberstadt, Naudts */ |
788 function kw_to_srm(colormethod,c){ |
827 function kw_to_srm(colormethod,c){ |
789 if(colormethod==0)return 1.4922*Math.pow(c,0.6859);//Morey |
828 if(colormethod==0) |
790 if(colormethod==1)return 0.3*c+4.7;//Mosher |
829 return 1.4922*Math.pow(c,0.6859);//Morey |
791 if(colormethod==2)return 0.2*c+8.4;//Daniels |
830 if(colormethod==1) |
792 return 0;//Halberstadt,Naudts |
831 return 0.3*c+4.7;//Mosher |
793 } |
832 if(colormethod==2) |
794 function kw_to_ebc(colormethod, c){return srm_to_ebc(kw_to_srm(colormethod,c));} |
833 return 0.2*c+8.4;//Daniels |
|
834 return 0;//Halberstadt,Naudts |
|
835 } |
|
836 |
|
837 |
|
838 |
|
839 function kw_to_ebc(colormethod, c){ |
|
840 |
|
841 return srm_to_ebc(kw_to_srm(colormethod,c)); |
|
842 } |
795 |
843 |
796 |
844 |
797 |
845 |
798 /* |
846 /* |
799 * Berekeningen uit https://www.hobbybrouwen.nl/forum/index.php/topic,6079.msg69464.html#msg69464 |
847 * Berekeningen uit https://www.hobbybrouwen.nl/forum/index.php/topic,6079.msg69464.html#msg69464 |
800 */ |
848 */ |
801 function toIBU(Use,Form,SG,Volume,Amount,Boiltime,Alpha,Method){ |
849 function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method) { |
802 var gravity=parseFloat(SG); |
850 |
803 var liters=parseFloat(Volume); |
851 var gravity, liters, alpha, mass, time, fmoment=1.0, pfactor=1.0, ibu=0, boilfactor, sgfactor, |
804 var alpha=parseFloat(Alpha)/100; |
852 AddedAlphaAcids, Bigness_factor, BoilTime_factor, utiisation; |
805 var mass=parseFloat(Amount)*1000; |
853 |
806 var time=parseFloat(Boiltime); |
854 gravity = parseFloat(SG); |
807 var fmoment=1.0; |
855 liters = parseFloat(Volume); |
808 var pfactor=1.0; |
856 alpha = parseFloat(Alpha)/100; |
809 var ibu=0; |
857 mass = parseFloat(Amount)*1000; |
810 |
858 time = parseFloat(Boiltime); |
811 if((Use==3)||(Use==4)||(Use==5)){// Aroma, Whirlpool or Dry hop. |
859 |
812 fmoment=0.0; |
860 if ((Use==3) || (Use==4) || (Use==5)) { // Aroma, Whirlpool or Dry hop. |
813 }else if(Use==0){// Mash |
861 fmoment=0.0; |
814 fmoment+=my_factor_mashhop/100;// Brouwhulp |
862 } else if (Use==0) { // Mash |
815 }else if(Use==1){// First wort |
863 fmoment+=my_factor_mashhop/100; // Brouwhulp |
816 fmoment+=my_factor_fwh/100;// Brouwhulp, Louis, Ozzie |
864 } else if (Use==1) { // First wort |
817 } |
865 fmoment+=my_factor_fwh/100; // Brouwhulp, Louis, Ozzie |
818 |
866 } |
819 if(Form==0){// Pellet |
867 |
820 pfactor+=my_factor_pellet/100; |
868 if (Form==0){ // Pellet |
821 } |
869 pfactor+=my_factor_pellet/100; |
822 if(Form==1){// Plug |
870 } else if (Form==1) { // Plug |
823 pfactor+=my_factor_plug/100; |
871 pfactor+=my_factor_plug/100; |
824 } |
872 } else if (Form==3) { // Wet leaf |
825 if(Form==3){// Wet leaf |
873 pfactor+=my_factor_wethop/100; // From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py |
826 pfactor+=my_factor_wethop/100;// From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py |
874 } else if (Form==4) { // Cryo hop |
827 } |
875 pfactor+=my_factor_cryohop/100; |
828 if(Form==4){// Cryo hop |
876 } |
829 pfactor+=my_factor_cryohop/100; |
877 |
830 } |
878 if(Method==0){// Tinseth |
831 |
879 /* http://realbeer.com/hops/research.html */ |
832 if(Method==0){// Tinseth |
880 AddedAlphaAcids=(alpha*mass*1000)/liters; |
833 /* http://realbeer.com/hops/research.html */ |
881 Bigness_factor=1.65*Math.pow(0.000125,gravity-1); |
834 var AddedAlphaAcids=(alpha*mass*1000)/liters; |
882 BoilTime_factor=((1-Math.exp(-0.04*time))/4.15); |
835 var Bigness_factor=1.65*Math.pow(0.000125,gravity-1); |
883 utiisation=Bigness_factor*BoilTime_factor; |
836 var BoilTime_factor=((1-Math.exp(-0.04*time))/4.15); |
884 ibu=Round(utiisation*AddedAlphaAcids*fmoment*pfactor,1); |
837 var utiisation=Bigness_factor*BoilTime_factor; |
885 } |
838 ibu=Round(utiisation*AddedAlphaAcids*fmoment*pfactor,1); |
886 if(Method==2){// Daniels |
839 } |
887 if (Form == 2)// Leaf |
840 if(Method==2){// Daniels |
888 boilfactor = -(0.0041*time*time)+(0.6162*time)+1.5779; |
841 var boilfactor; |
889 else |
842 var sgfactor; |
890 boilfactor = -(0.0051*time*time)+(0.7835*time)+1.9348; |
843 if(Form==2)// Leaf |
891 if (gravity < 1050) |
844 boilfactor=-(0.0041*time*time)+(0.6162*time)+1.5779; |
892 sgfactor=0; |
845 else |
893 else |
846 boilfactor=-(0.0051*time*time)+(0.7835*time)+1.9348; |
894 sgfactor=(gravity-1050)/200; |
847 if(gravity<1050) |
895 ibu = Round(fmoment*((mass*(alpha*100)*boilfactor* 0.1)/(liters*(1+sgfactor))),1); |
848 sgfactor=0; |
896 } |
849 else |
897 if(Method==1){// Rager |
850 sgfactor=(gravity-1050)/200; |
898 boilfactor = fmoment*18.11 + 13.86*Math.tanh((time*31.32)/18.27); |
851 ibu = Round(fmoment*((mass*(alpha*100)*boilfactor* 0.1)/(liters*(1+sgfactor))),1); |
899 if (gravity < 1050) |
852 } |
900 sgfactor=0; |
853 if(Method==1){// Rager |
901 else |
854 var sgfactor; |
902 sgfactor=(gravity-1050)/200; |
855 var boilfactor=fmoment*18.11+13.86*Math.tanh((time*31.32)/18.27); |
903 ibu = Round((mass*(alpha*100)*boilfactor*0.1)/(liters*(1+sgfactor)),1); |
856 if(gravity<1050) |
904 } |
857 sgfactor=0; |
905 |
858 else |
906 //console.log("toIBU("+Use+","+Form+","+SG+","+Volume+","+Amount+","+Boiltime+","+Alpha+","+Method+"):"+ibu+" fm:"+fmoment+" pf:"+pfactor); |
859 sgfactor=(gravity-1050)/200; |
907 return ibu; |
860 ibu = Round((mass*(alpha*100)*boilfactor*0.1)/(liters*(1+sgfactor)),1); |
908 } |
861 } |
909 |
862 |
910 |
863 //console.log("toIBU("+Use+","+Form+","+SG+","+Volume+","+Amount+","+Boiltime+","+Alpha+","+Method+"):"+ibu+" fm:"+fmoment+" pf:"+pfactor); |
911 |
864 return ibu; |
912 function ebc_to_color(ebc){ |
865 } |
913 |
866 |
914 return srm_to_color(ebc_to_srm(ebc)); |
867 |
915 } |
868 |
916 |
869 function ebc_to_color(ebc){return srm_to_color(ebc_to_srm(ebc));} |
917 |
|
918 |
870 function srm_to_color(srm){ |
919 function srm_to_color(srm){ |
871 var i = Math.round(srm * 10); |
920 |
872 if(i<0)i=0; |
921 var i, R, G, B, color, result; |
873 if(i>299)i=299; |
922 |
874 /* Table copied from Brouwhulp/BrewBuddy */ |
923 i = Math.round(srm * 10); |
875 var R=[ |
924 if (i < 0) |
876 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,//0 |
925 i=0; |
877 250,250,250,250,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236,235,//2 |
926 if (i > 299) |
878 234,233,232,231,230,229,228,227,226,225,224,223,222,221,220,219,218,217,216,215,//4 |
927 i=299; |
879 214,213,212,211,210,209,208,207,206,205,204,203,202,201,200,200,199,199,198,198,//6 |
928 |
880 197,197,196,196,195,195,194,194,193,193,192,192,192,192,192,192,192,192,192,192,//8 |
929 /* Table copied from Brouwhulp/BrewBuddy */ |
881 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,//10 |
930 R=[ |
882 192,192,192,192,192,192,192,192,191,190,189,188,187,186,185,184,183,182,181,180,//12 |
931 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,//0 |
883 179,178,177,175,174,172,171,169,168,167,195,164,162,161,159,158,157,155,154,152,//14 |
932 250,250,250,250,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236,235,//2 |
884 151,149,148,147,145,144,142,141,139,138,137,135,134,132,131,129,128,127,125,124,//16 |
933 234,233,232,231,230,229,228,227,226,225,224,223,222,221,220,219,218,217,216,215,//4 |
885 122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101,99,98,97,95,//18 |
934 214,213,212,211,210,209,208,207,206,205,204,203,202,201,200,200,199,199,198,198,//6 |
886 94,92,91,89,88,87,85,84,82,81,79,78,77,75,74,72,71,69,68,67,//20 |
935 197,197,196,196,195,195,194,194,193,193,192,192,192,192,192,192,192,192,192,192,//8 |
887 65,64,62,61,59,58,57,55,54,52,51,49,48,47,45,44,43,41,39,38,//22 |
936 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,//10 |
888 37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,//24 |
937 192,192,192,192,192,192,192,192,191,190,189,188,187,186,185,184,183,182,181,180,//12 |
889 27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,//26 |
938 179,178,177,175,174,172,171,169,168,167,195,164,162,161,159,158,157,155,154,152,//14 |
890 17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8]; |
939 151,149,148,147,145,144,142,141,139,138,137,135,134,132,131,129,128,127,125,124,//16 |
891 var G=[ |
940 122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101,99,98,97,95,//18 |
892 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, |
941 94,92,91,89,88,87,85,84,82,81,79,78,77,75,74,72,71,69,68,67,//20 |
893 250,250,250,250,250,250,249,248,247,246,245,244,242,240,238,236,234,232,230,228, |
942 65,64,62,61,59,58,57,55,54,52,51,49,48,47,45,44,43,41,39,38,//22 |
894 226,224,222,220,218,216,214,212,210,208,206,204,202,200,198,196,194,192,190,188, |
943 37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,//24 |
895 186,184,182,180,178,176,174,172,170,168,166,164,162,160,158,156,154,152,150,148, |
944 27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,//26 |
896 146,144,142,141,140,139,139,138,137,136,136,135,134,133,133,132,131,130,130,129, |
945 17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8]; |
897 128,127,127,126,125,124,124,123,122,121,121,120,119,118,118,117,116,115,115,114, |
946 |
898 113,112,112,111,110,109,109,108,107,106,106,105,104,103,103,102,101,100,100,99, |
947 G=[ |
899 98,97,97,96,95,94,94,93,92,91,91,90,89,88,88,87,86,85,85,84, |
948 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, |
900 83,82,82,81,80,79,78,77,76,75,75,74,73,72,72,71,70,69,69,68, |
949 250,250,250,250,250,250,249,248,247,246,245,244,242,240,238,236,234,232,230,228, |
901 67,66,66,65,64,63,63,62,61,60,60,59,58,57,57,56,55,54,54,53, |
950 226,224,222,220,218,216,214,212,210,208,206,204,202,200,198,196,194,192,190,188, |
902 52,51,51,50,49,48,48,47,46,45,45,44,43,42,42,41,40,39,39,38, |
951 186,184,182,180,178,176,174,172,170,168,166,164,162,160,158,156,154,152,150,148, |
903 37,36,36,35,34,33,33,32,31,30,30,29,28,27,27,26,25,24,24,23, |
952 146,144,142,141,140,139,139,138,137,136,136,135,134,133,133,132,131,130,130,129, |
904 22,22,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,16, |
953 128,127,127,126,125,124,124,123,122,121,121,120,119,118,118,117,116,115,115,114, |
905 16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9, |
954 113,112,112,111,110,109,109,108,107,106,106,105,104,103,103,102,101,100,100,99, |
906 9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3]; |
955 98,97,97,96,95,94,94,93,92,91,91,90,89,88,88,87,86,85,85,84, |
907 var B=[ |
956 83,82,82,81,80,79,78,77,76,75,75,74,73,72,72,71,70,69,69,68, |
908 210,204,199,193,188,182,177,171,166,160,155,149,144,138,133,127,122,116,111,105, |
957 67,66,66,65,64,63,63,62,61,60,60,59,58,57,57,56,55,54,54,53, |
909 100,94,89,83,78,72,67,61,56,50,45,45,45,46,46,46,46,47,47,47, |
958 52,51,51,50,49,48,48,47,46,45,45,44,43,42,42,41,40,39,39,38, |
910 47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52, |
959 37,36,36,35,34,33,33,32,31,30,30,29,28,27,27,26,25,24,24,23, |
911 52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,56,56,56, |
960 22,22,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,16, |
912 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, |
961 16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9, |
913 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, |
962 9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3]; |
914 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, |
963 |
915 56,56,56,55,55,55,55,54,54,54,54,53,53,53,53,52,52,52,52,51, |
964 B=[ |
916 51,51,51,50,50,50,50,49,49,48,47,47,46,45,45,44,43,43,42,41, |
965 210,204,199,193,188,182,177,171,166,160,155,149,144,138,133,127,122,116,111,105, |
917 41,40,39,39,38,37,37,36,35,34,33,32,31,29,28,27,26,25,24,23, |
966 100,94,89,83,78,72,67,61,56,50,45,45,45,46,46,46,46,47,47,47, |
918 21,20,19,18,17,16,15,13,12,11,10,9,8,9,9,10,10,11,11,12, |
967 47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52, |
919 12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22, |
968 52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,56,56,56, |
920 21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,17,16,16,15,15, |
969 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, |
921 15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8, |
970 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, |
922 8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3,2,2,2]; |
971 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, |
923 var color=R[i]*65536+G[i]*256+B[i]; |
972 56,56,56,55,55,55,55,54,54,54,54,53,53,53,53,52,52,52,52,51, |
924 var result=color.toString(16).toUpperCase(); |
973 51,51,51,50,50,50,50,49,49,48,47,47,46,45,45,44,43,43,42,41, |
925 if(result.length<6)result='0'+result; |
974 41,40,39,39,38,37,37,36,35,34,33,32,31,29,28,27,26,25,24,23, |
926 return '#'+result; |
975 21,20,19,18,17,16,15,13,12,11,10,9,8,9,9,10,10,11,11,12, |
927 } |
976 12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22, |
928 |
977 21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,17,16,16,15,15, |
929 |
978 15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8, |
930 |
979 8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3,2,2,2]; |
931 function sg_to_plato(sg){return ((135.997*sg-630.272)*sg+1111.14)*sg-616.868;} |
980 |
932 function plato_to_sg(plato){return 1+(plato/(258.6-((plato/258.2)*227.1)));} |
981 color = R[i]*65536 + G[i]*256 + B[i]; |
933 function brix_to_sg(brix){if(my_brix_correction>0)return plato_to_sg(brix/my_brix_correction);else return plato_to_sg(brix);} |
982 result = color.toString(16).toUpperCase(); |
934 function sg_to_brix(sg){return sg_to_plato(sg)*my_brix_correction;} |
983 if (result.length < 6) |
|
984 result = '0'+result; |
|
985 return '#'+result; |
|
986 } |
|
987 |
|
988 |
|
989 |
|
990 function sg_to_plato(sg){ |
|
991 return ((135.997*sg - 630.272) * sg + 1111.14) * sg - 616.868; |
|
992 } |
|
993 |
|
994 |
|
995 |
|
996 function plato_to_sg(plato){ |
|
997 return 1 + (plato / (258.6-((plato/258.2)*227.1))); |
|
998 } |
|
999 |
|
1000 |
|
1001 |
|
1002 function brix_to_sg(brix){ |
|
1003 if(my_brix_correction>0) |
|
1004 return plato_to_sg(brix/my_brix_correction); |
|
1005 else |
|
1006 return plato_to_sg(brix); |
|
1007 } |
|
1008 |
|
1009 |
|
1010 |
|
1011 function sg_to_brix(sg){ |
|
1012 return sg_to_plato(sg)*my_brix_correction; |
|
1013 } |
|
1014 |
|
1015 |
935 |
1016 |
936 function estimate_sg(sugars,batch_size){ |
1017 function estimate_sg(sugars,batch_size){ |
937 var plato=100*sugars/batch_size; |
1018 |
938 var sg=plato_to_sg(plato); |
1019 var plato, sg, i; |
939 for(var i=0;i<20;i++){if(sg>0)plato=100*sugars/(batch_size*sg);sg=plato_to_sg(plato);} |
1020 |
940 return Round(sg,4); |
1021 plato = 100*sugars / batch_size; |
|
1022 sg = plato_to_sg(plato); |
|
1023 for (i = 0; i < 20; i++) { |
|
1024 if (sg > 0) |
|
1025 plato = 100*sugars / (batch_size*sg); |
|
1026 sg = plato_to_sg(plato); |
|
1027 } |
|
1028 return Round(sg,4); |
941 } |
1029 } |
942 |
1030 |
943 |
1031 |
944 |
1032 |
945 function estimate_fg(percSugar,percCara,WGratio,TotTme,Temp,attenuation,og){ |
1033 function estimate_fg(percSugar,percCara,WGratio,TotTme,Temp,attenuation,og){ |
946 |
1034 |
947 var BD; |
1035 var BD, AttBeer, fg; |
948 |
1036 |
949 if(percSugar>40)percSugar=0; |
1037 if (percSugar > 40) |
950 if(percCara>50)percCara=0; |
1038 percSugar = 0; |
951 if((WGratio>0)&&(TotTme>0)){ |
1039 if (percCara > 50) |
952 BD=WGratio; |
1040 percCara = 0; |
953 if(BD<2)BD=2; |
1041 if ((WGratio > 0) && (TotTme > 0)) { |
954 if(BD>5.5)BD=5.5; |
1042 BD = WGratio; |
955 if(Temp<60)Temp=60; |
1043 if(BD < 2) |
956 if(Temp>72)Temp=72; |
1044 BD=2; |
957 }else{ |
1045 if(BD > 5.5) |
958 BD=3.5; |
1046 BD=5.5; |
959 Temp=67; |
1047 if(Temp < 60) |
960 TotTme=75; |
1048 Temp=60; |
961 } |
1049 if(Temp > 72) |
962 if(attenuation<30)attenuation=77; |
1050 Temp=72; |
963 |
1051 } else { |
964 // 0.00825 Attenuation factor yeast |
1052 BD=3.5; |
965 // 0.00817 Attenuation factor water/grain ration |
1053 Temp=67; |
966 // -0.00684 Attenuation factor mash temperature |
1054 TotTme=75; |
967 // 0.00026 Attenuation factor total mash time (at some places this is 0.0026 this is wrong!) |
1055 } |
968 // -0.00356 Attenuation factor percentage crystal malt |
1056 if (attenuation < 30) |
969 // 0.00553 Attenuation factor percentage simple sugars |
1057 attenuation=77; |
970 // 0.547 Attenuation factor constant |
1058 |
971 var AttBeer=0.00825*attenuation+0.00817*BD-0.00684*Temp+0.00026*TotTme-0.00356*percCara+0.00553*percSugar+0.547; |
1059 // 0.00825 Attenuation factor yeast |
972 var fg=Round(1+(1-AttBeer)*(og-1),4); |
1060 // 0.00817 Attenuation factor water/grain ration |
973 |
1061 // -0.00684 Attenuation factor mash temperature |
974 console.log("estimate_fg("+percSugar+","+percCara+","+BD+","+TotTme+","+Temp+","+attenuation+","+og+") AttBeer:"+AttBeer+" fg:"+fg); |
1062 // 0.00026 Attenuation factor total mash time (at some places this is 0.0026 this is wrong!) |
975 return fg; |
1063 // -0.00356 Attenuation factor percentage crystal malt |
|
1064 // 0.00553 Attenuation factor percentage simple sugars |
|
1065 // 0.547 Attenuation factor constant |
|
1066 AttBeer = 0.00825*attenuation + 0.00817*BD - 0.00684*Temp + 0.00026*TotTme - 0.00356*percCara + 0.00553*percSugar + 0.547; |
|
1067 fg = Round(1 + (1 - AttBeer) * (og - 1), 4); |
|
1068 |
|
1069 console.log("estimate_fg("+percSugar+","+percCara+","+BD+","+TotTme+","+Temp+","+attenuation+","+og+") AttBeer:"+AttBeer+" fg:"+fg); |
|
1070 return fg; |
976 } |
1071 } |
977 |
1072 |
978 |
1073 |
979 |
1074 |
980 function CalcFrac(TpH, pK1, pK2, pK3) { |
1075 function CalcFrac(TpH, pK1, pK2, pK3) { |
981 |
1076 |
982 var r1d = Math.pow(10, TpH - pK1); |
1077 var r1d, r2d, r3d, dd, f2d, f3d, f4d; |
983 var r2d = Math.pow(10, TpH - pK2); |
1078 |
984 var r3d = Math.pow(10, TpH - pK3); |
1079 r1d = Math.pow(10, TpH - pK1); |
985 var dd = 1/(1 + r1d + r1d*r2d + r1d*r2d*r3d); |
1080 r2d = Math.pow(10, TpH - pK2); |
986 var f1d = dd; |
1081 r3d = Math.pow(10, TpH - pK3); |
987 var f2d = r1d*dd; |
1082 dd = 1/(1 + r1d + r1d*r2d + r1d*r2d*r3d); |
988 var f3d = r1d*r2d*dd; |
1083 f2d = r1d*dd; |
989 var f4d = r1d*r2d*r3d*dd; |
1084 f3d = r1d*r2d*dd; |
|
1085 f4d = r1d*r2d*r3d*dd; |
990 return f2d + 2*f3d + 3*f4d; |
1086 return f2d + 2*f3d + 3*f4d; |
991 } |
1087 } |
992 |
1088 |
993 |
1089 |
|
1090 |
994 function lintner_to_kolbach(lintner) { |
1091 function lintner_to_kolbach(lintner) { |
995 |
1092 |
996 return (3.5 * lintner) - 16; |
1093 return (3.5 * lintner) - 16; |
997 } |
1094 } |
998 |
1095 |