www/js/inv_equipments.js

changeset 692
dc3311736fb7
parent 691
9c21125f584e
child 693
c4fe2e5f3efa
equal deleted inserted replaced
691:9c21125f584e 692:dc3311736fb7
48 var calc = $('#calc_boil_volume').val(), 48 var calc = $('#calc_boil_volume').val(),
49 boil_size = parseFloat($('#boil_size').jqxNumberInput('decimal')), 49 boil_size = parseFloat($('#boil_size').jqxNumberInput('decimal')),
50 evap_rate = parseFloat($('#evap_rate').jqxNumberInput('decimal')), 50 evap_rate = parseFloat($('#evap_rate').jqxNumberInput('decimal')),
51 boil_time = parseFloat($('#boil_time').jqxNumberInput('decimal')), 51 boil_time = parseFloat($('#boil_time').jqxNumberInput('decimal')),
52 top_up = parseFloat($('#top_up_kettle').jqxNumberInput('decimal')), 52 top_up = parseFloat($('#top_up_kettle').jqxNumberInput('decimal')),
53 batch; 53 batch = parseFloat($('#batch_size').jqxNumberInput('decimal'));
54 54
55 if (calc) { // If checked, calculate the batch size. 55 if (calc) { // If checked, calculate the batch size.
56 batch = boil_size - (evap_rate * boil_time / 60) + top_up; 56 batch = boil_size - (evap_rate * boil_time / 60) + top_up;
57 $('#batch_size').val(batch); 57 $('#batch_size').val(batch);
58 } 58 }
59 $('#vol_fermenter').val((batch / 1.04) + parseFloat($('#top_up_water').jqxNumberInput('decimal')) - parseFloat($('#trub_chiller_loss').jqxNumberInput('decimal')));
59 } 60 }
60 61
61 // tooltips 62 // tooltips
62 $('#name').jqxTooltip({ content: 'The unique name of this brew equipment.' }); 63 $('#name').jqxTooltip({ content: 'The unique name of this brew equipment.' });
63 $('#notes').jqxTooltip({ content: 'Some notes about the equipment.' }); 64 $('#notes').jqxTooltip({ content: 'Some notes about the equipment.' });
78 $('#boil_time').jqxTooltip({ content: 'Normal boil time in minutes.' }); 79 $('#boil_time').jqxTooltip({ content: 'Normal boil time in minutes.' });
79 $('#top_up_kettle').jqxTooltip({ content: 'Extra water added to the boil.' }); 80 $('#top_up_kettle').jqxTooltip({ content: 'Extra water added to the boil.' });
80 $('#hop_utilization').jqxTooltip({ content: '100% for smaller installations, higher for large breweries.' }); 81 $('#hop_utilization').jqxTooltip({ content: '100% for smaller installations, higher for large breweries.' });
81 $('#batch_size').jqxTooltip({ content: 'Calculated batch size, liters at end of the boil.' }); 82 $('#batch_size').jqxTooltip({ content: 'Calculated batch size, liters at end of the boil.' });
82 $('#trub_chiller_loss').jqxTooltip({ content: 'Standard loss in liters during transfer to the fermenter.' }); 83 $('#trub_chiller_loss').jqxTooltip({ content: 'Standard loss in liters during transfer to the fermenter.' });
84 $('#top_up_water').jqxTooltip({ content: 'Extra water added into the fermenter.' });
83 85
84 var dataRecord = {}, 86 var dataRecord = {},
85 url = 'includes/db_inventory_equipments.php', 87 url = 'includes/db_inventory_equipments.php',
86 // prepare the data 88 // prepare the data
87 source = { 89 source = {
212 $('#kettle_volume').jqxNumberInput(Spin1dec); 214 $('#kettle_volume').jqxNumberInput(Spin1dec);
213 $('#kettle_height').jqxNumberInput(Spin1dec); 215 $('#kettle_height').jqxNumberInput(Spin1dec);
214 $('#mash_volume').jqxNumberInput(Spin1dec); 216 $('#mash_volume').jqxNumberInput(Spin1dec);
215 $('#mash_max').jqxNumberInput(Spin1dec); 217 $('#mash_max').jqxNumberInput(Spin1dec);
216 $('#efficiency').jqxNumberInput(Perc1dec); 218 $('#efficiency').jqxNumberInput(Perc1dec);
219 $('#vol_fermenter').jqxNumberInput(Show2dec);
217 220
218 // initialize jqxGrid 221 // initialize jqxGrid
219 $('#jqxgrid').jqxGrid({ 222 $('#jqxgrid').jqxGrid({
220 width: 1280, 223 width: 1280,
221 height: 630, 224 height: 630,
238 editrow = -1; 241 editrow = -1;
239 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); 242 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
240 $('#name').val('Nieuwe brouwset'); 243 $('#name').val('Nieuwe brouwset');
241 $('#boil_size').val(18); 244 $('#boil_size').val(18);
242 $('#batch_size').val(15.3); 245 $('#batch_size').val(15.3);
246 $('#vol_fermenter').val(14.2);
243 $('#tun_volume').val(20); 247 $('#tun_volume').val(20);
244 $('#tun_weight').val(2); 248 $('#tun_weight').val(2);
245 $('#tun_specific_heat').val(0.11); 249 $('#tun_specific_heat').val(0.11);
246 $('#tun_material').val(0); 250 $('#tun_material').val(0);
247 $('#tun_height').val(20); 251 $('#tun_height').val(20);
272 $('#boil_size').on('change', function(event) { calcBatchVolume(); }); 276 $('#boil_size').on('change', function(event) { calcBatchVolume(); });
273 $('#evap_rate').on('change', function(event) { calcBatchVolume(); }); 277 $('#evap_rate').on('change', function(event) { calcBatchVolume(); });
274 $('#boil_time').on('change', function(event) { calcBatchVolume(); }); 278 $('#boil_time').on('change', function(event) { calcBatchVolume(); });
275 $('#top_up_kettle').on('change', function(event) { calcBatchVolume(); }); 279 $('#top_up_kettle').on('change', function(event) { calcBatchVolume(); });
276 $('#calc_boil_volume').on('change', function(event) { calcBatchVolume(); }); 280 $('#calc_boil_volume').on('change', function(event) { calcBatchVolume(); });
281 $('#top_up_water').on('change', function(event) { calcBatchVolume(); });
282 $('#trub_chiller_loss').on('change', function(event) { calcBatchVolume(); });
277 $('#tun_material').on('select', function(event) { 283 $('#tun_material').on('select', function(event) {
278 dataRecord.tun_specific_heat = MaterialData[event.args.index].sh; 284 dataRecord.tun_specific_heat = MaterialData[event.args.index].sh;
279 $('#tun_specific_heat').val(dataRecord.tun_specific_heat); 285 $('#tun_specific_heat').val(dataRecord.tun_specific_heat);
280 }); 286 });
281 }, 287 },

mercurial