Main Content

slreportgen.report.SimulinkObjectProperties Class

Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter

Simulink object properties reporter

Description

The SimulinkObjectProperties reporter generates tables that list the properties and property values of Simulink® objects.

Note

To use a Simulink object properties reporter in a report, you must create the report using the slreportgen.report.Report class.

The slreportgen.report.SimulinkObjectProperties class is a handle class.

Creation

Description

reporter = SimulinkObjectProperties creates an empty Simulink object properties reporter. Use the Object property to specify the object to report.

To specify the list of Simulink object properties to include in the generated properties table, use the Properties property of the reporter. If you do not specify any properties, the reporter includes a default set of properties based on the object type. For example, the property table for a block includes the properties set by its parameter dialog box.

To customize the format of the generated property table, use the PropertyTable property.

Note

This reporter compiles the model containing the object to be reported if the model is not already compiled. Compiling the model is necessary to propagate values to properties that are unspecified when the model has not been compiled. The model is uncompiled when you close the report that contains the generated property table.

example

reporter = SimulinkObjectProperties(obj) creates a reporter that generates a table listing the property values of the specified Simulink object.

example

reporter = SimulinkObjectProperties(Name=Value) sets properties using name-value pairs. You can specify multiple name-value pair arguments in any order.

Input Arguments

expand all

See Object property.

Properties

expand all

Simulink object whose properties to report, specified as a path to or handle of the specified object. The Object value must be one of these types of objects:

  • model

  • block

  • annotation

  • port

  • line

  • line segment

Object properties table reporter, specified as an mlreportgen.report.BaseTable reporter. The object properties reporter uses the base table reporter to format object properties. If this property is initially empty, the object properties reporter sets the property to a default property table reporter. To customize the property table formatting, set this property to a base table reporter that meets your formatting requirements.

Choice to display property names as dialog box prompts, specified as a logical. If true and the property appears on the dialog box of the object, the table lists its dialog box prompt instead of its property name. Otherwise, the generated property table lists the property using its property name.

Choice to show properties with empty values.

Whether to show properties with empty values, specified as a logical. If false, the generated object properties table omits object properties whose value is empty. If true, the table includes properties whose value is empty.

Names of object properties to be reported, specified as a cell array.

A cell array of names of object properties to be reported, specified as a cell array of strings or character vectors. If you do not specify any properties, the reporter determines a set of properties to report.

Source of the template for this reporter, specified as one of these options:

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

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

  • DOM document or document part whose template is used for this reporter or whose template library contains the template for this reporter

The specified template must be the same type as the report to which this reporter is appended. 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.

Name of 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 source (TemplateSrc) for this reporter.

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

Methods

expand all

Examples

collapse all

Use the SimulinkObjectProperties reporter to add a properties table for the slrgex_vdp model to the report.

import slreportgen.report.*
import mlreportgen.report.*
model_name = "slrgex_vdp";
load_system(model_name);

rpt = slreportgen.report.Report("output","pdf");
chapter = Chapter(model_name);
rptr = SimulinkObjectProperties(model_name);

add(chapter, rptr);
add(rpt, chapter);
close(rpt);
close_system(model_name);
rptview(rpt);

Add a properties table to a report and include properties for a model line segment only.

import slreportgen.report.*
import mlreportgen.report.*
model_name = "slrgex_vdp";
rpt = slreportgen.report.Report("output","pdf");
chapter = Chapter(model_name);

load_system(model_name);
ph = get_param("slrgex_vdp/Mu","PortHandles");
outPort = ph.Outport;
line = get_param(outPort,"Line");
rptr = SimulinkObjectProperties(line);
rptr.Properties = {"Parent","SourcePort","StorageClass"};

add(chapter,rptr);
add(rpt,chapter);
close(rpt);
close_system(model_name);
rptview(rpt);

Version History

Introduced in R2017b