360 row.h_useat, parseFloat(row.h_amount)); |
360 row.h_useat, parseFloat(row.h_amount)); |
361 hop_aroma += hopAromaContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size), |
361 hop_aroma += hopAromaContribution(parseFloat(row.h_time), parseFloat(dataRecord.batch_size), |
362 row.h_useat, parseFloat(row.h_amount)); |
362 row.h_useat, parseFloat(row.h_amount)); |
363 } |
363 } |
364 total_ibus = Math.round(total_ibus * 10) / 10; |
364 total_ibus = Math.round(total_ibus * 10) / 10; |
365 hop_flavour = Math.round(hop_flavour * 100) / 10; |
365 hop_flavour = Math.round(hop_flavour * 1000 / 5) / 10; |
366 hop_aroma = Math.round(hop_aroma * 100) / 10; |
366 hop_aroma = Math.round(hop_aroma * 1000 / 6) / 10; |
367 if (hop_flavour > 100) |
367 if (hop_flavour > 100) |
368 hop_flavour = 100; |
368 hop_flavour = 100; |
369 if (hop_aroma > 100) |
369 if (hop_aroma > 100) |
370 hop_aroma = 100; |
370 hop_aroma = 100; |
371 console.log("calcIBUs(): " + total_ibus + " flavour: " + hop_flavour + " aroma: " + hop_aroma); |
371 console.log("calcIBUs(): " + total_ibus + " flavour: " + hop_flavour + " aroma: " + hop_aroma); |
2299 var commit = $("#miscGrid").jqxGrid('deleterow', id); |
2313 var commit = $("#miscGrid").jqxGrid('deleterow', id); |
2300 } |
2314 } |
2301 }); |
2315 }); |
2302 }, |
2316 }, |
2303 ready: function() { |
2317 ready: function() { |
|
2318 var datainformation = $('#miscGrid').jqxGrid('getdatainformation'); |
|
2319 if (datainformation.rowscount) { |
|
2320 $("#miscGrid").jqxGrid('sortby', 'm_use_use', 'asc'); |
|
2321 $("#miscGrid").jqxGrid('sortby', 'm_type', 'asc'); |
|
2322 } |
2304 $('#jqxTabs').jqxTabs('next'); |
2323 $('#jqxTabs').jqxTabs('next'); |
2305 }, |
2324 }, |
2306 columns: [ |
2325 columns: [ |
2307 { text: 'Ingredient', datafield: 'm_name' }, |
2326 { text: 'Ingredient', datafield: 'm_name' }, |
2308 { text: 'Type', width: 140, datafield: 'm_type', |
2327 { text: 'Type', width: 140, datafield: 'm_type', |
2787 // Tab 2, Vergistbaar |
2811 // Tab 2, Vergistbaar |
2788 $("#est_color2").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
2812 $("#est_color2").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
2789 $("#est_color2").jqxNumberInput( Show0dec ); |
2813 $("#est_color2").jqxNumberInput( Show0dec ); |
2790 $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
2814 $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
2791 $("#est_og2").jqxNumberInput( Show3dec ); |
2815 $("#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 ); |
|
2794 $("#perc_malts").jqxProgressBar({ |
2816 $("#perc_malts").jqxProgressBar({ |
2795 width: 300, |
2817 width: 300, |
2796 height: 23, |
2818 height: 23, |
2797 theme: theme, |
2819 theme: theme, |
2798 showText: true, |
2820 showText: true, |
|
2821 max: 120, |
2799 animationDuration: 0, |
2822 animationDuration: 0, |
2800 colorRanges: [ |
2823 colorRanges: [ |
2801 { stop: 90, color: '#008C00' }, |
2824 { stop: 90, color: '#008C00' }, |
2802 { stop: 95, color: '#EB7331' }, |
2825 { stop: 100, color: '#EB7331' }, |
2803 { stop: 100, color: '#FF0000' } |
2826 { stop: 120, color: '#FF0000' } |
2804 ] |
2827 ], |
|
2828 renderText: function (text) { |
|
2829 return (Math.round(parseInt(text) * 1.2)) + '%'; |
|
2830 } |
2805 }); |
2831 }); |
2806 $("#perc_sugars").jqxProgressBar({ |
2832 $("#perc_sugars").jqxProgressBar({ |
2807 width: 300, |
2833 width: 300, |
2808 height: 23, |
2834 height: 23, |
2809 theme: theme, |
2835 theme: theme, |
2810 showText: true, |
2836 showText: true, |
|
2837 max: 50, |
2811 animationDuration: 0, |
2838 animationDuration: 0, |
2812 colorRanges: [ |
2839 colorRanges: [ |
2813 { stop: 20, color: '#008C00' }, |
2840 { stop: 20, color: '#008C00' }, |
2814 { stop: 100, color: '#FF0000' } |
2841 { stop: 50, color: '#FF0000' } |
2815 ] |
2842 ], |
|
2843 renderText: function (text) { |
|
2844 return (Math.round(parseInt(text) * 5) / 10) + '%'; |
|
2845 } |
2816 }); |
2846 }); |
2817 $("#perc_cara").jqxProgressBar({ |
2847 $("#perc_cara").jqxProgressBar({ |
2818 width: 300, |
2848 width: 300, |
2819 height: 23, |
2849 height: 23, |
2820 theme: theme, |
2850 theme: theme, |
2821 showText: true, |
2851 showText: true, |
|
2852 max: 50, |
2822 animationDuration: 0, |
2853 animationDuration: 0, |
2823 colorRanges: [ |
2854 colorRanges: [ |
2824 { stop: 25, color: '#008C00' }, |
2855 { stop: 25, color: '#008C00' }, |
2825 { stop: 100, color: '#FF0000' } |
2856 { stop: 50, color: '#FF0000' } |
2826 ] |
2857 ], |
2827 }); |
2858 renderText: function (text) { |
|
2859 return (Math.round(parseInt(text) * 5) / 10) + '%'; |
|
2860 } |
|
2861 }); |
|
2862 $("#ferm_lintner").jqxProgressBar({ |
|
2863 width: 300, |
|
2864 height: 23, |
|
2865 theme: theme, |
|
2866 showText: true, |
|
2867 max: 200, |
|
2868 animationDuration: 0, |
|
2869 colorRanges: [ |
|
2870 { stop: 30, color: '#FF0000' }, |
|
2871 { stop: 40, color: '#EB7331' }, |
|
2872 { stop: 200, color: '#008C00' } |
|
2873 ], |
|
2874 renderText: function (text) { |
|
2875 return (parseInt(text) * 2) + ' lintner'; |
|
2876 } |
|
2877 }); |
2828 $("#popupFermentable").jqxWindow({ |
2878 $("#popupFermentable").jqxWindow({ |
2829 width: 800, |
2879 width: 800, |
2830 height: 300, |
2880 height: 300, |
2831 position: { x: 230, y: 100 }, |
2881 position: { x: 230, y: 100 }, |
2832 resizable: false, |
2882 resizable: false, |
2836 cancelButton: $("#FermentableReady"), |
2886 cancelButton: $("#FermentableReady"), |
2837 modalOpacity: 0.40 |
2887 modalOpacity: 0.40 |
2838 }); |
2888 }); |
2839 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
2889 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
2840 $("#FermentableReady").click(function () { |
2890 $("#FermentableReady").click(function () { |
2841 $("#fermentableGrid").jqxGrid('sortby', 'f_amount', 'desc'); |
|
2842 // Recalc percentages |
2891 // Recalc percentages |
2843 calcFermentables(); |
2892 calcFermentables(); |
2844 calcIBUs(); |
2893 calcIBUs(); |
2845 calcMash(); |
2894 calcMash(); |
2846 // Waters: yes there is impact. |
2895 // Waters: yes there is impact. |
3035 { stop: 20, color: '#004D00' }, |
3084 { stop: 20, color: '#004D00' }, |
3036 { stop: 40, color: '#008C00' }, |
3085 { stop: 40, color: '#008C00' }, |
3037 { stop: 60, color: '#00BF00' }, |
3086 { stop: 60, color: '#00BF00' }, |
3038 { stop: 80, color: '#00FF00' }, |
3087 { stop: 80, color: '#00FF00' }, |
3039 { stop: 100, color: '#80FF80' } |
3088 { stop: 100, color: '#80FF80' } |
3040 ] |
3089 ], |
|
3090 renderText: function (text) { |
|
3091 var val = parseInt(text); |
|
3092 if (val < 20) |
|
3093 return 'Weinig'; |
|
3094 else if (val < 40) |
|
3095 return 'Matig'; |
|
3096 else if (val < 60) |
|
3097 return 'Redelijk'; |
|
3098 else if (val < 80) |
|
3099 return 'Veel'; |
|
3100 else |
|
3101 return 'Zeer veel'; |
|
3102 } |
3041 }); |
3103 }); |
3042 $("#hop_aroma").jqxProgressBar({ |
3104 $("#hop_aroma").jqxProgressBar({ |
3043 width: 300, |
3105 width: 300, |
3044 height: 23, |
3106 height: 23, |
3045 theme: theme, |
3107 theme: theme, |
3049 { stop: 20, color: '#004D00' }, |
3111 { stop: 20, color: '#004D00' }, |
3050 { stop: 40, color: '#008C00' }, |
3112 { stop: 40, color: '#008C00' }, |
3051 { stop: 60, color: '#00BF00' }, |
3113 { stop: 60, color: '#00BF00' }, |
3052 { stop: 80, color: '#00FF00' }, |
3114 { stop: 80, color: '#00FF00' }, |
3053 { stop: 100, color: '#80FF80' } |
3115 { stop: 100, color: '#80FF80' } |
3054 ] |
3116 ], |
|
3117 renderText: function (text) { |
|
3118 var val = parseInt(text); |
|
3119 if (val < 20) |
|
3120 return 'Weinig'; |
|
3121 else if (val < 40) |
|
3122 return 'Matig'; |
|
3123 else if (val < 60) |
|
3124 return 'Redelijk'; |
|
3125 else if (val < 80) |
|
3126 return 'Veel'; |
|
3127 else |
|
3128 return 'Zeer veel'; |
|
3129 } |
3055 }); |
3130 }); |
3056 $("#popupHop").jqxWindow({ |
3131 $("#popupHop").jqxWindow({ |
3057 width: 800, |
3132 width: 800, |
3058 height: 300, |
3133 height: 300, |
3059 position: { x: 230, y: 100 }, |
3134 position: { x: 230, y: 100 }, |
3064 cancelButton: $("#HopReady"), |
3139 cancelButton: $("#HopReady"), |
3065 modalOpacity: 0.40 |
3140 modalOpacity: 0.40 |
3066 }); |
3141 }); |
3067 $("#HopReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
3142 $("#HopReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
3068 $("#HopReady").click(function () { |
3143 $("#HopReady").click(function () { |
3069 $("#hopGrid").jqxGrid('sortby', 'h_amount', 'asc'); |
|
3070 calcIBUs(); |
3144 calcIBUs(); |
3071 }); |
3145 }); |
3072 $("#wh_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
3146 $("#wh_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
3073 $("#wh_instock").jqxCheckBox({ theme: theme, height: 23 }); |
3147 $("#wh_instock").jqxCheckBox({ theme: theme, height: 23 }); |
3074 $("#wh_instock").on('change', function (event) { |
3148 $("#wh_instock").on('change', function (event) { |
3203 autoOpen: false, |
3277 autoOpen: false, |
3204 cancelButton: $("#MiscReady"), |
3278 cancelButton: $("#MiscReady"), |
3205 modalOpacity: 0.40 |
3279 modalOpacity: 0.40 |
3206 }); |
3280 }); |
3207 $("#MiscReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
3281 $("#MiscReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
3208 $("#MiscReady").click(function () { |
|
3209 $("#miscGrid").jqxGrid('sortby', 'm_use_use', 'asc'); |
|
3210 }); |
|
3211 $("#wm_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
3282 $("#wm_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
3212 $("#wm_instock").jqxCheckBox({ theme: theme, height: 23 }); |
3283 $("#wm_instock").jqxCheckBox({ theme: theme, height: 23 }); |
3213 $("#wm_instock").on('change', function (event) { |
3284 $("#wm_instock").on('change', function (event) { |
3214 miscinstock = event.args.checked; |
3285 miscinstock = event.args.checked; |
3215 misclist.dataBind(); |
3286 misclist.dataBind(); |
3307 modalOpacity: 0.40 |
3378 modalOpacity: 0.40 |
3308 }); |
3379 }); |
3309 $("#YeastReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
3380 $("#YeastReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
3310 $("#YeastReady").click(function () { |
3381 $("#YeastReady").click(function () { |
3311 calcFermentables(); |
3382 calcFermentables(); |
3312 $("#yeastGrid").jqxGrid('sortby', 'y_use', 'asc'); |
|
3313 }); |
3383 }); |
3314 $("#wy_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
3384 $("#wy_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
3315 $("#wy_laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); |
3385 $("#wy_laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); |
3316 $("#wy_product_id").jqxInput({ theme: theme, width: 320, height: 23 }); |
3386 $("#wy_product_id").jqxInput({ theme: theme, width: 320, height: 23 }); |
3317 $("#wy_instock").jqxCheckBox({ theme: theme, height: 23 }); |
3387 $("#wy_instock").jqxCheckBox({ theme: theme, height: 23 }); |