www/js/inv_equipments.js

changeset 692
dc3311736fb7
parent 691
9c21125f584e
child 693
c4fe2e5f3efa
--- a/www/js/inv_equipments.js	Sat May 23 20:53:48 2020 +0200
+++ b/www/js/inv_equipments.js	Sat May 23 22:00:44 2020 +0200
@@ -50,12 +50,13 @@
   evap_rate = parseFloat($('#evap_rate').jqxNumberInput('decimal')),
   boil_time = parseFloat($('#boil_time').jqxNumberInput('decimal')),
   top_up = parseFloat($('#top_up_kettle').jqxNumberInput('decimal')),
-  batch;
+  batch = parseFloat($('#batch_size').jqxNumberInput('decimal'));
 
   if (calc) { // If checked, calculate the batch size.
    batch = boil_size - (evap_rate * boil_time / 60) + top_up;
    $('#batch_size').val(batch);
   }
+  $('#vol_fermenter').val((batch / 1.04) + parseFloat($('#top_up_water').jqxNumberInput('decimal')) - parseFloat($('#trub_chiller_loss').jqxNumberInput('decimal')));
  }
 
  // tooltips
@@ -80,6 +81,7 @@
  $('#hop_utilization').jqxTooltip({ content: '100% for smaller installations, higher for large breweries.' });
  $('#batch_size').jqxTooltip({ content: 'Calculated batch size, liters at end of the boil.' });
  $('#trub_chiller_loss').jqxTooltip({ content: 'Standard loss in liters during transfer to the fermenter.' });
+ $('#top_up_water').jqxTooltip({ content: 'Extra water added into the fermenter.' });
 
  var dataRecord = {},
  url = 'includes/db_inventory_equipments.php',
@@ -214,6 +216,7 @@
  $('#mash_volume').jqxNumberInput(Spin1dec);
  $('#mash_max').jqxNumberInput(Spin1dec);
  $('#efficiency').jqxNumberInput(Perc1dec);
+ $('#vol_fermenter').jqxNumberInput(Show2dec);
 
  // initialize jqxGrid
  $('#jqxgrid').jqxGrid({
@@ -240,6 +243,7 @@
     $('#name').val('Nieuwe brouwset');
     $('#boil_size').val(18);
     $('#batch_size').val(15.3);
+    $('#vol_fermenter').val(14.2);
     $('#tun_volume').val(20);
     $('#tun_weight').val(2);
     $('#tun_specific_heat').val(0.11);
@@ -274,6 +278,8 @@
    $('#boil_time').on('change', function(event) { calcBatchVolume(); });
    $('#top_up_kettle').on('change', function(event) { calcBatchVolume(); });
    $('#calc_boil_volume').on('change', function(event) { calcBatchVolume(); });
+   $('#top_up_water').on('change', function(event) { calcBatchVolume(); });
+   $('#trub_chiller_loss').on('change', function(event) { calcBatchVolume(); });
    $('#tun_material').on('select', function(event) {
     dataRecord.tun_specific_heat = MaterialData[event.args.index].sh;
     $('#tun_specific_heat').val(dataRecord.tun_specific_heat);

mercurial