Skip to content

Commit

Permalink
docs: Add docs for and
Browse files Browse the repository at this point in the history
  • Loading branch information
huyenngn committed Jun 17, 2024
1 parent a3b5359 commit 3de28c1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/gen_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"educate Wizards": ("957c5799-1d4a-4ac0-b5de-33a65bf1519c", {}),
"Weird guy": ("098810d9-0325-4ae8-a111-82202c0d2016", {}),
"Top secret": ("5bf3f1e3-0f5e-4fec-81d5-c113d3a1b3a6", {}),
"Physical Node": ("fdb34c92-7c49-491d-bf11-dd139930786e", {}),
"Physical Behavior": ("313f48f4-fb7e-47a8-b28a-76440932fcb9", {}),
"Maintain": ("ee745644-07d7-40b9-ad7a-910dc8cbb805", {}),
}
interface_context_diagram_uuids: dict[str, tuple[str, dict[str, t.Any]]] = {
"Left to right": ("3ef23099-ce9a-4f7d-812f-935f47e7938d", {}),
Expand Down
48 changes: 44 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,52 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e
<figcaption>Context diagram of educate Wizards LogicalFunction with type [LDFB]</figcaption>
</figure>

* [`pa.PhysicalComponent`][capellambse.model.layers.pa.PhysicalComponent] (PAB)
* [`pa.PhysicalFunction`][capellambse.model.layers.pa.PhysicalFunction] (PDFB)
* [`pa.PhysicalComponent`][capellambse.model.layers.pa.PhysicalComponent] (PAB)
- ??? example "[`pa.PhysicalComponent`][capellambse.model.layers.pa.PhysicalComponent] (PAB)"

- Physical Node Component

``` py
import capellambse

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("fdb34c92-7c49-491d-bf11-dd139930786e").context_diagram
diag.render("svgdiagram").save(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Physical Component.svg" width="1000000">
<figcaption>Context of Physical Component [PAB]</figcaption>
</figure>

- Physical Behaviour Component

``` py
import capellambse

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("313f48f4-fb7e-47a8-b28a-76440932fcb9").context_diagram
diag.render("svgdiagram").save(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of PC Software.svg" width="1000000">
<figcaption>Context diagram of PC Software [PAB]</figcaption>
</figure>

* [`pa.PhysicalFunction`][capellambse.model.layers.pa.PhysicalFunction] (PDFB)

- ??? example "[`pa.PhysicalFunction`][capellambse.model.layers.pa.PhysicalFunction] (PDFB)"

``` py
import capellambse

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("ee745644-07d7-40b9-ad7a-910dc8cbb805").context_diagram
diag.render("svgdiagram").save(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Maintain Switch Firmware.svg" width="1000000">
<figcaption>Context of Maintain Switch Firmware [PDFB]</figcaption>
</figure>

#### Hierarchy in diagrams

Hierarchical diagrams are diagrams where boxes have child boxes and edges
Expand Down Expand Up @@ -206,7 +247,6 @@ The data is collected by [get_elkdata_for_exchanges][capellambse_context_diagram
<figcaption>Interface context diagram of Interface LogicalComponentExchange with type [LAB]</figcaption>
</figure>


!!! warning "Interface context only supported for the LogicalComponentExchanges"

### Customized edge routing
Expand Down

0 comments on commit 3de28c1

Please sign in to comment.