Main Content

next

Class: systemcomposer.rptgen.finder.DictionaryFinder
Namespace: systemcomposer.rptgen.finder

Get next dictionary search result

Since R2022b

Syntax

result = next(finder)

Description

result = next(finder) gets the next Dictionary search result.

Input Arguments

expand all

Dictionary finder, specified as a systemcomposer.rptgen.finder.DictionaryFinder object.

Output Arguments

expand all

Dictionary result, returned as a systemcomposer.rptgen.finder.DictionaryResult object.

Examples

expand all

Use the DictionaryFinder, DictionaryResult, InterfaceFinder, and InterfaceResult classes to create a report that finds all dictionaries and interfaces in a given architecture model.

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

Open the scKeylessEntrySystem project.

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

Create a report and append a title page and table of contents.

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

Create a chapter to contain all sections related to dictionaries.

dictionaryChapter = Chapter(Title="Dictionaries");

Find all dictionaries linked to the architecture model.

dictionaryFinder = DictionaryFinder(model_name);

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

Find all interfaces in the dictionary.

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

Create a section for each interface in the dictionary.

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

    append(dictionaryChapter,dictionarySection);
end

Append the chapter to the report and view the generated report.

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

Version History

Introduced in R2022b