1584 { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', |
1584 { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', |
1585 cellsrenderer: function() { |
1585 cellsrenderer: function() { |
1586 return 'Wijzig'; |
1586 return 'Wijzig'; |
1587 }, buttonclick: function(row) { |
1587 }, buttonclick: function(row) { |
1588 if (dataRecord.stage > 3) { |
1588 if (dataRecord.stage > 3) { |
1589 alert('Het maichen is al gedaan.'); |
1589 alert('Het maischen is al gedaan.'); |
1590 } else { |
1590 } else { |
1591 mashRow = row; |
1591 mashRow = row; |
1592 mashData = $('#mashGrid').jqxGrid('getrowdata', mashRow); |
1592 mashData = $('#mashGrid').jqxGrid('getrowdata', mashRow); |
1593 $('#wstep_name').val(mashData.step_name); |
1593 $('#wstep_name').val(mashData.step_name); |
1594 $('#wstep_type').val(mashData.step_type); |
1594 $('#wstep_type').val(mashData.step_type); |
1616 /* |
1616 /* |
1617 * Remove the top menu so that we MUST use the buttons to leave the editor. |
1617 * Remove the top menu so that we MUST use the buttons to leave the editor. |
1618 */ |
1618 */ |
1619 $('#jqxMenu').jqxMenu('destroy'); |
1619 $('#jqxMenu').jqxMenu('destroy'); |
1620 console.log('record:' + my_record + ' return:' + my_return + ' theme:' + theme); |
1620 console.log('record:' + my_record + ' return:' + my_return + ' theme:' + theme); |
1621 $('#jqxLoader').jqxLoader({ |
1621 $('#jqxLoader').jqxLoader({ width: 250, height: 150, isModal: true, text: 'Laden product ...', theme: theme }); |
1622 width: 250, |
|
1623 height: 150, |
|
1624 isModal: true, |
|
1625 text: 'Laden product ...', |
|
1626 theme: theme |
|
1627 }); |
|
1628 |
1622 |
1629 /* |
1623 /* |
1630 * Generic functions |
1624 * Generic functions |
1631 */ |
1625 */ |
1632 function calcSupplies() { |
1626 function calcSupplies() { |
2065 if ((((dataRecord.inventory_reduced <= 2) && (row.h_useat <= 4)) || // Mash, FW, Boil, Aroma, Whirlpool |
2059 if ((((dataRecord.inventory_reduced <= 2) && (row.h_useat <= 4)) || // Mash, FW, Boil, Aroma, Whirlpool |
2066 ((dataRecord.inventory_reduced <= 6) && (row.h_useat == 5))) && // Dry-hop |
2060 ((dataRecord.inventory_reduced <= 6) && (row.h_useat == 5))) && // Dry-hop |
2067 (row.h_inventory < row.h_amount)) |
2061 (row.h_inventory < row.h_amount)) |
2068 ok_hops = 0; |
2062 ok_hops = 0; |
2069 } |
2063 } |
2070 total_ibus = Math.round(total_ibus * 10) / 10; |
2064 total_ibus = Round(total_ibus, 1); |
2071 ferm_ibus = Math.round(ferm_ibus * 10) / 10; |
2065 ferm_ibus = Round(ferm_ibus, 1); |
2072 hop_flavour = Math.round(hop_flavour * 1000 / 5) / 10; |
2066 hop_flavour = Round(hop_flavour * 100 / 5, 1); |
2073 hop_aroma = Math.round(hop_aroma * 1000 / 6) / 10; |
2067 hop_aroma = Round(hop_aroma * 100 / 6, 1); |
2074 if (hop_flavour > 100) |
2068 if (hop_flavour > 100) |
2075 hop_flavour = 100; |
2069 hop_flavour = 100; |
2076 if (hop_aroma > 100) |
2070 if (hop_aroma > 100) |
2077 hop_aroma = 100; |
2071 hop_aroma = 100; |
2078 console.log('calcIBUs(): ' + total_ibus + ' flavour: ' + hop_flavour + ' aroma: ' + hop_aroma + |
2072 console.log('calcIBUs(): ' + total_ibus + ' flavour: ' + hop_flavour + ' aroma: ' + hop_aroma + |
3412 $('#bottle_pressure').val(GetPressure(dataRecord.bottle_carbonation, TSec, dataRecord.bottle_carbonation_temp)); |
3406 $('#bottle_pressure').val(GetPressure(dataRecord.bottle_carbonation, TSec, dataRecord.bottle_carbonation_temp)); |
3413 |
3407 |
3414 // Kegs |
3408 // Kegs |
3415 Pressure = CarbCO2ToPressure(dataRecord.keg_carbonation, dataRecord.keg_carbonation_temp); |
3409 Pressure = CarbCO2ToPressure(dataRecord.keg_carbonation, dataRecord.keg_carbonation_temp); |
3416 if (Pressure < 0) |
3410 if (Pressure < 0) |
3417 Pressure = 0; |
3411 Pressure = 0; |
3418 dataRecord.keg_pressure = Pressure; |
3412 dataRecord.keg_pressure = Pressure; |
3419 $('#keg_pressure').val(Round(Pressure, 1)); |
3413 $('#keg_pressure').val(Round(Pressure, 1)); |
3420 |
3414 |
3421 dataRecord.keg_priming_amount = 0; |
3415 dataRecord.keg_priming_amount = 0; |
3422 dataRecord.keg_priming_total = 0; |
3416 dataRecord.keg_priming_total = 0; |
3423 if (!dataRecord.keg_forced_carb) { |
3417 if (!dataRecord.keg_forced_carb) { |
3424 for (i = 0; i < rows.length; i++) { |
3418 for (i = 0; i < rows.length; i++) { |
3425 row = rows[i]; |
3419 row = rows[i]; |
3426 if (row.f_added == 5) { |
3420 if (row.f_added == 5) { |
3427 SFactor = 1 / ((row.f_yield / 100) * (1 - row.f_moisture / 100)); |
3421 SFactor = 1 / ((row.f_yield / 100) * (1 - row.f_moisture / 100)); |
3428 dataRecord.keg_priming_amount = CarbCO2toS(dataRecord.keg_carbonation, TSec, SFactor); |
3422 dataRecord.keg_priming_amount = CarbCO2toS(dataRecord.keg_carbonation, TSec, SFactor); |
3429 dataRecord.keg_priming_total = Round(dataRecord.keg_amount * dataRecord.keg_priming_amount, 2); |
3423 dataRecord.keg_priming_total = Round(dataRecord.keg_amount * dataRecord.keg_priming_amount, 2); |
3430 $('#fermentableGrid').jqxGrid('setcellvalue', i, 'f_amount', dataRecord.keg_priming_total / 1000); |
3424 $('#fermentableGrid').jqxGrid('setcellvalue', i, 'f_amount', dataRecord.keg_priming_total / 1000); |
3431 } |
3425 } |
3432 } |
3426 } |
3433 $('#keg_priming_amount').val(Round(dataRecord.keg_priming_amount, 1)); |
3427 $('#keg_priming_amount').val(Round(dataRecord.keg_priming_amount, 1)); |
3434 $('#keg_priming_total').val(dataRecord.keg_priming_total); |
3428 $('#keg_priming_total').val(dataRecord.keg_priming_total); |
3435 pabv = ABV + dataRecord.keg_priming_amount * 0.47 / 7.907; |
3429 pabv = ABV + dataRecord.keg_priming_amount * 0.47 / 7.907; |
3436 pvol = dataRecord.keg_amount - (pabv * dataRecord.keg_amount) / 100; |
3430 pvol = dataRecord.keg_amount - (pabv * dataRecord.keg_amount) / 100; |
3437 talc = dataRecord.keg_amount - pvol; |
3431 talc = dataRecord.keg_amount - pvol; |
3438 tvol = pvol + dataRecord.keg_priming_water; |
3432 tvol = pvol + dataRecord.keg_priming_water; |
3439 kabv = Round(talc / (tvol + talc) * 100, 2); |
3433 kabv = Round(talc / (tvol + talc) * 100, 2); |
3440 //console.log("kegs pabv:"+pabv+" pvol:"+pvol+" wvol:"+dataRecord.keg_priming_water+" tvol:"+tvol+" talc:"+talc+" abv:"+kabv); |
3434 //console.log("kegs pabv:"+pabv+" pvol:"+pvol+" wvol:"+dataRecord.keg_priming_water+" tvol:"+tvol+" talc:"+talc+" abv:"+kabv); |
3441 $('#keg_abv').val(kabv); |
3435 $('#keg_abv').val(kabv); |
3442 } else { |
3436 } else { |
3443 $('#keg_priming_amount').val(0); |
3437 $('#keg_priming_amount').val(0); |
3444 $('#keg_priming_total').val(0); |
3438 $('#keg_priming_total').val(0); |
3445 $('#keg_abv').val(ABV); |
3439 $('#keg_abv').val(ABV); |
3446 } |
3440 } |
3447 } |
3441 } |
3448 |
3442 |
3449 function calcStage() { |
3443 function calcStage() { |
3450 |
3444 |