FLYNC Model

Hint

The main entry point for any FLYNC Model is this class.

Expand for Schematic
        classDiagram

    class FLYNCModel {
        general: FLYNCGeneralConfig | None = None
        ecus: list[ECU]
        topology: FLYNCTopology
        metadata: SystemMetadata
    }

    class NamingStrategy {
        <<Enumeration>>
        AUTO: int = 0
        FIELD_NAME: int = 0
        FIXED_PATH: int = 1
    }

    class OutputStrategy {
        <<Enumeration>>
        AUTO: int = 1
        FOLDER: int = 1
        SINGLE_FILE: int = 2
        OMMIT_ROOT: int = 4
        FIXED_ROOT: int = 8
    }

    class VirtualControllerInterface {
        name: str
        vlanid: int
        addresses: list[IPv6AddressEndpoint | IPv4AddressEndpoint]
        multicast: list[IPvAnyAddress | MacAddress] | None = []
    }

    class VLANEntry {
        name: str
        id: int
        default_priority: int
        ports: list[str]
        multicast: list[MulticastGroup] | None = []
    }

    class FLYNCBaseModel {
    }

    class ECU {
        name: str
        ports: list[ECUPort] = list
        controllers: list[Controller]
        switches: list[Switch] | None = list
        topology: InternalTopology
        ecu_metadata: ECUMetadata
        sockets: list[SocketContainer] | None = list
    }

    class ECUPort {
        name: str
        mdi_config: BASET1 | BASET1S | BASET = BASET1
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
    }

    class FLYNCGeneralConfig {
        tcp_profiles: list[TCPOption] = []
        someip_config: SOMEIPConfig | None = None
    }

    class FLYNCTopology {
        system_topology: SystemTopology
        multicast_paths: MulticastConfig | None = None
    }

    class SystemMetadata {
        type: Literal['system'] = 'system'
        author: str
        compatible_flync_version: BaseVersion
        extensions: dict[str, str] | None = None
        oem: str | None = None
        platform: str | None = None
        variant: str | None = None
        release: BaseVersion
    }

    ECU ..> ECUMetadata
    ECU ..> ECUPort
    ECU ..> SocketContainer
    ECU ..> Switch
    ECU ..> InternalTopology
    ECU ..> Controller
    ECUPort ..> XFI
    ECUPort ..> BASET1S
    ECUPort ..> MII
    ECUPort ..> BASET1
    ECUPort ..> BASET
    ECUPort ..> RMII
    ECUPort ..> SGMII
    ECUPort ..> RGMII
    VirtualControllerInterface ..> MacAddress
    VirtualControllerInterface ..> IPv4AddressEndpoint
    VirtualControllerInterface ..> IPv6AddressEndpoint
    VirtualControllerInterface ..> IPvAnyAddress
    VLANEntry ..> MulticastGroup
    FLYNCGeneralConfig ..> TCPOption
    FLYNCGeneralConfig ..> SOMEIPConfig
    SystemMetadata ..> BaseVersion
    FLYNCTopology ..> SystemTopology
    FLYNCTopology ..> MulticastConfig
    FLYNCModel ..> ECU
    FLYNCModel ..> FLYNCTopology
    FLYNCModel ..> FLYNCGeneralConfig
    FLYNCModel ..> SystemMetadata


    
class FLYNCModel

Bases: FLYNCBaseModel

Represents the top-level FLYNC configuration model for a system.

This model aggregates all ECUs, system topology, metadata, and general configuration settings for the entire system.

Parameters

ecuslist of ECU

List of ECU definitions included in the system.

topologyFLYNCTopology

The system-wide topology including external ECU connections and optional multicast paths.

metadataSystemMetadata

System-level metadata including OEM, platform, and hardware/software information.

generalFLYNCGeneralConfig

, optional Optional general configuration settings applicable system-wide.

validate_unique_ips()

Validate all IPs are unique system wide

get_all_ecus()

Return a list of all ECU names.

get_ecu_by_name(ecu_name: str)

Retrieve an ECU by name.

get_all_controllers()

Return a list of all controllers in all ECUs.

get_all_ecu_ports() List[ECUPort]

Return a list of all ECU ports

get_all_interfaces_names()

Return all the controller interface names

get_interfaces_for_ecu(ecu_name: str)

Return a list of all interfaces for a given ECU.

get_system_topology_info()

Return system topology details.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.