154 $("#sparge_acid_perc").jqxNumberInput({ spinButtons: rw, readOnly: ro, width: w100 }); |
154 $("#sparge_acid_perc").jqxNumberInput({ spinButtons: rw, readOnly: ro, width: w100 }); |
155 }; |
155 }; |
156 |
156 |
157 function calcFermentables() { |
157 function calcFermentables() { |
158 console.log("calcFermentables()"); |
158 console.log("calcFermentables()"); |
159 sugarsf = 0; |
159 sugarsf = 0; // fermentable sugars mash + boil |
160 sugarsm = 0; |
160 sugarsm = 0; // fermentable sugars in mash |
161 psugar = 0; |
161 psugar = 0; |
162 pcara = 0; |
162 pcara = 0; |
163 mashkg = 0; |
163 mashkg = 0; |
164 var colorw = 0; // Colors working |
164 var vol = 0; // Volume sugars after boil |
|
165 var addedS = 0; // Added sugars after boil |
|
166 var addedmass = 0; // Added mass after boil |
|
167 var mvol = 0; // mash volume |
|
168 var colort = 0; // Colors srm * vol totals |
165 var my_100 = false; |
169 var my_100 = false; |
166 |
170 var mashtime = 0; // Total mash time |
167 var rows = $('#fermentableGrid').jqxGrid('getrows'); |
171 var mashtemp = 0; // Average mash temperature |
|
172 |
|
173 if ((rows = $('#mashGrid').jqxGrid('getrows'))) { |
|
174 for (var i = 0; i < rows.length; i++) { |
|
175 var row = rows[i]; |
|
176 if (row.step_type == 0) // Infusion |
|
177 mvol += parseFloat(row.step_infuse_amount); |
|
178 if (row.step_temp <= 75) { // Ignore mashout |
|
179 mashtime += row.step_time; |
|
180 mashtemp += row.step_time * row.step_temp; |
|
181 } |
|
182 } |
|
183 mashtemp = mashtemp / mashtime; |
|
184 } |
|
185 |
|
186 if (!(rows = $('#fermentableGrid').jqxGrid('getrows'))) { |
|
187 return; // grid not yet loaded. |
|
188 } |
|
189 |
|
190 var s = 0; |
168 for (var i = 0; i < rows.length; i++) { |
191 for (var i = 0; i < rows.length; i++) { |
169 var row = rows[i]; |
192 var row = rows[i]; |
170 if (row.f_adjust_to_total_100) |
193 if (row.f_adjust_to_total_100) |
171 my_100 = true; |
194 my_100 = true; |
172 if (row.f_type == 1) // Sugar |
195 if (row.f_type == 1) // Sugar |
173 psugar += row.f_percentage; |
196 psugar += row.f_percentage; |
174 if (row.f_graintype == 2) // Crystal |
197 if (row.f_graintype == 2) // Crystal |
175 pcara += row.f_percentage; |
198 pcara += row.f_percentage; |
176 var d = row.f_amount * (row.f_yield / 100) * (1 - row.f_moisture / 100); |
199 var d = row.f_amount * (row.f_yield / 100) * (1 - row.f_moisture / 100); |
177 if (row.f_added == 0) { // Mash |
200 if (row.f_added == 0) { // Mash |
|
201 if (mvol > 0) { // Only if mash already known |
|
202 mvol += row.f_amount * row.f_moisture / 100; |
|
203 s += d; |
|
204 } |
178 d = parseFloat(dataRecord.efficiency) / 100 * d; |
205 d = parseFloat(dataRecord.efficiency) / 100 * d; |
179 sugarsm += d; |
206 sugarsm += d; |
180 mashkg += row.f_amount; |
207 mashkg += row.f_amount; |
181 } |
208 } |
182 sugarsf += d; |
209 if (row.f_added == 0 || row.f_added == 1) // Mash or Boil |
183 colorw += row.f_amount * ebc_to_srm(row.f_color) / parseFloat(dataRecord.batch_size) * 8.34436; |
210 sugarsf += d; |
|
211 if (row.f_added == 2 || row.f_added == 3) { |
|
212 var x = (row.f_yield / 100) * (1 - row.f_moisture / 100); |
|
213 addedS += row.f_amount * x; |
|
214 addedmass += row.f_amount; |
|
215 vol += (x * sugardensity + (1 - x) * 1) * row.f_amount; |
|
216 } |
|
217 colort += row.f_amount * ebc_to_srm(row.f_color); |
184 } |
218 } |
185 to_100 = my_100; |
219 to_100 = my_100; |
186 if (to_100) { |
220 if (to_100) { |
187 $("#wf_amount").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); |
221 $("#wf_amount").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); |
188 } else { |
222 } else { |
189 $("#wf_amount").jqxNumberInput({ width: 110, readOnly: false, spinButtons: true }); |
223 $("#wf_amount").jqxNumberInput({ width: 110, readOnly: false, spinButtons: true }); |
190 } |
224 } |
191 var est_og = estimate_sg(sugarsf, parseFloat(dataRecord.batch_size)); |
225 |
192 $('#est_og').val(est_og); |
226 // Estimate total recipe OG. |
193 $('#est_og2').val(est_og); |
227 dataRecord.est_og = estimate_sg(sugarsf + addedS, parseFloat(dataRecord.batch_size)); |
194 preboil_sg = estimate_sg(sugarsm, dataRecord.boil_size); |
228 $('#est_og').val(dataRecord.est_og); |
195 var color = kw_to_ebc(dataRecord.color_method, colorw); |
229 $('#est_og2').val(dataRecord.est_og); |
|
230 |
|
231 // Estimate SG in kettle before boil |
|
232 preboil_sg = estimate_sg(sugarsm, parseFloat(dataRecord.boil_size)); |
|
233 |
|
234 // Color of the wort |
|
235 var cw = colort / parseFloat(dataRecord.batch_size) * 8.34436; |
|
236 var color = kw_to_ebc(dataRecord.color_method, cw); |
|
237 dataRecord.est_color = color; |
196 $('#est_color').val(color); |
238 $('#est_color').val(color); |
197 $('#est_color2').val(color); |
239 $('#est_color2').val(color); |
198 var scolor = ebc_to_color(color); |
240 var scolor = ebc_to_color(color); |
199 document.getElementById("bcolor").style.background= scolor; |
241 document.getElementById("bcolor").style.background= scolor; |
200 document.getElementById("bcolor2").style.background= scolor; |
242 document.getElementById("bcolor2").style.background= scolor; |
201 // Use boil_size instead of mash_max from equipment. |
243 |
|
244 // Progress bars |
202 pmalts = mashkg / (dataRecord.boil_size / 3) * 100; |
245 pmalts = mashkg / (dataRecord.boil_size / 3) * 100; |
203 $("#perc_malts").jqxProgressBar('val', pmalts); |
246 $("#perc_malts").jqxProgressBar('val', pmalts); |
204 $("#perc_sugars").jqxProgressBar('val', psugar); |
247 $("#perc_sugars").jqxProgressBar('val', psugar); |
205 $("#perc_cara").jqxProgressBar('val', pcara); |
248 $("#perc_cara").jqxProgressBar('val', pcara); |
|
249 |
|
250 // Calculate estimated svg. |
|
251 svg = 0; // default. |
|
252 var rows = $('#yeastGrid').jqxGrid('getrows'); |
|
253 for (var i = 0; i < rows.length; i++) { |
|
254 var row = rows[i]; |
|
255 if (row.y_use == 0) { // Primary |
|
256 if (parseFloat(row.y_attenuation) > svg) |
|
257 svg = parseFloat(row.y_attenuation); // Take the highest if multiple yeasts. |
|
258 } |
|
259 // TODO: brett in secondary ?? |
|
260 } |
|
261 if (svg == 0) |
|
262 svg = 77; |
|
263 |
|
264 if ((mashkg > 0) && (mash_infuse > 0) && (mashtime > 0) && (mashtemp > 0)) { |
|
265 dataRecord.est_fg = estimate_fg(psugar, pcara, mash_infuse / mashkg, mashtime, mashtemp, svg, dataRecord.est_og); |
|
266 } else { |
|
267 dataRecord.est_fg = estimate_fg(psugar, pcara, 0, 0, 0, svg, dataRecord.est_og); |
|
268 } |
|
269 $('#est_fg').val(dataRecord.est_fg); |
|
270 $('#est_fg2').val(dataRecord.est_fg); |
|
271 |
|
272 dataRecord.est_abv = abvol(dataRecord.est_og, dataRecord.est_fg); |
|
273 $("#est_abv").val(dataRecord.est_abv); |
|
274 $("#est_abv2").val(dataRecord.est_abv); |
206 }; |
275 }; |
207 |
276 |
208 function hopFlavourContribution(bt, vol, use, amount) { |
277 function hopFlavourContribution(bt, vol, use, amount) { |
209 var result; |
278 var result; |
210 |
279 |
1161 // console.log("old_evap:"+old_evap+" new_evap:"+new_evap+" new_boil:"+new_boil); |
1205 // console.log("old_evap:"+old_evap+" new_evap:"+new_evap+" new_boil:"+new_boil); |
1162 dataRecord.boil_time = parseFloat(event.args.value); |
1206 dataRecord.boil_time = parseFloat(event.args.value); |
1163 dataRecord.boil_size = new_boil; |
1207 dataRecord.boil_size = new_boil; |
1164 $("#boil_size").val(Math.round(new_boil * 100) / 100); |
1208 $("#boil_size").val(Math.round(new_boil * 100) / 100); |
1165 calcFermentables(); |
1209 calcFermentables(); |
1166 calcSVG(); |
|
1167 calcFG(); |
|
1168 calcABV(); |
|
1169 // TODO: adjust the hops, miscs, yeast, water. |
1210 // TODO: adjust the hops, miscs, yeast, water. |
1170 calcIBUs(); |
1211 calcIBUs(); |
1171 }); |
1212 }); |
1172 $('#efficiency').on('change', function (event) { |
1213 $('#efficiency').on('change', function (event) { |
1173 console.log("efficiency change:"+event.args.value); |
1214 console.log("efficiency change:"+event.args.value); |
1174 calcFermentables(); |
1215 calcFermentables(); |
1175 calcSVG(); |
|
1176 calcFG(); |
|
1177 calcABV(); |
|
1178 calcIBUs(); |
1216 calcIBUs(); |
1179 }); |
1217 }); |
1180 $('#est_og').on('change', function (event) { |
1218 $('#est_og').on('change', function (event) { |
1181 console.log("est_og change:"+event.args.value); |
1219 console.log("est_og change:"+event.args.value); |
1182 calcFermentablesFromOG(event.args.value); // Adjust fermentables amounts |
1220 calcFermentablesFromOG(event.args.value); // Adjust fermentables amounts |
1183 calcFermentables(); // Update the recipe details |
1221 calcFermentables(); // Update the recipe details |
1184 calcSVG(); |
|
1185 calcFG(); |
|
1186 calcABV(); // and ABV |
|
1187 calcIBUs(); // and the IBU's. |
1222 calcIBUs(); // and the IBU's. |
1188 }); |
1223 }); |
1189 $('#mash_ph').on('change', function (event) { |
1224 $('#mash_ph').on('change', function (event) { |
1190 dataRecord.mash_ph = parseFloat(event.args.value); |
1225 dataRecord.mash_ph = parseFloat(event.args.value); |
1191 calcWater(); |
1226 calcWater(); |
2410 $("#st_category").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'}); |
2438 $("#st_category").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'}); |
2411 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 }); |
2439 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 }); |
2412 $("#st_category_number").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'}); |
2440 $("#st_category_number").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'}); |
2413 $("#st_category_number").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2441 $("#st_category_number").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2414 $("#st_type").jqxTooltip({ content: 'Het bierstijl type.'}); |
2442 $("#st_type").jqxTooltip({ content: 'Het bierstijl type.'}); |
2415 $("#st_type").jqxInput({ theme: theme, width: 180, height: 23 }); |
2443 $("#st_type").jqxInput({ theme: theme, width: 250, height: 23 }); |
2416 |
2444 |
2417 $("#est_og").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
2445 $("#est_og").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
2418 $("#est_og").jqxNumberInput( SGopts ); |
2446 $("#est_og").jqxNumberInput( SGopts ); |
2419 $("#st_og_min").jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'}); |
2447 $("#st_og_min").jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'}); |
2420 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
2448 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
2421 $("#st_og_max").jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'}); |
2449 $("#st_og_max").jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'}); |
2422 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
2450 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
2423 |
2451 |
2424 $("#est_fg").jqxTooltip({ content: 'Het eind SG. Dit wordt automatisch berekend.' }); |
2452 $("#est_fg").jqxTooltip({ content: 'Het eind SG. Dit wordt automatisch berekend.' }); |
2425 $("#est_fg").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true }); |
2453 $("#est_fg").jqxNumberInput( Show3dec ); |
2426 $("#st_fg_min").jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'}); |
2454 $("#st_fg_min").jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'}); |
2427 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
2455 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
2428 $("#st_fg_max").jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'}); |
2456 $("#st_fg_max").jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'}); |
2429 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
2457 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
2430 |
2458 |
2434 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
2462 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
2435 $("#st_abv_max").jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'}); |
2463 $("#st_abv_max").jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'}); |
2436 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
2464 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
2437 |
2465 |
2438 $("#est_color").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
2466 $("#est_color").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
2439 $("#est_color").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true }); |
2467 $("#est_color").jqxNumberInput( Show0dec ); |
2440 $("#st_color_min").jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'}); |
2468 $("#st_color_min").jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'}); |
2441 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2469 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2442 $("#st_color_max").jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'}); |
2470 $("#st_color_max").jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'}); |
2443 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2471 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2444 $("#color_method").jqxDropDownList({ |
2472 $("#color_method").jqxDropDownList({ |
2450 height: 23, |
2478 height: 23, |
2451 autoDropDownHeight: true |
2479 autoDropDownHeight: true |
2452 }); |
2480 }); |
2453 |
2481 |
2454 $("#est_ibu").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); |
2482 $("#est_ibu").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); |
2455 $("#est_ibu").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true }); |
2483 $("#est_ibu").jqxNumberInput( Show0dec ); |
2456 $("#st_ibu_min").jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'}); |
2484 $("#st_ibu_min").jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'}); |
2457 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2485 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2458 $("#st_ibu_max").jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'}); |
2486 $("#st_ibu_max").jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'}); |
2459 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2487 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2460 $("#ibu_method").jqxDropDownList({ |
2488 $("#ibu_method").jqxDropDownList({ |
2475 $("#st_carb_max").jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'}); |
2503 $("#st_carb_max").jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'}); |
2476 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
2504 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
2477 |
2505 |
2478 // Tab 2, Vergistbaar |
2506 // Tab 2, Vergistbaar |
2479 $("#est_color2").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
2507 $("#est_color2").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
2480 $("#est_color2").jqxNumberInput({ inputMode: 'simple', theme: theme, symbol: ' EBC', symbolPosition: 'right', width: 100, height: 23, decimalDigits: 0, readOnly: true }); |
2508 $("#est_color2").jqxNumberInput( Show0dec ); |
2481 $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
2509 $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
2482 $("#est_og2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 3, readOnly: true }); |
2510 $("#est_og2").jqxNumberInput( Show3dec ); |
2483 $("#perc_malts").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2511 $("#perc_malts").jqxProgressBar({ |
2484 $("#perc_sugars").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2512 width: 300, |
2485 $("#perc_cara").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2513 height: 23, |
|
2514 theme: theme, |
|
2515 showText: true, |
|
2516 animationDuration: 0, |
|
2517 colorRanges: [ |
|
2518 { stop: 90, color: '#008C00' }, |
|
2519 { stop: 95, color: '#EB7331' }, |
|
2520 { stop: 100, color: '#FF0000' } |
|
2521 ] |
|
2522 }); |
|
2523 $("#perc_sugars").jqxProgressBar({ |
|
2524 width: 300, |
|
2525 height: 23, |
|
2526 theme: theme, |
|
2527 showText: true, |
|
2528 animationDuration: 0, |
|
2529 colorRanges: [ |
|
2530 { stop: 20, color: '#008C00' }, |
|
2531 { stop: 100, color: '#FF0000' } |
|
2532 ] |
|
2533 }); |
|
2534 $("#perc_cara").jqxProgressBar({ |
|
2535 width: 300, |
|
2536 height: 23, |
|
2537 theme: theme, |
|
2538 showText: true, |
|
2539 animationDuration: 0, |
|
2540 colorRanges: [ |
|
2541 { stop: 25, color: '#008C00' }, |
|
2542 { stop: 100, color: '#FF0000' } |
|
2543 ] |
|
2544 }); |
2486 $("#popupFermentable").jqxWindow({ |
2545 $("#popupFermentable").jqxWindow({ |
2487 width: 800, |
2546 width: 800, |
2488 height: 300, |
2547 height: 300, |
2489 position: { x: 230, y: 100 }, |
2548 position: { x: 230, y: 100 }, |
2490 resizable: false, |
2549 resizable: false, |
2666 width: 180, |
2722 width: 180, |
2667 height: 23, |
2723 height: 23, |
2668 autoDropDownHeight: true, |
2724 autoDropDownHeight: true, |
2669 dropDownVerticalAlignment: 'top' |
2725 dropDownVerticalAlignment: 'top' |
2670 }); |
2726 }); |
|
2727 $("#wf_added").on('select', function (event) { |
|
2728 if (event.args) { |
|
2729 var index = event.args.index; |
|
2730 $("#fermentableGrid").jqxGrid('setcellvalue', fermentableRow, 'f_added', index); |
|
2731 calcFermentables(); |
|
2732 calcIBUs(); |
|
2733 } |
|
2734 }); |
2671 |
2735 |
2672 // Tab 3, Hoppen |
2736 // Tab 3, Hoppen |
2673 $("#est_ibu2").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); |
2737 $("#est_ibu2").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); |
2674 $("#est_ibu2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2738 $("#est_ibu2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2675 $("#hop_flavour").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2739 $("#hop_flavour").jqxProgressBar({ |
2676 $("#hop_aroma").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2740 width: 300, |
|
2741 height: 23, |
|
2742 theme: theme, |
|
2743 showText: true, |
|
2744 animationDuration: 0, |
|
2745 colorRanges: [ |
|
2746 { stop: 20, color: '#004D00' }, |
|
2747 { stop: 40, color: '#008C00' }, |
|
2748 { stop: 60, color: '#00BF00' }, |
|
2749 { stop: 80, color: '#00FF00' }, |
|
2750 { stop: 100, color: '#80FF80' } |
|
2751 ] |
|
2752 }); |
|
2753 $("#hop_aroma").jqxProgressBar({ |
|
2754 width: 300, |
|
2755 height: 23, |
|
2756 theme: theme, |
|
2757 showText: true, |
|
2758 animationDuration: 0, |
|
2759 colorRanges: [ |
|
2760 { stop: 20, color: '#004D00' }, |
|
2761 { stop: 40, color: '#008C00' }, |
|
2762 { stop: 60, color: '#00BF00' }, |
|
2763 { stop: 80, color: '#00FF00' }, |
|
2764 { stop: 100, color: '#80FF80' } |
|
2765 ] |
|
2766 }); |
2677 $("#popupHop").jqxWindow({ |
2767 $("#popupHop").jqxWindow({ |
2678 width: 800, |
2768 width: 800, |
2679 height: 300, |
2769 height: 300, |
2680 position: { x: 230, y: 100 }, |
2770 position: { x: 230, y: 100 }, |
2681 resizable: false, |
2771 resizable: false, |
3183 $("#w1_cost").val(datarecord.cost); |
3265 $("#w1_cost").val(datarecord.cost); |
3184 dataRecord.w1_cost = datarecord.cost; |
3266 dataRecord.w1_cost = datarecord.cost; |
3185 calcWater(); |
3267 calcWater(); |
3186 } |
3268 } |
3187 }); |
3269 }); |
3188 $("#w1_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3270 $("#w1_amount").jqxNumberInput( Show1wat ); |
3189 $("#w1_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3271 $("#w1_calcium").jqxNumberInput( Show1wat ); |
3190 $("#w1_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3272 $("#w1_magnesium").jqxNumberInput( Show1wat ); |
3191 $("#w1_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3273 $("#w1_sodium").jqxNumberInput( Show1wat ); |
3192 $("#w1_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3274 $("#w1_total_alkalinity").jqxNumberInput( Show1wat ); |
3193 $("#w1_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3275 $("#w1_chloride").jqxNumberInput( Show1wat ); |
3194 $("#w1_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3276 $("#w1_sulfate").jqxNumberInput( Show1wat ); |
3195 $("#w1_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3277 $("#w1_ph").jqxNumberInput( Show1wat ); |
3196 // Water source 2 |
3278 // Water source 2 |
3197 $("#w2_name").jqxDropDownList({ |
3279 $("#w2_name").jqxDropDownList({ |
3198 placeHolder: "Kies meng water:", |
3280 placeHolder: "Kies meng water:", |
3199 theme: theme, |
3281 theme: theme, |
3200 source: waterlist, |
3282 source: waterlist, |
3228 $("#w2_amount").jqxNumberInput({ max: 100000, readOnly: false }); // Set high max to enable the spinbuttons. |
3310 $("#w2_amount").jqxNumberInput({ max: 100000, readOnly: false }); // Set high max to enable the spinbuttons. |
3229 calcWater(); |
3311 calcWater(); |
3230 } |
3312 } |
3231 }); |
3313 }); |
3232 $("#w2_amount").jqxTooltip({ content: 'De verdeling van het hoofd en meng water. Het totale maisch water volume blijft gelijk.'}); |
3314 $("#w2_amount").jqxTooltip({ content: 'De verdeling van het hoofd en meng water. Het totale maisch water volume blijft gelijk.'}); |
3233 $("#w2_amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 94, height: 23, min: 0, max: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5, readOnly: true }); |
3315 $("#w2_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 94, height: 23, min: 0, max: 0, decimalDigits: 1, spinButtons: true, readOnly: true }); |
3234 $("#w2_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3316 $("#w2_calcium").jqxNumberInput( Show1wat ); |
3235 $("#w2_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3317 $("#w2_magnesium").jqxNumberInput( Show1wat ); |
3236 $("#w2_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3318 $("#w2_sodium").jqxNumberInput( Show1wat ); |
3237 $("#w2_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3319 $("#w2_total_alkalinity").jqxNumberInput( Show1wat ); |
3238 $("#w2_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3320 $("#w2_chloride").jqxNumberInput( Show1wat ); |
3239 $("#w2_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3321 $("#w2_sulfate").jqxNumberInput( Show1wat ); |
3240 $("#w2_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3322 $("#w2_ph").jqxNumberInput( Show1wat ); |
3241 // Water mixed |
3323 // Water mixed |
3242 $("#wg_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3324 $("#wg_amount").jqxNumberInput( Show1wat ); |
3243 $("#wg_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3325 $("#wg_calcium").jqxNumberInput( Show1wat ); |
3244 $("#wg_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3326 $("#wg_magnesium").jqxNumberInput( Show1wat ); |
3245 $("#wg_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3327 $("#wg_sodium").jqxNumberInput( Show1wat ); |
3246 $("#wg_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3328 $("#wg_total_alkalinity").jqxNumberInput( Show1wat ); |
3247 $("#wg_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3329 $("#wg_chloride").jqxNumberInput( Show1wat ); |
3248 $("#wg_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3330 $("#wg_sulfate").jqxNumberInput( Show1wat ); |
3249 $("#wg_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3331 $("#wg_ph").jqxNumberInput( Show1wat ); |
3250 // Water treated |
3332 // Water treated |
3251 $("#wb_calcium").jqxTooltip({ content: 'De ideale hoeveelheid Calcium is tussen 40 en 150.'}); |
3333 $("#wb_calcium").jqxTooltip({ content: 'De ideale hoeveelheid Calcium is tussen 40 en 150.'}); |
3252 $("#wb_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3334 $("#wb_calcium").jqxNumberInput( Show1wat ); |
3253 $("#wb_magnesium").jqxTooltip({ content: 'De ideale hoeveelheid Magnesium is lager dan 30.'}); |
3335 $("#wb_magnesium").jqxTooltip({ content: 'De ideale hoeveelheid Magnesium is lager dan 30.'}); |
3254 $("#wb_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3336 $("#wb_magnesium").jqxNumberInput( Show1wat ); |
3255 $("#wb_sodium").jqxTooltip({ content: 'De ideale hoeveelheid Natrium is lager dan 150.'}); |
3337 $("#wb_sodium").jqxTooltip({ content: 'De ideale hoeveelheid Natrium is lager dan 150.'}); |
3256 $("#wb_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3338 $("#wb_sodium").jqxNumberInput( Show1wat ); |
3257 $("#wb_chloride").jqxTooltip({ content: 'De ideale hoeveelheid Chloride is lager dan 100.'}); |
3339 $("#wb_chloride").jqxTooltip({ content: 'De ideale hoeveelheid Chloride is lager dan 100.'}); |
3258 $("#wb_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3340 $("#wb_chloride").jqxNumberInput( Show1wat ); |
3259 $("#wb_sulfate").jqxTooltip({ content: 'De ideale hoeveelheid Sulfaat is lager dan 350.'}); |
3341 $("#wb_sulfate").jqxTooltip({ content: 'De ideale hoeveelheid Sulfaat is lager dan 350.'}); |
3260 $("#wb_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3342 $("#wb_sulfate").jqxNumberInput( Show1wat ); |
3261 $("#wb_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3343 $("#wb_total_alkalinity").jqxNumberInput( Show1wat ); |
3262 $("#wb_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3344 $("#wb_ph").jqxNumberInput( Show1wat ); |
3263 // Water target profile |
3345 // Water target profile |
3264 $("#pr_name").jqxDropDownList({ |
3346 $("#pr_name").jqxDropDownList({ |
3265 placeHolder: "Kies doel profiel:", |
3347 placeHolder: "Kies doel profiel:", |
3266 theme: theme, |
3348 theme: theme, |
3267 source: waterprofiles, |
3349 source: waterprofiles, |
3281 $("#pr_sodium").val(datarecord.sodium); |
3363 $("#pr_sodium").val(datarecord.sodium); |
3282 $("#pr_magnesium").val(datarecord.magnesium); |
3364 $("#pr_magnesium").val(datarecord.magnesium); |
3283 $("#pr_total_alkalinity").val(datarecord.total_alkalinity); |
3365 $("#pr_total_alkalinity").val(datarecord.total_alkalinity); |
3284 } |
3366 } |
3285 }); |
3367 }); |
3286 $("#pr_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3368 $("#pr_calcium").jqxNumberInput( Show1wat ); |
3287 $("#pr_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3369 $("#pr_magnesium").jqxNumberInput( Show1wat ); |
3288 $("#pr_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3370 $("#pr_sodium").jqxNumberInput( Show1wat ); |
3289 $("#pr_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3371 $("#pr_total_alkalinity").jqxNumberInput( Show1wat ); |
3290 $("#pr_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3372 $("#pr_chloride").jqxNumberInput( Show1wat ); |
3291 $("#pr_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
3373 $("#pr_sulfate").jqxNumberInput( Show1wat ); |
3292 |
3374 |
3293 // Water agents |
3375 // Water agents |
3294 $("#wa_cacl2").jqxTooltip({ content: 'Voor het maken van een ander waterprofiel. Voegt calcium en chloride toe. Voor het verbeteren van zoetere bieren.'}); |
3376 $("#wa_cacl2").jqxTooltip({ content: 'Voor het maken van een ander waterprofiel. Voegt calcium en chloride toe. Voor het verbeteren van zoetere bieren.'}); |
3295 $("#wa_cacl2").jqxNumberInput( Spin1dec ); |
3377 $("#wa_cacl2").jqxNumberInput( Spin1dec ); |
3296 $("#wa_caso4").jqxTooltip({ content: 'Gips. Voor het maken van een ander waterprofiel. Voegt calcium en sulfaat toe. Voor het verbeteren van bittere bieren.'}); |
3378 $("#wa_caso4").jqxTooltip({ content: 'Gips. Voor het maken van een ander waterprofiel. Voegt calcium en sulfaat toe. Voor het verbeteren van bittere bieren.'}); |