Skip to content

Commit

Permalink
improve sofdcar
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner authored Jun 23, 2023
1 parent 52e62a3 commit b026e26
Show file tree
Hide file tree
Showing 55 changed files with 1,275 additions and 1,157 deletions.
2 changes: 1 addition & 1 deletion docs/cmds/puccini/check-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd "$(dirname "$0")"
DOCS_DIR="../../docs"

# Validate each service template
for TEMPLATE in ${DOCS_DIR}/sofdcar/tosca-sofdcar-profile.yaml ${DOCS_DIR}/sofdcar/tosca-sofdcar-profile-non-normative.yaml ${DOCS_DIR}/sofdcar/guides/location/service-template.yaml ${DOCS_DIR}/sofdcar/guides/zone/service-template.yaml; do
for TEMPLATE in ${DOCS_DIR}/sofdcar/tosca-sofdcar-profile.yaml ${DOCS_DIR}/sofdcar/tosca-sofdcar-profile-core.yaml ${DOCS_DIR}/sofdcar/tosca-sofdcar-profile-extended.yaml ${DOCS_DIR}/sofdcar/guides/location/service-template.yaml ${DOCS_DIR}/sofdcar/guides/zone/service-template.yaml; do
echo
./check.sh $TEMPLATE
done
4 changes: 2 additions & 2 deletions docs/cmds/puml/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ fi
$VINTNER_CLI template puml topology --path docs/docs/sofdcar/guides/location/service-template.yaml
$VINTNER_CLI template puml topology --path docs/docs/sofdcar/guides/zone/service-template.yaml

$VINTNER_CLI template puml types --path docs/docs/sofdcar/tosca-sofdcar-profile.yaml
$VINTNER_CLI template puml types --path docs/docs/sofdcar/tosca-sofdcar-profile-non-normative.yaml
$VINTNER_CLI template puml types --path docs/docs/sofdcar/tosca-sofdcar-profile-core.yaml
$VINTNER_CLI template puml types --path docs/docs/sofdcar/tosca-sofdcar-profile-extended.yaml
10 changes: 7 additions & 3 deletions docs/cmds/sofdcar/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {ServiceTemplate} from '#spec/service-template'
import * as utils from '#utils'
import * as path from 'path'

async function run(name: string) {
async function run(name: string, id: string, variant: string) {
const dir = path.join('docs', 'docs', 'sofdcar')
const template = files.loadYAML<ServiceTemplate>(path.join(dir, name + '.yaml'))
await files.renderFile(
Expand All @@ -20,14 +20,18 @@ async function run(name: string) {
toText: (value: string) => value.split('_').join(' '),
toFigure: (value: string) => name + '.' + value.replace('_', '-') + '.svg',
},
profile: {
id,
variant,
},
},
path.join(dir, name + '.md')
)
}

async function main() {
await run('tosca-sofdcar-profile')
await run('tosca-sofdcar-profile-non-normative')
await run('tosca-sofdcar-profile-core', 'c', 'Core')
await run('tosca-sofdcar-profile-extended', 'e', 'Extended')
}

