Imperial Sketcher grid in Dialog

This commit is contained in:
jriegel
2013-12-16 15:09:43 +01:00
parent 9de649a248
commit a3136d8abe
5 changed files with 50 additions and 89 deletions

View File

@@ -60,6 +60,7 @@ using namespace Base;
double UnitsApi::defaultFactor = 1.0;
UnitsSchema *UnitsApi::UserPrefSystem = new UnitsSchemaInternal();
UnitSystem UnitsApi::actSystem = SI1;
//double UnitsApi::UserPrefFactor [50];
//QString UnitsApi::UserPrefUnit [50];
@@ -88,6 +89,7 @@ void UnitsApi::setSchema(UnitSystem s)
case SI2 : UserPrefSystem = new UnitsSchemaMKS(); break;
case Imperial1: UserPrefSystem = new UnitsSchemaImperial1(); break;
}
actSystem = s;
UserPrefSystem->setSchemaUnits(); // if necesarry a unit schema can change the constants in Quantity (e.g. mi=1.8km rather then 1.6km).
}

View File

@@ -61,6 +61,8 @@ public:
* for representative strings.
*/
static void setSchema(UnitSystem s);
/// return the active schema
static UnitSystem getSchema(void){return actSystem;}
static QString schemaTranslate(Base::Quantity quant,double &factor,QString &unitString);
static QString schemaTranslate(Base::Quantity quant){ // to satisfy GCC
@@ -92,7 +94,7 @@ public:
protected:
// not used at the moment
static UnitsSchema * UserPrefSystem;
static UnitSystem actSystem;
/// number of decimals for floats
static int UserPrefDecimals;