1626 } |
1626 } |
1627 |
1627 |
1628 function calcFermentation() { |
1628 function calcFermentation() { |
1629 if (dataRecord.brew_fermenter_sg < 1.020) |
1629 if (dataRecord.brew_fermenter_sg < 1.020) |
1630 return; |
1630 return; |
|
1631 var obrix = sg_to_brix(dataRecord.brew_fermenter_sg); |
|
1632 console.log("calcFermentation() og:"+dataRecord.brew_fermenter_sg+" brix:"+obrix); |
1631 if ((dataRecord.primary_end_sg > 0.990) && (dataRecord.primary_end_sg < dataRecord.brew_fermenter_sg)) { |
1633 if ((dataRecord.primary_end_sg > 0.990) && (dataRecord.primary_end_sg < dataRecord.brew_fermenter_sg)) { |
1632 var primary_svg = 100 * (dataRecord.brew_fermenter_sg - dataRecord.primary_end_sg) / (dataRecord.brew_fermenter_sg - 1); |
1634 var primary_svg = 100 * (dataRecord.brew_fermenter_sg - dataRecord.primary_end_sg) / (dataRecord.brew_fermenter_sg - 1); |
1633 //console.log("primary svg: "+primary_svg); |
1635 //console.log("primary svg: "+primary_svg); |
1634 $("#primary_svg").val(primary_svg); |
1636 $("#primary_svg").val(primary_svg); |
1635 if ((dataRecord.fg > 0.990) && (dataRecord.fg < dataRecord.brew_fermenter_sg)) { |
1637 if ((dataRecord.fg > 0.990) && (dataRecord.fg < dataRecord.brew_fermenter_sg)) { |
1804 $("#sparge_volume").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
1806 $("#sparge_volume").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
1805 $("#sparge_ph").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
1807 $("#sparge_ph").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
1806 $("#sparge_source").jqxDropDownList({ disabled: true }); |
1808 $("#sparge_source").jqxDropDownList({ disabled: true }); |
1807 $("#sparge_acid_type").jqxDropDownList({ disabled: true }); |
1809 $("#sparge_acid_type").jqxDropDownList({ disabled: true }); |
1808 $("#sparge_acid_perc").jqxNumberInput({ spinButtons: false, readOnly: true, width: false }); |
1810 $("#sparge_acid_perc").jqxNumberInput({ spinButtons: false, readOnly: true, width: false }); |
|
1811 } |
|
1812 if (dataRecord.stage > 3) { // Primary fermentation done |
|
1813 $("#brew_date_start").jqxDateTimeInput({ disabled: true }); |
|
1814 $("#brew_date_end").jqxDateTimeInput({ disabled: true }); |
|
1815 $("#brew_mash_ph").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1816 $("#brew_preboil_ph").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1817 $("#brew_aboil_ph").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1818 $("#brew_mash_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1819 $("#brew_preboil_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1820 $("#brew_aboil_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1821 $("#brew_preboil_volume").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1822 $("#brew_aboil_volume").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1823 $("#brew_sparge_temperature").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1824 $("#brew_whirlpool9").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1825 $("#brew_cooling_to").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1826 $("#brew_sparge_volume").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1827 $("#brew_whirlpool7").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1828 $("#brew_cooling_method").jqxDropDownList({ disabled: true }); |
|
1829 $("#brew_whirlpool6").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1830 $("#brew_cooling_time").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1831 $("#brew_sparge_ph").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1832 $("#brew_whirlpool2").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1833 $("#brew_aeration_type").jqxDropDownList({ disabled: true }); |
|
1834 $("#brew_fermenter_tcloss").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1835 $("#brew_aeration_time").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1836 $("#brew_fermenter_extrawater").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
|
1837 $("#brew_aeration_speed").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); |
1809 } |
1838 } |
1810 if (dataRecord.stage < 5) { // At least secondary |
1839 if (dataRecord.stage < 5) { // At least secondary |
1811 $('#jqxTabs').jqxTabs('disableAt', 10); // Packaging tab |
1840 $('#jqxTabs').jqxTabs('disableAt', 10); // Packaging tab |
1812 } else { |
1841 } else { |
1813 $('#jqxTabs').jqxTabs('enableAt', 10); |
1842 $('#jqxTabs').jqxTabs('enableAt', 10); |
2166 }); |
2195 }); |
2167 $("#primary_end_sg").on('change', function (event) { |
2196 $("#primary_end_sg").on('change', function (event) { |
2168 dataRecord.primary_end_sg = parseFloat(event.args.value); |
2197 dataRecord.primary_end_sg = parseFloat(event.args.value); |
2169 calcFermentation(); |
2198 calcFermentation(); |
2170 }); |
2199 }); |
2171 |
2200 $("#primary_end_brix").on('change', function (event) { |
|
2201 // Brix reading from refractometer RI |
|
2202 if (dataRecord.brew_fermenter_sg >= 1.020) { |
|
2203 OBrix = sg_to_brix(dataRecord.brew_fermenter_sg); |
|
2204 FBrix = parseFloat(event.args.value) / my_brix_correction; |
|
2205 // http://seanterrill.com/2011/04/07/refractometer-fg-results/ |
|
2206 var FG = 1.0000 - 0.0044993 * OBrix + 0.0117741 * FBrix + |
|
2207 0.000275806 * (OBrix * OBrix) - 0.00127169 * (FBrix * FBrix) - |
|
2208 0.00000727999 * Math.pow(OBrix, 3) + 0.0000632929 * Math.pow(FBrix, 3); |
|
2209 // var FG = 1.0000 - 0.00085683 * OBrix + 0.0034941 * FBrix; |
|
2210 // Brouwhulp |
|
2211 // var FG = ((1.001843 - 0.002318474 * OBrix - 0.000007775 * (OBrix * OBrix) |
|
2212 // - 0.000000034 * Math.pow(OBrix, 3) + 0.00574 * (FBrix) |
|
2213 // + 0.00003344 * (FBrix * FBrix) + 0.000000086 * Math.pow(FBrix, 3)) |
|
2214 // + (1.313454) * 0.001); |
|
2215 console.log("OBrix:"+OBrix+" FBrix:"+FBrix+" FG:"+FG); |
|
2216 if (FG > 1.00001) { |
|
2217 $("#primary_end_sg").val(FG); |
|
2218 dataRecord.primary_end_sg = FG; |
|
2219 } |
|
2220 calcFermentation(); |
|
2221 } |
|
2222 }); |
|
2223 $("#final_brix").on('change', function (event) { |
|
2224 // Brix reading from refractometer RI |
|
2225 if (dataRecord.brew_fermenter_sg >= 1.020) { |
|
2226 OBrix = sg_to_brix(dataRecord.brew_fermenter_sg); |
|
2227 FBrix = parseFloat(event.args.value) / my_brix_correction; |
|
2228 var FG = 1.0000 - 0.0044993 * OBrix + 0.0117741 * FBrix + |
|
2229 0.000275806 * (OBrix * OBrix) - 0.00127169 * (FBrix * FBrix) - |
|
2230 0.00000727999 * Math.pow(OBrix, 3) + 0.0000632929 * Math.pow(FBrix, 3); |
|
2231 console.log("OBrix:"+OBrix+" FBrix:"+FBrix+" FG:"+FG); |
|
2232 if (FG > 1.00001) { |
|
2233 $("#fg").val(FG); |
|
2234 dataRecord.fg = FG; |
|
2235 } |
|
2236 calcFermentation(); |
|
2237 } |
|
2238 }); |
2172 $("#BLog").jqxButton({ disabled: (dataRecord.log_brew) ? false:true }); |
2239 $("#BLog").jqxButton({ disabled: (dataRecord.log_brew) ? false:true }); |
2173 $("#FLog").jqxButton({ disabled: (dataRecord.log_fermentation) ? false:true }); |
2240 $("#FLog").jqxButton({ disabled: (dataRecord.log_fermentation) ? false:true }); |
2174 }; |
2241 }; |
2175 |
2242 |
2176 $("#styleSelect").jqxDropDownList({ |
2243 $("#styleSelect").jqxDropDownList({ |
5103 window.open(url); |
5170 window.open(url); |
5104 }); |
5171 }); |
5105 |
5172 |
5106 // Tab 10, Fermentation |
5173 // Tab 10, Fermentation |
5107 // Note, fermentation temps changes must do calcCarbonation() |
5174 // Note, fermentation temps changes must do calcCarbonation() |
|
5175 $("#brew_fermenter_sg2").jqxTooltip({ content: 'Het behaalde SG in het gistvat, overgenomen van de brouwdag.' }); |
5108 $("#brew_fermenter_sg2").jqxNumberInput( Show3dec ); |
5176 $("#brew_fermenter_sg2").jqxNumberInput( Show3dec ); |
|
5177 $("#primary_start_temp").jqxTooltip({ content: 'De begintemperatuur van de hoofdvergisting.' }); |
5109 $("#primary_start_temp").jqxNumberInput( YeastT ); |
5178 $("#primary_start_temp").jqxNumberInput( YeastT ); |
|
5179 $("#primary_max_temp").jqxTooltip({ content: 'De hoogst bereikte piek temperatuur tijdens de hoofgvergisting.' }); |
5110 $("#primary_max_temp").jqxNumberInput( YeastT ); |
5180 $("#primary_max_temp").jqxNumberInput( YeastT ); |
|
5181 $("#primary_end_temp").jqxTooltip({ content: 'De eind temperatuur van de hoofdvergisting.' }); |
5111 $("#primary_end_temp").jqxNumberInput( YeastT ); |
5182 $("#primary_end_temp").jqxNumberInput( YeastT ); |
|
5183 $("#primary_end_sg").jqxTooltip({ content: 'Het gemeten SG aan het eind van de hoofdvergisting.' }); |
5112 $("#primary_end_sg").jqxNumberInput( SGopts ); |
5184 $("#primary_end_sg").jqxNumberInput( SGopts ); |
|
5185 $("#primary_end_brix").jqxTooltip({ content: 'Hulpfinctie: de afgelezen °Brix RI waarde met een refractometer.' }); |
|
5186 $("#primary_end_brix").jqxNumberInput( Spin1dec ); |
|
5187 $("#primary_svg").jqxTooltip({ content: 'De schijnbare vergisting graad behaald na de hoofdgisting.' }); |
5113 $("#primary_svg").jqxNumberInput( Show1dec ); |
5188 $("#primary_svg").jqxNumberInput( Show1dec ); |
5114 $("#primary_end_date").jqxTooltip({ content: 'De eind datum van de hoofdvergisting en eventueel overhevelen.' }); |
5189 $("#primary_end_date").jqxTooltip({ content: 'De eind datum van de hoofdvergisting en eventueel overhevelen.' }); |
5115 $("#primary_end_date").jqxDateTimeInput( Dateopts ); |
5190 $("#primary_end_date").jqxDateTimeInput( Dateopts ); |
5116 $('#primary_end_date').on('close', function (event) { calcStage(); }); |
5191 $('#primary_end_date').on('close', function (event) { calcStage(); }); |
5117 $("#secondary_temp").jqxNumberInput( YeastT ); |
5192 $("#secondary_temp").jqxNumberInput( YeastT ); |
5120 $('#secondary_end_date').on('close', function (event) { calcStage(); }); |
5195 $('#secondary_end_date').on('close', function (event) { calcStage(); }); |
5121 $("#tertiary_temp").jqxNumberInput( YeastT ); |
5196 $("#tertiary_temp").jqxNumberInput( YeastT ); |
5122 $("#fg").jqxNumberInput( Spin3dec ); |
5197 $("#fg").jqxNumberInput( Spin3dec ); |
5123 $("#est_fg3").jqxTooltip({ content: 'Het verwachte eind SG. Dit wordt automatisch berekend.' }); |
5198 $("#est_fg3").jqxTooltip({ content: 'Het verwachte eind SG. Dit wordt automatisch berekend.' }); |
5124 $("#est_fg3").jqxNumberInput( Show3dec ); |
5199 $("#est_fg3").jqxNumberInput( Show3dec ); |
|
5200 $("#final_brix").jqxTooltip({ content: 'Hulpfinctie: de afgelezen °Brix RI waarde met een refractometer.' }); |
|
5201 $("#final_brix").jqxNumberInput( Spin1dec ); |
5125 $("#final_abv").jqxNumberInput( Show1dec ); |
5202 $("#final_abv").jqxNumberInput( Show1dec ); |
5126 $("#final_svg").jqxNumberInput( Show1dec ); |
5203 $("#final_svg").jqxNumberInput( Show1dec ); |
5127 $("#FLog").jqxButton({ template: "info", width: '150px', theme: theme }); |
5204 $("#FLog").jqxButton({ template: "info", width: '150px', theme: theme }); |
5128 $("#FLog").click(function () { |
5205 $("#FLog").click(function () { |
5129 // Open log in a new tab. |
5206 // Open log in a new tab. |