1905 $('#kcal').val(Math.round((alc + sug) / (12 * 0.0295735296))); |
1906 $('#kcal').val(Math.round((alc + sug) / (12 * 0.0295735296))); |
1906 }; |
1907 }; |
1907 |
1908 |
1908 function calcMash() { |
1909 function calcMash() { |
1909 |
1910 |
1910 var infused = 0, i, row; |
1911 var h, m, infused = 0, mashtime = 0, mashvol = 0, i, row; |
1911 |
1912 |
1912 if (!(rows = $('#mashGrid').jqxGrid('getrows'))) |
1913 if ((rows = $('#mashGrid').jqxGrid('getrows')) && (mashkg > 0)) { |
1913 return; |
1914 for (i = 0; i < rows.length; i++) { |
1914 if (mashkg == 0) |
1915 row = $('#mashGrid').jqxGrid('getrowdata', i); |
1915 return; |
1916 if (row.step_type == 0) // Infusion |
1916 |
1917 infused += row.step_infuse_amount; |
1917 for (i = 0; i < rows.length; i++) { |
1918 mashtime += row.step_time + row.ramp_time; |
1918 row = $('#mashGrid').jqxGrid('getrowdata', i); |
1919 $('#mashGrid').jqxGrid('setcellvalue', i, 'step_thickness', infused / mashkg); |
1919 if (row.step_type == 0) // Infusion |
1920 } |
1920 infused += row.step_infuse_amount; |
1921 } |
1921 $('#mashGrid').jqxGrid('setcellvalue', i, 'step_thickness', infused / mashkg); |
1922 mashvol = mashkg * MaltVolume + infused; |
1922 } |
1923 $('#est_mashvol').val(mashvol); |
|
1924 h = Math.floor(mashtime / 60); |
|
1925 m = Math.floor(mashtime - (h * 60)); |
|
1926 if (h < 10) |
|
1927 h = '0' + h; |
|
1928 if (m < 10) |
|
1929 m = '0' + m; |
|
1930 $('#est_mashtime').val(h + ':' + m); |
1923 } |
1931 } |
1924 |
1932 |
1925 /* |
1933 /* |
1926 * Change OG of recipe but keep the water volumes. |
1934 * Change OG of recipe but keep the water volumes. |
1927 */ |
1935 */ |
5349 row['ramp_time'] = data.ramp_time; |
5357 row['ramp_time'] = data.ramp_time; |
5350 $('#mashGrid').jqxGrid('addrow', null, row); |
5358 $('#mashGrid').jqxGrid('addrow', null, row); |
5351 } |
5359 } |
5352 } |
5360 } |
5353 }); |
5361 }); |
|
5362 $('#est_mashvol').jqxTooltip({ content: 'Het totale volume van het maishwater en de mout in de maish pan.' }); |
|
5363 $('#est_mashvol').jqxNumberInput(Show1dec); |
|
5364 $('#est_mashtime').jqxTooltip({ content: 'De totale tijdsduur van het maischen.' }); |
|
5365 $('#est_mashtime').jqxInput({ theme: theme, width: 70, height: 23 }); |
5354 $('#popupMash').jqxWindow({ |
5366 $('#popupMash').jqxWindow({ |
5355 width: 800, |
5367 width: 800, |
5356 height: 350, |
5368 height: 350, |
5357 position: { x: 230, y: 100 }, |
5369 position: { x: 230, y: 100 }, |
5358 resizable: false, |
5370 resizable: false, |