From ae53ca0a4a1b3ff0a87b7e983c7959a1331d3dbc Mon Sep 17 00:00:00 2001 From: MFK-18 <61701871+MFK-18@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:58:11 +0200 Subject: [PATCH 1/3] commit message --- templates/common_macros.html.j2 | 2 +- .../system-analysis/system_function.html.j2 | 40 ++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/templates/common_macros.html.j2 b/templates/common_macros.html.j2 index 23c249c..3d6570e 100644 --- a/templates/common_macros.html.j2 +++ b/templates/common_macros.html.j2 @@ -88,7 +88,7 @@ {%- endfor -%} {%- set realized_objects = object[realized_attrs | first] if realized_attrs else None -%} {%- set realizing_objects = object[realizing_attrs | first] if realizing_attrs else None -%} - +

Traceability

{% if realized_objects %}

{{ object.name }} realizes the following objects:

diff --git a/templates/system-analysis/system_function.html.j2 b/templates/system-analysis/system_function.html.j2 index b60b099..51903fd 100644 --- a/templates/system-analysis/system_function.html.j2 +++ b/templates/system-analysis/system_function.html.j2 @@ -36,6 +36,44 @@ {{ object.context_diagram.as_svg | safe }} +

Inputs and Outputs

+

{% set cache = namespace(currentLevel='1', hnr=1, h1=0, h2=0, h3=0, h4=0, h5=0, h6=0, temp0=[], primaryId='', found=false) %}

+

+ Inputs +

+

{% set cache.InfoIsPrinted = False %}

+

{% if object.inputs|length == 0 %}No exchanges consumed by function {{object.name}}.{% endif %}

+

{% for inp in object.inputs %}{% for iExch in inp.exchanges|sort(attribute='name', reverse=False) %}{# FOR 1, 2 ##}

+

{% if not cache.InfoIsPrinted %}

+

{% set cache.InfoIsPrinted = True %}

+

The following exchanges are consumed by the function {{object.name}}:

+

{% endif%}

+ +

{% endfor %}{% endfor %}{# FOR 1, 2 ##}

+

+ Outputs +

+

{% set cache.InfoIsPrinted = False %}

+

{% if object.outputs|length == 0 %}No exchanges are provided by function {{object.name}}.{% endif %}

+

{% for outp in object.outputs %}{% for iExch in outp.exchanges %}{# FOR 1, 2 ##}

+

{% if not cache.InfoIsPrinted %}

+

{% set cache.InfoIsPrinted = True %}

+

The following exchanges are provided by the function {{object.name}}:

+

{% endif%}

+ +

{% endfor %}{% endfor %}{# FOR 1, 2 ##}

+ + + + + +

Other properties of "{{ object.name }}"

-{% set excluded = ["context_diagram", "description", "name", "owner", "xtype"] %} +{% set excluded = ["context_diagram", "description", "name", "owner", "xtype","inputs","outputs"] %} {{ show_other_attributes(object, excluded) | safe}} From 92193c30fbc5d565b1aebf241642804b2f3c0ac5 Mon Sep 17 00:00:00 2001 From: MFK-18 <61701871+MFK-18@users.noreply.github.com> Date: Thu, 2 May 2024 16:36:41 +0200 Subject: [PATCH 2/3] FEAT: Updated system functions template with functional exchanges(according to viktors comment) --- .../system-analysis/system_function.html.j2 | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/templates/system-analysis/system_function.html.j2 b/templates/system-analysis/system_function.html.j2 index 51903fd..ed9781b 100644 --- a/templates/system-analysis/system_function.html.j2 +++ b/templates/system-analysis/system_function.html.j2 @@ -37,17 +37,17 @@ {{ object.context_diagram.as_svg | safe }}

Inputs and Outputs

-

{% set cache = namespace(currentLevel='1', hnr=1, h1=0, h2=0, h3=0, h4=0, h5=0, h6=0, temp0=[], primaryId='', found=false) %}

+{% set cache = namespace(currentLevel='1', hnr=1, h1=0, h2=0, h3=0, h4=0, h5=0, h6=0, temp0=[], primaryId='', found=false) %}

Inputs

-

{% set cache.InfoIsPrinted = False %}

+{% set cache.InfoIsPrinted = False %}

{% if object.inputs|length == 0 %}No exchanges consumed by function {{object.name}}.{% endif %}

-

{% for inp in object.inputs %}{% for iExch in inp.exchanges|sort(attribute='name', reverse=False) %}{# FOR 1, 2 ##}

-

{% if not cache.InfoIsPrinted %}

-

{% set cache.InfoIsPrinted = True %}

+{% for inp in object.inputs %}{% for iExch in inp.exchanges|sort(attribute='name', reverse=False) %}{# FOR 1, 2 ##} +{% if not cache.InfoIsPrinted %} +{% set cache.InfoIsPrinted = True %}

The following exchanges are consumed by the function {{object.name}}:

-

{% endif%}

+{% endif%}