The classes fall into the following groups:
这个 类 分成以下几组:
Data model definition classes
Basic database access, query and modification.
Filters and iterators
Dabacon table access
DB, MDB, Project access
Events and pseudo attribute plugins
数据模型定义类
基本数据库存取,查询和修改
过滤和循环
Dabacon表存取
数据库,数据库组,项目存取
事件和隐含属性
The classes are:
DbElementType
DbAttribute
DbElementTypeInstance
DbAttributeInstance
这个类是:
数据库元素类型
数据库属性
数据库元素类型实例
数据库属性实例
Overview
There is a single class for all element types.
一个类包含所有元素类型。
The purpose of the class is to:
Instances of the class identify the element type. i.e. methods on other classes take a DbElementType as an argument rather than a string to denote an Element type. The DbElementType has ‘value’ semantics for comparison purposes. i.e. comparing of two DbElementTypes will always return true if they refer to the same type, even if they are different objects.
Access the metadata associated with element types.
External to PDMS/Marine, the hash value can be used to uniquely identify an Element type. The hash value is a 32 bit integer.
这个类的用途是:
这个类的实例确定元素类型,比如在其他类的方法中调用一个DbElementType作为参数而不是一个字符串来表示一个元素类型。这个DbElementType可以用于比较,例如如果两个不同的对象如果有相同的类型,在比较的时候将返回True。
Constructors 构造方法
In C# a DbElementType object may be obtained in one of three ways:
在 C# 中DbElementType对象有三种获取方式:
Use the globally defined instances in DbElementTypeInstance. This is the recommended and easiest way to obtain a DbElementType.
使用DbElementTypeInstance实例,这是推荐的和最简单的获取DbElementType的方法。
示例:
if (elem.GetElementType() == DbElementTypeInstance.EQUIPMENT)
The static ‘GetElementType’ method may be used to return a DbElementType given the Element Type name. This is only needed for UDETs. The colon must be included as part of the name.
GetElementType静态方法可以用于给定一个元素类型名字后返回一个DbElementType,这个仅仅用于用户自定义元素类型(UDETs),名字前面必须带上冒号。
There is also a static ‘GetElementType’ method that may to be used to return a DbElementType given the hash value. This is only needed where a hash value has been stored outside of PDMS/Marine.
还有一个GetElementType静态方法可以通过给定一个哈希值后返回一个DbElementType,这仅用于哈希值保存在 PDMS/Marine之外的情况。
Various methods on other classes, such as DbElement will return a list of DbElementTypes.
在其他类的这种方法中,像DbElement将返回一个DbElementTypes列表。
Methods
The methods allow the Element type metadata to be accessed. E.g.
方法允许获取元素类型的元数据:
示例:
DbElementType[] types = elem.GetElementType().MemberTypes();
Related ENUMS 相关的枚举
DbNounManual- Manual category
DbType - DB type
Related Pseudo Attributes 相关的隐含属性
Pseudo attributes that provide similar information on a particular element instance (i.e. on a DbElement) are:
隐含属性能提供前面方法获取的类似的信息:
| Attribute Name | C# Data Type | Description |
|---|---|---|
| HLIS | DbElementType[] | List of all possible types in owning hierarchy |
| LIST | DbElementType[] | List of all possible member types |
| LLIS | DbElementType[] | List of all possible types in member hierarchy |
| OLIS | DbElementType[] | List of all possible owner types |
| REPTXT | String | Reporter text used for element type |
| ATTLIST | DbAttribute[] | List of all visible attributes for element |
| PSATTS | DbAttribute[] | List of pseudo attributes |
| UDALIS | DbAttribute[] | List of UDAs |
Overview
This is very similar to DbElementType. There is a single class for all attributes.
类似于DbElementType,一个类包含了所有属性。
The purpose of the class is to:
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 PDMS/Marine, 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:
示例
string name = elem.GetString(DbAttributeInstance.NAMN);
bool lock = elem.GetBool(DbAttributeInstance.LOCK);
Position pos = elem.GetPosition(DbAttributeInstance.POS);
Methods
The methods allow the following metadata to be accessed:
方法允许获取属性的元数据:
Example:
Find the type of attribute XLEN. We use the global instance of XLEN on the DbAttributeInstance class.
using ATT=Aveva.Pdms.Database.DbAttributeInstance;
DbAttributeType xlenTyp= ATT.XLEN.Type;
Related ENUMS 相关的枚举
DbAttributeUnit - Type of units, e.g. 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
属性限定条件,用于确定一个属性有哪些限定条件。
This class contains instances of DbElementType for every element type in PDMS/Marine. These instances may be used wherever a DbElementType is expected. E.g. if a method MyMethod() takes an DbElementType, then you could write:
e.g.
MyMethod(Aveva.Pdms.Database.DbElementTypeInstance.EQUIPMENT);
It is often convenient to add a using statement for these instances. E.g.
using NOUN=Aveva.Pdms.Database.DbElementTypeInstance;
MyMethod(NOUN.EQUIPMENT);
This class contains instances of DbAttribute for every element type in PDMS/Marine. These instances may be used wherever a DbAttribute is expected. E.g. if a method MyMethod() takes a DbAttribute, you could write:
e.g.
MyMethod(Aveva.Pdms.Database.DbAttributeInstance.XLEN);
It is often convenient to add a using statement for these instances. E.g
using ATT=Aveva.Pdms.Database.DbAttributeInstance;
MyMethod(ATT.XLEN);
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删