主要内容

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

next

类: systemcomposer.rptgen.finder.DictionaryFinder
命名空间: systemcomposer.rptgen.finder

获取下一个字典搜索结果

自 R2022b 起

语法

result = next(finder)

说明

result = next(finder) 获取下一个 Dictionary 搜索结果。

输入参数

全部展开

字典查找器,指定为 systemcomposer.rptgen.finder.DictionaryFinder 对象。

输出参量

全部展开

字典结果,以 systemcomposer.rptgen.finder.DictionaryResult 对象的形式返回。

示例

全部展开

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