Main Content

getReporter

Class: systemcomposer.rptgen.finder.ConnectorResult
Namespace: systemcomposer.rptgen.finder

Get connector reporter

Since R2022b

Syntax

reporter = getReporter(result)

Description

reporter = getReporter(result) returns a reporter that you can use to include information about connectors in a component. You can use this reporter to customize what information to include and how to format the information. See systemcomposer.rptgen.report.Connector 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