Skip to content

Commit

Permalink
Add support for variant and component reports
Browse files Browse the repository at this point in the history
  • Loading branch information
xxthunder authored and code-steadfast committed Jan 9, 2024
1 parent 538a20a commit e1a0714
Show file tree
Hide file tree
Showing 31 changed files with 199 additions and 172 deletions.
35 changes: 18 additions & 17 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"recommendations": [
"mhutchie.git-graph",
"ms-vscode.cmake-tools",
"twxs.cmake",
"ms-vscode.cpptools",
"ms-vscode.cpptools-themes",
"visualstudioexptteam.intellicode-api-usage-examples",
"visualstudioexptteam.vscodeintellicode",
"haugerbr.project-tasks",
"avengineers.show-link-list",
"ms-python.vscode-pylance",
"ms-python.python",
"donjayamanne.python-environment-manager",
"felipecaputo.git-project-manager",
"ms-vscode.powershell"
]
}
"recommendations": [
"mhutchie.git-graph",
"ms-vscode.cmake-tools",
"twxs.cmake",
"ms-vscode.cpptools",
"ms-vscode.cpptools-themes",
"visualstudioexptteam.intellicode-api-usage-examples",
"visualstudioexptteam.vscodeintellicode",
"haugerbr.project-tasks",
"avengineers.show-link-list",
"ms-python.vscode-pylance",
"ms-python.python",
"donjayamanne.python-environment-manager",
"felipecaputo.git-project-manager",
"ms-vscode.powershell",
"waderyan.gitblame"
]
}
17 changes: 10 additions & 7 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"**/test_results.rst", # We renamed this file, but nobody deletes it.
]

include_patterns = ["index.rst", "coverage.rst", "definitions.rst", "doc/**"]
include_patterns = ["index.rst", "doc/**"]

# configuration of built-in stuff ###########################################
# @see https://www.sphinx-doc.org/en/master/usage/configuration.html
Expand Down Expand Up @@ -164,24 +164,27 @@ def tr_link(app, need, needs, first_option_name, second_option_name, *args, **kw
"results": "[[tr_link('title', 'case')]]",
}

# Provide all config values to jinja
html_context = {
"build_config": {},
"config": {},
}

# Check if the SPHINX_BUILD_CONFIGURATION_FILE environment variable exists
# and if so, load the JSON file and set the 'html_context' variable
if "SPHINX_BUILD_CONFIGURATION_FILE" in os.environ:
with open(os.environ["SPHINX_BUILD_CONFIGURATION_FILE"], "r") as file:
html_context = json.load(file)
include_patterns.extend(html_context.get("include_patterns", []))

html_context["config"] = {}
html_context["build_config"] = json.load(file)
include_patterns.extend(html_context["build_config"].get("include_patterns", []))

# Check if the SPHINX_BUILD_CONFIGURATION_FILE environment variable exists
# and if so, load the JSON file and set the 'html_context' variable
if "AUTOCONF_JSON_FILE" in os.environ:
with open(os.environ["AUTOCONF_JSON_FILE"], "r") as file:
html_context["config"] = json.load(file)["features"]


if "VARIANT" in os.environ:
html_context["config"]["variant"] = os.environ["VARIANT"]
html_context["build_config"]["variant"] = os.environ["VARIANT"]


def rstjinja(app, docname, source):
Expand Down
4 changes: 0 additions & 4 deletions coverage.rst

This file was deleted.

File renamed without changes.
31 changes: 0 additions & 31 deletions doc/common/sw_architecture/index.rst

This file was deleted.

23 changes: 0 additions & 23 deletions doc/common/variants/index.rst

This file was deleted.

23 changes: 23 additions & 0 deletions doc/components/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Components
==========

{% for component_info in build_config.components_info %}
{% if component_info.has_docs %}

{{ component_info.long_name }}
--------------------

.. toctree::
:maxdepth: 2

/{{ component_info.path }}/doc/index
{% if component_info.has_tests %}
/{{ component_info.output_dir }}/unit_test_spec
/{{ component_info.output_dir }}/unit_test_results
/{{ component_info.output_dir }}/doxygen/html/index
/{{ component_info.output_dir }}/coverage
{% endif %}


{% endif %}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
Customer Requirements
=====================


Customer A - Disco Light
------------------------

Customer A requests a Disco Light that shall offer an ambient lighting experience that resonates with the rhythm of the surroundings.

* RQ-1: The lighting shall automatically sync with any ambient music, adjusting its blink rate to match the beats or rhythm.
* RQ-2: Users shall have the freedom to choose a specific color for the light. However, in the absence of a user-defined color, the software shall delight the user with randomized colors, ensuring an authentic disco experience.
* RQ-3: As the essence of a disco environment is dynamic and lively, light transitions shall happen instantaneously without any lag.
* RQ-4: The illumination provided shall be vibrant and noticeable, ranging from medium to high levels to keep up with the lively ambiance of disco settings.


Customer B - Sleep Light
------------------------

Customer B requests a sleep light offering an ambient lighting experience that facilitate a calm and restful environment.

* RQ-1: The light emitted shall be constant without any blink, ensuring a non-disruptive environment for rest.
* RQ-2: Color of the light shall be fixed to a warm white, known for its soothing and calming properties.
* RQ-3: The brightness of the light shall be adjustable.
* RQ-4: The light color shall be blue.


Customer C - Spa Light
----------------------