main()
6 changes: 3 additions & 3 deletions docs/cmds/sofdcar/profile.template.ejs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<% Object.entries(template).filter(([key, _]) => key.endsWith('_types')).sort((a, b) => a[0].localeCompare(b[0])).forEach(([types_key, types], index) => { %>
### <%= utils.toTitle(types_key) %>
We specify the following <%= utils.toText(types_key) %>.
An overview is given in the following Figure <%= index + 1%>.
We specify the following normative <%= utils.toText(types_key) %>.
An overview is given in Figure <%= profile.id %><%= index + 1%>.
<figure markdown>
![<%= utils.toTitle(types_key) %>](<%= utils.toFigure(types_key) %>)
<figcaption>Figure <%= index + 1%>: TOSCA SofDCar <%= utils.toTitle(types_key) %></figcaption>
<figcaption>Figure <%= profile.id %><%= index + 1%>: TOSCA SofDCar <%= profile.variant %> <%= utils.toTitle(types_key) %></figcaption>
</figure>
<%
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/queries4tosca/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ optionally by a number or a range.

## Appendix A "Grammar"

This appendix contains the complete [Ohm](https://ohmjs.org){target=_blank} grammar of Queries4TOSCA.
This appendix contains the [Ohm](https://ohmjs.org){target=_blank} grammar of Queries4TOSCA.

```text linenums="1"
Query {
Expand Down
4 changes: 3 additions & 1 deletion docs/docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ This page contains a collection of interesting resources such as the TOSCA speci
- [TOSCA Version 1.0](https://docs.oasis-open.org/tosca/TOSCA/v1.0/os/TOSCA-v1.0-os.html){target=_blank}
- [TOSCA Simple Profile in YAML Version 1.3](https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/os/TOSCA-Simple-Profile-YAML-v1.3-os.html){target=_blank}
- [TOSCA Version 2.0](https://docs.oasis-open.org/tosca/TOSCA/v2.0/TOSCA-v2.0.html){target=_blank}
- [Variability4TOSCA](variability4tosca/specification.md){target=_blank}
- [Variability4TOSCA](variability4tosca/specification){target=_blank}
- [Queries4TOSCA](queries4tosca/specification){target=_blank}
- [TOSCA SofDCar Profile](sofdcar/profile){target=_blank}

## Introductions

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/sofdcar/guides/location/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hardware.

## Appendix A "Service Template"

This appendix contains the complete service template of this guide.
This appendix contains the service template of this guide.
You can also download the service template [here](service-template.yaml){download=service-template.yaml}.

```yaml linenums="1"
Expand All @@ -22,7 +22,7 @@ You can also download the service template [here](service-template.yaml){downloa

## Appendix B "Type Definitions"

This appendix contains the complete type definitions of this guide.
This appendix contains the type definitions of this guide.
You can also download the type definitions [here](types.yaml){download=types.yaml}

```yaml linenums="1"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sofdcar/guides/location/types.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tosca_definitions_version: tosca_simple_yaml_1_3
imports:
- ../../tosca-sofdcar-profile.yaml
- ../../tosca-sofdcar-profile-non-normative.yaml
- ../../tosca-sofdcar-profile-extended.yaml

node_types:
example.nodes.Cloud.Service:
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/sofdcar/guides/zone/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A vehicle control unit connects both zones and also connects to some service run

## Appendix A "Service Template"

This appendix contains the complete service template of this guide.
This appendix contains the service template of this guide.
You can also download the service template [here](service-template.yaml){download=service-template.yaml}.

```yaml linenums="1"
Expand All @@ -21,7 +21,7 @@ You can also download the service template [here](service-template.yaml){downloa

## Appendix B "Type Definitions"

This appendix contains the complete type definitions of this guide.
This appendix contains the type definitions of this guide.
You can also download the type definitions [here](types.yaml){download=types.yaml}

```yaml linenums="1"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sofdcar/guides/zone/types.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tosca_definitions_version: tosca_simple_yaml_1_3
imports:
- ../../tosca-sofdcar-profile.yaml
- ../../tosca-sofdcar-profile-non-normative.yaml
- ../../tosca-sofdcar-profile-extended.yaml

node_types:
example.nodes.Cloud.Service:
Expand Down
38 changes: 23 additions & 15 deletions docs/docs/sofdcar/profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,56 @@ Various OEMs can then import provided models and integrate them into their cars.
The specification is under active development and is not backwards compatible with any previous versions.


## Normative TOSCA Type Definitions
## TOSCA SofDCar Core Profile

The normative TOSCA type definitions contain high-level type definitions which are supposed to be extended by custom types.
The core normative TOSCA type definitions contain high-level type definitions which are mainly derived from the normative TOSCA type definitions of the [TOSCA Simple Profile in YAML 1.3](https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/os/TOSCA-Simple-Profile-YAML-v1.3-os.html){target=_blank}.
These types mainly concern the following topics.

- ECU hardware and software
- HPC hardware and software
- Sensors and actuators
- Communications, such as CAN, FlexRay, and Ethernet
- Communication channels

Considering modeling communication, the TOSCA modeling approach is application centric meaning that, e.g., a CAN communication is modeled by relationships between the communicating software components and no CAN bus connected to the ECUs is modeled.
However, this might not provide all required information.
Therefore, we provide also node types to model, e.g., a CAN bus.
Therefore, we provide also a node type to model, e.g., a CAN bus.
This topic is also discussed in more detail in [TOSCA Networking](https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/os/TOSCA-Simple-Profile-YAML-v1.3-os.html#_Toc26969482){target=_blank} in which they propose to have a TOSCA model for the application and a second one for the networking.

--8<-- "sofdcar/tosca-sofdcar-profile.md"
--8<-- "sofdcar/tosca-sofdcar-profile-core.md"


## Non-Normative TOSCA Type Definitions
## TOSCA SofDCar Extended Profile

The non-normative TOSCA type definitions contain type definitions focusing on showing how the normative types can be used to model an Arduino as ECU and an Raspberry Pi as HPC.
However, since these types are non-normative they are not required to be supported.

--8<-- "sofdcar/tosca-sofdcar-profile-non-normative.md"
The extended normative TOSCA type definitions contain additional high-level type definitions which are derived from the core type definitions.
These types mainly concern specific communications, such as CAN or FlexRay, but also ECUs and HPCs, such as Arduino or Raspberry Pi.

--8<-- "sofdcar/tosca-sofdcar-profile-extended.md"

## Appendix A "TOSCA SofDCar Profile"

This appendix contains the complete TOSCA SofDCar profile.
This appendix contains the TOSCA SofDCar profile.
You can also download the profile [here](tosca-sofdcar-profile.yaml){download=tosca-sofdcar-profile.yaml}.

```yaml linenums="1"
--8<-- "sofdcar/tosca-sofdcar-profile.yaml"
```

## Appendix B "TOSCA SofDCar Profile (Non-Normative)"
## Appendix B "TOSCA SofDCar Core Profile"

This appendix contains the TOSCA SofDCar Core profile.
You can also download the profile [here](tosca-sofdcar-profile-core.yaml){download=tosca-sofdcar-profile-core.yaml}.

```yaml linenums="1"
--8<-- "sofdcar/tosca-sofdcar-profile-core.yaml"
```

## Appendix C "TOSCA SofDCar Extended Profile"

This appendix contains the complete non-normative TOSCA SofDCar profile.
You can also download the non-normative profile [here](tosca-sofdcar-profile-non-normative.yaml){download=tosca-sofdcar-profile-non-normative.yaml}.
This appendix contains the TOSCA SofDCar Extended profile.
You can also download the extended profile [here](tosca-sofdcar-profile-extended.yaml){download=tosca-sofdcar-profile-extended.yaml}.

```yaml linenums="1"
--8<-- "sofdcar/tosca-sofdcar-profile-non-normative.yaml"
--8<-- "sofdcar/tosca-sofdcar-profile-extended.yaml"
```

--8<-- "acd.md"
22 changes: 22 additions & 0 deletions docs/docs/sofdcar/tosca-sofdcar-profile-core.capability-types.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@startuml
skinparam componentStyle rectangle


rectangle "sofdcar.capabilities.Root"

rectangle "sofdcar.capabilities.Host.ECU.Software"

rectangle "sofdcar.capabilities.OperatingSystem.RealTime"

rectangle "sofdcar.capabilities.Endpoint"


"tosca.capabilities.Root" <|-- "sofdcar.capabilities.Root"

"tosca.capabilities.Container" <|-- "sofdcar.capabilities.Host.ECU.Software"

"tosca.capabilities.OperatingSystem" <|-- "sofdcar.capabilities.OperatingSystem.RealTime"

"sofdcar.capabilities.Root" <|-- "sofdcar.capabilities.Endpoint"

@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/docs/sofdcar/tosca-sofdcar-profile-core.data-types.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@startuml
skinparam componentStyle rectangle


rectangle "sofdcar.data.Root"


"tosca.datatypes.Root" <|-- "sofdcar.data.Root"

@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b026e26

Please sign in to comment.