www/js/prod_edit.js

changeset 622
39902353b159
parent 621
06322bcfecdf
child 623
4aee10bcb94e
equal deleted inserted replaced
621:06322bcfecdf 622:39902353b159
2793 2793
2794 function ProtonDeficit(pHZ) { 2794 function ProtonDeficit(pHZ) {
2795 2795
2796 var rows, i, C1, ebc, x, Result = ZRA(pHZ) * parseFloat($('#wg_amount').jqxNumberInput('decimal')); 2796 var rows, i, C1, ebc, x, Result = ZRA(pHZ) * parseFloat($('#wg_amount').jqxNumberInput('decimal'));
2797 // proton deficit for the grist 2797 // proton deficit for the grist
2798 rows = $('#fermentableGrid').jqxGrid('getrows'); 2798 if ((rows = $('#fermentableGrid').jqxGrid('getrows'))) {
2799 for (i = 0; i < rows.length; i++) { 2799 for (i = 0; i < rows.length; i++) {
2800 row = rows[i]; 2800 row = rows[i];
2801 if (row.f_added == 0 && row.f_graintype != 6) { // Added == Mash && graintype != No Malt 2801 if (row.f_added == 0 && row.f_graintype != 6) { // Added == Mash && graintype != No Malt
2802 // Check if acid is required 2802 // Check if acid is required
2803 C1 = 0; 2803 C1 = 0;
2804 if ((row.f_di_ph != 5.7) && ((row.f_acid_to_ph_57 < - 0.1) || (row.f_acid_to_ph_57 > 0.1))) { 2804 if ((row.f_di_ph != 5.7) && ((row.f_acid_to_ph_57 < - 0.1) || (row.f_acid_to_ph_57 > 0.1))) {
2805 C1 = row.f_acid_to_ph_57 / (row.f_di_ph - 5.7); 2805 C1 = row.f_acid_to_ph_57 / (row.f_di_ph - 5.7);
2806 } else { 2806 } else {
2807 // If the acid_to_ph_5.7 is unknown from the maltster, guess the required acid. 2807 // If the acid_to_ph_5.7 is unknown from the maltster, guess the required acid.
2808 ebc = row.f_color; 2808 ebc = row.f_color;
2809 switch (row.f_graintype) { 2809 switch (row.f_graintype) {
2810 case 0: // Base, Special, Kilned 2810 case 0: // Base, Special, Kilned
2811 case 3: 2811 case 3:
2812 case 5: C1 = 0.014 * ebc - 34.192; 2812 case 5: C1 = 0.014 * ebc - 34.192;
2813 break; 2813 break;
2814 case 2: C1 = -0.0597 * ebc - 32.457; // Crystal 2814 case 2: C1 = -0.0597 * ebc - 32.457; // Crystal
2815 break; 2815 break;
2816 case 1: C1 = 0.0107 * ebc - 54.768; // Roast 2816 case 1: C1 = 0.0107 * ebc - 54.768; // Roast
2817 break; 2817 break;
2818 case 4: C1 = -149; // Sour malt 2818 case 4: C1 = -149; // Sour malt
2819 break; 2819 break;
2820 }
2820 } 2821 }
2822 x = C1 * (pHZ - row.f_di_ph); // AcidRequired(ZpH)
2823 Result += x * row.f_amount;
2821 } 2824 }
2822 x = C1 * (pHZ - row.f_di_ph); // AcidRequired(ZpH) 2825 }
2823 Result += x * row.f_amount; 2826 } else {
2824 } 2827 console.log('ProtonDeficit(' + pHZ + ') invalid grist');
2825 } 2828 }
2826 return Result; 2829 return Result;
2827 } 2830 }
2828 2831
2829 function MashpH() { 2832 function MashpH() {
5266 }); 5269 });
5267 5270
5268 // Tab 6, Yeasts 5271 // Tab 6, Yeasts
5269 $('#est_fg2').jqxTooltip({ content: 'Het verwachte eind SG. Dit wordt automatisch berekend.' }); 5272 $('#est_fg2').jqxTooltip({ content: 'Het verwachte eind SG. Dit wordt automatisch berekend.' });
5270 $('#est_fg2').jqxNumberInput(Show3dec); 5273 $('#est_fg2').jqxNumberInput(Show3dec);
5271 $('#est_abv2').jqxTooltip({ content: 'Alcohol volume %. Dit wordt automatisch berekend.' }); 5274 $('#est_abv2').jqxTooltip({ content: 'Verwacht alcohol volume %. Dit wordt automatisch berekend.' });
5272 $('#est_abv2').jqxNumberInput(Smal1dec); 5275 $('#est_abv2').jqxNumberInput(Show2dec);
5273 $('#yeast_cells').jqxTooltip({ content: 'Het aantal beschikbare gistcellen zonder eventuele starter.' }); 5276 $('#yeast_cells').jqxTooltip({ content: 'Het aantal miljard beschikbare gistcellen zonder eventuele starter.' });
5274 $('#yeast_cells').jqxNumberInput(Show1dec); 5277 $('#yeast_cells').jqxNumberInput(Show1dec);
5275 $('#need_cells').jqxTooltip({ content: 'Het aantal nodige cellen is afhankelijk van het biertype.' }); 5278 $('#need_cells').jqxTooltip({ content: 'Het aantal miljard nodige cellen is afhankelijk van het begin SG, biertype en volume.' });
5276 $('#need_cells').jqxNumberInput(Show1dec); 5279 $('#need_cells').jqxNumberInput(Show1dec);
5277 $('#plato_cells').jqxTooltip({ content: 'De berekende hoeveelheid gistcellen in miljard per ml per graad Plato. Dit is de zogenaamde pitchrate.' }); 5280 $('#plato_cells').jqxTooltip({ content: 'De berekende pitchrate in miljard cellen per ml per graad Plato.' });
5278 $('#plato_cells').jqxNumberInput(Show2dec); 5281 $('#plato_cells').jqxNumberInput(Show2dec);
5279 $('#yeast_prod_date').jqxTooltip({ content: 'Bij korrelgisten is meestal "best voor" datum op het zakje gedrukt.<br>Gebruik die datum maar dan twee jaar eerder als productie datum.<br>Bij White Labs is de productie datum vier maanden voor de "Best by" datum die geprint op het buisje.<br>Bij Wyeast is dit de "manufacture date" die op het pak geprint is.<br>Voor schuine buis, slurry, opkweek en gedroogd is dit de datum dat je de gist geoogst hebt.' }); 5282 $('#yeast_prod_date').jqxTooltip({ content: 'Bij korrelgisten is meestal "best voor" datum op het zakje gedrukt.<br>Gebruik die datum maar dan twee jaar eerder als productie datum.<br>Bij White Labs is de productie datum vier maanden voor de "Best by" datum die geprint op het buisje.<br>Bij Wyeast is dit de "manufacture date" die op het pak geprint is.<br>Voor schuine buis, slurry, opkweek en gedroogd is dit de datum dat je de gist geoogst hebt.' });
5280 $('#yeast_prod_date').jqxDateTimeInput(Dateopts); 5283 $('#yeast_prod_date').jqxDateTimeInput(Dateopts);
5281 $('#yeast_prod_date').on('close', function(event) { 5284 $('#yeast_prod_date').on('close', function(event) {
5282 calcViability(); 5285 calcViability();
5451 }); 5454 });
5452 // $('#starter_type').jqxTooltip({ content: 'starter_type' }); 5455 // $('#starter_type').jqxTooltip({ content: 'starter_type' });
5453 $('#starter_sg').jqxTooltip({ content: 'Het ideale starter SG moet tussen de 1.030 en 1.040 zijn. Optimaal is 1.037.' }); 5456 $('#starter_sg').jqxTooltip({ content: 'Het ideale starter SG moet tussen de 1.030 en 1.040 zijn. Optimaal is 1.037.' });
5454 $('#starter_sg').jqxNumberInput(SGopts); 5457 $('#starter_sg').jqxNumberInput(SGopts);
5455 $('#starter_viability').jqxTooltip({ content: 'De gist conditie.' }); 5458 $('#starter_viability').jqxTooltip({ content: 'De gist conditie.' });
5456 $('#starter_viability').jqxNumberInput(Smal0dec); 5459 $('#starter_viability').jqxNumberInput(Show0dec);
5457 $('#starter_try').jqxButton({ template: 'primary', width: '100px', height: 23, theme: theme }); 5460 $('#starter_try').jqxButton({ template: 'primary', width: '100px', height: 23, theme: theme });
5458 5461
5459 5462
5460 // Tab 7, Mashing 5463 // Tab 7, Mashing
5461 $('#mash_name').jqxTooltip({ content: 'De omschrijving van dit maisch profiel.' }); 5464 $('#mash_name').jqxTooltip({ content: 'De omschrijving van dit maisch profiel.' });

mercurial