Contenido principal

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(PropertyName=Value) creates a truth table reporter with additional options specified by one or more PropertyName=Value pair arguments. Name is a property name and Value is the corresponding value. You can specify several name-value 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 logical 1 (true) or 0 (false). When you specify:

Specify whether to include headers in the truth table condition table, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — The report includes column headers in the truth table.

  • 0 (false) — The report does not include column headers in the truth table.

Specify whether to include row numbers in the truth table condition table, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — Each row of the condition table starts with a row number.

  • 0 (false) — The condition table does not include row numbers.

Specify whether to include the condition column in the truth table condition table, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — The report includes the conditions that trigger the decisions.

  • 0 (false) — The report does not include the conditions that trigger the decisions.

Specify whether to include the description column in the truth table condition table, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — The report includes descriptions of the truth table conditions.

  • 0 (false) — The report does not include 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 1 (true) or 0 (false). When you specify:

  • 1 (true) — The action table includes the column headers, such as "Description" that identify the contents of each column.

  • 0 (false) — The action table does not include column headers.

Specify whether to include row numbers in the truth table action table, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — The row numbers are included in the action table.

  • 0 (false) — The row numbers are not included in the action table.

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 1 (true) or 0 (false). When you specify:

  • 1 (true) — Each row of the action table lists the executable action statements for each action.

  • 0 (false) — The action column is not included in the action table.

Specify whether to include the description column in the truth table action table, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — Each row of the action table contains a description of the corresponding action.

  • 0 (false) — The description column is not included in the action table.

Reporter used by the TruthTable reporter to create the action table of the truth 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 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
Dependent
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

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

model = "sf_climate_control";
openExample(model);

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)
rptview(rpt)

Truth table presented in Chapter 1 of a PDF report

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

model = "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)
rptview(rpt)

Truth table presented in Chapter 1 of a PDF report

Version History

Introduced in R2018b