Main Content

getReporter

Class: systemcomposer.rptgen.finder.ConnectorResult
Package: systemcomposer.rptgen.finder

Get connector reporter

Since R2022b

Syntax

reporter = getReporter(result)

Description

reporter = getReporter(result) returns a reporter that is used to include information about connectors in a component. You can use this reporter to customize what information is included and how the information is formatted. See the systemcomposer.rptgen.report.Connector reporter class for more information on how to customize the reporter.

Input Arguments

expand all

Connector result, specified as a systemcomposer.rptgen.finder.ConnectorResult object.

Output Arguments

expand all

Connector reporter, returned as a systemcomposer.rptgen.report.Connector object.

Examples

expand all

Use the ConnectorFinder and ConnectorResult 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="ConnectorResultReport",...
CompileModelBeforeReporting=false);
add(rpt,TitlePage("Title",sprintf('Connectors in %s Model',model_name)));
add(rpt,TableOfContents);

connectorFinder = ConnectorFinder(model_name);
connectorFinder.Filter = "Component";
connectorFinder.ComponentName = "scExampleSmallUAVModel/Flight Support Components";
chapter = Chapter("Title","Connectors");
result = find(connectorFinder);
add(rpt,chapter);

for r = result
    reporter = getReporter(r);
    append(rpt,reporter);
end

close(rpt);
rptview(rpt)

Version History

Introduced in R2022b