Main Content

getSourceElement

获取在源端口上选择的数据元素以进行连接

    Description

    例子

    selectedElems= getSourceElement(连接or在连接的源端口上获取所选的数据元素。

    Examples

    collapse all

    Get the selected data element on the source port for a connection.

    Create a model and get its root architecture.

    modelName =“ ArchModel”;Arch = SystemComposer.CreateModel(modelName,true);rootArch = get(Arch,“建筑学”);

    一个dd a component, create an input port on the component, create an input port on the architecture. and extract both component port objects.

    newComponent = addComponent(rootArch,“ component1”);inportcomp = addport(newcomponent.architecture,..."testSig1",,,,“在”);inPortArch = addPort(rootArch,"testSig1",,,,“在”);compdestport = getport(newcomponent,"testSig1");ArchSrcport = getport(rootarch,"testSig1");

    一个dd data interface, create data element, and set the data interface on the architecture port.

    interface = arch.InterfaceDictionary.addInterface(“接口1”);interface.addElement(“X”);ArchSrcport.setInterface(接口);

    连接端口并获取连接器的源元素。

    conns = connect(ArchSrcport,compdestport,sourceElement =“X”);elem = getSourceElement(conns)
    elem = 1×1单元格数组{'x'}

    输入参数

    collapse all

    端口之间的连接,指定为SystemComposer.arch.connectorobject.

    输出参数

    collapse all

    选定的数据元素名称,返回为字符向量。

    数据类型:char

    更多关于

    collapse all

    定义

    学期 Definition 一个pplication 更多信息
    architecture

    系统作曲家™architecture代表组件系统以及它们如何在结构和行为上相互接口。您可以使用替代视图表示特定的体系结构。

    不同类型的体系结构描述了系统的不同方面:

    • Functional architecturedescribes the flow of data in a system.

    • 逻辑架构描述系统的预期操作。

    • 物理体系结构描述系统中的平台或硬件。

    在视觉上撰写体系结构
    model

    系统作曲家modelis the file that contains architectural information, including components, ports, connectors, interfaces, and behaviors.

    在模型上执行操作:

    • Extract the root-level architecture contained in the model.

    • 应用轮廓。

    • Link interface data dictionaries.

    • 从模型体系结构生成实例。

    系统作曲家模型存储为SLX文件。

    Create Architecture Model with Interfaces and Requirement Links
    零件

    一个零件是在体系结构中实现明确功能的系统的一个非平凡,几乎独立且可更换的部分。组件定义了构建元素,例如功能,系统,硬件,软件或其他概念实体。组件也可以是子系统或子函数。

    组件表示为块,是可以将可重复使用的伪像的体系结构模型的一部分。

    成分
    港口

    一个港口is a node on a component or architecture that represents a point of interaction with its environment. A port permits the flow of information to and from other components or systems.

    There are different types of ports:

    • 零件港口s是其他组件的组件上的交互点。

    • 一个rchitecture ports是系统边界上的端口,无论边界在组件内还是整体体系结构模型内。

    Ports
    连接or

    Connectorsare lines that provide connections between ports. Connectors describe how information flows between components or architectures.

    连接器允许两个组件进行交互,而无需定义交互的性质。在端口上设置一个接口以定义组件如何交互。

    连接

    学期 Definition 一个pplication 更多信息
    接口数据字典

    一个接口数据字典是架构中所有接口和值类型的合并列表以及它们所在的位置。

    系统作曲家模型上的本地接口可以使用该界面数据字典保存Interface Editor。可以在需要使用给定的一组接口,元素和值类型的模型之间重复接口字典。数据词典存储在单独的SLDD文件中。

    数据接口

    一个数据接口defines the kind of information that flows through a port. The same interface can be assigned to multiple ports. A data interface can be composite, meaning that it can include data elements that describe the properties of an interface signal.

    Data interfaces represent the information that is shared through a connector and enters or exits a component through a port. Use theInterface Editor创建和管理数据接口和数据元素,然后将它们存储在接口数据字典中,以在模型之间重复使用。

    数据元素

    一个数据元素describes a portion of an interface, such as a communication message, a calculated or measured parameter, or other decomposition of that interface.

    数据接口分解为数据元素:

    • 连接器或线束中的销钉或电线。

    • 跨公共汽车传输的消息。

    • 组件之间共享的数据结构。

    值类型

    一个值类型can be used as a port interface to define the atomic piece of data that flows through that port and has a top-level type, dimension, unit, complexity, minimum, maximum, and description.

    You can also assign the type of data elements in data interfaces to value types. Add value types to data dictionaries using theInterface Editor这样你可以重用价值类型接口s or data elements.

    Create Value Types as Interfaces
    owned interface

    一个owned interfaceis an interface that is local to a specific port and not shared in a data dictionary or the model dictionary.

    创建一个自有的接口来表示端口本地的值类型或数据接口。

    定义端口本地自有的接口
    适配器

    一个适配器通过在两个接口之间映射,帮助将两个组件与不兼容的端口接口连接。适配器可以充当单位延迟或费率转换。您也可以将适配器用于公交车。使用一个dapterblock to implement an adapter.

    With an adapter, you can perform functions on the接口适配器dialog:

    • 在输入和输出接口之间创建和编辑映射。

    • 应用接口转换UnitDelayto break an algebraic loop.

    • 应用接口转换比率to reconcile different sample time rates for reference models.

    • When output interfaces are undefined, you can use input interfaces in bus creation mode to author owned output interfaces.

    版本历史记录

    在R2020b中引入