www/js/global.js

changeset 475
c34d71572023
parent 465
dc3e14b976be
child 476
7ee8072baaba
equal deleted inserted replaced
474:7b7df475e67d 475:c34d71572023
22 22
23 23
24 // dropdownlists arrays 24 // dropdownlists arrays
25 25
26 var StageData = [ 26 var StageData = [
27 { id: 0, en: "Plan", nl: "Plan" }, 27 { id: 0, en: 'Plan', nl: 'Plan' },
28 { id: 1, en: "Wait", nl: "Wacht" }, 28 { id: 1, en: 'Wait', nl: 'Wacht' },
29 { id: 2, en: "Brew", nl: "Brouwen" }, 29 { id: 2, en: 'Brew', nl: 'Brouwen' },
30 { id: 3, en: "Primary", nl: "Hoofdgisting" }, 30 { id: 3, en: 'Primary', nl: 'Hoofdgisting' },
31 { id: 4, en: "Secondary", nl: "Nagisting" }, 31 { id: 4, en: 'Secondary', nl: 'Nagisting' },
32 { id: 5, en: "Tertiary", nl: "Lagering" }, 32 { id: 5, en: 'Tertiary', nl: 'Lagering' },
33 { id: 6, en: "Package", nl: "Afvullen" }, 33 { id: 6, en: 'Package', nl: 'Afvullen' },
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 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 StageAdapter = new $.jqx.dataAdapter(StageSource), 45 StageAdapter = new $.jqx.dataAdapter(StageSource),
46 46
47 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 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 MaterialAdapter = new $.jqx.dataAdapter(MaterialSource), 58 MaterialAdapter = new $.jqx.dataAdapter(MaterialSource),
59 59
60 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 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 FermentableTypeAdapter = new $.jqx.dataAdapter(FermentableTypeSource), 72 FermentableTypeAdapter = new $.jqx.dataAdapter(FermentableTypeSource),
73 73
74 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 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 GrainTypeAdapter = new $.jqx.dataAdapter(GrainTypeSource), 88 GrainTypeAdapter = new $.jqx.dataAdapter(GrainTypeSource),
89 89
90 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 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 AddedAdapter = new $.jqx.dataAdapter(AddedSource), 103 AddedAdapter = new $.jqx.dataAdapter(AddedSource),
104 104
105 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 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 HopTypeAdapter = new $.jqx.dataAdapter(HopTypeSource), 115 HopTypeAdapter = new $.jqx.dataAdapter(HopTypeSource),
116 116
117 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 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 HopFormAdapter = new $.jqx.dataAdapter(HopFormSource), 129 HopFormAdapter = new $.jqx.dataAdapter(HopFormSource),
130 130
131 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 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 HopUseAdapter = new $.jqx.dataAdapter(HopUseSource), 144 HopUseAdapter = new $.jqx.dataAdapter(HopUseSource),
145 145
146 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 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 YeastTypeAdapter = new $.jqx.dataAdapter(YeastTypeSource), 163 YeastTypeAdapter = new $.jqx.dataAdapter(YeastTypeSource),
164 164
165 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 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 YeastFormAdapter = new $.jqx.dataAdapter(YeastFormSource), 178 YeastFormAdapter = new $.jqx.dataAdapter(YeastFormSource),
179 179
180 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 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 YeastUseAdapter = new $.jqx.dataAdapter(YeastUseSource), 191 YeastUseAdapter = new $.jqx.dataAdapter(YeastUseSource),
192 192
193 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 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 FlocculationAdapter = new $.jqx.dataAdapter(FlocculationSource), 204 FlocculationAdapter = new $.jqx.dataAdapter(FlocculationSource),
205 205
206 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 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 StarterTypeAdapter = new $.jqx.dataAdapter(StarterTypeSource), 216 StarterTypeAdapter = new $.jqx.dataAdapter(StarterTypeSource),
217 217
218 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 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 MiscTypeAdapter = new $.jqx.dataAdapter(MiscTypeSource), 232 MiscTypeAdapter = new $.jqx.dataAdapter(MiscTypeSource),
233 233
234 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 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 MiscUseAdapter = new $.jqx.dataAdapter(MiscUseSource), 247 MiscUseAdapter = new $.jqx.dataAdapter(MiscUseSource),
248 248
249 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 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 StyleTypeAdapter = new $.jqx.dataAdapter(StyleTypeSource), 262 StyleTypeAdapter = new $.jqx.dataAdapter(StyleTypeSource),
263 263
264 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 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 MashStepTypeAdapter = new $.jqx.dataAdapter(MashStepTypeSource), 274 MashStepTypeAdapter = new $.jqx.dataAdapter(MashStepTypeSource),
275 275
276 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 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 RecipeTypeAdapter = new $.jqx.dataAdapter(RecipeTypeSource), 286 RecipeTypeAdapter = new $.jqx.dataAdapter(RecipeTypeSource),
287 287
288 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 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 IBUmethodAdapter = new $.jqx.dataAdapter(IBUmethodSource), 301 IBUmethodAdapter = new $.jqx.dataAdapter(IBUmethodSource),
302 302
303 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 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 ColorMethodAdapter = new $.jqx.dataAdapter(ColorMethodSource), 315 ColorMethodAdapter = new $.jqx.dataAdapter(ColorMethodSource),
316 316
317 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 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 CoolingTypeAdapter = new $.jqx.dataAdapter(CoolingTypeSource), 329 CoolingTypeAdapter = new $.jqx.dataAdapter(CoolingTypeSource),
330 330
331 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 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 AerationTypeAdapter = new $.jqx.dataAdapter(AerationTypeSource), 341 AerationTypeAdapter = new $.jqx.dataAdapter(AerationTypeSource),
342 342
343 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 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 AcidTypeAdapter = new $.jqx.dataAdapter(AcidTypeSource), 354 AcidTypeAdapter = new $.jqx.dataAdapter(AcidTypeSource),
355 355
356 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 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 BaseTypeAdapter = new $.jqx.dataAdapter(BaseTypeSource), 367 BaseTypeAdapter = new $.jqx.dataAdapter(BaseTypeSource),
368 368
369 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 stylesUrl = "includes/db_profile_styles.php",
417 stylesSource = { 416 stylesSource = {
418 datatype: "json", 417 datatype: 'json',
419 datafields: [ 418 datafields: [
420 { name: 'record', type: 'number' }, 419 { name: 'record', type: 'number' },
421 { name: 'name', type: 'string' }, 420 { name: 'name', type: 'string' },
422 { name: 'category', type: 'string' }, 421 { name: 'category', type: 'string' },
423 { name: 'category_number', type: 'number' }, 422 { name: 'category_number', type: 'number' },
424 { name: 'style_letter', type: 'string' }, 423 { name: 'style_letter', type: 'string' },
425 { name: 'style_guide', type: 'string' }, 424 { name: 'style_guide', type: 'string' },
426 { name: 'type', type: 'int' }, 425 { name: 'type', type: 'int' },
427 { name: 'og_min', type: 'float' }, 426 { name: 'og_min', type: 'float' },
428 { name: 'og_max', type: 'float' }, 427 { name: 'og_max', type: 'float' },
429 { name: 'fg_min', type: 'float' }, 428 { name: 'fg_min', type: 'float' },
430 { name: 'fg_max', type: 'float' }, 429 { name: 'fg_max', type: 'float' },
431 { name: 'ibu_min', type: 'float' }, 430 { name: 'ibu_min', type: 'float' },
432 { name: 'ibu_max', type: 'float' }, 431 { name: 'ibu_max', type: 'float' },
433 { name: 'color_min', type: 'float' }, 432 { name: 'color_min', type: 'float' },
434 { name: 'color_max', type: 'float' }, 433 { name: 'color_max', type: 'float' },
435 { name: 'carb_min', type: 'float' }, 434 { name: 'carb_min', type: 'float' },
436 { name: 'carb_max', type: 'float' }, 435 { name: 'carb_max', type: 'float' },
437 { name: 'abv_min', type: 'float' }, 436 { name: 'abv_min', type: 'float' },
438 { name: 'abv_max', type: 'float' }, 437 { name: 'abv_max', type: 'float' },
439 { name: 'notes', type: 'string' }, 438 { name: 'notes', type: 'string' },
440 { name: 'profile', type: 'string' }, 439 { name: 'profile', type: 'string' },
441 { name: 'ingredients', type: 'string' }, 440 { name: 'ingredients', type: 'string' },
442 { name: 'examples', type: 'string' } 441 { name: 'examples', type: 'string' }
443 ], 442 ],
444 url: stylesUrl 443 url: 'includes/db_profile_styles.php'
445 }, 444 },
446 styleslist = new $.jqx.dataAdapter(stylesSource), 445 styleslist = new $.jqx.dataAdapter(stylesSource),
447 446
448 // Equipemnt dropdown list 447 // Equipemnt dropdown list
449 equipmentUrl = "includes/db_inventory_equipments.php",
450 equipmentSource = { 448 equipmentSource = {
451 datatype: "json", 449 datatype: 'json',
452 datafields: [ 450 datafields: [
453 { name: 'name', type: 'string' }, 451 { name: 'name', type: 'string' },
454 { name: 'boil_size', type: 'float' }, 452 { name: 'boil_size', type: 'float' },
455 { name: 'batch_size', type: 'float' }, 453 { name: 'batch_size', type: 'float' },
456 { name: 'tun_volume', type: 'float' }, 454 { name: 'tun_volume', type: 'float' },
457 { name: 'tun_weight', type: 'float' }, 455 { name: 'tun_weight', type: 'float' },
458 { name: 'tun_specific_heat', type: 'float' }, 456 { name: 'tun_specific_heat', type: 'float' },
459 { name: 'tun_material', type: 'int' }, 457 { name: 'tun_material', type: 'int' },
460 { name: 'tun_height', type: 'float' }, 458 { name: 'tun_height', type: 'float' },
461 { name: 'top_up_water', type: 'float' }, 459 { name: 'top_up_water', type: 'float' },
462 { name: 'trub_chiller_loss', type: 'float' }, 460 { name: 'trub_chiller_loss', type: 'float' },
463 { name: 'evap_rate', type: 'float' }, 461 { name: 'evap_rate', type: 'float' },
464 { name: 'boil_time', type: 'float' }, 462 { name: 'boil_time', type: 'float' },
465 { name: 'calc_boil_volume', type: 'int' }, 463 { name: 'calc_boil_volume', type: 'int' },
466 { name: 'top_up_kettle', type: 'float' }, 464 { name: 'top_up_kettle', type: 'float' },
467 { name: 'hop_utilization', type: 'float' }, 465 { name: 'hop_utilization', type: 'float' },
468 { name: 'notes', type: 'string' }, 466 { name: 'notes', type: 'string' },
469 { name: 'lauter_volume', type: 'float' }, 467 { name: 'lauter_volume', type: 'float' },
470 { name: 'lauter_height', type: 'float' }, 468 { name: 'lauter_height', type: 'float' },
471 { name: 'lauter_deadspace', type: 'float' }, 469 { name: 'lauter_deadspace', type: 'float' },
472 { name: 'kettle_volume', type: 'float' }, 470 { name: 'kettle_volume', type: 'float' },
473 { name: 'kettle_height', type: 'float' }, 471 { name: 'kettle_height', type: 'float' },
474 { name: 'mash_volume', type: 'float' }, 472 { name: 'mash_volume', type: 'float' },
475 { name: 'mash_max', type: 'float' }, 473 { name: 'mash_max', type: 'float' },
476 { name: 'efficiency', type: 'float' } 474 { name: 'efficiency', type: 'float' }
477 ], 475 ],
478 url: equipmentUrl 476 url: 'includes/db_inventory_equipments.php'
479 }, 477 },
480 equipmentlist = new $.jqx.dataAdapter(equipmentSource), 478 equipmentlist = new $.jqx.dataAdapter(equipmentSource),
481 479
482 // dropdownlist datasource from inventory_fermentables 480 // dropdownlist datasource from inventory_fermentables
483 fermentableInvSource = { 481 fermentableInvSource = {
484 datatype: "json", 482 datatype: 'json',
485 datafields: [ 483 datafields: [
486 { name: 'record', type: 'number' }, 484 { name: 'record', type: 'number' },
487 { name: 'name', type: 'string' }, 485 { name: 'name', type: 'string' },
488 { name: 'type', type: 'int' }, 486 { name: 'type', type: 'int' },
489 { name: 'yield', type: 'float' }, 487 { name: 'yield', type: 'float' },
490 { name: 'color', type: 'float' }, 488 { name: 'color', type: 'float' },
491 { name: 'add_after_boil', type: 'int' }, 489 { name: 'add_after_boil', type: 'int' },
492 { name: 'origin', type: 'string' }, 490 { name: 'origin', type: 'string' },
493 { name: 'supplier', type: 'string' }, 491 { name: 'supplier', type: 'string' },
494 { name: 'coarse_fine_diff', type: 'float' }, 492 { name: 'coarse_fine_diff', type: 'float' },
495 { name: 'moisture', type: 'float' }, 493 { name: 'moisture', type: 'float' },
496 { name: 'diastatic_power', type: 'float' }, 494 { name: 'diastatic_power', type: 'float' },
497 { name: 'protein', type: 'float' }, 495 { name: 'protein', type: 'float' },
498 { name: 'dissolved_protein', type: 'float' }, 496 { name: 'dissolved_protein', type: 'float' },
499 { name: 'max_in_batch', type: 'float' }, 497 { name: 'max_in_batch', type: 'float' },
500 { name: 'recommend_mash', type: 'int' }, 498 { name: 'recommend_mash', type: 'int' },
501 { name: 'graintype', type: 'int' }, 499 { name: 'graintype', type: 'int' },
502 { name: 'di_ph', type: 'float' }, 500 { name: 'di_ph', type: 'float' },
503 { name: 'acid_to_ph_57', type: 'float' }, 501 { name: 'acid_to_ph_57', type: 'float' },
504 { name: 'inventory', type: 'float' }, 502 { name: 'inventory', type: 'float' },
505 { name: 'cost', type: 'float' } 503 { name: 'cost', type: 'float' }
506 ], 504 ],
507 url: "getfermentablesources.php" 505 url: 'getfermentablesources.php'
508 }, 506 },
509 fermentableinstock = false, 507 fermentableinstock = false,
510 fermentablelist = new $.jqx.dataAdapter(fermentableInvSource, { 508 fermentablelist = new $.jqx.dataAdapter(fermentableInvSource, {
511 beforeLoadComplete: function (records) { 509 beforeLoadComplete: function(records) {
512 var row, i, data = new Array(); 510 var row, i, data = new Array();
513 for (i = 0; i < records.length; i++) { 511 for (i = 0; i < records.length; i++) {
514 row = records[i]; 512 row = records[i];
515 if (row.inventory || ! fermentableinstock) 513 if (row.inventory || ! fermentableinstock)
516 data.push(row); 514 data.push(row);
517 } 515 }
518 return data; 516 return data;
519 }, 517 },
520 loadError: function(jqXHR, status, error) { 518 loadError: function(jqXHR, status, error) {
521 console.log(status + ' ' + error); 519 console.log(status + ' ' + error);
522 }, 520 },
523 }), 521 }),
524 fermentablesugars = new $.jqx.dataAdapter(fermentableInvSource, { 522 fermentablesugars = new $.jqx.dataAdapter(fermentableInvSource, {
525 beforeLoadComplete: function (records) { 523 beforeLoadComplete: function(records) {
526 var row, i, data = new Array(); 524 var row, i, data = new Array();
527 for (i = 0; i < records.length; i++) { 525 for (i = 0; i < records.length; i++) {
528 row = records[i]; 526 row = records[i];
529 if (row.type == 1 || row.type == 3) // Sugars or dry extract 527 if (row.type == 1 || row.type == 3) // Sugars or dry extract
530 data.push(row); 528 data.push(row);
531 } 529 }
532 return data; 530 return data;
533 }, 531 },
534 loadError: function(jqXHR, status, error) { 532 loadError: function(jqXHR, status, error) {
535 console.log(status + ' ' + error); 533 console.log(status + ' ' + error);
536 }, 534 },
537 }), 535 }),
538 536
539 // dropdownlist datasource from inventory_hops 537 // dropdownlist datasource from inventory_hops
540 hopInvSource = { 538 hopInvSource = {
541 datatype: "json", 539 datatype: 'json',
542 datafields: [ 540 datafields: [
543 { name: 'record', type: 'number' }, 541 { name: 'record', type: 'number' },
544 { name: 'name', type: 'string' }, 542 { name: 'name', type: 'string' },
545 { name: 'origin', type: 'string' }, 543 { name: 'origin', type: 'string' },
546 { name: 'type', type: 'int' }, 544 { name: 'type', type: 'int' },
547 { name: 'alpha', type: 'float' }, 545 { name: 'alpha', type: 'float' },
548 { name: 'beta', type: 'float' }, 546 { name: 'beta', type: 'float' },
549 { name: 'humulene', type: 'float' }, 547 { name: 'humulene', type: 'float' },
550 { name: 'caryophyllene', type: 'float' }, 548 { name: 'caryophyllene', type: 'float' },
551 { name: 'cohumulone', type: 'float' }, 549 { name: 'cohumulone', type: 'float' },
552 { name: 'myrcene', type: 'float' }, 550 { name: 'myrcene', type: 'float' },
553 { name: 'hsi', type: 'float' }, 551 { name: 'hsi', type: 'float' },
554 { name: 'useat', type: 'int' }, 552 { name: 'useat', type: 'int' },
555 { name: 'form', type: 'int' }, 553 { name: 'form', type: 'int' },
556 { name: 'total_oil', type: 'float' }, 554 { name: 'total_oil', type: 'float' },
557 { name: 'inventory', type: 'float' }, 555 { name: 'inventory', type: 'float' },
558 { name: 'cost', type: 'float' } 556 { name: 'cost', type: 'float' }
559 ], 557 ],
560 url: "gethopsources.php" 558 url: 'gethopsources.php'
561 }, 559 },
562 hopinstock = false, 560 hopinstock = false,
563 hoplist = new $.jqx.dataAdapter(hopInvSource, { 561 hoplist = new $.jqx.dataAdapter(hopInvSource, {
564 beforeLoadComplete: function (records) { 562 beforeLoadComplete: function(records) {
565 var row, i, data = new Array(); 563 var row, i, data = new Array();
566 for (i = 0; i < records.length; i++) { 564 for (i = 0; i < records.length; i++) {
567 row = records[i]; 565 row = records[i];
568 if (row.inventory || ! hopinstock) 566 if (row.inventory || ! hopinstock)
569 data.push(row); 567 data.push(row);
570 } 568 }
571 return data; 569 return data;
572 }, 570 },
573 loadError: function(jqXHR, status, error) { 571 loadError: function(jqXHR, status, error) {
574 console.log(status + ' ' + error); 572 console.log(status + ' ' + error);
575 }, 573 },
576 }), 574 }),
577 575
578 // dropdownlist datasource from inventory_miscs 576 // dropdownlist datasource from inventory_miscs
579 miscInvSource = { 577 miscInvSource = {
580 datatype: "json", 578 datatype: 'json',
581 datafields: [ 579 datafields: [
582 { name: 'record', type: 'number' }, 580 { name: 'record', type: 'number' },
583 { name: 'name', type: 'string' }, 581 { name: 'name', type: 'string' },
584 { name: 'type', type: 'int' }, 582 { name: 'type', type: 'int' },
585 { name: 'use_use', type: 'int' }, 583 { name: 'use_use', type: 'int' },
586 { name: 'amount_is_weight', type: 'int' }, 584 { name: 'amount_is_weight', type: 'int' },
587 { name: 'time', type: 'float' }, 585 { name: 'time', type: 'float' },
588 { name: 'inventory', type: 'float' }, 586 { name: 'inventory', type: 'float' },
589 { name: 'cost', type: 'float' } 587 { name: 'cost', type: 'float' }
590 ], 588 ],
591 url: "getmiscsources.php" 589 url: 'getmiscsources.php'
592 }, 590 },
593 miscinstock = false, 591 miscinstock = false,
594 misclist = new $.jqx.dataAdapter(miscInvSource, { 592 misclist = new $.jqx.dataAdapter(miscInvSource, {
595 beforeLoadComplete: function (records) { 593 beforeLoadComplete: function(records) {
596 var row, i, data = new Array(); 594 var row, i, data = new Array();
597 for (i = 0; i < records.length; i++) { 595 for (i = 0; i < records.length; i++) {
598 row = records[i]; 596 row = records[i];
599 if (row.inventory || ! miscinstock) 597 if (row.inventory || ! miscinstock)
600 data.push(row); 598 data.push(row);
601 } 599 }
602 return data; 600 return data;
603 }, 601 },
604 loadError: function(jqXHR, status, error) { 602 loadError: function(jqXHR, status, error) {
605 console.log(status + ' ' + error); 603 console.log(status + ' ' + error);
606 }, 604 },
607 }), 605 }),
608 606
609 // dropdownlist datasource from inventory_yeasts 607 // dropdownlist datasource from inventory_yeasts
610 yeastInvSource = { 608 yeastInvSource = {
611 datatype: "json", 609 datatype: 'json',
612 datafields: [ 610 datafields: [
613 { name: 'record', type: 'number' }, 611 { name: 'record', type: 'number' },
614 { name: 'name', type: 'string' }, 612 { name: 'name', type: 'string' },
615 { name: 'type', type: 'int' }, 613 { name: 'type', type: 'int' },
616 { name: 'form', type: 'int' }, 614 { name: 'form', type: 'int' },
617 { name: 'laboratory', type: 'string' }, 615 { name: 'laboratory', type: 'string' },
618 { name: 'product_id', type: 'string' }, 616 { name: 'product_id', type: 'string' },
619 { name: 'min_temperature', type: 'float' }, 617 { name: 'min_temperature', type: 'float' },
620 { name: 'max_temperature', type: 'float' }, 618 { name: 'max_temperature', type: 'float' },
621 { name: 'flocculation', type: 'int' }, 619 { name: 'flocculation', type: 'int' },
622 { name: 'attenuation', type: 'float' }, 620 { name: 'attenuation', type: 'float' },
623 { name: 'cells', type: 'float' }, 621 { name: 'cells', type: 'float' },
624 { name: 'inventory', type: 'float' }, 622 { name: 'inventory', type: 'float' },
625 { name: 'cost', type: 'float' }, 623 { name: 'cost', type: 'float' },
626 { name: 'tolerance', type: 'float' } 624 { name: 'tolerance', type: 'float' }
627 ], 625 ],
628 url: "getyeastsources.php" 626 url: 'getyeastsources.php'
629 }, 627 },
630 yeastinstock = false, 628 yeastinstock = false,
631 yeastlist = new $.jqx.dataAdapter(yeastInvSource, { 629 yeastlist = new $.jqx.dataAdapter(yeastInvSource, {
632 beforeLoadComplete: function (records) { 630 beforeLoadComplete: function(records) {
633 var row, i, data = new Array(); 631 var row, i, data = new Array();
634 for (i = 0; i < records.length; i++) { 632 for (i = 0; i < records.length; i++) {
635 row = records[i]; 633 row = records[i];
636 if (row.inventory || ! yeastinstock) 634 if (row.inventory || ! yeastinstock)
637 data.push(row); 635 data.push(row);
638 } 636 }
639 return data; 637 return data;
640 }, 638 },
641 loadError: function(jqXHR, status, error) { 639 loadError: function(jqXHR, status, error) {
642 console.log(status + ' ' + error); 640 console.log(status + ' ' + error);
643 }, 641 },
644 }), 642 }),
645 643
646 // dropdownlist datasource from inventory_waters 644 // dropdownlist datasource from inventory_waters
647 waterInvSource = { 645 waterInvSource = {
648 datatype: "json", 646 datatype: 'json',
649 datafields: [ 647 datafields: [
650 { name: 'record', type: 'number' }, 648 { name: 'record', type: 'number' },
651 { name: 'name', type: 'string' }, 649 { name: 'name', type: 'string' },
652 { name: 'unlimited_stock', type: 'int' }, 650 { name: 'unlimited_stock', type: 'int' },
653 { name: 'calcium', type: 'float' }, 651 { name: 'calcium', type: 'float' },
654 { name: 'sulfate', type: 'float' }, 652 { name: 'sulfate', type: 'float' },
655 { name: 'chloride', type: 'float' }, 653 { name: 'chloride', type: 'float' },
656 { name: 'sodium', type: 'float' }, 654 { name: 'sodium', type: 'float' },
657 { name: 'magnesium', type: 'float' }, 655 { name: 'magnesium', type: 'float' },
658 { name: 'ph', type: 'float' }, 656 { name: 'ph', type: 'float' },
659 { name: 'total_alkalinity', type: 'float' }, 657 { name: 'total_alkalinity', type: 'float' },
660 { name: 'inventory', type: 'float' }, 658 { name: 'inventory', type: 'float' },
661 { name: 'cost', type: 'float' }, 659 { name: 'cost', type: 'float' },
662 ], 660 ],
663 url: "getwatersources.php" 661 url: 'getwatersources.php'
664 }, 662 },
665 waterinstock = false, 663 waterinstock = false,
666 waterlist = new $.jqx.dataAdapter(waterInvSource, { 664 waterlist = new $.jqx.dataAdapter(waterInvSource, {
667 beforeLoadComplete: function (records) { 665 beforeLoadComplete: function(records) {
668 var data, i, row; 666 var data, i, row;
669 data = new Array(); 667 data = new Array();
670 for (i = 0; i < records.length; i++) { 668 for (i = 0; i < records.length; i++) {
671 row = records[i]; 669 row = records[i];
672 if (row.inventory || row.unlimited_stock || ! waterinstock) 670 if (row.inventory || row.unlimited_stock || ! waterinstock)
673 data.push(row); 671 data.push(row);
674 } 672 }
675 return data; 673 return data;
676 }, 674 },
677 loadError: function(jqXHR, status, error) { 675 loadError: function(jqXHR, status, error) {
678 console.log(status + ' ' + error); 676 console.log(status + ' ' + error);
679 }, 677 },
680 }), 678 }),
681 679
682 // dropdownlist datasource from profile_water 680 // dropdownlist datasource from profile_water
683 waterProfileSource = { 681 waterProfileSource = {
684 datatype: "json", 682 datatype: 'json',
685 datafields: [ 683 datafields: [
686 { name: 'record', type: 'number' }, 684 { name: 'record', type: 'number' },
687 { name: 'name', type: 'string' }, 685 { name: 'name', type: 'string' },
688 { name: 'calcium', type: 'float' }, 686 { name: 'calcium', type: 'float' },
689 { name: 'bicarbonate', type: 'float' }, 687 { name: 'bicarbonate', type: 'float' },
690 { name: 'sulfate', type: 'float' }, 688 { name: 'sulfate', type: 'float' },
691 { name: 'chloride', type: 'float' }, 689 { name: 'chloride', type: 'float' },
692 { name: 'sodium', type: 'float' }, 690 { name: 'sodium', type: 'float' },
693 { name: 'magnesium', type: 'float' }, 691 { name: 'magnesium', type: 'float' },
694 { name: 'ph', type: 'float' }, 692 { name: 'ph', type: 'float' },
695 { name: 'total_alkalinity', type: 'float' }, 693 { name: 'total_alkalinity', type: 'float' },
696 ], 694 ],
697 url: "includes/db_profile_water.php" 695 url: 'includes/db_profile_water.php'
698 }, 696 },
699 waterprofiles = new $.jqx.dataAdapter(waterProfileSource), 697 waterprofiles = new $.jqx.dataAdapter(waterProfileSource),
700 698
701 // dropdownlist datasource from profile_mash 699 // dropdownlist datasource from profile_mash
702 mashProfileSource = { 700 mashProfileSource = {
703 datatype: "json", 701 datatype: 'json',
704 datafields: [ 702 datafields: [
705 { name: 'record', type: 'number' }, 703 { name: 'record', type: 'number' },
706 { name: 'name', type: 'string' }, 704 { name: 'name', type: 'string' },
707 { name: 'steps', type: 'array' } 705 { name: 'steps', type: 'array' }
708 ], 706 ],
709 url: "includes/db_profile_mash.php" 707 url: 'includes/db_profile_mash.php'
710 }, 708 },
711 mashlist = new $.jqx.dataAdapter(mashProfileSource), 709 mashlist = new $.jqx.dataAdapter(mashProfileSource),
712 710
713 711
714 712
715 /* 713 /*
716 * From "Rekenen aan bier" by Hans Halberstadt. 714 * From "Rekenen aan bier" by Hans Halberstadt.
717 */ 715 */
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; 716 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;
719 717
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 718 // =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
721 // For Brix 719 // For Brix
722 function A(sugar, volume, alc, eiwit, glycerol) { 720 function A(sugar, volume, alc, eiwit, glycerol) {
723 721
724 var vol, A; 722 var vol, A;
725 723
726 vol = volume * 1000; 724 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; 725 A = sugar / vol + (alc / vol) * Ka1 / Ks + (alc / vol) * (alc / vol) * Ka2 / Ks + eiwit / vol * Ke / Ks + glycerol / vol * Kg / Ks;
728 console.log("A("+sugar+"."+volume+","+alc+","+eiwit+","+glycerol+"):"+A); 726 console.log('A(' + sugar + ',' + volume + ',' + alc + ',' + eiwit + ',' + glycerol + '):' + A);
729 return A; 727 return A;
730 } 728 }
731 729
732 // =E2/E6+(E3/E6)*$B$20/$B$19+E4/E6*$B$21/$B$19+E5/E6*$B$22/$B$19 730 // =E2/E6+(E3/E6)*$B$20/$B$19+E4/E6*$B$21/$B$19+E5/E6*$B$22/$B$19
733 // for Plato 731 // for Plato
734 function B(sugar, volume, alc, eiwit, glycerol) { 732 function B(sugar, volume, alc, eiwit, glycerol) {
735 733
736 var vol, B; 734 var vol, B;
737 735
738 vol = volume * 1000; 736 vol = volume * 1000;
739 B = sugar/vol + (alc/vol)*K1a/K1s + eiwit/vol*K1e/K1s + glycerol/vol*K1g/K1s; 737 B = sugar / vol + (alc / vol) * K1a / K1s + eiwit / vol * K1e / K1s + glycerol / vol * K1g / K1s;
740 console.log("B("+sugar+"."+volume+","+alc+","+eiwit+","+glycerol+"):"+B); 738 console.log('B(' + sugar + ',' + volume + ',' + alc + ',' + eiwit + ',' + glycerol + '):' + B);
741 return B; 739 return B;
742 } 740 }
743 741
744 742
745 743
746 $(document).ready(function(){ 744 $(document).ready(function() {
747 745
748 $("#jqxMenu").jqxMenu({ 746 $('#jqxMenu').jqxMenu({
749 width:1280, 747 width: 1280,
750 height:'30px', 748 height: '30px',
751 autoOpen:false, 749 autoOpen: false,
752 clickToOpen:true, 750 clickToOpen: true,
753 theme:theme 751 theme: theme
754 }); 752 });
755 $("#jqxWidget").css('visibility','visible'); 753 $('#jqxWidget').css('visibility', 'visible');
754
756 }); 755 });
757 756
758 757
759 758
760 function Round(n,d){ 759 function Round(n, d) {
761 760 for (var i = 0, m = 1; i < d; i++, m *= 10);
762 for (var i=0,m=1; i<d; i++,m*=10); 761 return Math.round(n * m) / m;
763 return Math.round(n*m)/m; 762 }
764 } 763
765 764
766 765
767 766 function ebc_to_srm(ebc) {
768 function ebc_to_srm(ebc){ 767 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 768 if (srm < 0)
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; 769 srm = 0;
771 if(srm<0) 770 return srm;
772 srm=0; 771 }
773 return srm; 772
774 } 773
775 774
776 775 function srm_to_ebc(srm) {
777 776 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);
778 function srm_to_ebc(srm){ 777 if (ebc < 0)
779 778 ebc = 0;
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); 779 return ebc;
781 if(ebc<0)
782 ebc=0;
783 return ebc;
784 } 780 }
785 781
786 782
787 783
788 /* Return incremented color by the boil and yeast. 784 /* Return incremented color by the boil and yeast.
789 * https://www.hobbybrouwen.nl/forum/index.php/topic,19020.msg281132.html#msg281132 */ 785 * https://www.hobbybrouwen.nl/forum/index.php/topic,19020.msg281132.html#msg281132 */
790 function get_kt(ebc){ 786 function get_kt(ebc) {
791 787
792 var kt=1; 788 var kt = 1;
793 if(ebc<3) 789 if (ebc < 3)
794 kt=3.5; 790 kt = 3.5;
795 else if(ebc<6) 791 else if (ebc < 6)
796 kt=3; 792 kt = 3;
797 else if(ebc<8) 793 else if (ebc < 8)
798 kt=2.75; 794 kt = 2.75;
799 else if(ebc<10) 795 else if (ebc < 10)
800 kt=2.5; 796 kt = 2.5;
801 else if(ebc<20) 797 else if (ebc < 20)
802 kt=1.8; 798 kt = 1.8;
803 else if(ebc<30) 799 else if (ebc < 30)
804 kt=1.6; 800 kt = 1.6;
805 else if(ebc<60) 801 else if (ebc < 60)
806 kt=1.3; 802 kt = 1.3;
807 else if(ebc<100) 803 else if (ebc < 100)
808 kt=1.2; 804 kt = 1.2;
809 else if(ebc<300) 805 else if (ebc < 300)
810 kt=1.1; 806 kt = 1.1;
811 return kt; 807 return kt;
812 } 808 }
813 809
814 810
815 811
816 function abvol(og,fg){ 812 function abvol(og, fg) {
817 813 if (((og - fg) < 0) || (fg < 0.9))
818 if(((og-fg)<0)||(fg<0.9)) 814 return 0;
819 return 0; 815 var factor = og * 3157 * Math.pow(10, -5) + 9.716 * Math.pow(10, -2);
820 var factor = og*3157*Math.pow(10,-5) + 9.716*Math.pow(10,-2); 816 return (og * 1000 - fg * 1000) * factor;
821 return (og*1000-fg*1000)*factor;
822 } 817 }
823 818
824 819
825 820
826 /* Kleurwerking naar SRM. Niet voor Halberstadt, Naudts */ 821 /* Kleurwerking naar SRM. Niet voor Halberstadt, Naudts */
827 function kw_to_srm(colormethod,c){ 822 function kw_to_srm(colormethod, c) {
828 if(colormethod==0) 823 if (colormethod == 0)
829 return 1.4922*Math.pow(c,0.6859);//Morey 824 return 1.4922 * Math.pow(c, 0.6859); //Morey
830 if(colormethod==1) 825 if (colormethod == 1)
831 return 0.3*c+4.7;//Mosher 826 return 0.3 * c + 4.7; //Mosher
832 if(colormethod==2) 827 if (colormethod == 2)
833 return 0.2*c+8.4;//Daniels 828 return 0.2 * c + 8.4; //Daniels
834 return 0;//Halberstadt,Naudts 829 return 0; //Halberstadt,Naudts
835 } 830 }
836 831
837 832
838 833
839 function kw_to_ebc(colormethod, c){ 834 function kw_to_ebc(colormethod, c) {
840 835 return srm_to_ebc(kw_to_srm(colormethod, c));
841 return srm_to_ebc(kw_to_srm(colormethod,c));
842 } 836 }
843 837
844 838
845 839
846 /* 840 /*
847 * Berekeningen uit https://www.hobbybrouwen.nl/forum/index.php/topic,6079.msg69464.html#msg69464 841 * Berekeningen uit https://www.hobbybrouwen.nl/forum/index.php/topic,6079.msg69464.html#msg69464
848 */ 842 */
849 function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method) { 843 function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method) {
850 844
851 var gravity, liters, alpha, mass, time, fmoment=1.0, pfactor=1.0, ibu=0, boilfactor, sgfactor, 845 var gravity, liters, alpha, mass, time, fmoment = 1.0, pfactor = 1.0, ibu = 0, boilfactor, sgfactor,
852 AddedAlphaAcids, Bigness_factor, BoilTime_factor, utiisation; 846 AddedAlphaAcids, Bigness_factor, BoilTime_factor, utiisation;
853 847
854 gravity = parseFloat(SG); 848 gravity = parseFloat(SG);
855 liters = parseFloat(Volume); 849 liters = parseFloat(Volume);
856 alpha = parseFloat(Alpha)/100; 850 alpha = parseFloat(Alpha) / 100;
857 mass = parseFloat(Amount)*1000; 851 mass = parseFloat(Amount) * 1000;
858 time = parseFloat(Boiltime); 852 time = parseFloat(Boiltime);
859 853
860 if ((Use==3) || (Use==4) || (Use==5)) { // Aroma, Whirlpool or Dry hop. 854 if ((Use == 3) || (Use == 4) || (Use == 5)) { // Aroma, Whirlpool or Dry hop.
861 fmoment=0.0; 855 fmoment = 0.0;
862 } else if (Use==0) { // Mash 856 } else if (Use == 0) { // Mash
863 fmoment+=my_factor_mashhop/100; // Brouwhulp 857 fmoment += my_factor_mashhop / 100; // Brouwhulp
864 } else if (Use==1) { // First wort 858 } else if (Use == 1) { // First wort
865 fmoment+=my_factor_fwh/100; // Brouwhulp, Louis, Ozzie 859 fmoment += my_factor_fwh / 100; // Brouwhulp, Louis, Ozzie
866 } 860 }
867 861
868 if (Form==0){ // Pellet 862 if (Form == 0) { // Pellet
869 pfactor+=my_factor_pellet/100; 863 pfactor += my_factor_pellet / 100;
870 } else if (Form==1) { // Plug 864 } else if (Form == 1) { // Plug
871 pfactor+=my_factor_plug/100; 865 pfactor += my_factor_plug / 100;
872 } else if (Form==3) { // Wet leaf 866 } else if (Form == 3) { // Wet leaf
873 pfactor+=my_factor_wethop/100; // From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py 867 pfactor += my_factor_wethop / 100; // From https://github.com/chrisgilmerproj/brewday/blob/master/brew/constants.py
874 } else if (Form==4) { // Cryo hop 868 } else if (Form == 4) { // Cryo hop
875 pfactor+=my_factor_cryohop/100; 869 pfactor += my_factor_cryohop / 100;
876 } 870 }
877 871
878 if(Method==0){// Tinseth 872 if (Method == 0) { // Tinseth
879 /* http://realbeer.com/hops/research.html */ 873 /* http://realbeer.com/hops/research.html */
880 AddedAlphaAcids=(alpha*mass*1000)/liters; 874 AddedAlphaAcids = (alpha * mass * 1000) / liters;
881 Bigness_factor=1.65*Math.pow(0.000125,gravity-1); 875 Bigness_factor = 1.65 * Math.pow(0.000125, gravity - 1);
882 BoilTime_factor=((1-Math.exp(-0.04*time))/4.15); 876 BoilTime_factor = ((1 - Math.exp(-0.04 * time)) / 4.15);
883 utiisation=Bigness_factor*BoilTime_factor; 877 utiisation = Bigness_factor * BoilTime_factor;
884 ibu=Round(utiisation*AddedAlphaAcids*fmoment*pfactor,1); 878 ibu = Round(utiisation * AddedAlphaAcids * fmoment * pfactor, 1);
885 } 879 }
886 if(Method==2){// Daniels 880 if (Method == 2) { // Daniels
887 if (Form == 2)// Leaf 881 if (Form == 2) // Leaf
888 boilfactor = -(0.0041*time*time)+(0.6162*time)+1.5779; 882 boilfactor = -(0.0041 * time * time) + (0.6162 * time) + 1.5779;
889 else 883 else
890 boilfactor = -(0.0051*time*time)+(0.7835*time)+1.9348; 884 boilfactor = -(0.0051 * time * time) + (0.7835 * time) + 1.9348;
891 if (gravity < 1050) 885 if (gravity < 1050)
892 sgfactor=0; 886 sgfactor = 0;
893 else 887 else
894 sgfactor=(gravity-1050)/200; 888 sgfactor = (gravity - 1050) / 200;
895 ibu = Round(fmoment*((mass*(alpha*100)*boilfactor* 0.1)/(liters*(1+sgfactor))),1); 889 ibu = Round(fmoment * ((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor))), 1);
896 } 890 }
897 if(Method==1){// Rager 891 if (Method == 1) { // Rager
898 boilfactor = fmoment*18.11 + 13.86*Math.tanh((time*31.32)/18.27); 892 boilfactor = fmoment * 18.11 + 13.86 * Math.tanh((time * 31.32) / 18.27);
899 if (gravity < 1050) 893 if (gravity < 1050)
900 sgfactor=0; 894 sgfactor = 0;
901 else 895 else
902 sgfactor=(gravity-1050)/200; 896 sgfactor = (gravity - 1050) / 200;
903 ibu = Round((mass*(alpha*100)*boilfactor*0.1)/(liters*(1+sgfactor)),1); 897 ibu = Round((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor)), 1);
904 } 898 }
905 899
906 //console.log("toIBU("+Use+","+Form+","+SG+","+Volume+","+Amount+","+Boiltime+","+Alpha+","+Method+"):"+ibu+" fm:"+fmoment+" pf:"+pfactor); 900 //console.log("toIBU("+Use+","+Form+","+SG+","+Volume+","+Amount+","+Boiltime+","+Alpha+","+Method+"):"+ibu+" fm:"+fmoment+" pf:"+pfactor);
907 return ibu; 901 return ibu;
908 } 902 }
909 903
910 904
911 905
912 function ebc_to_color(ebc){ 906 function ebc_to_color(ebc) {
913 907 return srm_to_color(ebc_to_srm(ebc));
914 return srm_to_color(ebc_to_srm(ebc)); 908 }
915 } 909
916 910
917 911
918 912 function srm_to_color(srm) {
919 function srm_to_color(srm){ 913 var i, R, G, B, color, result;
920 914
921 var i, R, G, B, color, result; 915 i = Math.round(srm * 10);
922 916 if (i < 0)
923 i = Math.round(srm * 10); 917 i = 0;
924 if (i < 0) 918 if (i > 299)
925 i=0; 919 i = 299;
926 if (i > 299) 920
927 i=299; 921 /* Table copied from Brouwhulp/BrewBuddy */
928 922
929 /* Table copied from Brouwhulp/BrewBuddy */ 923 R = [
930 R=[ 924 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, //0
931 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,//0 925 250, 250, 250, 250, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, //2
932 250,250,250,250,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236,235,//2 926 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, //4
933 234,233,232,231,230,229,228,227,226,225,224,223,222,221,220,219,218,217,216,215,//4 927 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 200, 199, 199, 198, 198, //6
934 214,213,212,211,210,209,208,207,206,205,204,203,202,201,200,200,199,199,198,198,//6 928 197, 197, 196, 196, 195, 195, 194, 194, 193, 193, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, //8
935 197,197,196,196,195,195,194,194,193,193,192,192,192,192,192,192,192,192,192,192,//8 929 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, //10
936 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,//10 930 192, 192, 192, 192, 192, 192, 192, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, //12
937 192,192,192,192,192,192,192,192,191,190,189,188,187,186,185,184,183,182,181,180,//12 931 179, 178, 177, 175, 174, 172, 171, 169, 168, 167, 195, 164, 162, 161, 159, 158, 157, 155, 154, 152, //14
938 179,178,177,175,174,172,171,169,168,167,195,164,162,161,159,158,157,155,154,152,//14 932 151, 149, 148, 147, 145, 144, 142, 141, 139, 138, 137, 135, 134, 132, 131, 129, 128, 127, 125, 124, //16
939 151,149,148,147,145,144,142,141,139,138,137,135,134,132,131,129,128,127,125,124,//16 933 122, 121, 119, 118, 117, 115, 114, 112, 111, 109, 108, 107, 105, 104, 102, 101, 99, 98, 97, 95, //18
940 122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101,99,98,97,95,//18 934 94, 92, 91, 89, 88, 87, 85, 84, 82, 81, 79, 78, 77, 75, 74, 72, 71, 69, 68, 67, //20
941 94,92,91,89,88,87,85,84,82,81,79,78,77,75,74,72,71,69,68,67,//20 935 65, 64, 62, 61, 59, 58, 57, 55, 54, 52, 51, 49, 48, 47, 45, 44, 43, 41, 39, 38, //22
942 65,64,62,61,59,58,57,55,54,52,51,49,48,47,45,44,43,41,39,38,//22 936 37, 37, 36, 36, 35, 35, 34, 34, 33, 33, 32, 32, 31, 31, 30, 30, 29, 29, 28, 28, //24
943 37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,//24 937 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 22, 21, 21, 20, 20, 19, 19, 18, 18, //26
944 27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,//26 938 17, 17, 16, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8];
945 17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8]; 939
946 940 G = [
947 G=[ 941 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
948 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250, 942 250, 250, 250, 250, 250, 250, 249, 248, 247, 246, 245, 244, 242, 240, 238, 236, 234, 232, 230, 228,
949 250,250,250,250,250,250,249,248,247,246,245,244,242,240,238,236,234,232,230,228, 943 226, 224, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 198, 196, 194, 192, 190, 188,
950 226,224,222,220,218,216,214,212,210,208,206,204,202,200,198,196,194,192,190,188, 944 186, 184, 182, 180, 178, 176, 174, 172, 170, 168, 166, 164, 162, 160, 158, 156, 154, 152, 150, 148,
951 186,184,182,180,178,176,174,172,170,168,166,164,162,160,158,156,154,152,150,148, 945 146, 144, 142, 141, 140, 139, 139, 138, 137, 136, 136, 135, 134, 133, 133, 132, 131, 130, 130, 129,
952 146,144,142,141,140,139,139,138,137,136,136,135,134,133,133,132,131,130,130,129, 946 128, 127, 127, 126, 125, 124, 124, 123, 122, 121, 121, 120, 119, 118, 118, 117, 116, 115, 115, 114,
953 128,127,127,126,125,124,124,123,122,121,121,120,119,118,118,117,116,115,115,114, 947 113, 112, 112, 111, 110, 109, 109, 108, 107, 106, 106, 105, 104, 103, 103, 102, 101, 100, 100, 99,
954 113,112,112,111,110,109,109,108,107,106,106,105,104,103,103,102,101,100,100,99, 948 98, 97, 97, 96, 95, 94, 94, 93, 92, 91, 91, 90, 89, 88, 88, 87, 86, 85, 85, 84,
955 98,97,97,96,95,94,94,93,92,91,91,90,89,88,88,87,86,85,85,84, 949 83, 82, 82, 81, 80, 79, 78, 77, 76, 75, 75, 74, 73, 72, 72, 71, 70, 69, 69, 68,
956 83,82,82,81,80,79,78,77,76,75,75,74,73,72,72,71,70,69,69,68, 950 67, 66, 66, 65, 64, 63, 63, 62, 61, 60, 60, 59, 58, 57, 57, 56, 55, 54, 54, 53,
957 67,66,66,65,64,63,63,62,61,60,60,59,58,57,57,56,55,54,54,53, 951 52, 51, 51, 50, 49, 48, 48, 47, 46, 45, 45, 44, 43, 42, 42, 41, 40, 39, 39, 38,
958 52,51,51,50,49,48,48,47,46,45,45,44,43,42,42,41,40,39,39,38, 952 37, 36, 36, 35, 34, 33, 33, 32, 31, 30, 30, 29, 28, 27, 27, 26, 25, 24, 24, 23,
959 37,36,36,35,34,33,33,32,31,30,30,29,28,27,27,26,25,24,24,23, 953 22, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 16, 16,
960 22,22,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,16, 954 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9,
961 16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9, 955 9, 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3];
962 9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3]; 956
963 957 B = [
964 B=[ 958 210, 204, 199, 193, 188, 182, 177, 171, 166, 160, 155, 149, 144, 138, 133, 127, 122, 116, 111, 105,
965 210,204,199,193,188,182,177,171,166,160,155,149,144,138,133,127,122,116,111,105, 959 100, 94, 89, 83, 78, 72, 67, 61, 56, 50, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47,
966 100,94,89,83,78,72,67,61,56,50,45,45,45,46,46,46,46,47,47,47, 960 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52,
967 47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52, 961 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56,
968 52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,56,56,56, 962 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
969 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, 963 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
970 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, 964 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
971 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, 965 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 52, 51,
972 56,56,56,55,55,55,55,54,54,54,54,53,53,53,53,52,52,52,52,51, 966 51, 51, 51, 50, 50, 50, 50, 49, 49, 48, 47, 47, 46, 45, 45, 44, 43, 43, 42, 41,
973 51,51,51,50,50,50,50,49,49,48,47,47,46,45,45,44,43,43,42,41, 967 41, 40, 39, 39, 38, 37, 37, 36, 35, 34, 33, 32, 31, 29, 28, 27, 26, 25, 24, 23,
974 41,40,39,39,38,37,37,36,35,34,33,32,31,29,28,27,26,25,24,23, 968 21, 20, 19, 18, 17, 16, 15, 13, 12, 11, 10, 9, 8, 9, 9, 10, 10, 11, 11, 12,
975 21,20,19,18,17,16,15,13,12,11,10,9,8,9,9,10,10,11,11,12, 969 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
976 12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22, 970 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 17, 16, 16, 15, 15,
977 21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,17,16,16,15,15, 971 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, 9, 9, 8,
978 15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8, 972 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2];
979 8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3,2,2,2]; 973
980 974 color = R[i] * 65536 + G[i] * 256 + B[i];
981 color = R[i]*65536 + G[i]*256 + B[i]; 975 result = color.toString(16).toUpperCase();
982 result = color.toString(16).toUpperCase(); 976 if (result.length < 6)
983 if (result.length < 6) 977 result = '0' + result;
984 result = '0'+result; 978 return '#' + result;
985 return '#'+result; 979 }
986 } 980
987 981
988 982
989 983 function sg_to_plato(sg) {
990 function sg_to_plato(sg){ 984 return ((135.997 * sg - 630.272) * sg + 1111.14) * sg - 616.868;
991 return ((135.997*sg - 630.272) * sg + 1111.14) * sg - 616.868; 985 }
992 } 986
993 987
994 988
995 989 function plato_to_sg(plato) {
996 function plato_to_sg(plato){ 990 return 1 + (plato / (258.6 - ((plato / 258.2) * 227.1)));
997 return 1 + (plato / (258.6-((plato/258.2)*227.1))); 991 }
998 } 992
999 993
1000 994
1001 995 function brix_to_sg(brix) {
1002 function brix_to_sg(brix){ 996 if (my_brix_correction > 0)
1003 if(my_brix_correction>0) 997 return plato_to_sg(brix / my_brix_correction);
1004 return plato_to_sg(brix/my_brix_correction); 998 else
1005 else 999 return plato_to_sg(brix);
1006 return plato_to_sg(brix); 1000 }
1007 } 1001
1008 1002
1009 1003
1010 1004 function sg_to_brix(sg) {
1011 function sg_to_brix(sg){ 1005 return sg_to_plato(sg) * my_brix_correction;
1012 return sg_to_plato(sg)*my_brix_correction; 1006 }
1013 } 1007
1014 1008
1015 1009
1016 1010 function estimate_sg(sugars, batch_size) {
1017 function estimate_sg(sugars,batch_size){ 1011
1018 1012 var plato, sg, i;
1019 var plato, sg, i; 1013
1020 1014 plato = 100 * sugars / batch_size;
1021 plato = 100*sugars / batch_size; 1015 sg = plato_to_sg(plato);
1022 sg = plato_to_sg(plato); 1016 for (i = 0; i < 20; i++) {
1023 for (i = 0; i < 20; i++) { 1017 if (sg > 0)
1024 if (sg > 0) 1018 plato = 100 * sugars / (batch_size * sg);
1025 plato = 100*sugars / (batch_size*sg); 1019 sg = plato_to_sg(plato);
1026 sg = plato_to_sg(plato); 1020 }
1027 } 1021 return Round(sg, 4);
1028 return Round(sg,4); 1022 }
1029 } 1023
1030 1024
1031 1025
1032 1026 function estimate_fg(percSugar, percCara, WGratio, TotTme, Temp, attenuation, og) {
1033 function estimate_fg(percSugar,percCara,WGratio,TotTme,Temp,attenuation,og){ 1027
1034 1028 var BD, AttBeer, fg;
1035 var BD, AttBeer, fg; 1029
1036 1030 if (percSugar > 40)
1037 if (percSugar > 40) 1031 percSugar = 0;
1038 percSugar = 0; 1032 if (percCara > 50)
1039 if (percCara > 50) 1033 percCara = 0;
1040 percCara = 0; 1034 if ((WGratio > 0) && (TotTme > 0)) {
1041 if ((WGratio > 0) && (TotTme > 0)) { 1035 BD = WGratio;
1042 BD = WGratio; 1036 if (BD < 2)
1043 if(BD < 2) 1037 BD = 2;
1044 BD=2; 1038 if (BD > 5.5)
1045 if(BD > 5.5) 1039 BD = 5.5;
1046 BD=5.5; 1040 if (Temp < 60)
1047 if(Temp < 60) 1041 Temp = 60;
1048 Temp=60; 1042 if (Temp > 72)
1049 if(Temp > 72) 1043 Temp = 72;
1050 Temp=72; 1044 } else {
1051 } else { 1045 BD = 3.5;
1052 BD=3.5; 1046 Temp = 67;
1053 Temp=67; 1047 TotTme = 75;
1054 TotTme=75; 1048 }
1055 } 1049 if (attenuation < 30)
1056 if (attenuation < 30) 1050 attenuation = 77;
1057 attenuation=77; 1051
1058 1052 // 0.00825 Attenuation factor yeast
1059 // 0.00825 Attenuation factor yeast 1053 // 0.00817 Attenuation factor water/grain ration
1060 // 0.00817 Attenuation factor water/grain ration 1054 // -0.00684 Attenuation factor mash temperature
1061 // -0.00684 Attenuation factor mash temperature 1055 // 0.00026 Attenuation factor total mash time (at some places this is 0.0026 this is wrong!)
1062 // 0.00026 Attenuation factor total mash time (at some places this is 0.0026 this is wrong!) 1056 // -0.00356 Attenuation factor percentage crystal malt
1063 // -0.00356 Attenuation factor percentage crystal malt 1057 // 0.00553 Attenuation factor percentage simple sugars
1064 // 0.00553 Attenuation factor percentage simple sugars 1058 // 0.547 Attenuation factor constant
1065 // 0.547 Attenuation factor constant 1059 AttBeer = 0.00825 * attenuation + 0.00817 * BD - 0.00684 * Temp + 0.00026 * TotTme - 0.00356 * percCara + 0.00553 * percSugar + 0.547;
1066 AttBeer = 0.00825*attenuation + 0.00817*BD - 0.00684*Temp + 0.00026*TotTme - 0.00356*percCara + 0.00553*percSugar + 0.547; 1060 fg = Round(1 + (1 - AttBeer) * (og - 1), 4);
1067 fg = Round(1 + (1 - AttBeer) * (og - 1), 4); 1061
1068 1062 console.log('estimate_fg(' + percSugar + ',' + percCara + ',' + BD + ',' + TotTme + ',' +
1069 console.log("estimate_fg("+percSugar+","+percCara+","+BD+","+TotTme+","+Temp+","+attenuation+","+og+") AttBeer:"+AttBeer+" fg:"+fg); 1063 Temp + ',' + attenuation + ',' + og + ') AttBeer:' + AttBeer + ' fg:' + fg);
1070 return fg; 1064 return fg;
1071 } 1065 }
1072 1066
1073 1067
1074 1068
1075 function CalcFrac(TpH, pK1, pK2, pK3) { 1069 function CalcFrac(TpH, pK1, pK2, pK3) {
1076 1070
1077 var r1d, r2d, r3d, dd, f2d, f3d, f4d; 1071 var r1d, r2d, r3d, dd, f2d, f3d, f4d;
1078 1072
1079 r1d = Math.pow(10, TpH - pK1); 1073 r1d = Math.pow(10, TpH - pK1);
1080 r2d = Math.pow(10, TpH - pK2); 1074 r2d = Math.pow(10, TpH - pK2);
1081 r3d = Math.pow(10, TpH - pK3); 1075 r3d = Math.pow(10, TpH - pK3);
1082 dd = 1/(1 + r1d + r1d*r2d + r1d*r2d*r3d); 1076 dd = 1 / (1 + r1d + r1d * r2d + r1d * r2d * r3d);
1083 f2d = r1d*dd; 1077 f2d = r1d * dd;
1084 f3d = r1d*r2d*dd; 1078 f3d = r1d * r2d * dd;
1085 f4d = r1d*r2d*r3d*dd; 1079 f4d = r1d * r2d * r3d * dd;
1086 return f2d + 2*f3d + 3*f4d; 1080 return f2d + 2 * f3d + 3 * f4d;
1087 } 1081 }
1088 1082
1089 1083
1090 1084
1091 function lintner_to_kolbach(lintner) { 1085 function lintner_to_kolbach(lintner) {
1092 1086 return (3.5 * lintner) - 16;
1093 return (3.5 * lintner) - 16;
1094 } 1087 }
1095 1088
1096 1089
1097 function kolbach_to_lintner(kolbach) { 1090 function kolbach_to_lintner(kolbach) {
1098 1091 return (kolbach + 16) / 3.5;
1099 return (kolbach + 16) / 3.5; 1092 }
1100 } 1093
1101 1094
1102

mercurial