主要内容

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

getInterface

获取字典中已命名接口的对象

说明

interface = getInterface(dictionary,name) 获取字典中已命名接口的对象。

示例

interface = getInterface(dictionary,name,Name=Value) 获取字典中指定接口的对象,并提供附加选项。

示例

全部折叠

在模型的字典中添加数据接口 newInterface。获取数据接口对象。打开接口编辑器确认。

arch = systemcomposer.createModel("newModel");
addInterface(arch.InterfaceDictionary,"newInterface");
interface = getInterface(arch.interface.Dictionary,"newInterface")
interface = 

  DataInterface with properties:

          Owner: [1×1 systemcomposer.interface.Dictionary]
           Name: 'newInterface'
       Elements: [0×0 systemcomposer.interface.DataElement]
          Model: [1×1 systemcomposer.arch.Model]
           UUID: '205cdd2f-12bc-4bbb-a4a7-75d0ab18adb8'
    ExternalUID: ''

在模型字典中添加物理接口 newInterface。获取物理接口对象。打开接口编辑器确认。

arch = systemcomposer.createModel("newModel");
addPhysicalInterface(arch.InterfaceDictionary,"newInterface");
interface = getInterface(arch.interface.Dictionary,"newInterface")
interface = 

  PhysicalInterface with properties:

          Owner: [1×1 systemcomposer.interface.Dictionary]
           Name: 'newInterface'
       Elements: [0×0 systemcomposer.interface.PhysicalElement]
          Model: [1×1 systemcomposer.arch.Model]
           UUID: '6110207d-2d6d-470e-9bf5-f0e6f6914685'
    ExternalUID: ''

输入参数

全部折叠

数据字典,指定为 systemcomposer.interface.Dictionary 对象。有关如何创建数据字典的信息,请参阅 createDictionary

接口名称,指定为字符向量或字符串。

示例: "newInterface"

数据类型: char | string

名称-值参数

全部折叠

将可选参量对组指定为 Name1=Value1,...,NameN=ValueN,其中 Name 是参量名称,Value 是对应的值。名称-值参量必须出现在其他参量之后,但对各个参量对组的顺序没有要求。

在 R2021a 之前,使用逗号分隔每个名称和值,并用引号将 Name 引起来

示例: getInterface(dict,"newInterface",ReferenceDictionary="")

用于搜索接口的引用字典,指定为带有 .sldd 扩展名的字符向量或字符串。输入空字符向量或字符串,将所有引用的词典都包括在搜索范围内。

示例: getInterface(dict,"newInterface",ReferenceDictionary="referenceDictionary.sldd")

数据类型: char | string

输出参量

全部折叠

详细信息

全部折叠

版本历史记录

在 R2019a 中推出

另请参阅

函数

对象

模块

工具