主要内容

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

systemcomposer.rptgen.finder.InterfaceResult 类

命名空间: systemcomposer.rptgen.finder
超类: mlreportgen.finder.Result (MATLAB Report Generator)

接口搜索结果

自 R2022b 起

描述

在 System Composer™ 架构模型中搜索接口信息的结果对象。

systemcomposer.rptgen.finder.InterfaceResult 类是 handle 类。

创建对象

result = InterfaceResult 为您通过 systemcomposer.rptgen.finder.InterfaceFinder 对象找到的接口创建搜索结果对象。

注意

systemcomposer.rptgen.finder.InterfaceFinder 类的 find 方法会为找到的每个接口创建一个搜索结果对象。您不需要自己创建该对象。

属性

全部展开

结果元素的通用唯一标识符 (UUID),以字符串形式返回。

数据类型: string

接口名称,以字符串形式返回。

数据类型: string

接口元素,以结构形式返回。

这些数据元素字段以字符串形式返回:

  • Name

  • Type

  • Description

  • Complexity

  • Dimensions

  • Maximum

  • Minimum

值类型的这些字段以字符串形式返回:

  • Name

  • DataType

  • Description

  • Complexity

  • Dimensions

  • Maximum

  • Minimum

服务接口的这些字段以字符串形式返回:

  • Name

  • FunctionPrototype

  • FunctionArgument,以结构形式返回,字段以字符串形式返回:

    • Name

    • Type

    • Dimensions

    • Description

数据类型: struct

端口信息,以包含字段的结构形式返回:

  • InterfaceName

  • PortName

  • FullPortName

  • Direction

数据类型: struct

与结果相关联的标记,指定为字符串。您可以使用此属性为结果附加额外信息。您可以将此属性设置为任何符合您需求的值。

数据类型: string

方法

全部展开

示例

全部折叠

使用 DictionaryFinderDictionaryResultInterfaceFinderInterfaceResult 类创建报告,查找给定架构模型中的所有字典和接口。

import mlreportgen.report.*
import slreportgen.report.*
import systemcomposer.rptgen.finder.*

打开 scKeylessEntrySystem 工程。

prj = openProject("scKeylessEntrySystem");
model_name = "KeylessEntryArchitecture";
mdl = systemcomposer.loadModel(model_name);

创建一个报告,并追加标题页和目录。

dataReport = slreportgen.report.Report(OutputPath=model_name + "_ArchitectureDataReport", ...
    CompileModelBeforeReporting=false);
append(dataReport,TitlePage(Title="Architectural Data in " + model_name));
append(dataReport,TableOfContents);

创建一个章节,包含与字典有关的所有部分。

dictionaryChapter = Chapter(Title="Dictionaries");

查找与架构模型相关联的所有字典。

dictionaryFinder = DictionaryFinder(model_name);

while hasNext(dictionaryFinder)
    dictionary = next(dictionaryFinder);
    dictionarySection = Section(Title="Dictionary: " + dictionary.Name);
    append(dictionarySection, dictionary);    

在字典中查找所有接口。

    interfaces = dictionary.Interfaces;
    for i=1:length(interfaces)
        interfaceFinder = InterfaceFinder(model_name);
        interfaceFinder.Filter = interfaces(i);
        interface = find(interfaceFinder);

为字典中的每个接口创建一个章节。

        interfaceSection = Section(Title="Interface: " + interface.InterfaceName);
        append(interfaceSection, interface);
        append(dictionarySection, interfaceSection);
    end

    append(dictionaryChapter,dictionarySection);
end

将章节附加到报告中,并查看生成的报告。

append(dataReport,dictionaryChapter);
close(dataReport);
rptview(dataReport);

版本历史记录

在 R2022b 中推出