Documentation

slreportgen.report.StateflowObjectProperties class

Package: slreportgen.report
Superclasses:

Stateflow object properties reporter

Description

The StateflowObjectProperties reporter generates tables that list the properties and property values of Stateflow® objects.

Note

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

Construction

reporter = StateflowObjectProperties() creates an empty Stateflow object properties reporter. Use the properties of this reporter to specify reporting on these Stateflow objects:

  • Object whose properties to report

  • Properties to report

  • Format of the reported properties

reporter = StateflowObjectProperties(obj) creates a reporter that generates a table listing the property values of the specified Stateflow object. The properties included by default depend on the object type. For example, a chart table includes the state and data of the chart. To specify a custom list of properties to be included in the generated property table, use the Properties property. Use the PropertyTable property to customize the format of the generated property table.

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 in an uncompiled state when you close the report that contains the generated property table.

reporter = StateflowObjectProperties(Name,Value) sets properties using name-value pairs. You can specify multiple name-value pair arguments in any order. Enclose each property name in single quotes.

Input Arguments

expand all

See Object property.

Properties

expand all

Stateflow object whose properties to report, specified as the path string or character vector or as the handle of the specified object.

Object properties table reporter, specified as a 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 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 of strings or character vectors.

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 template for this reporter, specified as one of these values:

  • String or character array specifying the path of the file containing the template for this reporter

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

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

The specified template must be of the same type as the report to which this reporter is appended. For example, for a 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 string or character array. The template for this reporter is in the template library of the template source (TemplateSrc) for this reporter.

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

Example: firstchapter.LinkTarget = 'ch1_link';

Methods

createTemplate Create StateflowStateflow object properties reporter template
customizeReporter Create custom Stateflow object properties class
getClassFolder Stateflow object properties class definition file location

Inherited Methods

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects (MATLAB).

Examples

Add Stateflow Chart Properties Table to Report

Add a table that reports the properties of the shift_model chart in sf_car model.

import slreportgen.report.*
import mlreportgen.report.*
import slreportgen.utils.*

model_name = 'sf_car';
load_system(model_name);

rpt = slreportgen.report.Report('output','pdf');
chapter = Chapter(model_name);
chart = block2chart('sf_car/shift_logic');
rptr = StateflowObjectProperties(chart);

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

Introduced in R2017b

Was this topic helpful?