Base: Handle Unit::Stress tha same way as Unit::Pressure in UnitsSchema

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
Przemo Firszt 2015-05-18 16:43:45 +01:00
parent 4729cafdcc
commit b7e7f1f40a
2 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ QString UnitsSchemaInternal::schemaTranslate(Base::Quantity quant,double &factor
// default action for all cases without special treatment:
unitString = quant.getUnit().getString();
factor = 1.0;
}else if (unit == Unit::Pressure){
}else if ((unit == Unit::Pressure) || (unit == Unit::Stress)){
if(UnitValue < 10.0){// Pa is the smallest
unitString = QString::fromLatin1("Pa");
factor = 0.001;

View File

@ -91,7 +91,7 @@ QString UnitsSchemaMKS::schemaTranslate(Base::Quantity quant,double &factor,QStr
unitString = QString::fromLatin1("km^3");
factor = 1000000000000000000.0;
}
}else if (unit == Unit::Pressure){
}else if ((unit == Unit::Pressure) || (unit == Unit::Stress)){
if(UnitValue < 10.0){// Pa is the smallest
unitString = QString::fromLatin1("Pa");
factor = 0.001;