# HG changeset patch # User Michiel Broek # Date 1582632533 -3600 # Node ID e9b10856981832bd133a49eec337ad56d22ff029 # Parent 0a8495edf53c4acb0f8448eebe6ec86dc06bf2b1 Testing, bottle carbonation pressure display without residential pressure diff -r 0a8495edf53c -r e9b108569818 www/js/prod_edit.js --- 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 * @@ -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) {