Skip to content

Commit

Permalink
Merge pull request #7 from UlfBj/master
Browse files Browse the repository at this point in the history
Support for referencing external tree node from service input/output.
  • Loading branch information
UlfBj authored Aug 1, 2023
2 parents b125e90 + 2a0618f commit e412c86
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 44 deletions.
38 changes: 6 additions & 32 deletions docs-gen/content/common_rule_set/node_types/property.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
---
title: "Property node"
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.

Nodes of the type `property` must have the following mandatory metadata:
- Name
- Type
- Datatype
- Description

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

Besides the mandatory metadata mentioned above, the following optional metadata may be used
- Unit
- Min
- Max
- Allowed
- Comment

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.

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

```YAML
Type.OpenHours.Open:
datatype: uint8
type: property
max: 24
description: Time the address opens
```
The `property` node type is used in both the `service` and `typedefinition` rule sets,
but as they differ slightly on the semantics in respective rule set it has a separate definition in each of the rule sets,
please see their definitions in the
[Service Rule Set:Property node node type](/hierarchical_information_model/service_data_rule_set/property) and the
[Type Definition Rule Set:Property node node type](/hierarchical_information_model/type_definition_rule_set/property)
respectively.
2 changes: 1 addition & 1 deletion docs-gen/content/service_data_rule_set/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ chapter: true

# HIM Service Data Rule Set

The rules that are specific for the information type `service_data` is described in this part of the document,
The rules that are specific for the information type `servicedata` is described in this part of the document,
and together with the rules in the [Common rule set part](/hierarchical_information_model/common_rule_set) it forms the overall rules for this information type.
7 changes: 3 additions & 4 deletions docs-gen/content/service_data_rule_set/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The general structure of how service data is represented in a HIM tree is shown
*Figure x. HIM service data graph representation

- The name of the procedure is the name of the node of `service` type.
- The input and output parameters are respectively represented by a node of type `struct` that must have the names 'Input' and 'Output', respectively.
- An input/output parameter is represented by a node of type `property`.
- The input and output parameters are respectively represented by a node of type `iostruct` that must have the names 'Input' and 'Output', respectively.
- An input/output parameter is represented by a node of type `property` or `symlink`.

Any Input/Output nodes, and their associated children, are only present if the procedure has at least one parameter of the respective Input/Output.

Expand All @@ -51,5 +51,4 @@ The rules for how a service shall update the state value follows below:
- If a service is functional but temporarily unavailable it shall be set to 101.
- If a service requires repair or other type of critical maintenance to become functioning it shall be set to 102.

The service state does not represent the error code that is typically part of a transport protocol.

The service state does not represent the error code that is typically part of a transport protocol.
37 changes: 37 additions & 0 deletions docs-gen/content/service_data_rule_set/iostruct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "IO-struct node"
date: 2019-08-04T12:37:03+02:00
weight: 30
---

An `iostruct` node type may be used to encapsulate multiple data points that have the relationship that they are all representing either
Input parameters or Output parameters of the service that they are linked to.

This node type is only allowed in trees of the information type `servicedata`.
For more information, please see respective parts of this document.

An `iostruct` node must have one of the two names `Input` or `Output`.

Nodes of the type `iostruct` must have the following mandatory metadata:
- Name
- Type
- Description

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

Besides the mandatory metadata mentioned above, the following optional metadata may be used
- Comment

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

- A leaf node cannot have the `iostruct` node type.
- A parent must be of the node type `service`.
- Children must be of the node types `property` or `symlink`.
- It must have at least one child.

An example of the specification of a `struct` node is given below.
```YAML
Input:
type: iostruct
description: This is an iostruct node representing Input parameters of a service.
```
37 changes: 37 additions & 0 deletions docs-gen/content/service_data_rule_set/property.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Property node"
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.

Nodes of the type `property` must have the following mandatory metadata:
- Name
- Type
- Datatype
- Description

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

Besides the mandatory metadata mentioned above, the following optional metadata may be used
- Unit
- Min
- Max
- Allowed
- Comment

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.

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

