-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
~ SPDX-FileCopyrightText: 2022 Copyright DB InfraGO AG and the capellambse-context-diagrams contributors | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
# Cable Tree View Diagram | ||
|
||
The `Cable Tree View` diagram visualizes the cable connections between ports. You can access `.cable_tree` on any `pa.PhysicalLink` element. | ||
|
||
??? example "Cable Tree View of Control Signal" | ||
|
||
``` py | ||
import capellambse | ||
|
||
model = capellambse.MelodyModel("tests/data/ContextDiagram.aird") | ||
diag = model.by_uuid("5c55b11b-4911-40fb-9c4c-f1363dad846e").cable_tree | ||
diag.render("svgdiagram").save(pretty=True) | ||
``` | ||
<figure markdown> | ||
<img src="../assets/images/Cable Tree View of Control Signal.svg"> | ||
<figcaption>[LAB] Cable Tree View of Control Signal</figcaption> | ||
</figure> | ||
|
||
## Check out the code | ||
|
||
To understand the collection have a look into the | ||
[`cable_tree`][capellambse_context_diagrams.collectors.cable_tree] | ||
module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# SPDX-FileCopyrightText: 2022 Copyright DB InfraGO AG and the capellambse-context-diagrams contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import capellambse | ||
import pytest | ||
|
||
|
||
@pytest.mark.parametrize("uuid", ["5c55b11b-4911-40fb-9c4c-f1363dad846e"]) | ||
@pytest.mark.parametrize("fmt", ["svgdiagram", "svg", None]) | ||
def test_exchange_item_relation_views( | ||
model: capellambse.MelodyModel, uuid: str, fmt: str | ||
) -> None: | ||
obj = model.by_uuid(uuid) | ||
|
||
diag = obj.cable_tree | ||
diag.render("svgdiagram").save(pretty=True) | ||
|
||
assert diag.render(fmt) |