主要内容

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

slreportgen.finder.DataDictionaryResult 类

命名空间: slreportgen.finder
超类: mlreportgen.finder.Result

数据字典搜索结果对象

描述

slreportgen.finder.DataDictionaryResult 类的对象表示数据字典搜索的结果。您可以将 DataDictionaryResult 对象直接附加到报告中。或者,您可以使用 getReporter 方法访问结果的 slreportgen.report.DataDictionary 报告器,然后自定义报告器并将其附加到报告中。

slreportgen.finder.DataDictionaryResult 类是 handle 类。

类属性

HandleCompatible
true

有关类属性的信息,请参阅类属性

创建对象

您没有明确创建 slreportgen.finder.DataDictionaryResult 对象。slreportgen.finder.DataDictionaryFinder findnext 方法为找到的每个数据字典创建一个 slreportgen.finder.DataDictionaryResult 对象。

属性

全部展开

公共属性

要添加到结果中的用户定义的额外信息,指定为任意值。

属性:

GetAccess
公共
SetAccess
公共
NonCopyable
true

受保护的属性

此结果所表示的数据字典的完整路径,指定为字符串标量。此属性为只读属性。

此结果所表示的数据字典的文件名,指定为字符串标量。此属性为只读属性。

方法

全部展开

示例

全部折叠

使用 getReporter 对象的 slreportgen.finder.DataDictionaryResult 方法来访问结果的数据字典报告器。然后,通过设置其属性来自定义报告器。

导入 MATLAB 和 Simulink 报告 API 包,这样您就不必使用长而完全限定的类名。

import mlreportgen.report.*
import slreportgen.report.*

创建 Simulink 报告并添加目录。

rpt = slreportgen.report.Report("MyReport","html-file");
append(rpt,TableOfContents);

创建一个搜索整个 MATLAB 路径的字典查找器。仅查找名称中包含type的數據字典。

f = slreportgen.finder.DataDictionaryFinder();
f.Name = "*type*";

为每个数据字典结果创建一个包含一个部分的章节。对于每个结果,自定义报告器以仅包含设计数据摘要表中的名称、值和类属性。

ch = Chapter("Data Dictionaries");
while hasNext(f)
    result = next(f);
    s = Section(result.Name);
    rptr = getReporter(result);
    rptr.SummaryProperties = ["Name" "Value" "Class"];
    append(s,rptr);
    append(ch,s);
end

将章节添加到报告中。关闭并查看报告。

append(rpt,ch);
close(rpt);
rptview(rpt);

报告为找到的每个词典(sldemo_fuelsys_dd_types.sldd sldemo_fuelsys_dd_types_float.sldd)都设有一个部分。每个字典的汇总表只包括 NameValueClass 属性。

Chapter 1 of report, containing sections for the data dictionaries sldemo_fuelsys_dd_types.sldd and sldemo_fuelsys_dd_types_float.sldd.

版本历史记录

在 R2020b 中推出