# HG changeset patch # User Michiel Broek # Date 1558895848 -7200 # Node ID 1de1623e1760b1c2ef78de26b5e2026b1fb6eac6 # Parent 7f5455806f2039e6c168a31f61eeeb14e6b4b795 Inventory fermentables convert diastatic power between kolbach and lintner. In recipe and product editors calculate the recipe lintner value. For now a raw presentation of the outcome. diff -r 7f5455806f20 -r 1de1623e1760 config.status --- a/config.status Sun May 26 16:09:50 2019 +0200 +++ b/config.status Sun May 26 20:37:28 2019 +0200 @@ -433,7 +433,7 @@ This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/mbroek/MyProjects/bms' +ac_pwd='/mnt/home/mbroek/MyProjects/bms' srcdir='.' test -n "$AWK" || AWK=awk # The default lists apply if the user does not specify any file. @@ -621,7 +621,7 @@ S["CC"]="gcc" S["CYEARS"]="2016-2019" S["COPYRIGHT"]="Copyright (C) 2016-2019 Michiel Broek, All Rights Reserved" -S["VERSION"]="0.3.1" +S["VERSION"]="0.3.2" S["PACKAGE"]="bms" S["SUBDIRS"]="bmsd doc script tools www" S["target_alias"]="" @@ -710,7 +710,7 @@ D["PACKAGE_STRING"]=" \"\"" D["PACKAGE_BUGREPORT"]=" \"\"" D["PACKAGE_URL"]=" \"\"" -D["VERSION"]=" \"0.3.1\"" +D["VERSION"]=" \"0.3.2\"" D["COPYRIGHT"]=" \"Copyright (C) 2016-2019 Michiel Broek, All Rights Reserved\"" D["STDC_HEADERS"]=" 1" D["HAVE_SYS_TYPES_H"]=" 1" diff -r 7f5455806f20 -r 1de1623e1760 configure --- a/configure Sun May 26 16:09:50 2019 +0200 +++ b/configure Sun May 26 20:37:28 2019 +0200 @@ -2043,7 +2043,7 @@ PACKAGE="bms" -VERSION="0.3.1" +VERSION="0.3.2" COPYRIGHT="Copyright (C) 2016-2019 Michiel Broek, All Rights Reserved" CYEARS="2016-2019" diff -r 7f5455806f20 -r 1de1623e1760 configure.ac --- a/configure.ac Sun May 26 16:09:50 2019 +0200 +++ b/configure.ac Sun May 26 20:37:28 2019 +0200 @@ -8,7 +8,7 @@ dnl General settings dnl After changeing the version number, run autoconf! PACKAGE="bms" -VERSION="0.3.1" +VERSION="0.3.2" COPYRIGHT="Copyright (C) 2016-2019 Michiel Broek, All Rights Reserved" CYEARS="2016-2019" AC_SUBST(PACKAGE) diff -r 7f5455806f20 -r 1de1623e1760 www/js/global.js --- a/www/js/global.js Sun May 26 16:09:50 2019 +0200 +++ b/www/js/global.js Sun May 26 20:37:28 2019 +0200 @@ -1058,3 +1058,16 @@ return f2d + 2*f3d + 3*f4d; } + +function lintner_to_kolbach(lintner) { + + return (3.5 * lintner) - 16; +} + + +function kolbach_to_lintner(kolbach) { + + return (kolbach + 16) / 3.5; +} + + diff -r 7f5455806f20 -r 1de1623e1760 www/js/inv_fermentables.js --- a/www/js/inv_fermentables.js Sun May 26 16:09:50 2019 +0200 +++ b/www/js/inv_fermentables.js Sun May 26 20:37:28 2019 +0200 @@ -156,7 +156,7 @@ $("#notes").jqxInput({ theme: theme, width: 640, height: 100 }); $("#coarse_fine_diff").jqxNumberInput( Spin1dec ); $("#moisture").jqxNumberInput( Spin1dec ); - $("#diastatic_power").jqxNumberInput( Spin1dec ); + $("#diastatic_power").jqxNumberInput( PosInt ); $("#protein").jqxNumberInput( Spin1dec ); $("#dissolved_protein").jqxNumberInput( Spin1dec ); $("#max_in_batch").jqxNumberInput( Perc1dec ); @@ -289,7 +289,7 @@ $("#notes").val(dataRecord.notes); $("#coarse_fine_diff").val(dataRecord.coarse_fine_diff); $("#moisture").val(dataRecord.moisture); - $("#diastatic_power").val(dataRecord.diastatic_power); + $("#diastatic_power").val(lintner_to_kolbach(dataRecord.diastatic_power)); $("#protein").val(dataRecord.protein); $("#dissolved_protein").val(dataRecord.dissolved_protein); $("#max_in_batch").val(dataRecord.max_in_batch); @@ -366,7 +366,7 @@ notes: $("#notes").val(), coarse_fine_diff: parseFloat($("#coarse_fine_diff").jqxNumberInput('decimal')), moisture: parseFloat($("#moisture").jqxNumberInput('decimal')), - diastatic_power: parseFloat($("#diastatic_power").jqxNumberInput('decimal')), + diastatic_power: kolbach_to_lintner(parseFloat($("#diastatic_power").jqxNumberInput('decimal'))), protein: parseFloat($("#protein").jqxNumberInput('decimal')), dissolved_protein: parseFloat($("#dissolved_protein").jqxNumberInput('decimal')), max_in_batch: parseFloat($("#max_in_batch").jqxNumberInput('decimal')), diff -r 7f5455806f20 -r 1de1623e1760 www/js/prod_edit.js --- a/www/js/prod_edit.js Sun May 26 16:09:50 2019 +0200 +++ b/www/js/prod_edit.js Sun May 26 20:37:28 2019 +0200 @@ -148,6 +148,7 @@ var mashtemp = 0; // Average mash temperature var bv = 0.925; // Bierverlies rendement var sr = 0.95; // Mash en spoel rendement + var lintner = 0; // Total recipe lintner if ((rows = $('#mashGrid').jqxGrid('getrows'))) { for (var i = 0; i < rows.length; i++) { @@ -203,7 +204,15 @@ ((dataRecord.inventory_reduced <= 6) && (row.f_added == 4))) && row.f_inventory < row.f_amount) { ok_fermentables = 0; } + if (row.f_added == 0 && (row.f_type == 0 || row.f_type == 4) && row.f_color < 50) { // Mash and Grain/Adjunct and Color < 50 + lintner += row.f_diastatic_power * row.f_amount; + // console.log("add "+row.f_name+" diastatic_power:"+row.f_diastatic_power*row.f_amount+" now:"+lintner); + // } else { + // console.log("ign "+row.f_name+" diastatic_power:"+row.f_diastatic_power*row.f_amount+" now:"+lintner); + } } + $("#ferm_lintner").val(Math.round(parseFloat(lintner / mashkg))); + // console.log("lintner:"+lintner+" kg:"+mashkg); $("#mash_kg").val(mashkg); console.log("calcFermentables() supplies:"+ok_fermentables); to_100 = my_100; @@ -3191,7 +3200,7 @@ var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); $("#fermentableGrid").jqxGrid({ width: 1240, - height: 500, + height: 470, source: fermentableAdapter, theme: theme, selectionmode: 'singlerow', @@ -4311,6 +4320,8 @@ $("#est_og2").jqxNumberInput( Show3dec ); $("#mash_kg").jqxTooltip({ content: 'Het gewicht van alle mouten in de maisch.' }); $("#mash_kg").jqxNumberInput( Show3dec ); + $("#ferm_lintner").jqxTooltip({ content: 'De enzymkracht van alle mouten in de maisch. Moet hoger dan 35 zijn.' }); + $("#ferm_lintner").jqxNumberInput( Show0dec ); $("#perc_malts").jqxProgressBar({ width: 300, height: 23, diff -r 7f5455806f20 -r 1de1623e1760 www/js/rec_edit.js --- a/www/js/rec_edit.js Sun May 26 16:09:50 2019 +0200 +++ b/www/js/rec_edit.js Sun May 26 20:37:28 2019 +0200 @@ -176,6 +176,7 @@ var mashtemp = 0; // Average mash temperature var bv = 0.925; // Bierverlies rendement var sr = 0.95; // Mash en spoel rendement + var lintner = 0; // Total recipe lintner if ((rows = $('#mashGrid').jqxGrid('getrows'))) { for (var i = 0; i < rows.length; i++) { @@ -221,10 +222,15 @@ addedmass += row.f_amount; vol += (x * sugardensity + (1 - x) * 1) * row.f_amount; } + if (row.f_added == 0 && (row.f_type == 0 || row.f_type == 4) && row.f_color < 50) { // Mash and Grain/Adjunct and Color < 50 + lintner += row.f_diastatic_power * row.f_amount; + } colort += row.f_amount * ebc_to_srm(row.f_color); colorh += row.f_amount * row.f_color * get_kt(row.f_color); colorn += (row.f_percentage / 100) * row.f_color; // For 8.6 Pt wort. } + $("#ferm_lintner").val(Math.round(parseFloat(lintner / mashkg))); + console.log("lintner:"+lintner+" kg:"+mashkg); to_100 = my_100; if (to_100) { $("#wf_amount").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); @@ -1767,7 +1773,7 @@ var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); $("#fermentableGrid").jqxGrid({ width: 1240, - height: 500, + height: 470, source: fermentableAdapter, theme: theme, selectionmode: 'singlerow', @@ -2783,6 +2789,8 @@ $("#est_color2").jqxNumberInput( Show0dec ); $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); $("#est_og2").jqxNumberInput( Show3dec ); + $("#ferm_lintner").jqxTooltip({ content: 'De enzymkracht van alle mouten in de maisch. Moet hoger dan 35 zijn.' }); + $("#ferm_lintner").jqxNumberInput( Show0dec ); $("#perc_malts").jqxProgressBar({ width: 300, height: 23, diff -r 7f5455806f20 -r 1de1623e1760 www/prod_edit.php --- a/www/prod_edit.php Sun May 26 16:09:50 2019 +0200 +++ b/www/prod_edit.php Sun May 26 20:37:28 2019 +0200 @@ -209,6 +209,11 @@
+ + Lintner totaal: +
+ +
diff -r 7f5455806f20 -r 1de1623e1760 www/rec_edit.php --- a/www/rec_edit.php Sun May 26 16:09:50 2019 +0200 +++ b/www/rec_edit.php Sun May 26 20:37:28 2019 +0200 @@ -123,6 +123,11 @@
+ + Lintner totaal: +
+ +