www/js/prod_edit.js

changeset 561
dc618b8a9552
parent 560
850e82c1021d
child 564
d5fad7d80899
equal deleted inserted replaced
560:850e82c1021d 561:dc618b8a9552
4059 $('#primary_end_brix').on('change', function(event) { 4059 $('#primary_end_brix').on('change', function(event) {
4060 var OBrix, FBrix, FG; 4060 var OBrix, FBrix, FG;
4061 if (dataRecord.brew_fermenter_sg >= 1.020) { 4061 if (dataRecord.brew_fermenter_sg >= 1.020) {
4062 OBrix = sg_to_brix(dataRecord.brew_fermenter_sg); 4062 OBrix = sg_to_brix(dataRecord.brew_fermenter_sg);
4063 FBrix = parseFloat(event.args.value); 4063 FBrix = parseFloat(event.args.value);
4064 // Brouwhulp, werkt zonder brix_correctie, waarom? 4064 FG = brix_to_fg(OBrix, FBrix);
4065 FG = Round(1.0031 - 0.002318474 * OBrix - 0.000007775 * (OBrix * OBrix) - 0.000000034 * Math.pow(OBrix, 3) +
4066 0.00574 * (FBrix) + 0.00003344 * (FBrix * FBrix) + 0.000000086 * Math.pow(FBrix, 3), 4);
4067 // from http://seanterrill.com FGoc = old cubix, FGnc = new cubic, FGnl = new linear
4068 var FGoc = Round(1.001843 - 0.002318474 * (OBrix / my_brix_correction) - 0.000007775 * Math.pow(OBrix / my_brix_correction, 2) -
4069 0.000000034 * Math.pow(OBrix / my_brix_correction, 3) +
4070 0.00574 * (FBrix / my_brix_correction) + 0.00003344 * Math.pow(FBrix / my_brix_correction, 2) +
4071 0.000000086 * Math.pow(FBrix / my_brix_correction, 3), 4);
4072 var FGnc = Round(1 - 0.0044993 * (OBrix / my_brix_correction) + 0.0117741 * (FBrix / my_brix_correction) +
4073 0.000275806 * Math.pow(OBrix / my_brix_correction, 2) - 0.00127169 * Math.pow(FBrix / my_brix_correction, 2) -
4074 0.00000727999 * Math.pow(OBrix / my_brix_correction, 3) + 0.0000632929 * Math.pow(FBrix / my_brix_correction, 3), 4);
4075 var FGnl = Round(1 - 0.000856829 * (OBrix / my_brix_correction) + 0.00349412 * (FBrix / my_brix_correction), 4);
4076 console.log("OBrix:" + OBrix + " FBrix:" + FBrix + " FG:" + FG + ' FGoc:' + FGoc + ' FGnc:' + FGnc + ' FGnl:' + FGnl);
4077 if (FBrix > 0.05) { 4065 if (FBrix > 0.05) {
4078 $('#primary_end_sg').val(FGnc); 4066 $('#primary_end_sg').val(FG);
4079 dataRecord.primary_end_sg = FGnc; 4067 dataRecord.primary_end_sg = FG;
4080 } 4068 }
4081 calcFermentation(); 4069 calcFermentation();
4082 } 4070 }
4083 }); 4071 });
4084 $('#secondary_end_sg').on('change', function(event) { 4072 $('#secondary_end_sg').on('change', function(event) {
4088 $('#secondary_end_brix').on('change', function(event) { 4076 $('#secondary_end_brix').on('change', function(event) {
4089 var OBrix, FBrix, FG; 4077 var OBrix, FBrix, FG;
4090 if (dataRecord.brew_fermenter_sg >= 1.020) { 4078 if (dataRecord.brew_fermenter_sg >= 1.020) {
4091 OBrix = sg_to_brix(dataRecord.brew_fermenter_sg); 4079 OBrix = sg_to_brix(dataRecord.brew_fermenter_sg);
4092 FBrix = parseFloat(event.args.value); 4080 FBrix = parseFloat(event.args.value);
4093 FG = Round(1.0031 - 0.002318474 * OBrix - 0.000007775 * (OBrix * OBrix) - 0.000000034 * Math.pow(OBrix, 3) + 4081 FG = brix_to_fg(OBrix, FBrix);
4094 0.00574 * (FBrix) + 0.00003344 * (FBrix * FBrix) + 0.000000086 * Math.pow(FBrix, 3), 4);
4095 var FGoc = Round(1.001843 - 0.002318474 * (OBrix / my_brix_correction) - 0.000007775 * Math.pow(OBrix / my_brix_correction, 2) -
4096 0.000000034 * Math.pow(OBrix / my_brix_correction, 3) +
4097 0.00574 * (FBrix / my_brix_correction) + 0.00003344 * Math.pow(FBrix / my_brix_correction, 2) +
4098 0.000000086 * Math.pow(FBrix / my_brix_correction, 3), 4);
4099 var FGnc = Round(1 - 0.0044993 * (OBrix / my_brix_correction) + 0.0117741 * (FBrix / my_brix_correction) +
4100 0.000275806 * Math.pow(OBrix / my_brix_correction, 2) - 0.00127169 * Math.pow(FBrix / my_brix_correction, 2) -
4101 0.00000727999 * Math.pow(OBrix / my_brix_correction, 3) + 0.0000632929 * Math.pow(FBrix / my_brix_correction, 3), 4);
4102 var FGnl = Round(1 - 0.000856829 * (OBrix / my_brix_correction) + 0.00349412 * (FBrix / my_brix_correction), 4);
4103 console.log("OBrix:" + OBrix + " FBrix:" + FBrix + " FG:" + FG + ' FGoc:' + FGoc + ' FGnc:' + FGnc + ' FGnl:' + FGnl);
4104 if (FBrix > 0.05) { 4082 if (FBrix > 0.05) {
4105 $('#secondary_end_sg').val(FGnc); 4083 $('#secondary_end_sg').val(FG);
4106 dataRecord.secondary_end_sg = FGnc; 4084 dataRecord.secondary_end_sg = FG;
4107 } 4085 }
4108 calcFermentation(); 4086 calcFermentation();
4109 } 4087 }
4110 }); 4088 });
4111 $('#final_brix').on('change', function(event) { 4089 $('#final_brix').on('change', function(event) {
4112 var OBrix, FBrix, FG; 4090 var OBrix, FBrix, FG;
4113 if (dataRecord.brew_fermenter_sg >= 1.020) { 4091 if (dataRecord.brew_fermenter_sg >= 1.020) {
4114 OBrix = sg_to_brix(dataRecord.brew_fermenter_sg); 4092 OBrix = sg_to_brix(dataRecord.brew_fermenter_sg);
4115 FBrix = parseFloat(event.args.value); 4093 FBrix = parseFloat(event.args.value);
4116 FG = Round(1.0031 - 0.002318474 * OBrix - 0.000007775 * (OBrix * OBrix) - 0.000000034 * Math.pow(OBrix, 3) + 4094 FG = brix_to_fg(OBrix, FBrix);
4117 0.00574 * (FBrix) + 0.00003344 * (FBrix * FBrix) + 0.000000086 * Math.pow(FBrix, 3), 4);
4118 // from http://seanterrill.com FGoc = old cubix, FGnc = new cubic, FGnl = new linear
4119 var FGoc = Round(1.001843 - 0.002318474 * (OBrix / my_brix_correction) - 0.000007775 * Math.pow(OBrix / my_brix_correction, 2) -
4120 0.000000034 * Math.pow(OBrix / my_brix_correction, 3) +
4121 0.00574 * (FBrix / my_brix_correction) + 0.00003344 * Math.pow(FBrix / my_brix_correction, 2) +
4122 0.000000086 * Math.pow(FBrix / my_brix_correction, 3), 4);
4123 var FGnc = Round(1 - 0.0044993 * (OBrix / my_brix_correction) + 0.0117741 * (FBrix / my_brix_correction) +
4124 0.000275806 * Math.pow(OBrix / my_brix_correction, 2) - 0.00127169 * Math.pow(FBrix / my_brix_correction, 2) -
4125 0.00000727999 * Math.pow(OBrix / my_brix_correction, 3) + 0.0000632929 * Math.pow(FBrix / my_brix_correction, 3), 4);
4126 var FGnl = Round(1 - 0.000856829 * (OBrix / my_brix_correction) + 0.00349412 * (FBrix / my_brix_correction), 4);
4127 console.log("OBrix:" + OBrix + " FBrix:" + FBrix + " FG:" + FG + ' FGoc:' + FGoc + ' FGnc:' + FGnc + ' FGnl:' + FGnl);
4128 if (FBrix > 0.05) { 4095 if (FBrix > 0.05) {
4129 $('#fg').val(FGnc); 4096 $('#fg').val(FG);
4130 dataRecord.fg = FGnc; 4097 dataRecord.fg = FG;
4131 } 4098 }
4132 calcFermentation(); 4099 calcFermentation();
4133 } 4100 }
4134 }); 4101 });
4135 $('#fg').on('change', function(event) { 4102 $('#fg').on('change', function(event) {
5355 yeastData.y_flocculation = datarecord.flocculation; 5322 yeastData.y_flocculation = datarecord.flocculation;
5356 yeastData.y_attenuation = datarecord.attenuation; 5323 yeastData.y_attenuation = datarecord.attenuation;
5357 yeastData.y_cells = datarecord.cells; 5324 yeastData.y_cells = datarecord.cells;
5358 yeastData.y_inventory = datarecord.inventory; 5325 yeastData.y_inventory = datarecord.inventory;
5359 yeastData.y_sta1 = datarecord.sta1; 5326 yeastData.y_sta1 = datarecord.sta1;
5360 yeastData,y_bacteria = datarecord.bacteria; 5327 yeastData.y_bacteria = datarecord.bacteria;
5361 yeastData.y_harvest_top = datarecord.harvest_top; 5328 yeastData.y_harvest_top = datarecord.harvest_top;
5362 yeastData.y_harvest_time = datarecord.harvest_time; 5329 yeastData.y_harvest_time = datarecord.harvest_time;
5363 yeastData.y_pitch_temperature = datarecord.pitch_temperature; 5330 yeastData.y_pitch_temperature = datarecord.pitch_temperature;
5364 yeastData.y_pofpos = datarecord.pofpos; 5331 yeastData.y_pofpos = datarecord.pofpos;
5365 yeastData.y_zymocide = datarecord.zymocide; 5332 yeastData.y_zymocide = datarecord.zymocide;

mercurial