The <Properties> node has the
following attributes:
[Data Entity Name] - The
internal (immutable) name assigned to the Data Entity. If this attribute
is not specified, a default name is assigned internally. However,
specification of a name enables the retrieval of the properties associated
with objects of the Data Entity (see below). A special name “CellProperties” is reserved for the DataEntity whose properties should be displayed in the
user interface from the context menu of the associated cell.
[Data Entity Label] - The
display name (user changeable) assigned to the Data Entity in the
user interface.
[Data Object Name] - The internal (immutable)
name assigned to the Data Object. If this attribute is not specified,
a default name is assigned internally. However, specification of a
name enables the retrieval of the properties associated with the given
object (see below).
Mandatory attributes for the definition of a property are:
[Property Name] - The name
to be assigned to the property, unique for that DataEntity
[DataType] - The type of
data which the properties define. Currently supported types include:
int
double
string
quantity
bool
option
DataReference
[Value] - A string representing
the value to be assigned to the property, which is parsed by the code
according to the type.
The bool type can assume
the values of “True” or “False.”
A quantity type should be
specified by providing a string of type “double
[ unit ]” (for example, “23 [ms^-1]” ).
The options type is used for mutually exclusive choices, which should
be specified by comma separated strings without white space
(for example,
“[Option1,Option2]”).
The DataReference type should be specified by a string of type
DataEntityType:ObjectName.
Optional attributes are:
[Property Label] - The user-visible
string that can be assigned to the property (default is the property
name).
[Group] - The group to organize
the properties (for user interface purpose only).
[IsReadOnly] (“True”/”False”) - Specifies that the property cannot be edited. Default is "False."
[IsExtrinsic] (“True”/”False”) - Specifies that the property is not relevant for the computation
of the state of the cell. Default is "False."
[IsVisible] (“True”/”False”) - Specifies whether the property should be shown in the user interface.
Default is "True."
[Min] - The lowest range
for the property value.
[Max] - The highest range
for the property value.
[OptionLabels] (for option
type only) - The visible names for the options, to be used in the
user interface, specified by comma separated strings without white
space (for example “[Background,Foreground]”).
You can access the value for each property from any
Python script used with Workbench via the Workbench query GetEntityProperty, as described below:
dataReference = “/” + container + “/” +DataEntityName+ “:” +ObjectNamepropertyVal = GetEntityProperty(Entity=dataReference, Name=PropertyName)
where
container is the name of
the container associated with the cell. This information is typically
available in the function from where the Python script is called (for
example, the update script for a cell or the script invoked from a
user interface operation selected on a given cell).
is the name specified in the configuration file. For
example: DataEntityName
<DataEntity Name="MyDataEntity">
is the name specified in the configuration file. For example: ObjectName
<Object Name="MyObjectName">
is the name of the property specified in the configuration
file.PropertyName
It is also possible to change the value of the properties
that are not marked as read-only using the Workbench SetEntityProperty command:
SetEntityProperty(Entity=dataReference,Name=PropertyName, Value=value)where value is the appropriate type
for the property being modified. For example, a property of type quantity
named “InletVelocity” defined
for an object named AnsSettingsObject of
the data entity type SettingsDataEntity can
be queried and set as follows:
dataReference = “/” + container + “/” + “SettingsDataEntity” + “:” + “AnsSettingsObject” value = GetEntityProperty(Entity=dataReference, Name = “InletVelocity”) SetEntityProperty(Entity = dataReference, Name = “InletVelocity”, Value=”10 [m s^-1]”)