DimensionUnit¶
Inheritance diagram¶

Classes¶
DimensionUnit¶
- class ORSModel.ors.DimensionUnit¶
Bases:
UnmanagedAn entity describing a unit of measure used by ORS.
- convertToUnit(self, aValue: float, aDimensionUnit: ORSModel.ors.DimensionUnit) float¶
Converts from a unit to another unit.
Note
Conversion can be applied only between units of the same type.
- Parameters:
aValue (float) –
aDimensionUnit (ORSModel.ors.DimensionUnit) –
- Returns:
output (float) –
- convertValuesToUnit(self, aValues: ORSModel.ors.ArrayDouble, aDimensionUnit: ORSModel.ors.DimensionUnit) ORSModel.ors.ArrayDouble¶
Converts an array of values from a unit to another unit.
Note
Conversion can be applied only between units of the same type.
Note
Each value in the array is converted individually using the same conversion logic as convertToUnit.
- Parameters:
aValues (ORSModel.ors.ArrayDouble) – the array of values to convert (an ArrayDouble)
aDimensionUnit (ORSModel.ors.DimensionUnit) – the target dimension unit (a DimensionUnit)
- Returns:
output (ORSModel.ors.ArrayDouble) – the converted array of values (an ArrayDouble)
- createFromPythonRepresentation(aPythonRepresentation: str) ORSModel.ors.DimensionUnit¶
Create aDimensionUnit from a python representation a static method.
- Parameters:
aPythonRepresentation (str) –
- Returns:
output (ORSModel.ors.DimensionUnit) –
- getAllCalibrationKeys(self) ORSModel.ors.ArrayString¶
Gets all the existing calibration keys of the dictionary of calibration values.
Note
it is the responsibility of the caller to delete the returned array
- Returns:
output (ORSModel.ors.ArrayString) – array of the calibration keys (an ArrayString)
- getAllRegistrationKeys() ORSModel.ors.ArrayString¶
Note
it is the responsibility of the caller to delete the returned array
- Returns:
output (ORSModel.ors.ArrayString) – array of the registration keys (an ArrayString)
- getCalibrationValue(self, sCalibrationKey: str) float¶
Gets a calibration value from the dictionary of calibration values.
- Parameters:
sCalibrationKey (str) – calibration key (a string)
- Returns:
output (float) – calibration value (a double)
- getClassNameStatic() str¶
getClassNameStatic
- Returns:
output (str) –
- getDefault(dimensionType: int) ORSModel.ors.DimensionUnit¶
- Parameters:
dimensionType (int) –
- Returns:
output (ORSModel.ors.DimensionUnit) –
- getDescription(self) str¶
Gets the description.
- Returns:
output (str) – the description (a string)
- getDimensionType(self) int¶
Note
See the CxvUniverse_Dimension_Type enum in ORS_def.h to know the supported values.
- Returns:
output (int) – a CxvUniverse_Dimension_Type describing the dimensionality of the dimension unit (an int)
- getFilenameCustomDimensionUnits() str¶
Gets the filename of the custom dimension units.
- Returns:
output (str) – filename of the custom dimension units (a string)
- getHasCalibrationKey(self, sCalibrationKey: str) bool¶
-
- Parameters:
sCalibrationKey (str) – calibration key (a string)
- Returns:
output (bool) – true if the calibration key is one of those defined for the calibration, false otherwise (a bool)
- getIsEqualTo(self, aDimensionUnit: ORSModel.ors.DimensionUnit) bool¶
Checks for equality to anotherDimensionUnit.
- Parameters:
aDimensionUnit (ORSModel.ors.DimensionUnit) – a DimensionUnit (a DimensionUnit)
- Returns:
output (bool) – true if the DimensionUnits are equal, false otherwise
- getIsImperialUnit(self) bool¶
- Returns:
output (bool) –
- getReferenceUnitConvertedToUnit(self, aVolume: float) float¶
Converts from MKS to another unit.
- Parameters:
aVolume (float) –
- Returns:
output (float) –
- getReferenceUnitToUnitFactor(self) float¶
- Returns:
output (float) –
- getRegisteredUnit(registrationKey: str) ORSModel.ors.DimensionUnit¶
Gets theDimensionUnit associated to a registration key.
- Parameters:
registrationKey (str) – registration key (a string)
- Returns:
output (ORSModel.ors.DimensionUnit) – a DimensionUnit (a DimensionUnit)
- getRegistrationKey(self) str¶
Gets the unit registration key.
- Returns:
output (str) – the unit registration key (a string)
- getRegistrationKeyFromCxvDimensionUniverse(pDimension: int) str¶
Note
See the CxvUniverse_Dimension enum in ORS_def.h to know the supported values.
- Parameters:
pDimension (int) – a dimension index (an int)
- Returns:
output (str) – registration key (a string)
- getRegistrationKeysSpecificDimensionUnitType(dimensionType: int) ORSModel.ors.ArrayString¶
Note
See the CxvUniverse_Dimension_Type enum in ORS_def.h to know the supported values.
Note
it is the responsibility of the caller to delete the returned array
- Parameters:
dimensionType (int) – a dimension type (an int)
- Returns:
output (ORSModel.ors.ArrayString) – array of the registration keys (an ArrayString)
- getSquaredUnit(self) ORSModel.ors.DimensionUnit¶
Gets the squared unit corresponding to this dimension unit.
- Returns:
output (ORSModel.ors.DimensionUnit) – a DimensionUnit representing the squared version of this unit
- getSupportsConversion(self) bool¶
Gets if the unit supports conversion to another unit.
Note
Generic units don’t support conversion.
- Returns:
output (bool) – true if the unit can be converted to another unit, false otherwise (a bool)
- getSupportsConversionToUnit(self, aDimensionUnit: ORSModel.ors.DimensionUnit) bool¶
Gets if the unit can be converted in the other unit.
Note
Generic units don’t support conversion.
Note
Conversion can be applied only between units of the same type.
- Parameters:
aDimensionUnit (ORSModel.ors.DimensionUnit) –
- Returns:
output (bool) – true if the unit can be converted to another unit, false otherwise (a bool)
- getTypeForID(pDimension: int) int¶
Deprecated since version (unknown): use getDimensionType instead
Note
See the CxvUniverse_Dimension_Type enum in ORS_def.h to know the supported values.
- Parameters:
pDimension (int) – a dimension index (an int)
- Returns:
output (int) – a CxvUniverse_Dimension_Type describing the dimensionality of the dimension unit (an int)
- getUnitAbbreviation(self) str¶
Gets the unit abbreviation.
- Returns:
output (str) – the unit abbreviation (a string)
- getUnitConvertedToReferenceUnit(self, aVolume: float) float¶
Converts to MKS from another unit.
- Parameters:
aVolume (float) –
- Returns:
output (float) –
- getUnitForID(pDimension: int) ORSModel.ors.DimensionUnit¶
Deprecated since version (unknown): use getRegisteredUnit instead
Note
See the CxvUniverse_Dimension enum in ORS_def.h to know the supported values.
- Parameters:
pDimension (int) –
- Returns:
output (ORSModel.ors.DimensionUnit) –
- getUnitName(self) str¶
Gets the unit name.
- Returns:
output (str) – the unit name (a string)
- getUnitWithAbbreviation(sAbbreviation: str) ORSModel.ors.DimensionUnit¶
Gets the unit that has the specified abbreviation.
- Parameters:
sAbbreviation (str) – a text abbreviation (a string)
- Returns:
output (ORSModel.ors.DimensionUnit) – a DimensionUnit or none
- getUnitWithName(sUnitName: str) ORSModel.ors.DimensionUnit¶
Gets the unit that has the specified name.
- Parameters:
sUnitName (str) – a text name (a string)
- Returns:
output (ORSModel.ors.DimensionUnit) – a DimensionUnit or none
- none() DimensionUnit¶
- Returns:
output (DimensionUnit) –
- removeFromRegisteredDimensionUnits(registrationKey: str) bool¶
- Parameters:
registrationKey (str) – registration key (a string)
- Returns:
output (bool) – true if the removal from the dictionary is successful, false otherwise (a bool)
- setFilenameCustomDimensionUnits(filenameCustomDimensionUnits: str) bool¶
Sets the filename of the custom dimension units.
Note
the file should be accessible with reading and writing permissions
- Parameters:
filenameCustomDimensionUnits (str) – filename of the custom dimension units (a string)
- Returns:
output (bool) – true if the file can be used, false otherwise (a bool)
Unmanaged¶
- class ORSModel.ors.Unmanaged
Bases:
ORSBaseClassAbstract class for objects that are not managed by the core library. Unmanaged objects are transient objects.
- atomicLoad(sFilename: str) Unmanaged
Creates an object from a file where an object was saved.
- Parameters:
sFilename (str) – path of the file to load
- Returns:
output (Unmanaged) – an unmanaged object, or none() if the load fails
- atomicSave(self, aFilename: str) int
Saves the object to a file.
- Parameters:
aFilename (str) – path of the file to save
- Returns:
output (int) – 0 if successful, otherwise an error code
- createFromPythonRepresentation(aPythonRepresentation: str) ORSModel.ors.Unmanaged
Create aUnmanaged Object from a python representation a static method.
- Parameters:
aPythonRepresentation (str) –
- Returns:
output (ORSModel.ors.Unmanaged) –
- fromPythonRepresentation(self, aPythonRepresentation: str) bool
Create aUnmanaged object from a Python string representation.
- Parameters:
aPythonRepresentation (str) – a Python evaluable string representation (a string)
- Returns:
output (bool) – true if parsing worked, false otherwise (a bool)
- getClassName(self) str
Retrieves the class name of the core object wrapped by this Interface object.
- Returns:
output (str) –
- getClassNameStatic() str
getClassNameStatic
- Returns:
output (str) –
- getDataChecksum(self) str
- Returns:
output (str) –
- getIsInstanceOf(self, pProgId: str) bool
Queries the object to know if it is an instance of a certain class.
- Parameters:
pProgId (str) –
- Returns:
output (bool) –
- getPythonRepresentation(self) str
Gets a Python evaluable string representation.
- Returns:
output (str) –
- isNone(self) bool
Checks if the receiver is none.
- Returns:
output (bool) –
- isNotNone(self) bool
Checks if the receiver is not none.
- Returns:
output (bool) –
ORSBaseClass¶
- class ORSModel.ors.ORSBaseClass
An abstract class from which all objects issued from the ORS Core Library inherit.
- getPythonTraceBack() List[str]
Set the python traceback for a call from python.
- Returns:
output (List[str]) –
- isManaged(self) bool
- Returns:
output (bool) –
- isNone(self) bool
- Returns:
output (bool) –
- setPythonTraceBack(tb: List[str])
Set the python traceback for a call from python.
- Parameters:
tb (List[str]) –