Main Content

slreportgen.report.StateTransitionTable Class

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

State transition table reporter

Since R2022a

Description

Use objects of the slreportgen.report.StateTransitionTable class to report on State Transition Table blocks and Stateflow.StateTransitionTableChart objects. The reporter includes:

  • A table with details about the state transition table.

  • An optional property table for symbols used by the state transition table.

You can only use StateTransitionTable objects with slreportgen.report.Report objects.

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

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

sttReporter = StateTransitionTable creates an empty state transition table reporter. Set the Object property before you add the sttReporter object to a report.

sttReporter = StateTransitionTable(sttObj) creates a state transition table reporter object and sets the Object property to sttObj.

example

sttReporter = StateTransitionTable(Name=Value) sets Properties using one or more name-value arguments.

Properties

expand all

State transition table on which to report, specified as one of these options:

valuedescription
string scalar or character arrayPath of the State Transition Table block on which to report.
Block handleBlock handle of the State Transition Table block on which to report. To get a block handle, use the function getSimulinkBlockHandle or get_param.
Stateflow.StateTransitionTableChartObject on which to report.
slreportgen.finder.BlockResultSearch result object that represents the block with a Stateflow.StateTransitionTableChart object on which to report.
slreportgen.finder.DiagramElementResultSearch result object that represents the Stateflow.StateTransitionTableChart object on which to report.

Attributes:

GetAccess
public
SetAccess
public

Data Types: char | string | double | Stateflow.StateTransitionTableChart | slreportgen.finder.BlockResult | slreportgen.finder.DiagramElementResult

Whether to include a table for the symbols used by the state transition table, specified as numeric or logical 0 (false) or 1 (true). The property table includes the symbols for input and output ports and for local, constant, parameter, and Data Store Memory data elements. You can choose whether to compile the model before adding the symbol values to the report by setting the CompileModelBeforeReporting property of the slreportgen.report.Report object.

Attributes:

GetAccess
public
SetAccess
public

Data Types: logical

Formatter of the symbols table, specified as an mlreportgen.report.BaseTable object. The default value of this property is a BaseTable object with the TableStyleName property set to the STTTableReporter style, which the default templates for StateTransitionTable define. To customize the symbols table, customize the existing BaseTable object or assign and customize a new BaseTable object to the TableReporter property.

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 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

This example shows how to report on a State Transition Table block.

Import these packages so that you do not have to use long, fully qualified class names.

import slreportgen.utils.*
import slreportgen.report.*
import slreportgen.finder.*
import mlreportgen.dom.*
import mlreportgen.report.*

Create an slreportgen.report.Report object of type DOCX with a chapter.

theReport = Report("STT_Generated_Report","docx");
chapter = Chapter("A State Transition Table Block");
append(theReport,chapter);

Load the Simulink® model and create an slreportgen.finder.BlockFinder object to find the blocks in the model.

modelName = "sf_stt_boiler";
load_system(modelName);
blockFinder = BlockFinder(modelName);

Iterate through the block search results to find the first result that represents a State Transition Table block.

while(blockFinder.hasNext)
  nextRes = blockFinder.next;

Use this result to create an slreportgen.report.StateTransitionTable reporter. Append the StateTransitionTable reporter to the report. Close the report and the model, view the report, and break the loop.

  if(isStateTransitionTable(nextRes))
    sttReporter = StateTransitionTable(Object=nextRes, ...
        IncludeSymbols=true);
    append(theReport,sttReporter);
    close(theReport);
    close_system(modelName);
    rptview(theReport);
    return;
  end
end

If the search does not find any State Transition Table blocks in the model, close the model and the report.

close_system(modelName);
close(theReport);

Version History

Introduced in R2022a