Main Content

slreportgen.report.TruthTable Class

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

Truth table reporter

Description

Create a Simulink® truth table block or Stateflow® truth table object reporter.

Note

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

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

Creation

Description

rptr = TruthTable creates an empty TruthTable reporter. Use its properties to specify the truth table on which to report and specify report options and format.

example

rptr = TruthTable(truthtableobj) creates a TruthTable reporter for the truth table specified by truthtableobj, which can be either a block or a Stateflow object. By default, the reporter generates a table of the conditions and actions of the truth table.

rptr = TruthTable(Name=Value) creates a truth table reporter with additional options specified by one or more Name=Value pair arguments. Name is a property name and Value is the corresponding value. You can specify several name-value pair arguments in any order as Name1=Value1,...,NameN=ValueN.

example

Input Arguments

expand all

See the Object property.

Properties

expand all

Simulink Truth Table block or Stateflow truth table object, specified as a path or handle.

Specify whether to include headers in the truth table condition table, specified as a logical. If this property is true, the report includes column headers that identify the contents of the table columns.

Specify whether to include row numbers in the truth table condition table, specified as a logical. If this property is true, each row of the condition table starts with a row number.

Specify whether to include the condition column in the truth table condition table, specified as a logical. If this property is true, the report includes the conditions that trigger the decisions.

Specify whether to include the description column in the truth table condition table, specified as a logical. If this property is true, the report includes descriptions of the truth table conditions.

Reporter used by the TruthTable reporter to create the truth table condition table. This property is set by default to an instance of a BaseTable reporter.

Use the associated BaseTable reporter properties to customize the appearance of the condition table. If the condition table is too wide to fit legibly on a page, use the MaxCols property of the BaseTable reporter to generate the condition table as a set of table slices that fit legibly.

Note

The TruthTable reporter always repeats the first two columns of the condition table in each slice. It does not use the RepeatCols property of the BaseTable or custom reporter.

Specify whether to include headers in the truth table action table, specified as a logical. If this property is true, the action table includes the column headers, such as "Description" that identify the contents of each column.

Specify whether to include row numbers in the truth table action table, specified as a logical. If this property is true, each row of the action table starts with a row number.

Specify whether to include the action column in the truth table action table, specified as a logical. If this property is true, each row of the action table lists the executable action statements for each action.

Specify whether to include the description column in the truth table action table, specified as a logical. If this property is true, each row of the action table contains a description of the corresponding action.

Reporter used by the TruthTable reporter to create the truth table's action table. This property is set by default to an instance of a BaseTable reporter. You can customize the appearance of the action table by changing the properties of this table reporter or by replacing it with a customized version of a BaseTable reporter.

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 is used for this reporter or whose template library contains the template for this reporter

  • Document Object Model (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 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.

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.

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.

Methods

expand all

Examples

collapse all

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

model_name = 'sf_climate_control';
openExample(model_name);

rpt = slreportgen.report.Report('output','pdf');
truthtableobj = 'sf_climate_control/ClimateController';

chapter = Chapter(truthtableobj);
rptr = TruthTable(truthtableobj);
rptr.IncludeConditionTableRowNumber = false;
add(chapter,rptr)
add(rpt,chapter)

close(rpt)
close_system(model_name)
rptview(rpt)

Truth table presented in Chapter 1 of a PDF report

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

model_name = 'sf_climate_control';
openExample('sf_climate_control');

rpt = slreportgen.report.Report('output','pdf');
truthtableobj = 'sf_climate_control/ClimateController';

chapter = Chapter(truthtableobj);
rptr = TruthTable(truthtableobj);
rptr.IncludeConditionTableRowNumber = false;
rptr.ConditionTableReporter.MaxCols = 4;
add(chapter,rptr)
add(rpt,chapter)

close(rpt)
close_system(model_name)
rptview(rpt)

Truth table presented in Chapter 1 of a PDF report

Version History

Introduced in R2018b