Added a couple of missing units in MKS schema
This commit is contained in:
parent
f5f6cb1adf
commit
62e9b60816
|
@ -65,15 +65,32 @@ QString UnitsSchemaMKS::schemaTranslate(Base::Quantity quant,double &factor,QStr
|
|||
factor = 1.0;
|
||||
}
|
||||
}else if (unit == Unit::Area){
|
||||
// TODO Cascade for the Areas
|
||||
// default action for all cases without special treatment:
|
||||
unitString = quant.getUnit().getString();
|
||||
factor = 1.0;
|
||||
if(UnitValue < 100.0){// smaller than 1 square cm
|
||||
unitString = QString::fromLatin1("mm^2");
|
||||
factor = 1.0;
|
||||
}else if(UnitValue < 10000000000000.0 ){
|
||||
unitString = QString::fromLatin1("m^2");
|
||||
factor = 1000000.0;
|
||||
}else{ // bigger then 1 square kilometer
|
||||
unitString = QString::fromLatin1("km^2");
|
||||
factor = 1000000000000.0;
|
||||
}
|
||||
}else if (unit == Unit::Mass){
|
||||
// TODO Cascade for the wights
|
||||
// default action for all cases without special treatment:
|
||||
unitString = quant.getUnit().getString();
|
||||
factor = 1.0;
|
||||
}else if (unit == Unit::Volume){
|
||||
if(UnitValue < 1000000.0){// smaller than 10 cubic cm
|
||||
unitString = QString::fromLatin1("mm^3");
|
||||
factor = 1.0;
|
||||
}else if(UnitValue < 1000000000000000000.0 ){
|
||||
unitString = QString::fromLatin1("m^3");
|
||||
factor = 1000000000.0;
|
||||
}else{ // bigger then 1 cubic kilometer
|
||||
unitString = QString::fromLatin1("km^3");
|
||||
factor = 1000000000000000000.0;
|
||||
}
|
||||
}else if (unit == Unit::Pressure){
|
||||
if(UnitValue < 10.0){// Pa is the smallest
|
||||
unitString = QString::fromLatin1("Pa");
|
||||
|
|
Loading…
Reference in New Issue
Block a user