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
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(
    self,
    diagram: context.ContextDiagram,
    params: dict[str, t.Any],
) -> None:
    self.diagram = diagram
    self.obj: m.ModelElement = self.diagram.target
    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] = {}

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
108
109
110
111
112
def collector(
    diagram: context.ContextDiagram, params: dict[str, t.Any]
) -> _elkjs.ELKInputData:
    """Main collector function for the CableTreeDiagram."""
    return CableTreeCollector(diagram, params)()