3662 $('#brew_aeration_time').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
3671 $('#brew_aeration_time').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
3663 $('#brew_fermenter_extrawater').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
3672 $('#brew_fermenter_extrawater').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
3664 $('#brew_aeration_speed').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
3673 $('#brew_aeration_speed').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
3665 $('#but_pre_boil').jqxButton({ disabled: true }); |
3674 $('#but_pre_boil').jqxButton({ disabled: true }); |
3666 $('#but_after_boil').jqxButton({ disabled: true }); |
3675 $('#but_after_boil').jqxButton({ disabled: true }); |
|
3676 } else { |
|
3677 if (dataRecord.boil_time == 0) { |
|
3678 $('#brew_preboil_ph').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
3679 $('#brew_aboil_ph').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
3680 $('#brew_preboil_sg').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
3681 $('#brew_aboil_sg').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
3682 $('#brew_preboil_volume').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
3683 $('#brew_aboil_volume').jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
3684 $('#but_pre_boil').jqxButton({ disabled: true }); |
|
3685 $('#but_after_boil').jqxButton({ disabled: true }); |
|
3686 } else { |
|
3687 $('#brew_preboil_ph').jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); |
|
3688 $('#brew_aboil_ph').jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); |
|
3689 $('#brew_preboil_sg').jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); |
|
3690 $('#brew_aboil_sg').jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); |
|
3691 $('#brew_preboil_volume').jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); |
|
3692 $('#brew_aboil_volume').jqxNumberInput({ spinButtons: true, readOnly: false, width: 110 }); |
|
3693 $('#but_pre_boil').jqxButton({ disabled: false }); |
|
3694 $('#but_after_boil').jqxButton({ disabled: false }); |
|
3695 } |
3667 } |
3696 } |
3668 if (dataRecord.stage == 5) // Lagering, allow packaging |
3697 if (dataRecord.stage == 5) // Lagering, allow packaging |
3669 $('#package_date').jqxDateTimeInput({ disabled: false }); |
3698 $('#package_date').jqxDateTimeInput({ disabled: false }); |
3670 else |
3699 else |
3671 $('#package_date').jqxDateTimeInput({ disabled: true }); |
3700 $('#package_date').jqxDateTimeInput({ disabled: true }); |
3941 calcWater(); |
3970 calcWater(); |
3942 calcSparge(); |
3971 calcSparge(); |
3943 calcMash(); |
3972 calcMash(); |
3944 }); |
3973 }); |
3945 $('#boil_time').on('change', function(event) { |
3974 $('#boil_time').on('change', function(event) { |
3946 console.log('boil_time change:' + parseFloat(event.args.value) + ' old:' + dataRecord.boil_time); |
3975 var new_boil, new_time, old_time, new_evap, old_evap; |
3947 var new_boil, new_evap, old_evap = parseFloat(dataRecord.boil_size) - parseFloat(dataRecord.batch_size); |
3976 old_time = parseFloat(dataRecord.boil_time); |
3948 new_evap = old_evap * (parseFloat(event.args.value) / dataRecord.boil_time); |
3977 new_time = parseFloat(event.args.value); |
3949 new_boil = parseFloat(dataRecord.batch_size) + new_evap; |
3978 |
3950 dataRecord.boil_time = parseFloat(event.args.value); |
3979 if (new_time && old_time) { |
3951 dataRecord.boil_size = new_boil; |
3980 /* normal boiltime change */ |
3952 $('#est_pre_vol').val(Round(new_boil * 1.04, 2)); |
3981 console.log('boil_time change:' + new_time + ' old:' + old_time); |
3953 $('#boil_size').val(Round(new_boil, 2)); |
3982 old_evap = parseFloat(dataRecord.boil_size) - parseFloat(dataRecord.batch_size); |
|
3983 new_evap = old_evap * (new_time / old_time); |
|
3984 new_boil = parseFloat(dataRecord.batch_size) + new_evap; |
|
3985 dataRecord.boil_time = new_time; |
|
3986 dataRecord.boil_size = new_boil; |
|
3987 $('#est_pre_vol').val(Round(new_boil * 1.04, 2)); |
|
3988 $('#boil_size').val(Round(new_boil, 2)); |
|
3989 } else if (new_time && ! old_time) { |
|
3990 /* from noboil to boil */ |
|
3991 console.log('boil_time change:' + new_time + ' old: noboil'); |
|
3992 new_evap = parseFloat($('#eq_evap_rate').jqxNumberInput('decimal')) * new_time / 60; |
|
3993 new_boil = parseFloat(dataRecord.batch_size) + new_evap; |
|
3994 dataRecord.boil_time = new_time; |
|
3995 dataRecord.boil_size = new_boil; |
|
3996 $('#est_pre_vol').val(Round(new_boil * 1.04, 2)); |
|
3997 $('#boil_size').val(Round(new_boil, 2)); |
|
3998 } else if (! new_time && old_time) { |
|
3999 /* from boil to noboil */ |
|
4000 console.log('boil_time change: noboil, old:' + old_time); |
|
4001 dataRecord.boil_time = 0; |
|
4002 dataRecord.boil_size = dataRecord.batch_size; |
|
4003 $('#est_pre_vol').val(Round(new_boil * 1.04, 2)); |
|
4004 $('#boil_size').val(Round(dataRecord.boil_size, 2)); |
|
4005 } |
3954 calcFermentables(); |
4006 calcFermentables(); |
3955 calcIBUs(); |
4007 calcIBUs(); |
3956 calcYeast(); |
4008 calcYeast(); |
|
4009 calcStage(); |
|
4010 kookTijd(); |
3957 }); |
4011 }); |
3958 $('#efficiency').on('change', function(event) { |
4012 $('#efficiency').on('change', function(event) { |
3959 var estog = parseFloat($('#est_og').jqxNumberInput('decimal')); |
4013 var estog = parseFloat($('#est_og').jqxNumberInput('decimal')); |
3960 dataRecord.efficiency = parseFloat(event.args.value); |
4014 dataRecord.efficiency = parseFloat(event.args.value); |
3961 console.log('efficiency change:' + dataRecord.efficiency + ' est_og:' + estog); |
4015 console.log('efficiency change:' + dataRecord.efficiency + ' est_og:' + estog); |
4609 }); |
4663 }); |
4610 $('#efficiency').jqxNumberInput(Perc1dec); |
4664 $('#efficiency').jqxNumberInput(Perc1dec); |
4611 $('#batch_size').jqxNumberInput(Spin1dec); |
4665 $('#batch_size').jqxNumberInput(Spin1dec); |
4612 $('#batch_size').jqxNumberInput({ min: 4 }); |
4666 $('#batch_size').jqxNumberInput({ min: 4 }); |
4613 $('#boil_time').jqxNumberInput(PosInt); |
4667 $('#boil_time').jqxNumberInput(PosInt); |
4614 $('#boil_time').jqxNumberInput({ min: 4, max: 360 }); |
4668 $('#boil_time').jqxNumberInput({ min: 0, max: 360 }); |
4615 $('#boil_size').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 2, readOnly: true }); |
4669 $('#boil_size').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 2, readOnly: true }); |
4616 $('#st_guide,#st_name,#st_type,#st_category').jqxInput({ theme: theme, width: 250, height: 23 }); |
4670 $('#st_guide,#st_name,#st_type,#st_category').jqxInput({ theme: theme, width: 250, height: 23 }); |
4617 $('#est_og').jqxNumberInput(SGopts); |
4671 $('#est_og').jqxNumberInput(SGopts); |
4618 $('#est_fg').jqxNumberInput(Show3dec); |
4672 $('#est_fg').jqxNumberInput(Show3dec); |
4619 $('#st_og_min,#st_og_max,#st_fg_min,#st_fg_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
4673 $('#st_og_min,#st_og_max,#st_fg_min,#st_fg_max').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
4646 $('#eq_batch_size').jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' }); |
4700 $('#eq_batch_size').jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' }); |
4647 $('#eq_tun_volume').jqxTooltip({ content: 'Maisch ketel volume.' }); |
4701 $('#eq_tun_volume').jqxTooltip({ content: 'Maisch ketel volume.' }); |
4648 $('#eq_top_up_water').jqxTooltip({ content: 'Extra water in het gistvat.' }); |
4702 $('#eq_top_up_water').jqxTooltip({ content: 'Extra water in het gistvat.' }); |
4649 $('#eq_trub_chiller_loss').jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' }); |
4703 $('#eq_trub_chiller_loss').jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' }); |
4650 $('#eq_evap_rate').jqxTooltip({ content: 'Verdamping in liters per uur.' }); |
4704 $('#eq_evap_rate').jqxTooltip({ content: 'Verdamping in liters per uur.' }); |
4651 $('#eq_boil_time').jqxTooltip({ content: 'Normale kooktijd in minuten.' }); |
4705 $('#eq_boil_time').jqxTooltip({ content: 'Normale kooktijd in minuten, 0 voor no-boil recepten.' }); |
4652 $('#eq_top_up_kettle').jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' }); |
4706 $('#eq_top_up_kettle').jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' }); |
4653 $('#eq_hop_utilization').jqxTooltip({ content: '100% voor kleine installaties, hoger voor grote brouwerijen.' }); |
4707 $('#eq_hop_utilization').jqxTooltip({ content: '100% voor kleine installaties, hoger voor grote brouwerijen.' }); |
4654 $('#eq_notes').jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' }); |
4708 $('#eq_notes').jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' }); |
4655 $('#eq_lauter_volume').jqxTooltip({ content: 'Filterkuip volume.' }); |
4709 $('#eq_lauter_volume').jqxTooltip({ content: 'Filterkuip volume.' }); |
4656 $('#eq_lauter_deadspace').jqxTooltip({ content: 'Filterkuip verlies in liters.' }); |
4710 $('#eq_lauter_deadspace').jqxTooltip({ content: 'Filterkuip verlies in liters.' }); |