Main Content

systemcomposer.rptgen.finder.StereotypeFinder class

Package: systemcomposer.rptgen.finder
Superclasses: mlreportgen.finder.Finder (MATLAB Report Generator)

Find stereotypes

Description

The systemcomposer.rptgen.finder.StereotypeFinder class searches for information about stereotypes in a profile in a given System Composer™ architecture model.

Creation

finder = StereotypeFinder(Container) creates a finder that finds stereotypes in a profile in a given model.

Note

This finder provides two ways to get search results:

  1. To return the search results as an array, use the find method. Add the results directly to a report or process the results in a for loop.

  2. To iterate through the results one at a time, use the hasNext and next methods in a while loop.

Neither option has a performance advantage.

Properties

expand all

Profile file name without the .xml extension, specified as a string.

Example: f = StereotypeFinder("TestProfile")

Data Types: string

Stereotype name, specified as a string in the form "<profile>.<stereotype>".

Example: f.StereotypeName = "TestProfile.MechanicalComponent"

Attributes:

GetAccess
public
SetAccess
public

Data Types: string

Properties of objects to find, specified as a cell array of name-value arguments. The finder returns only objects that have the specified properties with the specified values.

Example: f.Properties = {'Gain','5'}

Data Types: char

Methods

expand all

Examples

collapse all

Use the StereotypeFinder and StereotypeResult classes to generate a report.

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

scExampleSmallUAV
model_name = "scExampleSmallUAVModel";
model = systemcomposer.loadModel(model_name);
rpt = slreportgen.report.Report(output="StereotypeFinderReport",...
CompileModelBeforeReporting=false);
add(rpt,TitlePage("Title",sprintf('Stereotypes in %s Model',model_name)));
add(rpt,TableOfContents);

stereotypeFinder = StereotypeFinder("UAVComponent");
chapter = Chapter("Title","Stereotypes");
while hasNext(stereotypeFinder)
    stereotype = next(stereotypeFinder);
    sect = Section("Title",stereotype.Name);
    add(sect,stereotype);
    add(chapter,sect);
end

add(rpt,chapter);
close(rpt);
rptview(rpt);

Version History

Introduced in R2022b