diff --git a/src/Base/Quantity.cpp b/src/Base/Quantity.cpp index 23a99443e0..d98e23afda 100644 --- a/src/Base/Quantity.cpp +++ b/src/Base/Quantity.cpp @@ -272,17 +272,17 @@ Quantity Quantity::KiloNewton (1e+6 ,Unit(1,1,-2)); Quantity Quantity::MegaNewton (1e+9 ,Unit(1,1,-2)); Quantity Quantity::MilliNewton (1.0 ,Unit(1,1,-2)); -Quantity Quantity::Pascal (0.001 ,Unit(-1,1,-2)); // Pascal (kg/m*s^2 or N/m^2) +Quantity Quantity::Pascal (0.001 ,Unit(-1,1,-2)); // Pascal (kg/m/s^2 or N/m^2) Quantity Quantity::KiloPascal (1.00 ,Unit(-1,1,-2)); Quantity Quantity::MegaPascal (1000.0 ,Unit(-1,1,-2)); Quantity Quantity::GigaPascal (1e+6 ,Unit(-1,1,-2)); -Quantity Quantity::Torr (101.325/760.0 ,Unit(-1,1,-2)); // Torr is a defined fraction of Pascal (kg/m*s^2 or N/m^2) -Quantity Quantity::mTorr (0.101325/760.0,Unit(-1,1,-2)); // Torr is a defined fraction of Pascal (kg/m*s^2 or N/m^2) -Quantity Quantity::yTorr (0.000101325/760.0 ,Unit(-1,1,-2)); // Torr is a defined fraction of Pascal (kg/m*s^2 or N/m^2) +Quantity Quantity::Torr (101.325/760.0 ,Unit(-1,1,-2)); // Torr is a defined fraction of Pascal (kg/m/s^2 or N/m^2) +Quantity Quantity::mTorr (0.101325/760.0,Unit(-1,1,-2)); // Torr is a defined fraction of Pascal (kg/m/s^2 or N/m^2) +Quantity Quantity::yTorr (0.000101325/760.0 ,Unit(-1,1,-2)); // Torr is a defined fraction of Pascal (kg/m/s^2 or N/m^2) -Quantity Quantity::PSI (0.145038 ,Unit(-1,1,-2)); // pounds/in^2 -Quantity Quantity::KSI (145.038 ,Unit(-1,1,-2)); // 1000 x pounds/in^2 +Quantity Quantity::PSI (6.894744825494,Unit(-1,1,-2)); // pounds/in^2 +Quantity Quantity::KSI (6894.744825494,Unit(-1,1,-2)); // 1000 x pounds/in^2 Quantity Quantity::Watt (1e+6 ,Unit(2,1,-3)); // Watt (kg*m^2/s^3) Quantity Quantity::VoltAmpere (1e+6 ,Unit(2,1,-3)); // VoltAmpere (kg*m^2/s^3) diff --git a/src/Base/QuantityPyImp.cpp b/src/Base/QuantityPyImp.cpp index fb53ee7dcf..1dfd312aec 100644 --- a/src/Base/QuantityPyImp.cpp +++ b/src/Base/QuantityPyImp.cpp @@ -182,9 +182,9 @@ PyObject* QuantityPy::getValueAs(PyObject *args) PyErr_Clear(); char* string; if (PyArg_ParseTuple(args,"et", "utf-8", &string)) { - QString qstr = QString::fromUtf8(string); - PyMem_Free(string); - quant = Quantity::parse(qstr); + QString qstr = QString::fromUtf8(string); + PyMem_Free(string); + quant = Quantity::parse(qstr); } } diff --git a/src/Base/UnitsSchemaImperial1.cpp b/src/Base/UnitsSchemaImperial1.cpp index a8f5ad60bd..9a8df779c1 100644 --- a/src/Base/UnitsSchemaImperial1.cpp +++ b/src/Base/UnitsSchemaImperial1.cpp @@ -114,17 +114,17 @@ QString UnitsSchemaImperial1::schemaTranslate(const Quantity &quant, double &fac factor = 0.45359237; } else if (unit == Unit::Pressure) { - if (UnitValue < 145.038) {// psi is the smallest + if (UnitValue < 6894.744) {// psi is the smallest unitString = QString::fromLatin1("psi"); - factor = 0.145038; + factor = 6.894744825494; } - else if (UnitValue < 145038) { + else if (UnitValue < 6894744.825) { unitString = QString::fromLatin1("ksi"); - factor = 145.038; + factor = 6894.744825494; } else { // bigger then 1000 ksi -> psi + scientific notation unitString = QString::fromLatin1("psi"); - factor = 0.145038; + factor = 6.894744825494; } } else if (unit == Unit::Velocity) { @@ -180,16 +180,13 @@ QString UnitsSchemaImperialDecimal::schemaTranslate(const Base::Quantity& quant, factor = 0.45359237; } else if (unit == Unit::Pressure) { - if (UnitValue < 145.038) {// psi is the smallest + if (UnitValue < 6894.744) {// psi is the smallest unitString = QString::fromLatin1("psi"); - factor = 0.145038; - //}else if(UnitValue < 145038){ - // unitString = QString::fromLatin1("ksi"); - // factor = 145.038; + factor = 6.894744825494; } else { // bigger then 1000 ksi -> psi + scientific notation unitString = QString::fromLatin1("psi"); - factor = 0.145038; + factor = 6.894744825494; } } else if (unit == Unit::Velocity) {