www/js/global.js

changeset 241
e95d2886f49f
parent 232
daf2d9d6fa18
child 245
3649c3d31d15
equal deleted inserted replaced
240:a85c1d4c4d12 241:e95d2886f49f
425 inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true 425 inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true
426 }; 426 };
427 var Dateopts = { 427 var Dateopts = {
428 theme: theme, width: 150, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true, 428 theme: theme, width: 150, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true,
429 formatString: 'yyyy-MM-dd', enableBrowserBoundsDetection: true 429 formatString: 'yyyy-MM-dd', enableBrowserBoundsDetection: true
430 };
431 var DateTimeopts = {
432 theme: theme, width: 230, height: 23, allowNullDate: true, todayString: 'Vandaag', clearString: 'Wissen', showFooter: true,
433 formatString: 'yyyy-MM-dd HH:mm:ss', enableBrowserBoundsDetection: true, showTimeButton: true
430 }; 434 };
431 435
432 436
433 var sugardensity = 1.611; //kg/l in solution 437 var sugardensity = 1.611; //kg/l in solution
434 438
1008 1012
1009 function estimate_fg(percSugar, percCara, WGratio, TotTme, Temp, attenuation, og) { 1013 function estimate_fg(percSugar, percCara, WGratio, TotTme, Temp, attenuation, og) {
1010 1014
1011 var BD; 1015 var BD;
1012 1016
1013 console.log("estimate_fg("+percSugar+","+percCara+","+WGratio+","+TotTme+","+Temp+","+attenuation+","+og+")");
1014
1015 if (percSugar > 40) 1017 if (percSugar > 40)
1016 percSugar = 0; 1018 percSugar = 0;
1017 if (percCara > 50) 1019 if (percCara > 50)
1018 percCara = 0; 1020 percCara = 0;
1019 if ((WGratio > 0) && (TotTme > 0)) { 1021 if ((WGratio > 0) && (TotTme > 0)) {
1028 if (attenuation < 30) 1030 if (attenuation < 30)
1029 attenuation = 77; 1031 attenuation = 77;
1030 1032
1031 var AttBeer = 0.00825 * attenuation + 0.00817 * BD - 0.00684 * Temp + 0.00026 * TotTme - 0.00356 * percCara + 0.00553 * percSugar + 0.547; 1033 var AttBeer = 0.00825 * attenuation + 0.00817 * BD - 0.00684 * Temp + 0.00026 * TotTme - 0.00356 * percCara + 0.00553 * percSugar + 0.547;
1032 var fg = Math.round((1 + (1 - AttBeer) * (og - 1)) * 1000) / 1000; 1034 var fg = Math.round((1 + (1 - AttBeer) * (og - 1)) * 1000) / 1000;
1033 console.log("fg:"+fg); 1035
1036 console.log("estimate_fg("+percSugar+","+percCara+","+WGratio+","+TotTme+","+Temp+","+attenuation+","+og+") :"+fg);
1034 return fg; 1037 return fg;
1035 } 1038 }
1036 1039
1037 1040
1038 function CalcFrac(TpH, pK1, pK2, pK3) { 1041 function CalcFrac(TpH, pK1, pK2, pK3) {

mercurial