Main Content

systemcomposer.rptgen.finder.InterfaceFinder Class

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

Find interfaces

Since R2022b

Description

The systemcomposer.rptgen.finder.InterfaceFinder class searches for information about all the interfaces in a given System Composer™ architecture model.

Creation

finder = InterfaceFinder(Container) creates a finder that finds all interfaces in a given model that meet the specifications of the Filter property.

Note

This finder provides these options to get search results:

  • 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.

  • 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

Architecture model filename without the .slx extension, specified as a string.

Example: f = InterfaceFinder("ArchModel")

Data Types: string

Where to find interfaces, specified as "Model" to find interfaces in the model or "Component" to find all interfaces on the ports of a given component.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string

Filter to find interfaces, specified as "All" to find all interfaces associated with the model, "InterfaceName" to find a specific interface, or "ComponentName" to find all interfaces on the ports of a given component.

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 InterfaceFinder and InterfaceResult 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="InterfaceFinderReport",...
CompileModelBeforeReporting=false);
add(rpt,TitlePage("Title",sprintf('Interfaces in %s Model',model_name)));
add(rpt,TableOfContents);
 
intfFinder = InterfaceFinder(model_name);

chapter = Chapter("Title","Interfaces");
while hasNext(intfFinder)
    interface = next(intfFinder);
    sect = Section("Title",interface.InterfaceName);
    add(sect,interface);
    add(chapter,sect);
end
 
add(rpt,chapter);
close(rpt);
rptview(rpt);

Version History

Introduced in R2022b