Main Content

next

Class: systemcomposer.rptgen.finder.ViewFinder
Namespace: systemcomposer.rptgen.finder

Get next view search result

Since R2022b

Syntax

result = next(finder)

Description

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

Input Arguments

expand all

View finder, specified as a systemcomposer.rptgen.finder.ViewFinder object.

Output Arguments

expand all

View result, returned as a systemcomposer.rptgen.finder.ViewResult object.

Examples

expand all

Use the ViewFinder and ViewResult classes to create a report that finds all views 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.

viewsReport = slreportgen.report.Report(OutputPath=model_name + "_ViewsReport", ...
    CompileModelBeforeReporting=false);
append(viewsReport,TitlePage(Title="Views in " + model_name));
append(viewsReport,TableOfContents);

Create a chapter to contain all sections related to views in the architecture model.

viewsChapter = Chapter(Title="Views");

Find all views in the architecture model.

viewFinder = ViewFinder(model_name);
while hasNext(viewFinder)
    view = next(viewFinder);
    viewSection = Section(Title=view.Name);
    append(viewSection,view);
    append(viewsChapter,viewSection);
end

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

append(viewsReport,viewsChapter);
close(viewsReport);
rptview(viewsReport);

Version History

Introduced in R2022b