主要内容

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

systemcomposer.rptgen.report.Interface 类

命名空间: systemcomposer.rptgen.report
超类: slreportgen.report.Reporter (Simulink Report Generator)

接口报告器

自 R2022b 起

描述

创建一个报告器,报告 System Composer™ 架构模型中的接口。

systemcomposer.rptgen.report.Interface 类是 handle 类。

创建对象

reporter = Interface("Source",result) 创建一个报告器,使用 systemcomposer.rptgen.finder.InterfaceResult 对象报告模型中的接口。

属性

全部展开

接口结果,指定为 systemcomposer.rptgen.finder.InterfaceResult 对象。

组件接口中的元素,指定为报告器对象。默认值为 mlreportgen.report.BaseTable (MATLAB Report Generator) 报告器。

接口所在的端口,指定为报告器对象。默认值为 mlreportgen.report.BaseTable (MATLAB Report Generator) 报告器。

是否报告元素表,指定为 1 (true) 或 0 (false)。

数据类型: logical

是否报告端口使用情况表,指定为 1 (true) 或 0 (false)。

数据类型: logical

此报告器的模板来源,以下列方式之一指定:

  • 指定此报告器模板文件路径的字符向量或字符串标量

  • 此报告器所用模板的源报告器或报告(或其模板库包含此报告器的模板)

  • 此报告器所用模板的文档对象模型 (DOM) 文档或文档部件(或其模板库包含此报告器的模板)

指定的模板必须与您附加此报告器的报告类型相同。例如,对于 Microsoft® Word 报告,TemplateSrc 必须是 Word 报告器模板。如果 TemplateSrc 属性为空,则此报告器将使用默认报告器模板作为报告的输出类型。

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

此报告器的模板名称,指定为字符向量或字符串标量。该报告器的模板必须位于该报告器的 TemplateSrc 属性指定的模板的模板库中。

属性:

GetAccess
public
SetAccess
public

数据类型: char | string

此报告器的超链接目标,指定为指定链接目标 ID 的字符向量或字符串标量,或 mlreportgen.dom.LinkTarget (MATLAB Report Generator) 对象。字符向量或字符串标量值转换为 LinkTarget 对象。链接目标在输出报告中紧接着此报告器的内容。

属性:

GetAccess
public
SetAccess
public

方法

全部展开

示例

全部折叠

使用 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 中推出