Skip to content

Commit

Permalink
Merge pull request #21 from UlfBj/master
Browse files Browse the repository at this point in the history
Property node use for allowed definition added.
  • Loading branch information
UlfBj authored Jul 3, 2024
2 parents 197484c + cff26b2 commit afc893c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
10 changes: 6 additions & 4 deletions docs-gen/content/type_definition_rule_set/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ title: "Type Definition Model"
weight: 1
---

A `type_definition` tree contains data type definitions that are not part of the
[primitive datatypes](/hierarchical_information_model/common_rule_set/data_entry/datatypes#primitive-datatypes) defined by HIM.

The currently supported node types are suited for definition of [structs](https://en.wikipedia.org/wiki/Composite_data_type).
A `type_definition` tree contains data type definitions.
These can either be complex datatypes that are not part of the
[primitive datatypes](/hierarchical_information_model/common_rule_set/data_entry/datatypes#primitive-datatypes) defined by HIM,
or it can be common allowed definitions.

## Node Types
The currently supported node types can be used for either the definition of [structs](https://en.wikipedia.org/wiki/Composite_data_type),
or for the definition of [allowed](/hierarchical_information_model/common_rule_set/data_entry/value_restrictions/#allowed) value restrictions.

The node types for representing type definitions are:
- Branch
Expand Down
26 changes: 22 additions & 4 deletions docs-gen/content/type_definition_rule_set/property.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ date: 2019-08-04T12:37:03+02:00
weight: 30
---

Data represented by the node type `property` have a relationship to any other data having the same `struct` parent in that they are all sampled in an "atomic" operation,
i.e. the set of data points have the same timestamp representing the sample time.
The node type `property` can either be used to represent members of a struct, or common allowed definitions.

Nodes of the type `property` must have the following mandatory metadata:
- Name
Expand All @@ -22,11 +21,17 @@ Besides the mandatory metadata mentioned above, the following optional metadata
- Allowed
- Comment

When used for allowed definition, the metadata types Unit, Min, Max must not be used.

For more information, please see the [Common Rule Set: Optional Metadata](/hierarchical_information_model/common_rule_set/basics#optional-metadata).

This node type must have a node of type `struct` as parent, and must not have any children.
## Property node used to define struct members
Data represented by the node type `property` have a relationship to any other data having the same `struct` parent in that they are all sampled in an "atomic" operation,
i.e. the set of data points have the same timestamp representing the sample time.

In this usage the node type must have a node of type `struct` as parent, and must not have any children.

An example of the specification of a `property` node is given below.
An example of the specification of a `property` node for a struct member is given below.

```YAML
Type.OpenHours.Open:
Expand All @@ -35,3 +40,16 @@ Type.OpenHours.Open:
max: 24
description: Time the address opens
```
## Propety node used for allowed definition
In this usage the node type must have a node of type `branch` as parent, and must not have any children.

An example of the specification of a `property` node for an allowed definition is given below.

```YAML
Type.Cabin.DriverPositionValues:
type: property
datatype: string
allowed: ['LEFT', 'MIDDLE', 'RIGHT']
description: DriverPosition allowed values.
```

0 comments on commit afc893c

Please sign in to comment.