635 var r2d = Math.pow(10, (TpH - 10.38)); |
651 var r2d = Math.pow(10, (TpH - 10.38)); |
636 var f1d = 1 / (1 + r1d + r1d * r2d); |
652 var f1d = 1 / (1 + r1d + r1d * r2d); |
637 var f2d = f1d * r1d; |
653 var f2d = f1d * r1d; |
638 var f3d = f2d * r2d; |
654 var f3d = f2d * r2d; |
639 switch (BT) { |
655 switch (BT) { |
640 case 'NaHCO3': RA = -protonDeficit / (f1d - f3d); //mmol totaal |
656 case 0: RA = -protonDeficit / (f1d - f3d); //Sodiumbicarbonate, mmol totaal |
641 RA = RA * MMNaHCO3/1000; //gram |
657 RA = RA * MMNaHCO3/1000; //gram |
642 $("#wa_base").val(Math.round(RA * 100) / 100); |
658 $("#wa_base").val(Math.round(RA * 100) / 100); |
643 setWaterAgent(BT, Math.round(RA * 100) / 100); |
659 setWaterAgent(BT, Math.round(RA * 100) / 100); |
644 if (liters > 0) { |
660 if (liters > 0) { |
645 // Na |
661 // Na |
646 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl + |
662 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl + |
647 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMNa / MMNaHCO3; |
663 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMNa / MMNaHCO3; |
648 RA = 1000 * RA / liters; |
664 RA = 1000 * RA / liters; |
649 sodium = wg_sodium + RA; |
665 sodium = wg_sodium + RA; |
650 // HCO3 |
666 // HCO3 |
651 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNaHCO3; |
667 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNaHCO3; |
652 RA = 1000 * RA / liters; |
668 RA = 1000 * RA / liters; |
653 bicarbonate = wg_bicarbonate + RA; |
669 bicarbonate = wg_bicarbonate + RA; |
654 total_alkalinity = bicarbonate * 50 / 61; |
670 total_alkalinity = bicarbonate * 50 / 61; |
655 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
671 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
656 } |
672 } |
657 break; |
673 break; |
658 case 'Na2CO3': RA = -protonDeficit / (2 * f1d + f2d); //mmol totaal |
674 case 1: RA = -protonDeficit / (2 * f1d + f2d); // Sodiumcarbonate, mmol totaal |
659 RA = RA * MMNa2CO3/1000; //gram |
675 RA = RA * MMNa2CO3/1000; //gram |
660 $("#wa_base").val(Math.round(RA * 100) / 100); |
676 $("#wa_base").val(Math.round(RA * 100) / 100); |
661 setWaterAgent(BT, Math.round(RA * 100) / 100); |
677 setWaterAgent(BT, Math.round(RA * 100) / 100); |
662 if (liters > 0) { |
678 if (liters > 0) { |
663 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl + |
679 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl + |
664 parseFloat($("#wa_base").jqxNumberInput('decimal')) * 2 * MMNa / MMNa2CO3; |
680 parseFloat($("#wa_base").jqxNumberInput('decimal')) * 2 * MMNa / MMNa2CO3; |
665 RA = 1000 * RA / liters; |
681 RA = 1000 * RA / liters; |
666 sodium = wg_sodium + RA; |
682 sodium = wg_sodium + RA; |
667 // HCO3 |
683 // HCO3 |
668 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNa2CO3; |
684 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNa2CO3; |
669 RA = 1000 * RA / liters; |
685 RA = 1000 * RA / liters; |
670 bicarbonate = wg_bicarbonate + RA; |
686 bicarbonate = wg_bicarbonate + RA; |
671 total_alkalinity = bicarbonate * 50 / 61; |
687 total_alkalinity = bicarbonate * 50 / 61; |
672 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
688 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
673 } |
689 } |
674 break; |
690 break; |
675 case 'CaCO3': RA = -protonDeficit * (f1d - f3d); //mmol totaal |
691 case 2: RA = -protonDeficit * (f1d - f3d); // Calciumcarbonate, mmol totaal |
676 RA = RA * MMCaCO3/1000; //gram |
692 RA = RA * MMCaCO3/1000; //gram |
677 //but only 1/3 is effective, so add 3 times as much |
693 //but only 1/3 is effective, so add 3 times as much |
678 RA = 3 * RA; |
694 RA = 3 * RA; |
679 $("#wa_base").val(Math.round(RA * 100) / 100); |
695 $("#wa_base").val(Math.round(RA * 100) / 100); |
680 setWaterAgent(BT, Math.round(RA * 100) / 100); |
696 setWaterAgent(BT, Math.round(RA * 100) / 100); |
681 if (liters > 0) { |
697 if (liters > 0) { |
682 //Bicarbonate |
698 //Bicarbonate |
683 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) / 3 * MMHCO3 / MMCaCO3; |
699 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) / 3 * MMHCO3 / MMCaCO3; |
684 RA = 1000 * RA / liters; |
700 RA = 1000 * RA / liters; |
685 bicarbonate = wg_bicarbonate + RA; |
701 bicarbonate = wg_bicarbonate + RA; |
686 total_alkalinity = bicarbonate * 50 / 61; |
702 total_alkalinity = bicarbonate * 50 / 61; |
687 //Ca precipitates out as Ca10(PO4)6(OH)2 |
703 //Ca precipitates out as Ca10(PO4)6(OH)2 |
688 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 + |
704 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 + |
689 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 + |
705 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 + |
690 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaCO3; |
706 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaCO3; |
691 RA = 1000 * RA / liters; |
707 RA = 1000 * RA / liters; |
692 calcium = wg_calcium + RA; |
708 calcium = wg_calcium + RA; |
693 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
709 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
694 } |
710 } |
695 break; |
711 break; |
696 case 'Ca(OH)2': RA = -protonDeficit / 19.3; // g |
712 case 3: RA = -protonDeficit / 19.3; // Calciumhydroxide |
697 $("#wa_base").val(Math.round(RA * 100) / 100); |
713 $("#wa_base").val(Math.round(RA * 100) / 100); |
698 setWaterAgent(BT, Math.round(RA * 100) / 100); |
714 setWaterAgent(BT, Math.round(RA * 100) / 100); |
699 if (liters > 0) { |
715 if (liters > 0) { |
700 // Bicarbonate |
716 // Bicarbonate |
701 RA = -protonDeficit / liters; |
717 RA = -protonDeficit / liters; |
702 total_alkalinity = wg_total_alkalinity + RA; |
718 total_alkalinity = wg_total_alkalinity + RA; |
703 bicarbonate = total_alkalinity * 61 / 50; |
719 bicarbonate = total_alkalinity * 61 / 50; |
704 // Calcium |
720 // Calcium |
705 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 + |
721 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 + |
706 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 + |
722 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 + |
707 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaOH2; |
723 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaOH2; |
708 RA = 1000 * RA / liters; |
724 RA = 1000 * RA / liters; |
709 calcium = wg_calcium + RA; |
725 calcium = wg_calcium + RA; |
710 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
726 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
711 } |
727 } |
712 break; |
728 break; |
713 } |
729 } |
714 } |
730 } |
715 ph = TpH; |
731 ph = TpH; |
716 $('#wb_ph').val(Math.round(ph * 10) / 10); |
732 $('#wb_ph').val(Math.round(ph * 10) / 10); |
717 } else { // Manual |
733 } else { // Manual |
718 console.log("calc_acid no"); |
734 console.log("calc_acid no"); |
719 // First add base salts |
735 // First add base salts |
720 if (parseFloat($("#wa_base").jqxNumberInput('decimal')) > 0) { |
736 if (parseFloat($("#wa_base").jqxNumberInput('decimal')) > 0) { |
721 if (liters > 0) { |
737 if (liters > 0) { |
722 switch (BT) { |
738 switch (BT) { |
723 case 'NaHCO3': // Na |
739 case 0: // Sodiumbicarbonate, Na |
724 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl + |
740 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl + |
725 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMNa / MMNaHCO3; |
741 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMNa / MMNaHCO3; |
726 RA = 1000 * RA / liters; |
742 RA = 1000 * RA / liters; |
727 sodium = wg_sodium + RA; |
743 sodium = wg_sodium + RA; |
728 // HCO3 |
744 // HCO3 |
729 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNaHCO3; |
745 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNaHCO3; |
730 RA = 1000 * RA / liters; |
746 RA = 1000 * RA / liters; |
731 bicarbonate = wg_bicarbonate + RA; |
747 bicarbonate = wg_bicarbonate + RA; |
732 total_alkalinity = bicarbonate * 50 / 61; |
748 total_alkalinity = bicarbonate * 50 / 61; |
733 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
749 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
734 break; |
750 break; |
735 case 'Na2CO3': RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl + |
751 case 1: // Sodiumcarbonate |
736 parseFloat($("#wa_base").jqxNumberInput('decimal')) * 2 * MMNa / MMNa2CO3; |
752 RA = parseFloat($("#wa_nacl").jqxNumberInput('decimal')) * MMNa / MMNaCl + |
737 RA = 1000 * RA / liters; |
753 parseFloat($("#wa_base").jqxNumberInput('decimal')) * 2 * MMNa / MMNa2CO3; |
738 sodium = wg_sodium + RA; |
754 RA = 1000 * RA / liters; |
739 // HCO3 |
755 sodium = wg_sodium + RA; |
740 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNa2CO3; |
756 // HCO3 |
741 RA = 1000 * RA / liters; |
757 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMHCO3 / MMNa2CO3; |
742 bicarbonate = wg_bicarbonate + RA; |
758 RA = 1000 * RA / liters; |
743 total_alkalinity = bicarbonate * 50 / 61; |
759 bicarbonate = wg_bicarbonate + RA; |
744 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
760 total_alkalinity = bicarbonate * 50 / 61; |
745 break; |
761 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
746 case 'CaCO3': // Bicarbonate |
762 break; |
747 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) / 3 * MMHCO3 / MMCaCO3; |
763 case 2: // Calciumcarbonate: Bicarbonate |
748 RA = 1000 * RA / liters; |
764 RA = parseFloat($("#wa_base").jqxNumberInput('decimal')) / 3 * MMHCO3 / MMCaCO3; |
749 bicarbonate = wg_bicarbonate + RA; |
765 RA = 1000 * RA / liters; |
750 total_alkalinity = bicarbonate * 50 / 61; |
766 bicarbonate = wg_bicarbonate + RA; |
751 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
767 total_alkalinity = bicarbonate * 50 / 61; |
752 // Ca |
768 RA = ResidualAlkalinity(wb_total_alkalinity, wb_calcium, wb_magnesium); |
753 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 + |
769 // Ca |
754 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 + |
770 RA = parseFloat($("#wa_cacl2").jqxNumberInput('decimal')) * MMCa / MMCaCl2 + |
755 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaCO3; |
771 parseFloat($("#wa_caso4").jqxNumberInput('decimal')) * MMCa / MMCaSO4 + |
756 RA = 1000 * RA / liters; |
772 parseFloat($("#wa_base").jqxNumberInput('decimal')) * MMCa / MMCaCO3; |
757 calcium = wg_calcium + RA; |
773 RA = 1000 * RA / liters; |
758 break; |
774 calcium = wg_calcium + RA; |
|
775 break; |
759 } |
776 } |
760 } |
777 } |
761 } |
778 } |
762 |
779 |
763 TpH = parseFloat(dataRecord.mash_ph); |
780 TpH = parseFloat(dataRecord.mash_ph); |
1269 { name: 'st_carb_max', type: 'float' }, |
1242 { name: 'st_carb_max', type: 'float' }, |
1270 { name: 'st_abv_min', type: 'float' }, |
1243 { name: 'st_abv_min', type: 'float' }, |
1271 { name: 'st_abv_max', type: 'float' }, |
1244 { name: 'st_abv_max', type: 'float' }, |
1272 { name: 'name', type: 'string' }, |
1245 { name: 'name', type: 'string' }, |
1273 { name: 'notes', type: 'string' }, |
1246 { name: 'notes', type: 'string' }, |
1274 { name: 'type', type: 'string' }, |
1247 { name: 'type', type: 'int' }, |
1275 { name: 'batch_size', type: 'float' }, |
1248 { name: 'batch_size', type: 'float' }, |
1276 { name: 'boil_size', type: 'float' }, |
1249 { name: 'boil_size', type: 'float' }, |
1277 { name: 'boil_time', type: 'float' }, |
1250 { name: 'boil_time', type: 'float' }, |
1278 { name: 'efficiency', type: 'float' }, |
1251 { name: 'efficiency', type: 'float' }, |
1279 { name: 'est_og', type: 'float' }, |
1252 { name: 'est_og', type: 'float' }, |
1280 { name: 'est_fg', type: 'float' }, |
1253 { name: 'est_fg', type: 'float' }, |
1281 { name: 'est_abv', type: 'float' }, |
1254 { name: 'est_abv', type: 'float' }, |
1282 { name: 'est_color', type: 'float' }, |
1255 { name: 'est_color', type: 'float' }, |
1283 { name: 'color_method', type: 'string' }, |
1256 { name: 'color_method', type: 'int' }, |
1284 { name: 'est_ibu', type: 'float' }, |
1257 { name: 'est_ibu', type: 'float' }, |
1285 { name: 'ibu_method', type: 'string' }, |
1258 { name: 'ibu_method', type: 'int' }, |
1286 { name: 'est_carb', type: 'float' }, |
1259 { name: 'est_carb', type: 'float' }, |
1287 { name: 'sparge_temp', type: 'float' }, |
1260 { name: 'sparge_temp', type: 'float' }, |
1288 { name: 'sparge_ph', type: 'float' }, |
1261 { name: 'sparge_ph', type: 'float' }, |
1289 { name: 'sparge_volume', type: 'float' }, |
1262 { name: 'sparge_volume', type: 'float' }, |
1290 { name: 'sparge_source', type: 'string' }, |
1263 { name: 'sparge_source', type: 'string' }, |
1291 { name: 'sparge_acid_type', type: 'string' }, |
1264 { name: 'sparge_acid_type', type: 'int' }, |
1292 { name: 'sparge_acid_perc', type: 'float' }, |
1265 { name: 'sparge_acid_perc', type: 'float' }, |
1293 { name: 'sparge_acid_amount', type: 'float' }, |
1266 { name: 'sparge_acid_amount', type: 'float' }, |
1294 { name: 'mash_ph', type: 'float' }, |
1267 { name: 'mash_ph', type: 'float' }, |
1295 { name: 'mash_name', type: 'string' }, |
1268 { name: 'mash_name', type: 'string' }, |
1296 { name: 'calc_acid', type: 'bool' }, |
1269 { name: 'calc_acid', type: 'bool' }, |
1422 { name: 'f_name', type: 'string' }, |
1401 { name: 'f_name', type: 'string' }, |
1423 { name: 'f_origin', type: 'string' }, |
1402 { name: 'f_origin', type: 'string' }, |
1424 { name: 'f_supplier', type: 'string' }, |
1403 { name: 'f_supplier', type: 'string' }, |
1425 { name: 'f_amount', type: 'float' }, |
1404 { name: 'f_amount', type: 'float' }, |
1426 { name: 'f_cost', type: 'float' }, |
1405 { name: 'f_cost', type: 'float' }, |
1427 { name: 'f_type', type: 'string' }, |
1406 { name: 'f_type', type: 'int' }, |
1428 { name: 'f_yield', type: 'float' }, |
1407 { name: 'f_yield', type: 'float' }, |
1429 { name: 'f_color', type: 'float' }, |
1408 { name: 'f_color', type: 'float' }, |
1430 { name: 'f_coarse_fine_diff', type: 'float' }, |
1409 { name: 'f_coarse_fine_diff', type: 'float' }, |
1431 { name: 'f_moisture', type: 'float' }, |
1410 { name: 'f_moisture', type: 'float' }, |
1432 { name: 'f_diastatic_power', type: 'float' }, |
1411 { name: 'f_diastatic_power', type: 'float' }, |
1433 { name: 'f_protein', type: 'float' }, |
1412 { name: 'f_protein', type: 'float' }, |
1434 { name: 'f_max_in_batch', type: 'float' }, |
1413 { name: 'f_max_in_batch', type: 'float' }, |
1435 { name: 'f_graintype', type: 'string' }, |
1414 { name: 'f_graintype', type: 'int' }, |
1436 { name: 'f_added', type: 'string' }, |
1415 { name: 'f_added', type: 'int' }, |
1437 { name: 'f_dissolved_protein', type: 'float' }, |
1416 { name: 'f_dissolved_protein', type: 'float' }, |
1438 { name: 'f_recommend_mash', type: 'bool' }, |
1417 { name: 'f_recommend_mash', type: 'int' }, |
1439 { name: 'f_add_after_boil', type: 'bool' }, |
1418 { name: 'f_add_after_boil', type: 'int' }, |
1440 { name: 'f_adjust_to_total_100', type: 'bool' }, |
1419 { name: 'f_adjust_to_total_100', type: 'int' }, |
1441 { name: 'f_percentage', type: 'float' }, |
1420 { name: 'f_percentage', type: 'float' }, |
1442 { name: 'f_di_ph', type: 'float' }, |
1421 { name: 'f_di_ph', type: 'float' }, |
1443 { name: 'f_acid_to_ph_57', type: 'float' } |
1422 { name: 'f_acid_to_ph_57', type: 'float' }, |
|
1423 { name: 'f_stock', type: 'float' }, |
1444 ], |
1424 ], |
1445 addrow: function (rowid, rowdata, position, commit) { |
1425 addrow: function (rowid, rowdata, position, commit) { |
1446 commit(true); |
1426 commit(true); |
1447 }, |
1427 }, |
1448 deleterow: function (rowid, commit) { |
1428 deleterow: function (rowid, commit) { |
1449 commit(true); |
1429 commit(true); |
1450 } |
1430 } |
1451 }; |
1431 }; |
1452 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); |
1432 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); |
1453 $("#fermentableGrid").jqxGrid({ |
1433 $("#fermentableGrid").jqxGrid({ |
1454 width: 1150, |
1434 width: 1240, |
1455 height: 400, |
1435 height: 400, |
1456 source: fermentableAdapter, |
1436 source: fermentableAdapter, |
1457 theme: theme, |
1437 theme: theme, |
1458 selectionmode: 'singlerow', |
1438 selectionmode: 'singlerow', |
1459 editmode: 'selectedcell', |
|
1460 editable: true, |
|
1461 localization: getLocalization(), |
1439 localization: getLocalization(), |
1462 showtoolbar: true, |
1440 showtoolbar: true, |
1463 rendertoolbar: function (toolbar) { |
1441 rendertoolbar: function (toolbar) { |
1464 var me = this; |
1442 var me = this; |
1465 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
1443 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
1578 ready: function() { |
1556 ready: function() { |
1579 calcFermentables(); |
1557 calcFermentables(); |
1580 $('#jqxTabs').jqxTabs('next'); |
1558 $('#jqxTabs').jqxTabs('next'); |
1581 }, |
1559 }, |
1582 columns: [ |
1560 columns: [ |
1583 { text: 'Vergistbaar ingrediënt', editable: false, datafield: 'f_name', |
1561 { text: 'Vergistbaar ingrediënt', datafield: 'f_name', |
1584 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) { |
1562 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) { |
1585 var rowData = $("#fermentableGrid").jqxGrid('getrowdata', row); |
1563 var rowData = $("#fermentableGrid").jqxGrid('getrowdata', row); |
1586 return "<span style='margin: 3px; margin-top: 6px; float: "+ |
1564 return "<span style='margin: 3px; margin-top: 6px; float: "+ |
1587 columnproperties.cellsalign+"'>" +rowData.f_supplier+" / "+rowData.f_name+" ("+rowData.f_color+" EBC)</span>"; |
1565 columnproperties.cellsalign+"'>" +rowData.f_supplier+" / "+rowData.f_name+" ("+rowData.f_color+" EBC)</span>"; |
1588 } |
1566 } |
1589 }, |
1567 }, |
1590 { text: 'Type', editable: false, align: 'center', cellsalign: 'center', width: 100, datafield: 'f_type' }, |
1568 { text: 'Type', width: 100, datafield: 'f_type', |
1591 { text: 'Moment', width: 110, align: 'center', cellsalign: 'center', datafield: 'f_added', columntype: 'dropdownlist', |
1569 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
1592 createeditor: function (row, column, editor) { |
1570 return "<div style='margin: 4px;'>" + FermentableTypeData[value].nl + "</div>"; |
1593 var srcAdded = [ "Mash", "Boil", "Fermentation", "Lagering", "Bottle" ]; |
1571 } |
1594 editor.jqxDropDownList({ autoDropDownHeight: true, source: srcAdded }); |
1572 }, |
|
1573 { text: 'Moment', width: 110, datafield: 'f_added', |
|
1574 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
|
1575 return "<div style='margin: 4px;'>" + AddedData[value].nl + "</div>"; |
1595 } |
1576 } |
1596 }, |
1577 }, |
1597 { text: 'Opbrengst', editable: false, datafield: 'f_yield', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, |
1578 { text: 'Opbrengst', editable: false, datafield: 'f_yield', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, |
1598 { text: 'Gewicht Kg', datafield: 'f_amount', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f3', |
1579 { text: 'Gewicht Kg', datafield: 'f_amount', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, |
1599 columntype: 'numberinput', |
1580 { text: 'Voorr. Kg', datafield: 'f_stock', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, |
1600 validation: function (cell, value) { |
1581 { text: 'Percent', datafield: 'f_percentage', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, |
1601 // Maximum weight is the batch_size, just a simple check. |
1582 { text: '100%', align: 'center', datafield: 'f_adjust_to_total_100', columntype: 'checkbox', width: 70 }, |
1602 var maxmout = parseFloat($("#batch_size").jqxNumberInput('decimal')); |
1583 { text: 'Wijzig', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () { |
1603 if (value < 0 || value > maxmout) { |
1584 return "Wijzig"; |
1604 return { result: false, message: "Gewicht moet 0-"+maxmout+" zijn" }; |
1585 }, buttonclick: function (row) { |
1605 } |
1586 fermentableRow = row; |
1606 return true; |
1587 fermentableData = $("#fermentableGrid").jqxGrid('getrowdata', fermentableRow); |
1607 }, |
1588 $("#wf_name").val(fermentableData.f_name); |
1608 initeditor: function (row, cellvalue, editor) { |
1589 $("#wf_amount").val(fermentableData.f_amount); |
1609 editor.jqxNumberInput({ inputMode: 'simple', min: 0, decimalDigits: 3, spinButtons: false }); |
1590 $("#wf_percentage").val(fermentableData.f_percentage); |
1610 }, |
1591 $("#wf_adjust_to_total_100").val(fermentableData.f_adjust_to_total_100); |
1611 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) { |
1592 $("#wf_added").val(fermentableData.f_added); |
1612 if (to_100) { |
1593 // show the popup window. |
1613 return oldvalue; // When using percentages, don't allow edited results. |
1594 $("#popupFermentable").jqxWindow('open'); |
1614 } |
1595 } |
1615 } |
1596 } |
1616 }, |
|
1617 { text: 'Percentage', datafield: 'f_percentage', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'p1', |
|
1618 columntype: 'numberinput', |
|
1619 validation: function (cell, value) { |
|
1620 if (value < 0 || value > 100) { |
|
1621 return { result: false, message: "Percentage moet 0-100 zijn" }; |
|
1622 } |
|
1623 return true; |
|
1624 }, |
|
1625 initeditor: function (row, cellvalue, editor) { |
|
1626 editor.jqxNumberInput({ decimalDigits: 1, min: 0, max: 100, spinButtons: false }); |
|
1627 }, |
|
1628 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) { |
|
1629 oldvalue = Math.round(oldvalue * 10) / 10.0; |
|
1630 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount; |
|
1631 if ((oldvalue != newvalue) && (rowscount > 1)) { |
|
1632 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', row); |
|
1633 if (rowdata.f_adjust_to_total_100) { |
|
1634 return oldvalue; |
|
1635 } |
|
1636 var diff = newvalue - oldvalue; |
|
1637 var tw = 0; // total weight |
|
1638 for (i = 0; i < rowscount; i++) { |
|
1639 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
1640 tw += rowdata.f_amount; |
|
1641 } |
|
1642 if (to_100) { |
|
1643 // Adjust this row and the 100% row. |
|
1644 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', row); |
|
1645 rowdata.f_amount += tw * diff / 100; |
|
1646 for (i = 0; i < rowscount; i++) { |
|
1647 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
1648 if (rowdata.f_adjust_to_total_100) { |
|
1649 rowdata.f_percentage -= diff; |
|
1650 rowdata.f_amount -= tw * diff / 100; |
|
1651 } |
|
1652 } |
|
1653 } else { |
|
1654 // Adjust all the rows. |
|
1655 var nw = tw * diff / 100; |
|
1656 for (i = 0; i < rowscount; i++) { |
|
1657 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
1658 if (i == row) { |
|
1659 rowdata.f_amount += nw; |
|
1660 } else { |
|
1661 rowdata.f_amount -= nw / (rowscount - 1); |
|
1662 rowdata.f_percentage = Math.round((rowdata.f_amount / tw) * 1000) / 10.0; |
|
1663 } |
|
1664 } |
|
1665 } |
|
1666 } |
|
1667 } |
|
1668 }, |
|
1669 { text: '100%', align: 'center', datafield: 'f_adjust_to_total_100', columntype: 'checkbox', width: 80, |
|
1670 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) { |
|
1671 if (to_100) { |
|
1672 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount; |
|
1673 for (i = 0; i < rowscount; i++) { |
|
1674 if (i != row) { |
|
1675 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
1676 rowdata.f_adjust_to_total_100 = false; |
|
1677 } |
|
1678 } |
|
1679 } |
|
1680 } |
|
1681 } |
|
1682 ] |
1597 ] |
1683 }); |
|
1684 $("#fermentableGrid").on('cellendedit', function (event) { |
|
1685 var args = event.args; |
|
1686 console.log("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (args.rowindex) + ", Value: " + args.value); |
|
1687 // Make sure the grid itself is updated. |
|
1688 $("#fermentableGrid").jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value); |
|
1689 if ((args.datafield == 'f_amount') && (! to_100)) { |
|
1690 // If one of the amounts is changed, recalculate the percentages. |
|
1691 console.log("adjust percentages"); |
|
1692 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount; |
|
1693 if (rowscount > 1) { |
|
1694 var tw = 0; |
|
1695 for (i = 0; i < rowscount; i++) { |
|
1696 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
1697 tw += rowdata.f_amount; |
|
1698 }; |
|
1699 for (i = 0; i < rowscount; i++) { |
|
1700 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
1701 var percentage = Math.round(rowdata.f_amount / tw * 1000) / 10.0; |
|
1702 $("#fermentableGrid").jqxGrid('setcellvalue', i, "f_percentage", percentage); |
|
1703 }; |
|
1704 } else { |
|
1705 $("#fermentableGrid").jqxGrid('setcellvalue', 0, "f_percentage", 100); |
|
1706 } |
|
1707 }; |
|
1708 $('#fermentableGrid').jqxGrid('sortby', 'f_amount', 'desc'); // TODO: not reliable |
|
1709 calcFermentables(); |
|
1710 calcSVG(); |
|
1711 calcABV(); |
|
1712 calcIBUs(); // Depends on gravity, so recalculate. |
|
1713 }); |
1598 }); |
1714 }; |
1599 }; |
1715 |
1600 |
1716 // Inline hops editor |
1601 // Inline hops editor |
1717 var editHop = function (data) { |
1602 var editHop = function (data) { |
2488 $('#mashGrid').jqxGrid('sortby', 'step_temp', 'asc'); |
2373 $('#mashGrid').jqxGrid('sortby', 'step_temp', 'asc'); |
2489 }); |
2374 }); |
2490 }; |
2375 }; |
2491 |
2376 |
2492 // initialize the input fields. |
2377 // initialize the input fields. |
2493 var srcType = [ "All Grain", "Partial Mash", "Extract" ]; |
|
2494 var srcColor = [ "Morey", "Mosher", "Daniels" ]; |
|
2495 //var srcIBU = [ "Tinseth", "Rager", "Garetz", "Daniels", "Mosher", "Noonan" ]; |
|
2496 var srcIBU = [ "Tinseth", "Rager", "Daniels" ]; // Only these are supported at this time. |
|
2497 var srcBase = [ "NaHCO3", "Na2CO3", "CaCO3", "Ca(OH)2" ]; |
2378 var srcBase = [ "NaHCO3", "Na2CO3", "CaCO3", "Ca(OH)2" ]; |
2498 var srcAcid = [ "Melkzuur", "Zoutzuur", "Fosforzuur", "Zwavelzuur" ]; |
2379 var srcAcid = [ "Melkzuur", "Zoutzuur", "Fosforzuur", "Zwavelzuur" ]; |
2499 var srcSource = [ "Bron 1", "Bron 2", "Gemengd" ]; |
2380 var srcSource = [ "Bron 1", "Bron 2", "Gemengd" ]; |
|
2381 |
|
2382 // Tab 1, Algemeen |
|
2383 $("#name").jqxTooltip({ content: 'De naam voor dit recept.' }); |
2500 $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
2384 $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
2501 $("#locked").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
2385 $("#locked").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
|
2386 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit recept.' }); |
2502 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 }); |
2387 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 }); |
|
2388 $("#type").jqxTooltip({ content: 'Het brouw type van dit recept.' }); |
|
2389 $("#type").jqxDropDownList({ |
|
2390 theme: theme, |
|
2391 source: RecipeTypeAdapter, |
|
2392 valueMember: 'id', |
|
2393 displayMember: 'nl', |
|
2394 width: 180, |
|
2395 height: 23, |
|
2396 autoDropDownHeight: true |
|
2397 }); |
|
2398 $("#efficiency").jqxTooltip({ content: 'Het rendement van maischen en koken.' }); |
|
2399 $("#efficiency").jqxNumberInput( Perc1dec5 ); |
|
2400 $("#batch_size").jqxTooltip({ content: 'Het volume van het gekoelde wort na het koken.' }); |
|
2401 $("#batch_size").jqxNumberInput( Spin1dec5 ); |
|
2402 $("#batch_size").jqxNumberInput({ min: 4 }); |
|
2403 $("#boil_size").jqxTooltip({ content: 'Het volume van het wort voor het koken.' }); |
|
2404 $("#boil_size").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 2, readOnly: true }); |
|
2405 $("#boil_time").jqxTooltip({ content: 'De kooktijd in minuten.' }); |
|
2406 $("#boil_time").jqxNumberInput( PosInt ); |
|
2407 $("#boil_time").jqxNumberInput({ min: 4, max: 360 }); |
|
2408 |
|
2409 $("#st_name").jqxTooltip({ content: 'De bierstijl naam voor dit recept.'}); |
2503 $("#st_name").jqxInput({ theme: theme, width: 250, height: 23 }); |
2410 $("#st_name").jqxInput({ theme: theme, width: 250, height: 23 }); |
|
2411 $("#st_letter").jqxTooltip({ content: 'De bierstijl letter voor dit recept.'}); |
2504 $("#st_letter").jqxInput({ theme: theme, width: 100, height: 23 }); |
2412 $("#st_letter").jqxInput({ theme: theme, width: 100, height: 23 }); |
|
2413 $("#st_guide").jqxTooltip({ content: 'De bierstijl gids voor dit recept.'}); |
2505 $("#st_guide").jqxInput({ theme: theme, width: 250, height: 23 }); |
2414 $("#st_guide").jqxInput({ theme: theme, width: 250, height: 23 }); |
|
2415 $("#st_category").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'}); |
2506 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 }); |
2416 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 }); |
|
2417 $("#st_category_number").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'}); |
2507 $("#st_category_number").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2418 $("#st_category_number").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
2508 $("#st_type").jqxInput({ theme: theme, width: 90, height: 23 }); |
2419 $("#st_type").jqxTooltip({ content: 'Het bierstijl type.'}); |
2509 $("#type").jqxDropDownList({ theme: theme, source: srcType, width: 125, height: 23, dropDownHeight: 95 }); |
2420 $("#st_type").jqxInput({ theme: theme, width: 180, height: 23 }); |
2510 $("#batch_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: 'L', symbolPosition: 'right' }); |
2421 |
2511 $("#boil_size").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 2, readOnly: true, symbol: 'L', symbolPosition: 'right' }); |
2422 $("#est_og").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
2512 $("#boil_time").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, max: 360, decimalDigits: 0, spinButtons: true }); |
2423 $("#est_og").jqxNumberInput( SGopts ); |
2513 $("#efficiency").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 40, max: 100, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); |
2424 $("#st_og_min").jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'}); |
2514 $("#est_og").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 1.000, max: 1.200, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 }); |
2425 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
2426 $("#st_og_max").jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'}); |
|
2427 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
2428 |
|
2429 $("#est_fg").jqxTooltip({ content: 'Het eind SG. Dit wordt automatisch berekend.' }); |
|
2430 $("#est_fg").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true }); |
|
2431 $("#st_fg_min").jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'}); |
|
2432 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
2433 $("#st_fg_max").jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'}); |
|
2434 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
2435 |
|
2436 $("#est_abv").jqxTooltip({ content: 'Alcohol volume %. Dit wordt automatisch berekend.' }); |
|
2437 $("#est_abv").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2438 $("#st_abv_min").jqxTooltip({ content: 'Het minimum alcohol volume % voor deze bierstijl.'}); |
|
2439 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2440 $("#st_abv_max").jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'}); |
|
2441 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2442 |
|
2443 $("#est_color").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
|
2444 $("#est_color").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true }); |
|
2445 $("#st_color_min").jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'}); |
|
2446 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2447 $("#st_color_max").jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'}); |
|
2448 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2449 $("#color_method").jqxDropDownList({ |
|
2450 theme: theme, |
|
2451 source: ColorMethodAdapter, |
|
2452 valueMember: 'id', |
|
2453 displayMember: 'nl', |
|
2454 width: 180, |
|
2455 height: 23, |
|
2456 autoDropDownHeight: true |
|
2457 }); |
|
2458 |
|
2459 $("#est_ibu").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); |
|
2460 $("#est_ibu").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true }); |
|
2461 $("#st_ibu_min").jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'}); |
|
2462 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2463 $("#st_ibu_max").jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'}); |
|
2464 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2465 $("#ibu_method").jqxDropDownList({ |
|
2466 theme: theme, |
|
2467 source: IBUmethodAdapter, |
|
2468 valueMember: 'id', |
|
2469 displayMember: 'nl', |
|
2470 width: 180, |
|
2471 height: 23, |
|
2472 autoDropDownHeight: true, |
|
2473 dropDownVerticalAlignment: 'top' |
|
2474 }); |
|
2475 |
|
2476 $("#est_carb").jqxTooltip({ content: 'Koolzuur volume. Dit wordt automatisch berekend.' }); |
|
2477 $("#est_carb").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2478 $("#st_carb_min").jqxTooltip({ content: 'Het minimum koolzuur volume voor deze bierstijl.'}); |
|
2479 $("#st_carb_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2480 $("#st_carb_max").jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'}); |
|
2481 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2482 |
|
2483 // Tab 2, Vergistbaar |
|
2484 $("#est_color2").jqxTooltip({ content: 'De kleur in EBC. Dit wordt automatisch berekend.' }); |
|
2485 $("#est_color2").jqxNumberInput({ inputMode: 'simple', theme: theme, symbol: ' EBC', symbolPosition: 'right', width: 100, height: 23, decimalDigits: 0, readOnly: true }); |
|
2486 $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); |
2515 $("#est_og2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 3, readOnly: true }); |
2487 $("#est_og2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 3, readOnly: true }); |
2516 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
2517 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
2518 |
|
2519 $("#est_fg").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 3, readOnly: true }); |
|
2520 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
2521 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); |
|
2522 |
|
2523 $("#est_abv").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2524 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2525 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2526 |
|
2527 $("#est_color").jqxNumberInput({ inputMode: 'simple', theme: theme, symbol: ' EBC', symbolPosition: 'right', width: 100, height: 23, decimalDigits: 0, readOnly: true }); |
|
2528 $("#est_color2").jqxNumberInput({ inputMode: 'simple', theme: theme, symbol: ' EBC', symbolPosition: 'right', width: 100, height: 23, decimalDigits: 0, readOnly: true }); |
|
2529 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2530 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2531 $("#color_method").jqxDropDownList({ theme: theme, source: srcColor, width: 125, height: 23, dropDownHeight: 95 }); |
|
2532 |
|
2533 $("#est_ibu").jqxNumberInput({ inputMode: 'simple', theme: theme, symbol: ' IBU', symbolPosition: 'right', width: 100, height: 23, decimalDigits: 0, readOnly: true }); |
|
2534 $("#est_ibu2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2535 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2536 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2537 $("#ibu_method").jqxDropDownList({ theme: theme, source: srcIBU, width: 125, height: 23, dropDownHeight: 95, dropDownVerticalAlignment: 'top' }); |
|
2538 |
|
2539 $("#est_carb").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2540 $("#st_carb_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2541 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); |
|
2542 |
|
2543 $("#mash_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
|
2544 $("#mash_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4, max: 8, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
|
2545 // Several gauges |
|
2546 $("#hop_flavour").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
|
2547 $("#hop_aroma").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
|
2548 $("#perc_malts").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2488 $("#perc_malts").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2549 $("#perc_sugars").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2489 $("#perc_sugars").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2550 $("#perc_cara").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2490 $("#perc_cara").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
2551 |
2491 $("#popupFermentable").jqxWindow({ |
2552 // Water treatment |
2492 width: 800, |
|
2493 height: 300, |
|
2494 position: { x: 230, y: 100 }, |
|
2495 resizable: false, |
|
2496 theme: theme, |
|
2497 isModal: true, |
|
2498 autoOpen: false, |
|
2499 cancelButton: $("#FermentableReady"), |
|
2500 modalOpacity: 0.40 |
|
2501 }); |
|
2502 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
|
2503 $("#FermentableReady").click(function () { |
|
2504 $("#fermentableGrid").jqxGrid('setcellvalue', fermentableRow, 'f_name', $("#wf_name").val()); |
|
2505 |
|
2506 // $("#fermentableGrid").jqxGrid('sortby', 'f_amount', 'desc'); |
|
2507 // Recalc percentages |
|
2508 // calcFermentables(); |
|
2509 // calcSVG(); |
|
2510 // calcABV(); |
|
2511 // calcIBUs(); |
|
2512 // Waters: yes there is impact. |
|
2513 }); |
|
2514 $("#wf_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
|
2515 $("#wf_amount").jqxNumberInput( Spin3dec5 ); |
|
2516 $('#wf_amount').on('change', function (event) { |
|
2517 console.log("amount changed: "+event.args.value); |
|
2518 $("#fermentableGrid").jqxGrid('setcellvalue', fermentableRow, 'f_amount', event.args.value); |
|
2519 if (! to_100) { |
|
2520 // Recalculate percentages |
|
2521 console.log("adjust percentages"); |
|
2522 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount; |
|
2523 if (rowscount > 1) { |
|
2524 var tw = 0; |
|
2525 for (i = 0; i < rowscount; i++) { |
|
2526 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
2527 tw += rowdata.f_amount; |
|
2528 }; |
|
2529 for (i = 0; i < rowscount; i++) { |
|
2530 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
2531 var percentage = Math.round(rowdata.f_amount / tw * 1000) / 10.0; |
|
2532 $("#fermentableGrid").jqxGrid('setcellvalue', i, "f_percentage", percentage); |
|
2533 // if (i == fermentableRow) // Will crash the script. |
|
2534 // $("#wf_percentage").val(percentage); |
|
2535 }; |
|
2536 } else { |
|
2537 $("#fermentableGrid").jqxGrid('setcellvalue', 0, "f_percentage", 100); |
|
2538 } |
|
2539 calcFermentables(); |
|
2540 }; |
|
2541 }); |
|
2542 $("#wf_percentage").jqxNumberInput( Perc1dec1 ); |
|
2543 $("#wf_percentage").on('change', function (event) { |
|
2544 var oldvalue = Math.round(fermentableData.f_percentage * 10) / 10.0; |
|
2545 var newvalue = event.args.value; |
|
2546 console.log("percentage changed: "+newvalue+" old: "+oldvalue); |
|
2547 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount; |
|
2548 if ((oldvalue != newvalue) && (rowscount > 1)) { |
|
2549 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', fermentableRow); |
|
2550 if (rowdata.f_adjust_to_total_100) { |
|
2551 $("#wf_percentage").val(oldvalue); |
|
2552 } else { |
|
2553 var diff = newvalue - oldvalue; |
|
2554 var tw = 0; // total weight |
|
2555 for (i = 0; i < rowscount; i++) { |
|
2556 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
2557 tw += rowdata.f_amount; |
|
2558 } |
|
2559 if (to_100) { |
|
2560 // Adjust this row and the 100% row. |
|
2561 var damount = tw * diff / 100; |
|
2562 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', fermentableRow); |
|
2563 var namount = rowdata.f_amount + damount; |
|
2564 $("#fermentableGrid").jqxGrid('setcellvalue', fermentableRow, 'f_amount', namount); |
|
2565 $("#wf_amount").val(namount); |
|
2566 $("#fermentableGrid").jqxGrid('setcellvalue', fermentableRow, 'f_percentage', rowdata.f_percentage + diff); |
|
2567 for (i = 0; i < rowscount; i++) { |
|
2568 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
2569 if (rowdata.f_adjust_to_total_100) { |
|
2570 namount = rowdata.f_amount - damount; |
|
2571 $("#fermentableGrid").jqxGrid('setcellvalue', i, 'f_percentage', rowdata.f_percentage - diff); |
|
2572 $("#fermentableGrid").jqxGrid('setcellvalue', i, 'f_amount', namount); |
|
2573 } |
|
2574 } |
|
2575 calcFermentables(); |
|
2576 } else { |
|
2577 // Adjust all the rows. |
|
2578 var nw = tw * diff / 100; |
|
2579 for (i = 0; i < rowscount; i++) { |
|
2580 var rowdata = $("#fermentableGrid").jqxGrid('getrowdata', i); |
|
2581 if (i == fermentableRow) { |
|
2582 var namount = rowdata.f_amount + nw; |
|
2583 $("#fermentableGrid").jqxGrid('setcellvalue', i, 'f_amount', namount); |
|
2584 // $("#wf_amount").val(namount); // Will crash the script. |
|
2585 $("#fermentableGrid").jqxGrid('setcellvalue', i, 'f_percentage', newvalue); |
|
2586 } else { |
|
2587 var namount = rowdata.f_amount - (nw / (rowscount - 1)); |
|
2588 var newperc = Math.round((namount / tw) * 1000) / 10.0; |
|
2589 $("#fermentableGrid").jqxGrid('setcellvalue', i, 'f_amount', namount); |
|
2590 $("#fermentableGrid").jqxGrid('setcellvalue', i, 'f_percentage', newperc); |
|
2591 } |
|
2592 } |
|
2593 calcFermentables(); |
|
2594 } |
|
2595 } |
|
2596 } |
|
2597 |
|
2598 }); |
|
2599 $("#wf_adjust_to_total_100").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
|
2600 $("#wf_adjust_to_total_100").on('checked', function (event) { |
|
2601 if (fermentableData.f_adjust_to_total_100 == 0) { |
|
2602 // console.log("wf_adjust_to_total_100: checked row: "+fermentableRow+" old: "+fermentableData.f_adjust_to_total_100); |
|
2603 if (to_100) { |
|
2604 // Reset other flag first. |
|
2605 var rowscount = $("#fermentableGrid").jqxGrid('getdatainformation').rowscount; |
|
2606 for (var i = 0; i < rowscount; i++) { |
|
2607 if (i != fermentableRow) { |
|
2608 $("#fermentableGrid").jqxGrid('setcellvalue', i, 'f_adjust_to_total_100', 0); |
|
2609 } |
|
2610 } |
|
2611 } |
|
2612 $("#fermentableGrid").jqxGrid('setcellvalue', fermentableRow, 'f_adjust_to_total_100', 1); |
|
2613 calcFermentables(); |
|
2614 } |
|
2615 }); |
|
2616 $("#wf_adjust_to_total_100").on('unchecked', function (event) { |
|
2617 if (fermentableData.f_adjust_to_total_100 != 0) { |
|
2618 // console.log("wf_adjust_to_total_100: unchecked row: "+fermentableRow+" old: "+fermentableData.f_adjust_to_total_100); |
|
2619 $("#fermentableGrid").jqxGrid('setcellvalue', fermentableRow, 'f_adjust_to_total_100', 0); |
|
2620 calcFermentables(); |
|
2621 } |
|
2622 }); |
|
2623 $("#wf_added").jqxDropDownList({ |
|
2624 theme: theme, |
|
2625 source: AddedAdapter, |
|
2626 valueMember: 'id', |
|
2627 displayMember: 'nl', |
|
2628 width: 180, |
|
2629 height: 23, |
|
2630 autoDropDownHeight: true, |
|
2631 dropDownVerticalAlignment: 'top' |
|
2632 }); |
|
2633 |
|
2634 // Tab 3, Hoppen |
|
2635 $("#est_ibu2").jqxTooltip({ content: 'De bitterheid in IBU. Dit wordt automatisch berekend.' }); |
|
2636 $("#est_ibu2").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); |
|
2637 $("#hop_flavour").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
|
2638 $("#hop_aroma").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true }); |
|
2639 |
|
2640 // Tab 4, Diversen |
|
2641 |
|
2642 // Tab 5, Gist |
|
2643 |
|
2644 // Tab 6, Maischen |
|
2645 $("#mash_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
|
2646 |
|
2647 // Tab 7, Water |
|
2648 $("#tgt_bu").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 2, readOnly: true }); |
|
2649 $("#tgt_cl_so4").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
|
2650 |
|
2651 // Water source 1 |
2553 $("#w1_name").jqxDropDownList({ |
2652 $("#w1_name").jqxDropDownList({ |
2554 placeHolder: "Kies hoofd water:", |
2653 placeHolder: "Kies hoofd water:", |
2555 theme: theme, |
2654 theme: theme, |
2556 source: waterlist, |
2655 source: waterlist, |
2557 displayMember: "name", |
2656 displayMember: "name", |
2626 dataRecord.w2_cost = datarecord.cost; |
2725 dataRecord.w2_cost = datarecord.cost; |
2627 $("#w2_amount").jqxNumberInput({ max: 100000, readOnly: false }); // Set high max to enable the spinbuttons. |
2726 $("#w2_amount").jqxNumberInput({ max: 100000, readOnly: false }); // Set high max to enable the spinbuttons. |
2628 calcWater(); |
2727 calcWater(); |
2629 } |
2728 } |
2630 }); |
2729 }); |
|
2730 $("#w2_amount").jqxTooltip({ content: 'De verdeling van het hoofd en meng water. Het totale maisch water volume blijft gelijk.'}); |
2631 $("#w2_amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 94, height: 23, min: 0, max: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5, readOnly: true }); |
2731 $("#w2_amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 94, height: 23, min: 0, max: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5, readOnly: true }); |
2632 $("#w2_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2732 $("#w2_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2633 $("#w2_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2733 $("#w2_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2634 $("#w2_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2734 $("#w2_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2635 $("#w2_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2735 $("#w2_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2636 $("#w2_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2736 $("#w2_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2637 $("#w2_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2737 $("#w2_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2638 $("#w2_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2738 $("#w2_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2639 |
2739 // Water mixed |
2640 $("#wg_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2740 $("#wg_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2641 $("#wg_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2741 $("#wg_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2642 $("#wg_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2742 $("#wg_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2643 $("#wg_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2743 $("#wg_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2644 $("#wg_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2744 $("#wg_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2645 $("#wg_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2745 $("#wg_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2646 $("#wg_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2746 $("#wg_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2647 $("#wg_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2747 $("#wg_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2648 |
2748 // Water treated |
|
2749 $("#wb_calcium").jqxTooltip({ content: 'De ideale hoeveelheid Calcium is tussen 40 en 150.'}); |
2649 $("#wb_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2750 $("#wb_calcium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
|
2751 $("#wb_magnesium").jqxTooltip({ content: 'De ideale hoeveelheid Magnesium is lager dan 30.'}); |
2650 $("#wb_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2752 $("#wb_magnesium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
|
2753 $("#wb_sodium").jqxTooltip({ content: 'De ideale hoeveelheid Natrium is lager dan 150.'}); |
2651 $("#wb_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2754 $("#wb_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
|
2755 $("#wb_chloride").jqxTooltip({ content: 'De ideale hoeveelheid Chloride is lager dan 100.'}); |
|
2756 $("#wb_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
|
2757 $("#wb_sulfate").jqxTooltip({ content: 'De ideale hoeveelheid Sulfaat is lager dan 350.'}); |
|
2758 $("#wb_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2652 $("#wb_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2759 $("#wb_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2653 $("#wb_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
|
2654 $("#wb_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
|
2655 $("#wb_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2760 $("#wb_ph").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2656 |
2761 // Water target profile |
2657 $("#pr_name").jqxDropDownList({ |
2762 $("#pr_name").jqxDropDownList({ |
2658 placeHolder: "Kies doel profiel:", |
2763 placeHolder: "Kies doel profiel:", |
2659 theme: theme, |
2764 theme: theme, |
2660 source: waterprofiles, |
2765 source: waterprofiles, |
2661 displayMember: "name", |
2766 displayMember: "name", |
2681 $("#pr_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2786 $("#pr_sodium").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2682 $("#pr_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2787 $("#pr_total_alkalinity").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2683 $("#pr_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2788 $("#pr_chloride").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2684 $("#pr_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2789 $("#pr_sulfate").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2685 |
2790 |
2686 $("#tgt_bu").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 2, readOnly: true }); |
2791 // Water agents |
2687 $("#tgt_cl_so4").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 74, height: 23, decimalDigits: 1, readOnly: true }); |
2792 $("#wa_cacl2").jqxTooltip({ content: 'Voor het maken van een ander waterprofiel. Voegt calcium en chloride toe. Voor het verbeteren van zoetere bieren.'}); |
2688 |
|
2689 $("#wa_cacl2").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' }); |
2793 $("#wa_cacl2").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' }); |
|
2794 $("#wa_caso4").jqxTooltip({ content: 'Gips. Voor het maken van een ander waterprofiel. Voegt calcium en sulfaat toe. Voor het verbeteren van bittere bieren.'}); |
2690 $("#wa_caso4").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' }); |
2795 $("#wa_caso4").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' }); |
|
2796 $("#wa_mgso4").jqxTooltip({ content: 'Epsom zout. Voor het maken van een ander waterprofiel. Voegt magnesium en sulfaat toe. Gebruik spaarzaam!'}); |
2691 $("#wa_mgso4").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' }); |
2797 $("#wa_mgso4").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' }); |
|
2798 $("#wa_nacl").jqxTooltip({ content: 'Keukenzout. Voor het maken van een ander waterprofiel. Voegt natrium en chloride toe. Voor het accentueren van zoetheid. Bij hoge dosering wordt het bier ziltig.'}); |
2692 $("#wa_nacl").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' }); |
2799 $("#wa_nacl").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, max: 1000, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1, symbol: ' gr', symbolPosition: 'right' }); |
2693 |
2800 $("#mash_ph").jqxTooltip({ content: 'Maisch pH tussen 5.2 en 5.6. Gebruik 5.2 voor lichte en 5.5 voor donkere bieren.'}); |
|
2801 $("#mash_ph").jqxNumberInput( SpinpH ); |
2694 $("#calc_acid").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
2802 $("#calc_acid").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
2695 $("#wa_base_name").jqxDropDownList({ theme: theme, source: srcBase, width: 100, height: 23, dropDownHeight: 128 }); |
2803 $("#wa_base_name").jqxDropDownList({ |
|
2804 theme: theme, |
|
2805 source: BaseTypeAdapter, |
|
2806 valueMember: 'id', |
|
2807 displayMember: 'nl', |
|
2808 width: 180, |
|
2809 height: 23, |
|
2810 autoDropDownHeight: true |
|
2811 }); |
2696 $("#wa_base").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05, symbol: ' gr', symbolPosition: 'right' }); |
2812 $("#wa_base").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05, symbol: ' gr', symbolPosition: 'right' }); |
2697 $("#wa_acid_name").jqxDropDownList({ theme: theme, source: srcAcid, width: 100, height: 23, dropDownHeight: 128 }); |
2813 $("#wa_acid_name").jqxDropDownList({ |
|
2814 theme: theme, |
|
2815 source: AcidTypeAdapter, |
|
2816 valueMember: 'id', |
|
2817 displayMember: 'nl', |
|
2818 width: 180, |
|
2819 height: 23, |
|
2820 autoDropDownHeight: true |
|
2821 }); |
2698 $("#wa_acid").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05, symbol: ' ml', symbolPosition: 'right' }); |
2822 $("#wa_acid").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05, symbol: ' ml', symbolPosition: 'right' }); |
2699 $("#wa_acid_perc").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 80, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); |
2823 $("#wa_acid_perc").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 80, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); |
2700 |
2824 // Sparge water |
2701 $("#sparge_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 70, max: 98, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
2825 $("#sparge_temp").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 70, max: 98, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
2702 $("#sparge_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
2826 $("#sparge_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
2703 $("#sparge_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4.5, max: 6.5, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
2827 $("#sparge_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 100, height: 23, min: 4.5, max: 6.5, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
2704 $("#sparge_source").jqxDropDownList({ theme: theme, source: srcSource, width: 100, height: 23, dropDownHeight: 95 }); |
2828 $("#sparge_source").jqxDropDownList({ theme: theme, source: srcSource, width: 100, height: 23, dropDownHeight: 95 }); |
2705 $("#sparge_acid_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 2, readOnly: true, symbol: ' ml', symbolPosition: 'right' }); |
2829 $("#sparge_acid_amount").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 100, height: 23, decimalDigits: 2, readOnly: true, symbol: ' ml', symbolPosition: 'right' }); |