主要内容

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

systemcomposer.rptgen.report.Profile 类

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

配置文件报告器

自 R2022b 起

描述

创建一个报告器,报告可与 System Composer™ 架构模型一起使用的配置文件。

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

创建对象

reporter = Profile("Source",result) 创建一个报告器,使用 systemcomposer.rptgen.finder.ProfileResult 对象报告模型中的配置文件。

属性

全部展开

配置文件结果,指定为 systemcomposer.rptgen.finder.ProfileResult 对象。

自定义摘要报告器,指定为报告器对象。默认值为 mlreportgen.report.BaseTable (MATLAB Report Generator) 报告对象。

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

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

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

  • 此报告器所用模板的文档对象模型 (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

方法

全部展开

示例

全部折叠

使用 ProfileFinderProfileResultStereotypeFinderStereotypeResult 类创建报告,以查找给定架构模型中的所有配置文件。

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

打开 scKeylessEntrySystem 工程。

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

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

profilesReport = slreportgen.report.Report(OutputPath=model_name + "_ProfileReport", ...
    CompileModelBeforeReporting=false);
append(profilesReport,TitlePage(Title="Profiles and their Stereotypes in " + model_name));
append(profilesReport,TableOfContents);

创建一个章节,包含与配置文件及其构造型相关的所有部分。

profileChapter = Chapter(Title="Profiles");

查找导入架构模型的所有配置文件。

profileFinder = ProfileFinder(model_name);

while hasNext(profileFinder)
    profile = next(profileFinder);
    profileSection = Section(Title="Profile: " + profile.Name);
    append(profileSection, profile);

查找配置文件中的所有构造型。

    stereotypeFinder = StereotypeFinder(profile.Name);
    while hasNext(stereotypeFinder) 
        stereotype = next(stereotypeFinder);
        stereotypeSection = Section(Title=stereotype.Name);
        append(stereotypeSection,stereotype);
        append(profileSection,stereotypeSection);
    end
    
    append(profileChapter,profileSection);
end

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

append(profilesReport,profileChapter);
close(profilesReport);
rptview(profilesReport);

版本历史记录

在 R2022b 中推出