Customer C requests a spa light encapsulating a tranquil and rejuvenating experience, reminiscent of real-world spa environments.

* RQ-1: The light shall have a slow, rhythmic blink that gives a sensation of calm and peace.
* RQ-2: Instead of a single color, the lighting shall cycle through multiple predefined colors that are commonly associated with relaxation and tranquility.
* RQ-3: Transitions between colors shall be smooth and seamless, ensuring a continuous flow of relaxation.
* RQ-4: The brightness of the light shall be adjustable.
Customer Requirements
=====================


Customer A - Disco Light
------------------------

Customer A requests a Disco Light that shall offer an ambient lighting experience that resonates with the rhythm of the surroundings.

* RQ-1: The lighting shall automatically sync with any ambient music, adjusting its blink rate to match the beats or rhythm.
* RQ-2: Users shall have the freedom to choose a specific color for the light. However, in the absence of a user-defined color, the software shall delight the user with randomized colors, ensuring an authentic disco experience.
* RQ-3: As the essence of a disco environment is dynamic and lively, light transitions shall happen instantaneously without any lag.
* RQ-4: The illumination provided shall be vibrant and noticeable, ranging from medium to high levels to keep up with the lively ambiance of disco settings.


Customer B - Sleep Light
------------------------

Customer B requests a sleep light offering an ambient lighting experience that facilitate a calm and restful environment.

* RQ-1: The light emitted shall be constant without any blink, ensuring a non-disruptive environment for rest.
* RQ-2: Color of the light shall be fixed to a warm white, known for its soothing and calming properties.
* RQ-3: The brightness of the light shall be adjustable.
* RQ-4: The light color shall be blue.


Customer C - Spa Light
----------------------

Customer C requests a spa light encapsulating a tranquil and rejuvenating experience, reminiscent of real-world spa environments.

* RQ-1: The light shall have a slow, rhythmic blink that gives a sensation of calm and peace.
* RQ-2: Instead of a single color, the lighting shall cycle through multiple predefined colors that are commonly associated with relaxation and tranquility.
* RQ-3: Transitions between colors shall be smooth and seamless, ensuring a continuous flow of relaxation.
* RQ-4: The brightness of the light shall be adjustable.
9 changes: 0 additions & 9 deletions doc/index.rst

This file was deleted.

31 changes: 30 additions & 1 deletion doc/software_architecture/index.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
Software Architecture
#####################
=====================

Components
----------

.. image:: _figures/sw_arch_component_diagram.svg

Feature Model
-------------

.. image:: _figures/feature_model.svg


* BlinkRate
* None
* Fixed
* Music-adjusted

* Color
* Fixed
* Randomized
* Multiple predefined

* Transition
* Smooth
* Immediate

* Brightness
* Fixed
* Adjustable
7 changes: 0 additions & 7 deletions doc/software_requirements/index.rst

This file was deleted.

6 changes: 3 additions & 3 deletions doc/test_report_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ Passed test cases
-----------------

.. needtable::
:filter: type == '{case_need}' and 'passed' == result
:filter: '{id}' in tags and type == '{case_need}' and 'passed' == result
:columns: id, title, is resulted from
:style: table

Failed test cases
-----------------

.. needtable::
:filter: type == '{case_need}' and 'failure' == result
:filter: '{id}' in tags and type == '{case_need}' and 'failure' == result
:columns: id, title, is resulted from
:style: table

Skipped test cases
------------------

.. needtable::
:filter: type == '{case_need}' and 'skipped' == result
:filter: '{id}' in tags and type == '{case_need}' and 'skipped' == result
:columns: id, title, is resulted from
:style: table

Expand Down
26 changes: 26 additions & 0 deletions doc/variants/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Variants
========

Disco Light
-----------

* Blink Rate: Music-adjusted
* Color: User-defined or randomized
* Transition: Immediate
* Brightness: Medium to High

Sleep Light
-----------

* Blink Rate: None (constant light)
* Color: Fixed (e.g., Warm White)
* Transition: None
* Brightness: Low

Spa Light
---------

* Blink Rate: Slow
* Color: Multiple predefined colors
* Transition: Smooth
* Brightness: Medium
43 changes: 36 additions & 7 deletions index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
Software Component Report
=========================

**Variant:** {{ config.variant }}

{{ generated_rst_content }}
coverage
{% if build_config.component_info %}

Software Component Report
#########################

| **Variant:** {{ build_config.variant }}
| **Component:** {{ build_config.component_info.long_name }}
.. toctree::
:maxdepth: 2

{{ build_config.component_info.path }}/doc/index
{% if build_config.component_info.has_tests %}
{{ build_config.component_info.output_dir }}/unit_test_spec
{{ build_config.component_info.output_dir }}/unit_test_results
{{ build_config.component_info.output_dir }}/doxygen/html/index
{{ build_config.component_info.output_dir }}/coverage
{% endif %}

{% else %}

Variant Report
##############

**Variant:** {{ build_config.variant }}

.. toctree::
:maxdepth: 1
:caption: Contents

doc/customer_requirements/index
doc/software_architecture/index
doc/variants/index
doc/components/index

{% endif %}
2 changes: 1 addition & 1 deletion src/brightness_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
spl_add_source(src/brightness_controller.c)
spl_add_test_source(test/test_brightness_controller.cc)
spl_create_component()
spl_create_component(LONG_NAME "Brightness Controller")
Loading

0 comments on commit e1a0714

Please sign in to comment.