mbdlyb.functional.capella_import

Capella model import utilities for functional analysis.

This module provides tools to transform Capella models (from Melody Modeling) into functional model clusters suitable for MBDlyb analysis. The transformation process:

  • Builds component and function trees from Capella architecture

  • Establishes functional dependencies and relations

  • Creates diagnostic tests and results

  • Manages error propagation and observation paths

  • Optionally imports operating mode specifications

Type aliases:

FN_GDB_NODE: Graph database node type (GFunctionalNode or GCluster) FN_GDB_NODE_ID: Tuple of node type and identifier string PVMT_DICT: Dictionary structure for PVMT (CAPELLA metadata) data

Attributes

FN_GDB_NODE

FN_GDB_NODE_ID

PVMT_DICT

Classes

CapellaToCluster

Transformer for converting Capella models to functional model clusters.

Module Contents

class mbdlyb.functional.capella_import.CapellaToCluster(aird: str, queue: multiprocessing.Queue | None = None)

Transformer for converting Capella models to functional model clusters.

This class orchestrates the multi-step transformation of a Capella model into a Cluster object suitable for functional analysis and diagnosis. The transformation supports multiple architectural layers (logical, physical), automatic diagnostic test generation, and operating mode import.

Variables:
  • _aird (str) – Path to the Capella AIRD model file.

  • _model (MelodyModel) – Loaded Capella model.

  • _architecture (cs.ComponentArchitecture) – Target architecture.

  • _cluster (GCluster) – Resulting functional model cluster.

  • _elements (dict) – Mapping of node types to created elements.

  • _diagnostic_test_mapping (dict) – Mapping test results to observables.

  • _function_to_test_result_mapping (dict) – Function to test result mappings.

  • _capella_fns (dict) – Capella function objects by identifier.

  • _error_code_nodes (dict) – Error code nodes by identifier.

transform(architecture: str, default_fn_tests: bool = False, default_hl_fn_tests: bool = False, default_hw_tests: bool = False, default_ll_hw_tests: bool = False, import_opms: bool = False) → mbdlyb.functional.gdb.GCluster

Transform Capella architecture to a functional model cluster.

Orchestrates the complete transformation process including building component/function trees, establishing relations, creating tests, and importing optional configurations.

Parameters:
  • architecture (str) – Architecture to import (‘logical’ or ‘physical’).

  • default_fn_tests (bool) – Generate tests for all functions. Defaults to False.

  • default_hl_fn_tests (bool) – Generate tests only for high-level functions. Defaults to False.

  • default_hw_tests (bool) – Generate tests for all hardware. Defaults to False.

  • default_ll_hw_tests (bool) – Generate tests only for low-level hardware. Defaults to False.

  • import_opms (bool) – Import operating modes. Defaults to False.

Returns:

The transformed functional model cluster.

Return type:

GCluster

type mbdlyb.functional.capella_import.FN_GDB_NODE = Type[GFunctionalNode | GCluster]
type mbdlyb.functional.capella_import.FN_GDB_NODE_ID = Tuple[FN_GDB_NODE, str]
type mbdlyb.functional.capella_import.PVMT_DICT = dict[str, dict[str, Any]]