filters
Functions and registry for filter functionality.
EX_ITEMS = 'show.exchange.items.filter'
module-attribute
๐
Show ExchangeItems
wrapped in [E1,...] and separated by ',' - filter
in Capella.
FEX_EX_ITEMS = 'show.functional.exchanges.exchange.items.filter'
module-attribute
๐
Show the name of FunctionalExchange
and its ExchangeItems
wrapped in
[E1,...] and separated by ',' - filter in Capella.
FEX_OR_EX_ITEMS = 'capellambse_context_diagrams-show.functional.exchanges.or.exchange.items.filter'
module-attribute
๐
Show either FunctionalExchange
name or its ExchangeItems
wrapped in
[E1,...] and separated by ',' - Custom filter, not available in Capella.
FILTER_LABEL_ADJUSTERS: dict[str, cabc.Callable[[common.GenericElement, str | None], str]] = {EX_ITEMS: lambda obj, _: exchange_items(obj), FEX_EX_ITEMS: exchange_name_and_items, FEX_OR_EX_ITEMS: lambda obj, label: exchange_items(obj) if getattr(obj, 'exchange_items', '') else label or obj.name, NO_UUID: uuid_filter, SYSTEM_EX_RELABEL: relabel_system_exchange}
module-attribute
๐
Label adjuster registry.
LABEL_CONVERSION: t.Final[dict[str, str]] = {'AbstractCapabilityExtend': 'extends', 'AbstractCapabilityGeneralization': 'specializes', 'AbstractCapabilityInclude': 'includes', 'CapabilityExploitation': 'exploits', 'CapabilityInvolvement': 'involves', 'EntityOperationalCapabilityInvolvement': 'involves', 'MissionInvolvement': 'involves'}
module-attribute
๐
A map that for relabelling specific ModelObject types.
NO_UUID = 'capellambse_context_diagrams-hide.uuids.filter'
module-attribute
๐
Filter out UUIDs from label text.
RENDER_ADJUSTERS: dict[str, cabc.Callable[[bool, common.GenericElement, dict[str, t.Any]], None]] = {'sorted_exchangedItems': sort_exchange_items_label}
module-attribute
๐
Available custom render parameter-solvers registry.
SYSTEM_EX_RELABEL = 'capellambse_context_diagrams-relabel.system.analysis.exchange'
module-attribute
๐
Relabel exchanges from the SystemAnalysis layer. E.g. ยซ i ยป is converted to includes or involves, based on the type.
UUID_PTRN = re.compile('\\s*\\([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\)')
module-attribute
๐
Regular expression pattern for UUIDs of ModelObject
s.
exchange_items(obj)
๐
Return obj
's ExchangeItem
s wrapped in [E1,...] and separated
by ','.
Source code in capellambse_context_diagrams/filters.py
53 54 55 56 57 58 59 60 |
|
exchange_name_and_items(obj, label=None)
๐
Return obj
's name and ExchangeItem
s if there are any.
Source code in capellambse_context_diagrams/filters.py
63 64 65 66 67 68 69 70 |
|
relabel_system_exchange(obj, label)
๐
Return converted label from obj, a system exchanges.
Source code in capellambse_context_diagrams/filters.py
80 81 82 83 84 85 86 87 |
|
sort_exchange_items_label(value, exchange, adjustments)
๐
Sort the exchange items in the exchange label if value is true.
Source code in capellambse_context_diagrams/filters.py
106 107 108 109 110 111 112 113 114 115 116 117 |
|
uuid_filter(obj, label=None)
๐
Return obj
's name or obj
if string w/o UUIDs in it.
Source code in capellambse_context_diagrams/filters.py
73 74 75 76 77 |
|