Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DSD-DBS/Capella-IFE-sample
Browse files Browse the repository at this point in the history
  • Loading branch information
vik378 committed Sep 21, 2024
2 parents 725210b + 26e069a commit 38a1222
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 37 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/push-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ jobs:
run: python -m pip install pre-commit
- name: Run Pre-Commit
run: pre-commit run --all-files

complexity-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DSD-DBS/py-capellambse/ci-templates/github/model-complexity-badge@master
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ This repo contains the "In-Flight Entertainment System" sample model,
originally maintained by the Capella developers at
<https://github.com/eclipse-capella/capella/tree/master/samples/In-Flight%20Entertainment%20System>.

Model complexity
----------------
![model complexity](./model-complexity-badge.svg)

This repo also contains some adjustments to the model as well as additional
configuration to showcase some features of
[py-capellambse](https://github.com/DSD-DBS/py-capellambse).
Expand Down
32 changes: 28 additions & 4 deletions capella2polarion_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ sa:
ComponentExchange:
links:
- allocated_functional_exchanges
serializer: add_context_diagram
serializer:
jinja_as_description:
template_folder: jinja/element_templates
template_path: component_exchange.html.j2
add_context_diagram:
filters:
- SHOW_EX_ITEMS
FunctionalExchange:
links:
- exchange_items
Expand All @@ -99,7 +105,13 @@ la:
LogicalComponent:
- links:
- allocated_functions
serializer: add_context_diagram
serializer:
jinja_as_description:
template_folder: jinja/element_templates
template_path: logical_component.html.j2
add_context_diagram:
filters:
- SHOW_EX_ITEMS
- is_actor: true
polarion_type: logicalActor
- is_actor: false
Expand All @@ -125,7 +137,13 @@ la:
Exchange Items: exchange_items
- realized_functions
ComponentExchange:
serializer: add_context_diagram
serializer:
jinja_as_description:
template_folder: jinja/element_templates
template_path: component_exchange.html.j2
add_context_diagram:
filters:
- SHOW_EX_ITEMS
links:
- allocated_functional_exchanges
FunctionalExchange:
Expand All @@ -146,7 +164,13 @@ pa:
- exchange_items
- polarion_role: physical_links
capella_attr: allocating_physical_link
serializer: add_context_diagram
serializer:
jinja_as_description:
template_folder: jinja/element_templates
template_path: component_exchange.html.j2
add_context_diagram:
filters:
- SHOW_EX_ITEMS
FunctionalExchange:
links:
- exchange_items
Expand Down
55 changes: 27 additions & 28 deletions capella2polarion_document_config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ full_authority:
- template_directory: jinja/document_templates
template: icd-interfaces-full_authority.html.j2
project_id: null # None -> Defaults to Sync Project
status_allow_list:
{# status_allow_list: # Only overwrite content when document has this status
- draft
- open
- open #}
heading_numbering: True
work_item_layouts:
componentExchange:
Expand Down Expand Up @@ -57,18 +57,16 @@ full_authority:
- id
fields_at_end:
- context_diagram
- allocated_functions
componentExchange:
logicalActor:
fields_at_start:
- id
fields_at_end:
- context_diagram
- allocated_functional_exchanges
- exchange_items
class:
show_title: False
componentExchange:
fields_at_start:
- id
fields_at_end:
- tree_view
- context_diagram
exchangeItem:
show_title: False
instances:
Expand All @@ -79,39 +77,40 @@ full_authority:
params:
uuid: {{ cmp.uuid }}
{% endfor %}
{# mixed_authority:
- template_directory: jinja/document_templates

mixed_authority:
- template_directory: jinja/document_templates/logical-architecture
heading_numbering: True
project_id: PROJECT_ID
project_id: null
work_item_layouts:
text:
show_title: False
physicalLink:
fields_at_start:
- id
physicalActor:
fields_at_start:
- id
physicalComponentActor:
logicalComponent:
fields_at_start:
- id
physicalComponentNode:
fields_at_end:
- context_diagram
logicalActor:
fields_at_start:
- id
physicalComponentBehavior:
fields_at_end:
- context_diagram
componentExchange:
fields_at_start:
- id
class:
show_title: False
fields_at_end:
- tree_view
- context_diagram
exchangeItem:
show_title: False
sections:
IcdContent: icd-interfaces-mixed_authority.html.j2
IcdContent: logical-component-mixed-authority.html.j2
instances:
- polarion_space: _default
polarion_name: NAME
polarion_title: TITLE
polarion_name: Mixed authority showcase
polarion_title: Mixed authority showcase
params:
physical_link: UUID #}
uuids:
- c8b78c78-5b11-4fc0-87b7-3ca84622efea # Aircraft
- d475ed7d-4644-4461-97d4-b52772c9b425 # Ground Operator
- 4890eae8-7a62-4d7b-bf8a-1590a199eebf # Cabin Crew
- 181a678c-dca9-46c1-9d18-b5a0c457c0de # Passenger
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div id="polarion_wiki macro name=page_break" contentEditable="false" data-is-landscape="false"></div>
{{ heading(2, "Introduction", session)}}
<p>
This Interface Control Document only covers software message based communication (application layer) between ETCS compatible components.
This Interface Control Document only covers software message based communication (application layer) between compatible components.
At the moment physical interface definition is not in scope for this document.
The scope of the document covers Interface Requirements and Definition
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
{% from 'icd-interfaces-common.html.j2' import render_content %}

{% set physical_link = model.by_uuid(physical_link) %}
{{ render_content(physical_link, model, session) }}
{{ render_content(physical_link, model, session) }}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% macro render_content(component, model, session) %}
{{ heading(2, component.name, session)}}
{{ heading(3, "Logical Component Context", session)}}
<workitem id="interface_partners">The figure below provides an overview of the logical subsystem and external entities that either require the functionality of <b>{{ component.name }}</b> (expect outputs) or enable it (provide inputs). The figure also identifies the interfaces between the subsystem and its environment.</workitem>
<workitem id="interface_partners-{{ component.uuid }}">The figure below provides an overview of the logical subsystem and external entities that either require the functionality of <b>{{ component.name }}</b> (expect outputs) or enable it (provide inputs). The figure also identifies the interfaces between the subsystem and its environment.</workitem>
{{ insert_work_item(component, session) }}
{{ heading(3, "Logical interface partners of " + component.name, session) }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
#}
{% from 'logical-common.html.j2' import render_content %}

{% for uuid in uuids %}
{% set component = model.by_uuid(uuid) %}
{{ render_content(component, model, session) }}
{% endfor %}
2 changes: 0 additions & 2 deletions jinja/element_templates/common_macros.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@
{% macro description(obj) %}
{% if obj.description %}
<p>{{ obj.description | safe }}</p>
{% else %}
<p style="color:red">No description available.</p>
{% endif %}
{% endmacro %}

Expand Down
50 changes: 50 additions & 0 deletions jinja/element_templates/component_exchange.html.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{#
Copyright DB InfraGO AG and contributors
SPDX-License-Identifier: Apache-2.0
#}

{% from 'common_macros.html.j2' import linked_name_with_icon %}
{% from 'polarion_props.j2' import table_attributes, th_attributes, td_attributes %}

{% macro describe_exchange(object) %}
{%- set source_function = object.source.owner -%}
{%- set target_function = object.target.owner -%}
{%- set source = source_function.owner -%}
{%- set target = target_function.owner -%}
The {{ linked_name_with_icon(source) | safe }} shall provide {{ linked_name_with_icon(object) | safe }} to {{ linked_name_with_icon(target) | safe }} so that the {{ linked_name_with_icon(target) | safe }} could {{ linked_name_with_icon(target_function) | safe }}.
{% endmacro %}

<span style="font-weight: bold;font-size: 12pt;line-height: 1.5;">Interface Partners</span>
<p>This logical interface connects between {{ linked_name_with_icon(object.source.owner) | safe}} and {{ linked_name_with_icon(object.target.owner) | safe}}.</p>
<p>The need for the interface is explained and requirements are provided so that the interface partners could find an appropriate interface definition (solution).</p>
<span style="font-weight: bold;font-size: 12pt;line-height: 1.5;">Enabled interactions</span>
<p>This interface enables the following interactions:</p>
<table {{table_attributes}}>
<thead>
<tr>
<th {{th_attributes}}>ID</th>
<th {{th_attributes}}>Interaction description</th>
</tr>
</thead>
<tbody>
{% for exchange in object.allocated_functional_exchanges %}
<tr>
<td {{td_attributes}}>{{ linked_name_with_icon(exchange) | safe }}</td>
<td {{td_attributes}}>
{{ describe_exchange(exchange) | safe }}
{% if exchange.exchange_itemslength > 1 %}
<p>{{ exchange.name }} is further specified via the following Exchange Items:</p>
<ul>
{% for item in exchange.exchange_items %}
<li>{{ linked_name_with_icon(item) | safe }}</li>
{% endfor %}
</ul>
{% elif exchange.exchange_items %}
<p>This interaction is further specified via {{ linked_name_with_icon(exchange.exchange_items[0]) | safe}}.</p>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>

21 changes: 21 additions & 0 deletions jinja/element_templates/logical_component.html.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{#
Copyright DB InfraGO AG and contributors
SPDX-License-Identifier: Apache-2.0
#}

{% from 'common_macros.html.j2' import show_other_attributes, description %}

{{ description(object) | safe }}

{%- for fnc in object.allocated_functions -%}
{%- if loop.first -%}
<h1>Allocated functions</h1>
{%- endif -%}

<h2>{{ fnc.name }}</h2>
{{ description(fnc) | safe }}
{%- endfor -%}

<p>
The figure below provides an overview of the logical subsystem and external entities that either require the functionality of <b>{{ object.name }}</b> (expect outputs) or enable it (provide inputs). The figure also identifies the interfaces between the subsystem and its environment.
</p>
38 changes: 38 additions & 0 deletions model-complexity-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 38a1222

Please sign in to comment.