DbAttribute
- Last UpdatedJun 02, 2022
- 2 minute read
This is very similar to DbElementType. There is a single class for all attributes.
The purpose of the class is to:
-
Access the metadata (i.e. data about data) associated with attributes, for example: type, name, length.
-
Identify attributes. i.e. methods on other classes should always take a DbAttribute rather than a string as an argument to denote the attribute. Any comparison of attribute identity should be done by comparing DbAttribute objects.
The class should not be confused with the attribute value. The actual Attribute value for a particular Element can only be accessed via the DbElement class. Comparing two DbAttributes just compares whether they identify the same attribute, the comparison does not look at attribute values in any way.
External to the AVEVA module, the hash value can be used to uniquely identify an Attribute. The hash value is a 32 bit integer.
Constructors
In C# a DbAttribute object may be obtained in the following ways:
-
Use globally defined instances. Each attribute has a globally declared instance in the DbAttributeInstance class. This is the standard way of specifying an attribute.
-
Look up the DbAttribute given the attribute name. This is only needed for UDAs, since all other attributes can be obtained from the global instances. The colon must be included as part of the name.
-
Look up the DbAttribute given the attribute hash value. Generally this is only needed if reading the hash value from an external system.
-
Various methods on other classes, such as DbElement, will return a list of DbAttributesTypes.
Methods
The methods allow the following metadata to be accessed:
|
Attribute Type |
|
Units |
|
Name |
|
Description |
|
Category |
|
Size |
|
Allowed Values |
|
Allowed ranges |
|
Is a UDA |
|
Is a pseudo attribute |
|
Whether the attribute may take a qualifier |
Example:
Find the type of attribute XLEN. We use the global instance of XLEN on the DbAttributeInstance class.
using ATT=Aveva.Core.Database.DbAttributeInstance;
DbAttributeType xlenTyp= ATT.XLEN.Type;
Related ENUMS
|
DbAttributeUnit - |
Type of units, for example: distance or bore or none. |
|
DbAttributeType – |
Type of attribute. One of |
|
INTEGER = 1, |
|
|
DOUBLE = 2, |
|
|
BOOL = 3, |
|
|
STRING = 4, |
|
|
ELEMENT = 5, |
|
|
DIRECTION = 7, |
|
|
POSITION = 8, |
|
|
ORIENTATION = 9 |
|
|
DbAttributeQualifier – used to determine what sort of qualifier an attribute has |
|