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’)
getValue (self, obj)
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.

getValue(self, obj)

Returns the double value for the specified object.

setValue(self, obj, value)

Sets the double value for the specified object.