主要内容

本页采用了机器翻译。点击此处可查看英文原文。

systemcomposer.getSelectedInterfaces

在接口编辑器中获取选定的接口

自 R2024a 起

    说明

    interfaces = systemcomposer.getSelectedInterfaces(modelName)modelName 指定的模型中的 接口编辑器中获取选定的接口,作为接口对象的数组。

    示例

    示例

    全部折叠

    创建一个带有名为 Component 的组件的模型。

    model = systemcomposer.createModel("archModel");
    systemcomposer.openModel("archModel");
    arch = get(model,"Architecture");
    comp = addComponent(arch,"Component");

    为组件添加一个端口。

    newPort = addPort(comp.Architecture,"newPort","in");

    为模型字典添加数据接口。

    newInterface = addInterface(model.InterfaceDictionary,"newInterface");

    接口编辑器上选择 newInterface。获取选定的接口。然后,在端口上设置接口。

    interfaces = systemcomposer.getSelectedInterfaces("archModel");
    setInterface(newPort,interfaces)

    输入参数

    全部折叠

    模型名称,指定为字符向量或字符串。

    示例: "exMobileRobot"

    数据类型: char | string

    输出参量

    全部折叠

    详细信息

    全部折叠

    版本历史记录

    在 R2024a 中推出