www/js/rec_edit.js

changeset 376
1de1623e1760
parent 373
ee16d9b844d8
child 380
2242521067a7
equal deleted inserted replaced
375:7f5455806f20 376:1de1623e1760
174 var my_100 = false; 174 var my_100 = false;
175 var mashtime = 0; // Total mash time 175 var mashtime = 0; // Total mash time
176 var mashtemp = 0; // Average mash temperature 176 var mashtemp = 0; // Average mash temperature
177 var bv = 0.925; // Bierverlies rendement 177 var bv = 0.925; // Bierverlies rendement
178 var sr = 0.95; // Mash en spoel rendement 178 var sr = 0.95; // Mash en spoel rendement
179 var lintner = 0; // Total recipe lintner
179 180
180 if ((rows = $('#mashGrid').jqxGrid('getrows'))) { 181 if ((rows = $('#mashGrid').jqxGrid('getrows'))) {
181 for (var i = 0; i < rows.length; i++) { 182 for (var i = 0; i < rows.length; i++) {
182 var row = rows[i]; 183 var row = rows[i];
183 if (row.step_type == 0) // Infusion 184 if (row.step_type == 0) // Infusion
219 var x = (row.f_yield / 100) * (1 - row.f_moisture / 100); 220 var x = (row.f_yield / 100) * (1 - row.f_moisture / 100);
220 addedS += row.f_amount * x; 221 addedS += row.f_amount * x;
221 addedmass += row.f_amount; 222 addedmass += row.f_amount;
222 vol += (x * sugardensity + (1 - x) * 1) * row.f_amount; 223 vol += (x * sugardensity + (1 - x) * 1) * row.f_amount;
223 } 224 }
225 if (row.f_added == 0 && (row.f_type == 0 || row.f_type == 4) && row.f_color < 50) { // Mash and Grain/Adjunct and Color < 50
226 lintner += row.f_diastatic_power * row.f_amount;
227 }
224 colort += row.f_amount * ebc_to_srm(row.f_color); 228 colort += row.f_amount * ebc_to_srm(row.f_color);
225 colorh += row.f_amount * row.f_color * get_kt(row.f_color); 229 colorh += row.f_amount * row.f_color * get_kt(row.f_color);
226 colorn += (row.f_percentage / 100) * row.f_color; // For 8.6 Pt wort. 230 colorn += (row.f_percentage / 100) * row.f_color; // For 8.6 Pt wort.
227 } 231 }
232 $("#ferm_lintner").val(Math.round(parseFloat(lintner / mashkg)));
233 console.log("lintner:"+lintner+" kg:"+mashkg);
228 to_100 = my_100; 234 to_100 = my_100;
229 if (to_100) { 235 if (to_100) {
230 $("#wf_amount").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); 236 $("#wf_amount").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false });
231 } else { 237 } else {
232 $("#wf_amount").jqxNumberInput({ width: 110, readOnly: false, spinButtons: true }); 238 $("#wf_amount").jqxNumberInput({ width: 110, readOnly: false, spinButtons: true });
1765 } 1771 }
1766 }; 1772 };
1767 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); 1773 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource);
1768 $("#fermentableGrid").jqxGrid({ 1774 $("#fermentableGrid").jqxGrid({
1769 width: 1240, 1775 width: 1240,
1770 height: 500, 1776 height: 470,
1771 source: fermentableAdapter, 1777 source: fermentableAdapter,
1772 theme: theme, 1778 theme: theme,
1773 selectionmode: 'singlerow', 1779 selectionmode: 'singlerow',
1774 showtoolbar: true, 1780 showtoolbar: true,
1775 rendertoolbar: function (toolbar) { 1781 rendertoolbar: function (toolbar) {
2781 // Tab 2, Vergistbaar 2787 // Tab 2, Vergistbaar
2782 $("#est_color2").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); 2788 $("#est_color2").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' });
2783 $("#est_color2").jqxNumberInput( Show0dec ); 2789 $("#est_color2").jqxNumberInput( Show0dec );
2784 $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); 2790 $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' });
2785 $("#est_og2").jqxNumberInput( Show3dec ); 2791 $("#est_og2").jqxNumberInput( Show3dec );
2792 $("#ferm_lintner").jqxTooltip({ content: 'De enzymkracht van alle mouten in de maisch. Moet hoger dan 35 zijn.' });
2793 $("#ferm_lintner").jqxNumberInput( Show0dec );
2786 $("#perc_malts").jqxProgressBar({ 2794 $("#perc_malts").jqxProgressBar({
2787 width: 300, 2795 width: 300,
2788 height: 23, 2796 height: 23,
2789 theme: theme, 2797 theme: theme,
2790 showText: true, 2798 showText: true,

mercurial