Double (hwx.inspire.core)¶
Store float value with units.
Units can be None, length, mass, force, …
Values are get/set in base units unless under inspire.usingUnits(…).
A value’s units can be specified using a string like: “5 mm”.
Public Methods¶
castForGet (self, obj, value) castForSet (self, obj, value) create (self, obj) getGuiValue (self, obj, format=’%g’) getInCoreValue (self, obj) getUnits (self, obj) getValue (self, obj) setInCoreValue (self, obj, value) setValue (self, obj, value)
Method Details¶
-
castForGet(self, obj, value)¶
Converts and returns the double value to gui units.
-
castForSet(self, obj, value)¶
Converts and validates the double value before setting.
| param obj: | Object this attribute belongs to. |
|---|---|
| type obj: | GeneralObject |
| param value: | Value of the attribute to set. |
| type value: | str, double |
| returns: | Validated and converted value. |
| rtype: | Double |
-
create(self, obj)
Creates a double attribute for the specified object.
-
getGuiValue(self, obj, format='%g')¶
Returns the formatted double value, as shown in the Property Editor.
-
getInCoreValue(self, obj)¶
Calls the incore get method (defined in C++) of the attribute.
| param obj: | Object this attribute belongs to. |
|---|---|
| type obj: | GeneralObject |
| param value: | Value of the attribute to get. |
| type value: | double |
| returns: | Value returned by the incore get method. |
| rtype: | Double |
-
getUnits(self, obj)¶
Returns the units of the attribute.
-
getValue(self, obj)¶
Returns the double value for the specified object.
-
setInCoreValue(self, obj, value)¶
Calls the incore set method (defined in C++) of the attribute.
| param obj: | Object this attribute belongs to. |
|---|---|
| type obj: | GeneralObject |
| param value: | Value of the attribute to set. |
| type value: | double |
-
setValue(self, obj, value)¶
Sets the double value for the specified object.