主要内容

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

setInterface

为端口设置接口

    说明

    setInterface(port,interface) 设置端口的接口。

    示例

    示例

    全部折叠

    创建模型并获取根架构。

    model = systemcomposer.createModel("archModel");
    systemcomposer.openModel("archModel");
    rootArch = get(model,"Architecture");

    添加一个组件,并为组件添加一个端口。

    newComponent = addComponent(rootArch,"newComponent");
    newPort = addPort(newComponent.Architecture,"newPort","in");

    添加数据接口并为端口设置接口。

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

    移除端口上的数据接口。

    newPort.setInterface("")

    输入参数

    全部折叠

    要设置的接口,指定为 systemcomposer.interface.DataInterfacesystemcomposer.ValueTypesystemcomposer.interface.PhysicalInterfacesystemcomposer.interface.ServiceInterface 对象。如果输入空字符串或字符向量,就会删除端口上的接口。

    详细信息

    全部折叠

    版本历史记录

    在 R2019a 中推出

    另请参阅

    函数

    对象

    模块

    工具