Skip to content

Commit

Permalink
merge: Add icons for Physical Layer Diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuestengecko committed Nov 2, 2023
2 parents d62d953 + 1fa64ad commit 0b390c1
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 43 deletions.
9 changes: 9 additions & 0 deletions capellambse/aird/_box_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ def part_factory(seb: C.SemanticElementBuilder) -> diagram.Box:

seb.styleclass = abstract_obj.attrib[C.ATT_XST].split(":")[-1]
assert seb.styleclass is not None
if seb.styleclass.startswith("Physical"):
seb.styleclass = "".join(
(
"Physical",
abstract_obj.get("nature", "Node").capitalize(),
seb.styleclass[len("Physical") :],
)
)

if seb.styleclass.endswith("Component"):
seb.styleclass = "".join(
(
Expand Down
9 changes: 8 additions & 1 deletion capellambse/svg/decorations.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@
"Note",
"RepresentationLink",
"OperationalActivity",
"PhysicalComponent",
"PhysicalBehaviorComponent",
"PhysicalBehaviorHumanComponent",
"PhysicalBehaviorActor",
"PhysicalBehaviorHumanActor",
"PhysicalNodeComponent",
"PhysicalNodeHumanComponent",
"PhysicalNodeActor",
"PhysicalNodeHumanActor",
}


Expand Down
10 changes: 9 additions & 1 deletion capellambse/svg/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"ErrorSymbol",
"RequirementSymbol",
"RepresentationLinkSymbol",
"StickFigureSymbol",
),
"Error": (),
"Class Diagram Blank": ("ClassSymbol",),
Expand All @@ -40,7 +41,6 @@
"LogicalHumanActorSymbol",
"LogicalHumanComponentSymbol",
"PortSymbol",
"StickFigureSymbol",
"FunctionalExchangeSymbol",
"ComponentExchangeSymbol",
),
Expand Down Expand Up @@ -88,6 +88,14 @@
),
"Physical Architecture Blank": (
"PhysicalLinkSymbol",
"PhysicalBehaviorComponentSymbol",
"PhysicalBehaviorHumanComponentSymbol",
"PhysicalBehaviorActorSymbol",
"PhysicalBehaviorHumanActorSymbol",
"PhysicalNodeComponentSymbol",
"PhysicalNodeHumanComponentSymbol",
"PhysicalNodeActorSymbol",
"PhysicalNodeHumanActorSymbol",
"ComponentExchangeSymbol",
"ComponentPortSymbol",
"PortSymbol",
Expand Down
Loading

0 comments on commit 0b390c1

Please sign in to comment.