• No results found

Dictionary (Lexicon) database

In document Pdms Aveva (Page 51-54)

3 Database Enhancements

3.4 Dictionary (Lexicon) database

The flexibility of the PDMS database has been enormously increased by the addition of User-defined Element Types and new facilities for User-Defined Attributes.

3.4.1 User-Defined Element Types

User-defined element types (UDETs) may now be created: they must be based on an existing element type in the Design, Draft, Catalogue or Property database. The BASETY attribute indicates from which system type the UDET is derived.

This allows users to distinguish between variants of each element type, filtering its attributes, specifying User Defined Attributes (UDAs), and modifying its allowed member types etc. This permits, for example, different types of EQUIPMENT such as pumps and towers to be distinguished in reports etc. It also allows specifications to be made more specific for different components. Local languages may be used if required.

UDETs also allow extra levels of administration element at the ZONE level.

In PML, the UDET is recognised wherever an element type is allowed. For example, you would be able to do a collection based on a specific UDET.

UDET elements are created in a UDET world (UDETWL), either directly or in a UDET group (UDETGR) in a UDETWL. For details, refer to section 6.6.

3.4.2 User-Defined Attributes

A number of enhancements allow much more control over the customisation of the PDMS data structures.

Category for a UDA

Text and Numerical Value validation

A UDA definition may now contain an acceptable set of valid values for a text UDA or an acceptable set of ranges for an int or real UDA, which are used to verify its value on entry. These are defined in the dictionary DB by adding UVALID and UVALID elements below the UDA, one for each valid value or range.

Remove existing limits

The limits on numbers of UDA definitions and UDAs per element type have been removed External links

A UDA may refer to ‘documents’ such as web and email addresses, external WORD documents or drawings. The links may be shown in the GUI and the appropriate editor invoked by clicking the link.

Hidden UDAs

UDAs may be hidden from the command ‘Q ATT’ and the attribute form, though the individual UDA may still be queried. It may be hidden for all users, or visible to specific teams. This is controlled by two new attributes UHIDE and UTEAM on a UDA element.

Connection flag

A new UCONN attribute on a UDA element signals that it is a connection: if set, the UDA value will appear in the reference List form.

Pseudo user-defined attributes

A UDA may now be marked, using the new attribute UPSEUD, as a pseudo attribute, for which the values are calculated as needed rather than being stored. The code to evaluate the attribute must be plugged in by the user through the C# API.

If the calculation of the pseudo attribute relies on other element attributes, and the pseudo attribute is to be used in a dynamic rule, then it is possible to denote what real attributes the pseudo attribute uses.

For example, to add a UDA :VOLUME to a box, the code multiplies XLEN*YLEN*ZLEN, therefore :VOLUME is dependent on those 3 attributes. This should be indicated by setting the UDPEND attribute to ‘XLEN YLEN ZLEN’. If :VOLUME is subsequently included in a dynamic rule, any revision of XLEN, YLEN, ZLEN will be reflected in the result.

Enhancements to system attributes

For system attributes, the user may define Valid values and Limits, and also specify a Category. In addition, it is also possible to specify that the attribute is hidden on forms.

Valid values and limits may be varied according to element type; they are defined by creating a USDA element in the dictionary DB. A USDA owns ULIMIT and UVALID elements that denote the limits and valid values. For example, to restrict the setting of the FUNC attribute on EQUIPMENT to be ‘HeatX’ or ‘Pump’, you could create a USDA as follows:

new usda /UFUNC

desc 'set restriction on FUNC attribute on EQUI' usysty FUNC

The existing ATTDEF command has been enhanced to take the following fields:

PROTEC – Protection on/off HYPERL – hyperlink flag

CONNEX – connection flag CATEG – category

For example:

VAR !A ATTDEF XLEN CATEG

New PML objects

There are new PML objects to represent element types and attributes. These are:

• Attribute class – To represent attributes

• ElementType class – To represent Element types

Instances of these classes is limited to querying details of the attributes and element types. Direct usage of the new objects in existing syntax is not supported.

Attribute class

An attribute instance may be created for a system attribute or a UDA, for example:

!AXLEN = object attribute('XLEN')

!UINT = object attribute(':UINT') Methods on an Attribute object are:

• String Type()

• String units – string (either BORE, DISTANCE or NONE)

• Bool Noclaim() – bool

• ElementType array ElementTypes – this will work for UDAs only

• Real array limits – only valid for real/int types

• String array ValidValues(ElementType) – The list may vary with element type.

• String DefaultValue(ElementType) – Only valid for UDAs initially.

• String Category()

• Bool hyperlink() – attribute denotes an external file if true

• Bool connection()

• Bool hidden()

• Bool protected() ElementType class

An ElementType instance may be created for a system Element type or a UDET. For example,

!EQUI = object elementtype('EQUI')

!UEQUI = object elementtype(':MYEQUI') Methods on an ElementType object are:

• string Name()

• ElementType SystemType()- for UDETs

• ElementType array udets() – UDETs derived from this type

• bool Primary()

• ElementType array MemberTypes()

• ElementType array ParentTypes()

In document Pdms Aveva (Page 51-54)