Skip to content

cable_tree

This module defines the collector for the CableTreeDiagram.

CableTreeCollector 🔗

CableTreeCollector(diagram: context.ContextDiagram, params: dict[str, t.Any])

Collect the context for PhysicalLink trees.

Source code in capellambse_context_diagrams/collectors/cable_tree.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def __init__(
    self,
    diagram: context.ContextDiagram,
    params: dict[str, t.Any],
) -> None:
    self.diagram = diagram
    self.src_port_obj: m.ModelElement = self.diagram.target.source
    self.tgt_port_obj: m.ModelElement = self.diagram.target.target
    self.src_obj: m.ModelElement = self.src_port_obj.owner
    self.tgt_obj: m.ModelElement = self.tgt_port_obj.owner
    self.data = makers.make_diagram(diagram)
    self.data.layoutOptions = DEFAULT_LAYOUT_OPTIONS
    self.params = params
    self.boxes: dict[str, _elkjs.ELKInputChild] = {}
    self.edges: dict[str, _elkjs.ELKInputEdge] = {}
    self.ports: dict[str, _elkjs.ELKInputPort] = {}
    self.common_owner: str | None = None

collector 🔗

collector(diagram: context.ContextDiagram, params: dict[str, t.Any]) -> _elkjs.ELKInputData

Main collector function for the CableTreeDiagram.

Source code in capellambse_context_diagrams/collectors/cable_tree.py
118
119
120
121
122
def collector(
    diagram: context.ContextDiagram, params: dict[str, t.Any]
) -> _elkjs.ELKInputData:
    """Main collector function for the CableTreeDiagram."""
    return CableTreeCollector(diagram, params)()