#include <UnitsApi.h>
Static Public Member Functions | |
static UnitsSchemaPtr | createSchema (UnitSystem s) |
return an instance of the given enum value More... | |
static int | getDecimals () |
static const char * | getDescription (UnitSystem) |
Returns a brief description of a schema. More... | |
static UnitSystem | getSchema () |
return the active schema More... | |
static QString | schemaTranslate (const Base::Quantity &quant) |
static QString | schemaTranslate (const Base::Quantity &quant, double &factor, QString &unitString) |
static void | setDecimals (int) |
static void | setSchema (UnitSystem s) |
set Schema set the UnitsSchema of the Application this a represented by a class of type UnitSchema which defines a set of standard units for that schema and rules for representative strings. More... | |
static double | toDouble (PyObject *args, const Base::Unit &u=Base::Unit()) |
generate a value for a quantity with default user preferred system More... | |
static QString | toNumber (const Base::Quantity &q, const QuantityFormat &f=QuantityFormat(QuantityFormat::Default)) |
Get a number as string for a quantity of a given format. More... | |
static QString | toNumber (double d, const QuantityFormat &f=QuantityFormat(QuantityFormat::Default)) |
Get a number as string for a double of a given format. More... | |
static Quantity | toQuantity (PyObject *args, const Base::Unit &u=Base::Unit()) |
generate a value for a quantity with default user preferred system More... | |
static QString | toString (const Base::Quantity &q, const QuantityFormat &f=QuantityFormat(QuantityFormat::Default)) |
Get a number as string for a quantity of a given format. More... | |
Static Public Attributes | |
static PyMethodDef | Methods [] |
Static Protected Member Functions | |
static PyObject * | sGetSchema (PyObject *self, PyObject *args) |
static PyObject * | sListSchemas (PyObject *self, PyObject *args) |
static PyObject * | sParseQuantity (PyObject *self, PyObject *args) |
static PyObject * | sSchemaTranslate (PyObject *self, PyObject *args) |
static PyObject * | sSetSchema (PyObject *self, PyObject *args) |
static PyObject * | sToNumber (PyObject *self, PyObject *args) |
Static Protected Attributes | |
static UnitSystem | currentSystem = UnitSystem::SI1 |
static int | UserPrefDecimals = 2 |
number of decimals for floats More... | |
static UnitsSchemaPtr | UserPrefSystem |
The UnitsApi.
|
static |
return an instance of the given enum value
References Base::Centimeters, Base::FemMilliMeterNewton, Base::Imperial1, Base::ImperialBuilding, Base::ImperialCivil, Base::ImperialDecimal, Base::MmMin, Base::SI1, and Base::SI2.
Referenced by Gui::QuantitySpinBox::setSchema(), setSchema(), and sSchemaTranslate().
|
static |
References UserPrefDecimals.
Referenced by PartGui::DlgFilletEdges::accept(), PartGui::CircleFromThreePoints::command(), SpreadsheetGui::SheetModel::data(), PartGui::DlgExtrusion::DlgExtrusion(), Gui::Dialog::DlgUnitsCalculator::DlgUnitsCalculator(), TechDraw::DrawViewDimension::formatValue(), TechDraw::DrawViewDimension::getDefaultFormatSpec(), Spreadsheet::Cell::getFormattedQuantity(), TechDrawGui::QGIDatumLabel::getPrecision(), Gui::LocationWidget::getUserDirection(), Gui::LocationDialog::getUserDirection(), Gui::Dialog::DlgSettingsUnitsImp::loadSettings(), PartGui::SectionCut::onCutXHSsliderMoved(), PartGui::SectionCut::onCutYHSsliderMoved(), PartGui::SectionCut::onCutZHSsliderMoved(), FemGui::PlaneWidget::PlaneWidget(), Gui::PropertyEditor::PropertyItem::PropertyItem(), PartDesignGui::TaskBoxPrimitives::setPrimitive(), TechDrawGui::TaskCenterLine::setUiEdit(), TechDrawGui::TaskDetail::setUiFromFeat(), TechDrawGui::TaskCenterLine::setUiPrimary(), TechDrawGui::TaskCosVertex::setUiPrimary(), PartDesignGui::TaskExtrudeParameters::setupDialog(), PartGui::ShapeFromMesh::ShapeFromMesh(), FemGui::SphereWidget::SphereWidget(), FemGui::TaskPostDataAlongLine::TaskPostDataAlongLine(), FemGui::TaskPostDataAtPoint::TaskPostDataAtPoint(), PartGui::Location::toPlacement(), PartGui::Picker::toPlacement(), and Gui::Dialog::DlgUnitsCalculator::valueChanged().
|
static |
Returns a brief description of a schema.
References Base::Centimeters, Base::FemMilliMeterNewton, Base::Imperial1, Base::ImperialBuilding, Base::ImperialCivil, Base::ImperialDecimal, Base::MmMin, Base::SI1, and Base::SI2.
Referenced by Gui::Dialog::DlgSettingsUnitsImp::DlgSettingsUnitsImp(), Gui::Dialog::DlgUnitsCalculator::DlgUnitsCalculator(), and sListSchemas().
|
static |
return the active schema
Referenced by TechDraw::DrawViewDimension::formatValue(), and TechDraw::DrawViewDimension::isMultiValueSchema().
|
static |
References schemaTranslate().
|
static |
|
static |
References UserPrefDecimals.
Referenced by Gui::Dialog::DlgSettingsUnitsImp::saveSettings().
|
static |
set Schema set the UnitsSchema of the Application this a represented by a class of type UnitSchema which defines a set of standard units for that schema and rules for representative strings.
References createSchema(), currentSystem, Base::SI1, and UserPrefSystem.
Referenced by sSetSchema().
References currentSystem.
References getDescription(), and Base::NumUnitSystemTypes.
References Base::Quantity::parse().
References createSchema().
References Base::NumUnitSystemTypes, and setSchema().
|
static |
generate a value for a quantity with default user preferred system
References Base::Quantity::parse().
|
static |
Get a number as string for a quantity of a given format.
The string is a number in C locale (i.e. the decimal separator is always a dot) and if needed represented in scientific notation. The string doesn't include the unit of the quantity.
References toNumber().
Referenced by MeshGui::DlgRegularSolidImp::on_createSolidButton_clicked(), PartDesignGui::TaskBoxPrimitives::setPrimitive(), Gui::PropertyEditor::PropertyVectorDistanceItem::setValue(), Gui::PropertyEditor::PropertyRotationItem::setValue(), Gui::PropertyEditor::PropertyPlacementItem::setValue(), sToNumber(), and toNumber().
|
static |
Get a number as string for a double of a given format.
The string is a number in C locale (i.e. the decimal separator is always a dot) and if needed represented in scientific notation. The string doesn't include the unit of the quantity.
|
static |
generate a value for a quantity with default user preferred system
References Base::Quantity::parse().
|
static |
Get a number as string for a quantity of a given format.
The string is a number in C locale (i.e. the decimal separator is always a dot) and if needed represented in scientific notation. The string also includes the unit of the quantity.
Referenced by Gui::PropertyEditor::PropertyUnitItem::setValue().
|
staticprotected |
Referenced by setSchema(), and sGetSchema().
|
static |
|
staticprotected |
number of decimals for floats
Referenced by getDecimals(), and setDecimals().
|
staticprotected |
Referenced by schemaTranslate(), and setSchema().