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
Simulink.VariableUsage object for the
variable represented by this result.
Attributes:
SetAccess | protected |
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
BaseTablereports on when you:
Define an enumeration type in a MATLAB® file
Table 1.1. ON_OFF_TYPE Properties
Property Value Name ON_OFF_TYPESource Type MATLAB file Source ON_OFF_TYPE.mMembers OFF(0)ON(1)FAILEDANDCLOSE(2)
Default Value OFF(0)
Define an enumeration type dynamically.
Table 1.1.
BasicColorsPropertiesProperty Value Name BasicColorsSource Type Dynamic class Source Define by Simulink.defineIntEnumTypeMembers Blue(0)
Red(1)
Yellow(2)
Default Value Blue Define an enumeration type in a data dictionary.
Table 1.1.
BasicColorsPropertiesProperty Value Name BasicColorsSource Type Data dictionary Source sldemo_fuelsys_dd_controller.ddEnumeration Members Blue(0)
Red(1)
Yellow(2)
Default Value Blue
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
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
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.
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
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.
Specify a reporter to report and format the MATLAB code that defines the enumeration
type, specified as a mlreportgen.report.MATLABCodeobject. 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.
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
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
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)