Tue, 25 Feb 2020 13:08:53 +0100
Testing, bottle carbonation pressure display without residential pressure
www/js/prod_edit.js | file | annotate | diff | comparison | revisions |
--- a/www/js/prod_edit.js Tue Feb 11 21:16:49 2020 +0100 +++ b/www/js/prod_edit.js Tue Feb 25 13:08:53 2020 +0100 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2018-2019 + * Copyright (C) 2018-2020 * * Michiel Broek <mbroek at mbse dot eu> * @@ -3337,15 +3337,16 @@ function GetPressure(CO2, T1, T2) { var P, V = CO2 - ResCO2(CO2, T1); + V = CO2; // TODO: temp only total pressure, testing if (V < 0) return 0; P = -1.09145427669121 + 0.00800006989646477 * T2 + 0.000260276315484684 * T2 * T2 + 0.0215142075945119 * T2 * V + 0.674996600795854 * V + -0.00471757220150754 * V * V; - //console.log("CO2: "+CO2+" "+V+" Temp: "+T1+" "+T2+" Pressure: "+P); if (P < 0) P = 0; - P = P * 1.01325; // atm to bar - return Round(P, 1); + P = Round(P * 1.01325, 2); // atm to bar + console.log("GetPressure(" + CO2 + ", " + T1 + ", " + T2 + ") V:" + V + " Bar: " + P); + return P; } function CarbCO2ToPressure(CO2, T) {