```YAML
Type.OpenHours.Open:
datatype: uint8
type: property
max: 24
description: Time the address opens
```
12 changes: 10 additions & 2 deletions docs-gen/content/service_data_rule_set/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ Besides the mandatory metadata mentioned above, the following optional metadata
For more information, please see the [Common Rule Set: Optional Metadata](/hierarchical_information_model/common_rule_set/basics#optional-metadata).

- A parent must be of the node type `branch`.
- Children, if any, must be of the node type `struct`.
- Children, if any, must be of the node type `iostruct`.

An example of the specification of a `service` node is given below.
```YAML
NodeName:
ServiceName:
type: service
description: This is a service node containing its mandatory metadata.
```
Expand All @@ -30,3 +30,11 @@ NodeName:
A `service` node has a mandatory datatype of uint8. As it cannot be set to any other datatype than uint8,
the datatype metadata shall not be explicitly shown in the node.
The main purpose of the state information is to provide a "percentage" state of the execution to clients.

The service must set i to zero (0) at the beginning of the execution, and it must set it to hundred (100) at the end of a successful execution.
It may further update it one or more times during the execution.

If an error occurs during execution the state shall be set to one of the predefined error values.
This error value is not replacing either a service specific error value which the service may return as an Output parameter,
nor with the error value that a transport protocol may report.
44 changes: 44 additions & 0 deletions docs-gen/content/service_data_rule_set/symlink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Symlink node"
weight: 30
---

Data represented by the node type `symlink` have a relationship to any other data having the same `iostruct` parent in that they are all representing either
Input parameters or Output parameters of the service that they are linked to.

An Otput parameter declared as a symlink will lead to that the returned value is read from that data point.

An Input parameter declared as a symlink will lead to that the provided input value is written to that data point.

Nodes of the type `symlink` must have the following mandatory metadata:
- Name
- Type
- Path
- Domain
- Version
- Description

The Path must be a valid path to a leaf node in the tree declared by the Domain and Version metadata.

The Domain must declare an existing HIM tree of information type resourcedata.

The Version must be a dot delimited triplet declaring a version of the tree eclared by the Domain.
The triplet may a suffix of either "+" or "-", denoting that also any following or previous versions are also valid.

Besides the mandatory metadata mentioned above, the following optional metadata may be used
- Comment

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 `iostruct` as parent, and must not have any children.

An example of the specification of a `symlink` node is given below.

```YAML
VehicleService.GPS.GetPosition.Output.Latitude:
type: symlink
path: Vehicle.CurrentLocation.Latitude
domain: Automotive.Vehicle.Car.ResourceData
version: 3.0.0+
description: This is a symlink to a VSS tree.
```
37 changes: 37 additions & 0 deletions docs-gen/content/type_definition_rule_set/property.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Property node"
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.

Nodes of the type `property` must have the following mandatory metadata:
- Name
- Type
- Datatype
- Description

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

Besides the mandatory metadata mentioned above, the following optional metadata may be used
- Unit
- Min
- Max
- Allowed
- Comment

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.

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

```YAML
Type.OpenHours.Open:
datatype: uint8
type: property
max: 24
description: Time the address opens
```
Binary file modified docs-gen/static/images/service_graph_representation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions examples/HIM_Service.v1.0.0.him
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ VehicleService.ExternalLightning.HeadLampsOnOff:
description: Service name: HeadLampsOnOff, Input: Switch, Output: None.

VehicleService.ExternalLightning.HeadLampsOnOff.Input:
type: struct
description: A struct type containing the input parameter(s).
type: iostruct
description: An iostruct type containing the input parameter(s).

VehicleService.ExternalLightning.HeadLampsOnOff.Input.Switch:
datatype: boolean
type: property
description: true = headlamps on, false = headlamps off
type: symlink
path: Vehicle.Body.Lights.IsHighBeamSwitchOn
domain: Automotive.Vehicle.Car.ResourceData
version: 3.0.0+
description: The reference in the VSS data tree is set to the input value.

VehicleService.Version:
type: branch
Expand Down

0 comments on commit e412c86

Please sign in to comment.