slreportgen.report.EnumerationType Class
Namespace: slreportgen.report
Description
Use an object of the slreportgen.report.EnumerationType
class to report on
enumerated types used in Simulink® models and submodels. Instances of this class are returned by the
getReporter
method of slreportgen.finder.EnumerationTypeResult
objects. Adding this reporter to a report,
without any modifications, adds enumeration-type information based on the default settings.
Use the reporter properties to specify the report options.
Note
You can use this reporter only with reports of the slreportgen.report.Report
class.
The slreportgen.report.EnumerationType
class is a handle
class.
Creation
You do not need to create an slreportgen.report.EnumerationType
object
yourself. Instances of this class are returned by the getReporter
method of slreportgen.finder.EnumerationTypeResult
objects. Adding this reporter to a report,
without any modifications, adds enumeration-type information based on the default settings.
Use the reporter properties to specify the report options.
Properties
EnumTypeUsage
— Simulink.VariableUsage
object
Simulink.VariableUsage
object
Simulink.VariableUsage
object for the
variable represented by this result.
Attributes:
SetAccess | protected |
EnumInfoFormatter
— Specify a reporter to use to report and format properties in table
mlreportgen.report.BaseTable
(default) | customized mlreportgen.report.BaseTable
Specifies a reporter to use to report and format the enumeration-type properties in
a tabular form that is, in a property-value pair table. The default value of this
property is an object of mlreportgen.report.BaseTable
type. You can
customize the appearance of the table by customizing the default reporter or by
replacing it with a customized version of the BaseTable
reporter. See the
mlreportgen.report.BaseTable
documentation or command-line help for
information on customizing this reporter. Any content that you specify in the
Title
property of the default or the replacement reporter will
appear before the title in the generated report. This example to shows what the
BaseTable
reports on when you:
Define an enumeration type in a MATLAB® file
Table 1.1. ON_OFF_TYPE Properties
Property Value Name ON_OFF_TYPE
Source Type MATLAB file Source ON_OFF_TYPE.m
Members OFF(0)
ON(1)
FAILEDANDCLOSE(2)
Default Value OFF(0)
Define an enumeration type dynamically.
Table 1.1. BasicColors Properties
Property Value Name BasicColors Source Type Dynamic class Source Define by Simulink.defineIntEnumType
Members Blue(0)
Red(1)
Yellow(2)
Default Value Blue Define an enumeration type in a data dictionary.
Table 1.1. BasicColors Properties
Property Value Name BasicColors Source Type Data dictionary Source sldemo_fuelsys_dd_controller.dd
Enumeration Members Blue(0)
Red(1)
Yellow(2)
Default Value Blue
Properties
— Specify the names of enumeration properties to report
{"Name","Source Type","Source","Members","Default
Value"}
(default) | cell array of enumerated type properties
Specify the names of enumeration properties to report, specified as a cell array of
strings or character vectors. The default value of this property is a cell array of
enumeration properties {"Name","Source Type","Source","Members","Default
Value"}
. You can customize this cell array from the following enumerated
type properties:
Enumerated Type Properties
"Name" |
"Source Type" |
"Source" |
"Members" |
"Default Value" |
"Header File" |
"Description" |
Data Types: cell
ShowUsedBy
— Whether to show list of blocks that use enumeration types
true
(default) | false
Whether to show a list of the blocks that use the enumeration type, specified as
true
or false
. If the
ShowUsedBy
property is set to true
, the
reporter includes a list of the blocks that use the bus object in the report. If the
ShowUsedBySnapshot
property is also set to
true
, the reporter includes a diagram snapshot for each parent
subsystem that uses the enumeration type. Blocks that use the enumeration type are
highlighted in the snapshot.
Data Types: logical
ListFormatter
— Formatter for enumeration type lists
mlreportgen.dom.OrderedList
object | mlreportgen.dom.UnorderedList
object
Formatter for the enumeration type lists, specified as an mlreportgen.dom.OrderedList
object or mlreportgen.dom.UnorderedList
object. The OrderedList
or
UnorderedList
object must not contain list items.
The default value of this property is an OrderedList
object with the
StyleName
property set to the
ExecutionOrderList
style, which is defined in the default template
for an ExecutionOrder
reporter. To customize the appearance of the list,
modify the properties of the default OrderedList
object or replace the
object with a your own OrderedList
or UnorderedList
object.
IncludeMATLABCode
— Specify whether to include MATLAB code that defines the enumeration type
false (default) | true
This property specifies whether to include the MATLAB code that defines the
enumeration type, specified as true
or false
. The
default value is false
.
Note
This property applies only when you define the enumeration type in an M file.
Data Types: logical
MATLABCodeSectionTitle
— Specify a DOM Paragraph object to fill with title content for MATLABCodeReporter
code
empty mlreportgen.dom.Paragraph
object (default) | customized mlreportgen.dom.Paragraph
object
Specify a mlreportgen.dom.Paragraph
object to fill with the title
content for the MATLABCodeReporter
code, specified as a
mlreportgen.dom.Paragraph
object. The default value of this
property is an empty mlreportgen.dom.Paragraph
object whose properties
specify the appearance of the source code title. By default, the
EnumerationType
reporter generates a title from the enumerated data
type name and appends it to the paragraph. The generated title consists of the
enumerated type name followed by "Source Code"
. For example, an
enumerated type of "ON_OFF_TYPE"
generates the title
"ON_OFF_TYPE Source Code"
. You can customize the title appearance
by modifying the properties of the default paragraph object or by replacing it with
another paragraph object. Any content that you add to the default or replacement
paragraph appears before the title in the generated report. See the mlreportgen.dom.Paragraph
documentation or command-line help for information
on customizing the DOM paragraph formats.
Note
This property applies only when the IncludeMATLABCode
property is set to true
.
MATLABCodeReporter
— Specify a reporter to report and format the MATLAB code that defines the enumeration type
empty mlreportgen.report.MATLABCode
object (default) | customized mlreportgen.report.MATLABCode
object
Specify a reporter to report and format the MATLAB code that defines the enumeration
type, specified as a mlreportgen.report.MATLABCode
object. The default
value of this property is a mlreportgen.report.MATLABCode
object. To customize the code appearance,
modify the properties of the default MATLABCode
reporter or replace
the reporter with a custom reporter. See the mlreportgen.report.MATLABCode
documentation or command-line help for
information on customizing this reporter.
Note
This property applies only when the IncludeMATLABCode
property is set to true.
TemplateSrc
— Source of template for reporter
[]
(default) | character vector | string scalar | reporter or report | DOM document or document part
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
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 report. 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.
TemplateName
— Name of template for this reporter
character vector | string scalar
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
LinkTarget
— Hyperlink target for this reporter
[]
(default) | character vector | string scalar | mlreportgen.dom.LinkTarget
object
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
Public Methods
slreportgen.report.EnumerationType.createTemplate | Create copy of slreportgen.report.EnumerationType reporter
template |
slreportgen.report.EnumerationType.customizeReporter | Create custom subclass of slreportgen.report.EnumerationType
class |
slreportgen.report.EnumerationType.getClassFolder | Get location of folder containing
slreportgen.report.EnumerationType class definition file |
getImpl | Get implementation of reporter |
Examples
Include Enumerated Type Information in Report
Customize the formatting of model variables in a report by iterating through the search results and setting properties of the model variable reporter for each result.
% Create a Report rpt = slreportgen.report.Report("MyReport","docx"); % Create a Chapter chapter = mlreportgen.report.Chapter(); chapter.Title = "EnumerationType Reporter Example"; % Load the model model_name = "EnumExample"; load_system(model_name); % Find the enumerated types in the model finder = slreportgen.finder.EnumerationTypeFinder(model_name); while hasNext(finder) result = next(finder); % Get the EnumerationType reporter for the result and set the IncludeMATLABCode property to true reporter = getReporter(result); reporter.IncludeMATLABCode = true; % Add the reporter to the chapter append(chapter,reporter); end % Add chapter to the report append(rpt,chapter); % Close the report and open the viewer close(rpt); rptview(rpt);
Version History
Introduced in R2023b
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)