146 var my_100 = false; |
146 var my_100 = false; |
147 var mashtime = 0; // Total mash time |
147 var mashtime = 0; // Total mash time |
148 var mashtemp = 0; // Average mash temperature |
148 var mashtemp = 0; // Average mash temperature |
149 var bv = 0.925; // Bierverlies rendement |
149 var bv = 0.925; // Bierverlies rendement |
150 var sr = 0.95; // Mash en spoel rendement |
150 var sr = 0.95; // Mash en spoel rendement |
|
151 var lintner = 0; // Total recipe lintner |
151 |
152 |
152 if ((rows = $('#mashGrid').jqxGrid('getrows'))) { |
153 if ((rows = $('#mashGrid').jqxGrid('getrows'))) { |
153 for (var i = 0; i < rows.length; i++) { |
154 for (var i = 0; i < rows.length; i++) { |
154 var row = rows[i]; |
155 var row = rows[i]; |
155 if (row.step_type == 0) // Infusion |
156 if (row.step_type == 0) // Infusion |
201 ((dataRecord.inventory_reduced <= 3) && (row.f_added == 2)) || // Primary |
202 ((dataRecord.inventory_reduced <= 3) && (row.f_added == 2)) || // Primary |
202 ((dataRecord.inventory_reduced <= 5) && (row.f_added == 3)) || // Secondary or Tertiary |
203 ((dataRecord.inventory_reduced <= 5) && (row.f_added == 3)) || // Secondary or Tertiary |
203 ((dataRecord.inventory_reduced <= 6) && (row.f_added == 4))) && row.f_inventory < row.f_amount) { |
204 ((dataRecord.inventory_reduced <= 6) && (row.f_added == 4))) && row.f_inventory < row.f_amount) { |
204 ok_fermentables = 0; |
205 ok_fermentables = 0; |
205 } |
206 } |
206 } |
207 if (row.f_added == 0 && (row.f_type == 0 || row.f_type == 4) && row.f_color < 50) { // Mash and Grain/Adjunct and Color < 50 |
|
208 lintner += row.f_diastatic_power * row.f_amount; |
|
209 // console.log("add "+row.f_name+" diastatic_power:"+row.f_diastatic_power*row.f_amount+" now:"+lintner); |
|
210 // } else { |
|
211 // console.log("ign "+row.f_name+" diastatic_power:"+row.f_diastatic_power*row.f_amount+" now:"+lintner); |
|
212 } |
|
213 } |
|
214 $("#ferm_lintner").val(Math.round(parseFloat(lintner / mashkg))); |
|
215 // console.log("lintner:"+lintner+" kg:"+mashkg); |
207 $("#mash_kg").val(mashkg); |
216 $("#mash_kg").val(mashkg); |
208 console.log("calcFermentables() supplies:"+ok_fermentables); |
217 console.log("calcFermentables() supplies:"+ok_fermentables); |
209 to_100 = my_100; |
218 to_100 = my_100; |
210 if (to_100) { |
219 if (to_100) { |
211 $("#wf_amount").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); |
220 $("#wf_amount").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); |
3189 } |
3198 } |
3190 }; |
3199 }; |
3191 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); |
3200 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); |
3192 $("#fermentableGrid").jqxGrid({ |
3201 $("#fermentableGrid").jqxGrid({ |
3193 width: 1240, |
3202 width: 1240, |
3194 height: 500, |
3203 height: 470, |
3195 source: fermentableAdapter, |
3204 source: fermentableAdapter, |
3196 theme: theme, |
3205 theme: theme, |
3197 selectionmode: 'singlerow', |
3206 selectionmode: 'singlerow', |
3198 showtoolbar: true, |
3207 showtoolbar: true, |
3199 rendertoolbar: function (toolbar) { |
3208 rendertoolbar: function (toolbar) { |
4309 $("#est_color2").jqxNumberInput( Show0dec ); |
4318 $("#est_color2").jqxNumberInput( Show0dec ); |
4310 $("#est_og2").jqxTooltip({ content: 'Het geschatte begin SG van dit product.' }); |
4319 $("#est_og2").jqxTooltip({ content: 'Het geschatte begin SG van dit product.' }); |
4311 $("#est_og2").jqxNumberInput( Show3dec ); |
4320 $("#est_og2").jqxNumberInput( Show3dec ); |
4312 $("#mash_kg").jqxTooltip({ content: 'Het gewicht van alle mouten in de maisch.' }); |
4321 $("#mash_kg").jqxTooltip({ content: 'Het gewicht van alle mouten in de maisch.' }); |
4313 $("#mash_kg").jqxNumberInput( Show3dec ); |
4322 $("#mash_kg").jqxNumberInput( Show3dec ); |
|
4323 $("#ferm_lintner").jqxTooltip({ content: 'De enzymkracht van alle mouten in de maisch. Moet hoger dan 35 zijn.' }); |
|
4324 $("#ferm_lintner").jqxNumberInput( Show0dec ); |
4314 $("#perc_malts").jqxProgressBar({ |
4325 $("#perc_malts").jqxProgressBar({ |
4315 width: 300, |
4326 width: 300, |
4316 height: 23, |
4327 height: 23, |
4317 theme: theme, |
4328 theme: theme, |
4318 showText: true, |
4329 showText: true, |