Main Content

systemcomposer.rptgen.finder.StereotypeResult Class

Namespace: systemcomposer.rptgen.finder
Superclasses: mlreportgen.finder.Result (MATLAB Report Generator)

Search result for stereotypes

Since R2022b

Description

Search result object for information about a stereotype in a profile in a given System Composer™ architecture model.

The systemcomposer.rptgen.finder.StereotypeResult class is a handle class.

Creation

result = StereotypeResult creates a search result object for a stereotype that you find by using a systemcomposer.rptgen.finder.StereotypeFinder object.

Note

The find method of the systemcomposer.rptgen.finder.StereotypeFinder class creates a search result object for each stereotype that it finds. You do not need to create this object yourself.

Properties

expand all

Universal unique identifier (UUID) of result element, returned as a string.

Data Types: string

Name of stereotype, specified as a string. This property must be a valid MATLAB® identifier.

Example: "HardwareComponent"

Data Types: string

Icon for stereotype, specified as a mlreportgen.dom.Image (MATLAB Report Generator) object.

Stereotype from which stereotype inherits properties, specified as a systemcomposer.profile.Stereotype object.

Description text for stereotype, specified as a string.

Data Types: string

Element type to which stereotype can be applied, specified as one of these options:

Data Types: string

Properties contained in stereotype and inherited from the stereotype base hierarchy, returned as a structure with fields:

  • Name, returned as a string.

  • Type, returned as a string.

  • Index, returned as an integer.

  • Unit, returned as a string.

  • DefaultValue, returned as a string.

Data Types: struct

Tag to associate with result, specified as a string. You can use this property to attach additional information to a result. You can set this property to any value that meets your requirements.

Data Types: string

Methods

expand all

Examples

collapse all

Use the ProfileFinder, ProfileResult, StereotypeFinder, and StereotypeResult classes to create a report that finds all profiles 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.

profilesReport = slreportgen.report.Report(OutputPath=model_name + "_ProfileReport", ...
    CompileModelBeforeReporting=false);
append(profilesReport,TitlePage(Title="Profiles and their Stereotypes in " + model_name));
append(profilesReport,TableOfContents);

Create a chapter to contain all sections related to profiles and their stereotypes.

profileChapter = Chapter(Title="Profiles");

Find all profiles imported into the architecture model.

profileFinder = ProfileFinder(model_name);

while hasNext(profileFinder)
    profile = next(profileFinder);
    profileSection = Section(Title="Profile: " + profile.Name);
    append(profileSection, profile);

Find all stereotypes in a profile.

    stereotypeFinder = StereotypeFinder(profile.Name);
    while hasNext(stereotypeFinder) 
        stereotype = next(stereotypeFinder);
        stereotypeSection = Section(Title=stereotype.Name);
        append(stereotypeSection,stereotype);
        append(profileSection,stereotypeSection);
    end
    
    append(profileChapter,profileSection);
end

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

append(profilesReport,profileChapter);
close(profilesReport);
rptview(profilesReport);

Version History

Introduced in R2022b