主要内容

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

getInterface

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

说明

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

示例

interface = getInterface(___,ReferenceDictionary=reference) 除了前面的语法中的参量外,还会在某个参考字典 reference 中搜索接口。

示例

全部折叠

在模型的字典中添加数据接口 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

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

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

数据类型: char | string

输出参量

全部折叠

详细信息

全部折叠

版本历史记录

在 R2019a 中推出

另请参阅

函数

对象

模块

工具