slreportgen.report.SystemHierarchy Class
Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter
System hierarchy reporter
Description
Creates a system hierarchy reporter that generates a nested list of the subsystems of a Simulink® model or subsystem in a report.
Note
To use a system hierarchy reporter in a report, you must create the report using the
slreportgen.report.Report
class or subclass.
The slreportgen.report.SystemHierarchy
class is a handle
class.
Creation
Description
rptr = slreportgen.report.SystemHierarchy
creates an empty system hierarchy reporter based on a default template. Customize the
content and format of the generated list by using the reporter properties. Before you add
the reporter to a report, you must specify a model or subsystem in the Source
property of the reporter. Adding an empty reporter to a report produces an error.
rptr = slreportgen.report.SystemHierarchy(
creates a system hierarchy reporter for the model or subsystem specified by
source
)source
. See the Source
property.
sets the reporter properties using name-value pairs. You can specify multiple name-value
pair arguments in any order.rptr
= slreportgen.report.SystemHierarchy(Name=Value
)
Properties
Source
— Simulink model or subsystem
[]
(default) | string scalar | character vector | handle
Simulink model or subsystem, specified as a string scalar or character vector that contains the path to the model or subsystem, or as a handle to the model or subsystem.
Attributes:
NonCopyable | true |
MaxAncestorLevel
— Maximum number of levels of ancestors to include
Inf
(default) | nonnegative integer scalar
Maximum number of levels of ancestors of the source subsystem to include in the
generated list, specified as a nonnegative integer scalar. For example, if
MaxAncestorLevel
is 2
, the list includes the
source and up to two levels of ancestors. If MaxAncestorLevel
is
Inf
, the default value, the list includes all ancestors. If
MaxAncestorLevel
is zero, the list does not include
ancestors.
MaxDescendantLevel
— Maximum number of levels of descendants to include
Inf
(default) | nonnegative integer scalar
Maximum number of levels of descendants of the source model or subsystem to include
in the generated list, specified as a nonnegative integer scalar. For example, if
MaxDescendantLevel
is 2
, the list includes the
source and up to two levels of descendants. If MaxDescendantLevel
is
Inf
, the default value, the list includes all descendants. If
MaxDescendantLevel
is zero, the list does not include
descendants.
IncludePeers
— Whether to include peers of the subsystem
true
(default) | false
Whether to include peers of the source subsystem in the generated list, specified as
true
or false
.
EmphasizeSource
— Whether to emphasize the source
true
(default) | false
Whether to emphasize the source model or subsystem in the generated list, specified
as true
or false
. If
EmphasizeSource
is true
, the name of the source
model or subsystem is formatted according to the TextFormatter
property. Otherwise, it is formatted like the other items in the list.
ListFormatter
— List formatter
mlreportgen.dom.UnorderedList
(default) | mlreportgen.dom.OrderedList
List formatter that formats the generated list, specified as an mlreportgen.dom.UnorderedList
object or an mlreportgen.dom.OrderedList
object. The default value of this property is an
object of mlreportgen.dom.UnorderedList
. To
customize the list formatting, modify the list object properties or replace the list
object with a customized list object that does not contain list items.
SourceTextFormatter
— Text formatter for highlighting the name of the source
mlreportgen.dom.Text
Text formatter object that formats the name of the source model or subsystem in the
generated list, specified as an mlreportgen.dom.Text
object. This property
applies only if the EmphasizeSource
property is
true
. The initial value of the
SourceTextFormatter
property is an mlreportgen.dom.Text
object with the Bold
and
Italic
properties set to true
. To customize
the appearance of the name in the generated list, modify the
mlreportgen.dom.Text
object properties or replace the object with a
customized mlreportgen.dom.Text
object. If you add text to the default or
replacement text object, the text appears in front of the source name in the generated
report.
IncludeMaskedSubsystems
— Whether to include masked subsystems
false
(default) | true
Whether the generated list of descendants of the source system includes masked
subsystems, specified as true
or false
. If
IncludeMaskedSubsystems
is true
, the list
includes masked subsystems and their descendant subsystems, as long as the number of
levels below the source subsystem is less than or equal to the value of the
MaxDescendantLevel
property.
To enable the system hierarchy reporter to link masked subsystems to the
corresponding diagrams in the report, in the diagram reporter, set the
MaskedSystemLinkPolicy
property to
'system'
.
IncludeReferencedModels
— Whether to include referenced models
true
(default) | false
Whether the generated list of descendants of the source system includes referenced
models, specified as true
or false
. If
IncludeReferencedModels
is true
, the list
includes referenced models and their descendant subsystems, as long as the number of
levels below the source subsystem is less than or equal to the value of the
MaxDescendantLevel
property.
IncludeReferencedSubsystems
— Whether to include referenced subsystems
true
or 1
(default) | false
or 0
Whether the generated list of descendants of the source system includes referenced
subsystems, specified as true
or false
. If
IncludeReferencedSubsystems
is true
, the list
includes referenced subsystems and their descendant subsystems, as long as the number of
levels below the source subsystem is less than or equal to the value of the
MaxDescendantLevel
property.
IncludeSimulinkLibraryLinks
— Whether to include Simulink library links
true
(default) | false
Whether the generated list of descendants of the source system includes subsystems
that link to a Simulink library subsystem, specified as true
or
false
. The list includes a linked subsystem or one of its
descendant subsystems, only if all of these conditions are true:
The value of
IncludeSimulinkLibraryLinks
istrue
.The subsystem is not masked, or the subsystem is masked and the value of the
IncludeMaskedSubsystems
property istrue
.The number of levels below the source subsystem is less than or equal to the value of the
MaxDescendantLevel
property.
IncludeUserLibraryLinks
— Whether to include library links to user-defined libraries
true
(default) | false
Whether the generated list of descendants of the source system includes subsystems
that link to a user-defined library subsystem, specified as true
or
false
. The list includes a linked subsystem, or one of its
descendant subsystems, only if all of these conditions are true:
The value of
IncludeUserLibraryLinks
istrue
.The subsystem is not masked, or the subsystem is masked and the value of the
IncludeMaskedSubsystems
property istrue
.The number of levels below the source subsystem is less than or equal to the value of the
MaxDescendantLevel
property.
IncludeVariants
— Variants to include
"Active"
(default) | "All"
| "ActivePlusCode"
Variants of a variant block to include in the generated list of descendants of the source system, specified as one of the values in the table. You can specify the value as a string scalar or a character vector.
Value | Description |
---|---|
"Active" | Active variants (default) |
"All" | All variants |
"ActivePlusCode" | Active variants and code variants |
The list includes the variants only if the number of levels below the source
subsystem is less than or equal to the value of the
MaxDescendantLevel
property.
TemplateSrc
— Source of template for this reporter
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
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.
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.SystemHierarchy.createTemplate | Create system hierarchy reporter template |
slreportgen.report.SystemHierarchy.customizeReporter | Create custom system hierarchy reporter class |
slreportgen.report.SystemHierarchy.getClassFolder | Get location of system hierarchy reporter class definition file |
copy | Create copy of a Simulink reporter object and make deep copies of certain property values |
getImpl | Get implementation of reporter |
Examples
Include System Hierarchy of a Model in a Report
Include the system hierarchy of the slrgex_fuelsys
model in a report by adding an slreportgen.report.SystemHierarchy
reporter to a report generation program. Generate the model diagrams by adding an slreportgen.finder.DiagramFinder
object. The system hierarchy reporter generates links from subsystems in the nested list to the corresponding diagrams.
% Import the API packages import slreportgen.report.* import mlreportgen.report.* import mlreportgen.dom.* % Load the model model = "slrgex_fuelsys"; load_system(model); % Create a report rpt = slreportgen.report.Report("output","pdf"); % Create a chapter reporter chapter = Chapter("System Hierarchy for the " + model + " Model"); % Create a SystemHierarchy reporter for the model rptr = SystemHierarchy(model); % Add the SystemHierarchy reporter to the chapter. % Add the chapter to the report add(chapter, rptr); add(rpt, chapter); % Find the diagrams for the subsystems finder = slreportgen.finder.DiagramFinder(model); while hasNext(finder) result = next(finder); ch = Chapter(result.Name); add(ch, result); add(rpt, ch); end % Close and view the output report close(rpt); close_system(model); rptview(rpt);
Here is the system hierarchy in the generated report:
To see the diagram corresponding to a subsystem, click the subsystem in the list.
Version History
Introduced in R2019b
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.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)