filters
Functions and registry for filter functionality.
EX_ITEMS
module-attribute
๐
EX_ITEMS = 'show.exchange.items.filter'
Show ExchangeItems
wrapped in [E1,...] and separated by ',' - filter
in Capella.
EX_ITEMS_OR_EXCH
module-attribute
๐
EX_ITEMS_OR_EXCH = 'capellambse_context_diagrams-show.exchanges.or.exchange.items.filter'
Show the names of ExchangeItem
s wrapped in [E1,...] and separated by ','
- Custom filter or the name of the ComponentExchange
or FunctionalExchange
,
not available in Capella.
FILTER_LABEL_ADJUSTERS
module-attribute
๐
FILTER_LABEL_ADJUSTERS: dict[str, Callable[[ModelElement, str | None], str]] = {EX_ITEMS: lambda obj, _: exchange_items(obj), SHOW_EX_ITEMS: exchange_name_and_items, EX_ITEMS_OR_EXCH: lambda obj, label: exchange_items(obj) if getattr(obj, 'exchange_items', '') else label or name, NO_UUID: uuid_filter, SYSTEM_EX_RELABEL: relabel_system_exchange}
Label adjuster registry.
LABEL_CONVERSION
module-attribute
๐
LABEL_CONVERSION: Final[dict[str, str]] = {'AbstractCapabilityExtend': 'extends', 'AbstractCapabilityGeneralization': 'specializes', 'AbstractCapabilityInclude': 'includes', 'CapabilityExploitation': 'exploits', 'CapabilityInvolvement': 'involves', 'EntityOperationalCapabilityInvolvement': 'involves', 'MissionInvolvement': 'involves'}
A map that for relabelling specific ModelObject types.
NO_UUID
module-attribute
๐
NO_UUID = 'capellambse_context_diagrams-hide.uuids.filter'
Filter out UUIDs from label text.
RENDER_ADJUSTERS
module-attribute
๐
RENDER_ADJUSTERS: dict[str, Callable[[bool, ModelElement, dict[str, Any]], None]] = {'sorted_exchangedItems': sort_exchange_items_label}
Available custom render parameter-solvers registry.
SHOW_EX_ITEMS
module-attribute
๐
SHOW_EX_ITEMS = 'show.functional.exchanges.exchange.items.filter'
Show the name of ComponentExchange
or FunctionalExchange
and its
ExchangeItems
wrapped in [E1,...] and separated by ',' - filter in Capella.
SYSTEM_EX_RELABEL
module-attribute
๐
SYSTEM_EX_RELABEL = 'capellambse_context_diagrams-relabel.system.analysis.exchange'
Relabel exchanges from the SystemAnalysis layer. E.g. ยซ i ยป is converted to includes or involves, based on the type.
UUID_PTRN
module-attribute
๐
UUID_PTRN = 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}\\)')
Regular expression pattern for UUIDs of ModelObject
s.
exchange_items ๐
exchange_items(obj: m.ModelElement) -> str
Return obj
's ExchangeItem
s wrapped in [E1,...] and separated
by ','.
Source code in capellambse_context_diagrams/filters.py
56 57 58 59 60 61 62 63 |
|
exchange_name_and_items ๐
exchange_name_and_items(obj: m.ModelElement, label: str | None = None) -> str
Return obj
's name and ExchangeItem
s if there are any.
Source code in capellambse_context_diagrams/filters.py
66 67 68 69 70 71 72 73 |
|
relabel_system_exchange ๐
relabel_system_exchange(obj: m.ModelElement, label: str | None) -> str
Return converted label from obj, a system exchanges.
Source code in capellambse_context_diagrams/filters.py
83 84 85 86 87 88 |
|
sort_exchange_items_label ๐
sort_exchange_items_label(value: bool, exchange: m.ModelElement, adjustments: dict[str, t.Any]) -> None
Sort the exchange items in the exchange label if value is true.
Source code in capellambse_context_diagrams/filters.py
107 108 109 110 111 112 113 114 115 116 |
|
uuid_filter ๐
uuid_filter(obj: m.ModelElement, label: str | None = None) -> str
Return obj
's name or obj
if string w/o UUIDs in it.
Source code in capellambse_context_diagrams/filters.py
76 77 78 79 80 |
|