Main Content

systemcomposer.rptgen.report.Interface Class

Namespace: systemcomposer.rptgen.report
Superclasses: slreportgen.report.Reporter (Simulink Report Generator)

Interface reporter

Since R2022b

Description

Create a reporter that reports on interfaces in a System Composer™ architecture model.

The systemcomposer.rptgen.report.Interface class is a handle class.

Creation

reporter = Interface("Source",result) creates a reporter that reports on interfaces in a model using a systemcomposer.rptgen.finder.InterfaceResult object.

Properties

expand all

Interface result, specified as a systemcomposer.rptgen.finder.InterfaceResult object.

Elements in the interface of the component, specified as a reporter object. The default value is the mlreportgen.report.BaseTable (MATLAB Report Generator) reporter.

Ports on which the interface is present, specified as a reporter object. The default value is the mlreportgen.report.BaseTable (MATLAB Report Generator) reporter.

Whether to report on the elements table, specified as 1 (true) or 0 (false).

Data Types: logical

Whether to report on the ports usage table, specified as 1 (true) or 0 (false).

Data Types: logical

Source of the template for this reporter, specified in one of these ways:

  • Character vector or string scalar that specifies the path of the file that contains the template for this reporter

  • Reporter or report whose template this reporter uses or whose template library contains the template for this reporter

  • Document Object Model (DOM) document or document part whose template this reporter uses or whose template library contains the template for this reporter

The specified template must be the same type as the report to which you append this reporter. For example, for a Microsoft® Word report, TemplateSrc must be a Word reporter template. If the TemplateSrc property is empty, this reporter uses the default reporter template for the output type of the report.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Name of the template for this reporter, specified as a character vector or string scalar. The template for this reporter must be in the template library of the template specified by the TemplateSrc property of this reporter.

Attributes:

GetAccess
public
SetAccess
public

Data Types: char | string

Hyperlink target for this reporter, specified as a character vector or string scalar that specifies the link target ID, or an mlreportgen.dom.LinkTarget (MATLAB Report Generator) object. A character vector or string scalar value converts to a LinkTarget object. The link target immediately precedes the content of this reporter in the output report.

Attributes:

GetAccess
public
SetAccess
public

Methods

expand all

Examples

collapse 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