slreportgen.report.ExecutionOrder Class
Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter
Description
Use an object of the slreportgen.report.ExecutionOrder
class to report the
tasks of a model or nonvirtual subsystem and the blocks in each task, sorted by execution
order. By default, an ExecutionOrder
reporter generates:
A table of task names and properties
A list of the blocks in each task
Conditionally executed blocks, such as subsystems triggered by a function call
or an If block, are not displayed in the block execution order list. Instead,
these blocks are displayed in a Conditional Execution
table that follows
the block execution order list. The table lists the conditionally executed blocks and the
blocks that trigger their execution.
Use the ExecutionOrder
reporter properties to filter the reported content
and customize the content formatting.
Note
To use an slreportgen.report.ExecutionOrder
reporter in a report, you
must create the report using the slreportgen.report.Report
class or subclass. An ExecutionOrder
reporter does not generate content if it is added to an
slreportgen.report.Report
object that has the
CompileModelBeforeReporting
set to false
.
The slreportgen.report.ExecutionOrder
class is a handle
class.
Creation
Description
creates an empty reporter
= slreportgen.report.ExecutionOrderExecutionOrder
reporter object based on the default
template. You must specify a model or subsystem for which to report the execution order by
setting the Object
property. Use other properties to specify report options.
creates an reporter
= slreportgen.report.ExecutionOrder(system
)ExecutionOrder
reporter and sets the Object
property to the specified model or subsystem.
sets the reporter properties using name-value pairs. You can specify multiple name-value
pair arguments in any order.reporter
= slreportgen.report.ExecutionOrder(Name=Value
)
Properties
Object
— Model or nonvirtual subsystem block to report
[]
(default) | character vector | string scalar | handle | slreportgen.finder.DiagramResult
object | slreportgen.finder.BlockResult
Model or nonvirtual subsystem block to report, specified as one of these types of values:
Character vector or string scalar containing the path of the model or subsystem
Handle to the model or subsystem
An
slreportgen.finder.BlockResult
objectAn
slreportgen.finder.DiagramResult
object
Specifying a BlockResult
or DiagramResult
that
represents an unloaded model or a virtual subsystem results in an error.
ShowTaskDetails
— Whether to include a task details table
true
(default) | false
Whether to include a task details table, specified as true
or
false
. If ShowTaskDetails
is
true
, the reporter generates a table that displays names and
properties of tasks in the specified system.
Data Types: logical
ShowBlockExecutionOrder
— Whether to include block execution order lists
true
(default) | false
Whether to include block execution order lists, specified as true
or false
. If ShowBlockEecutionOrder
is
true
, the reporter includes a list of blocks, sorted in order of
execution, for each task in the system. Conditionally executed blocks, such as
subsystems triggered by a function call or If block, are not displayed in
the execution order list. Instead, these blocks are displayed in a Conditional
Execution
table that follows the block execution order list. The table lists
the conditionally executed blocks and the blocks that trigger their execution.
Data Types: logical
TaskProperties
— Properties to report for task
["Order" "Name" "Type" "Trigger" "TaskID"
"SourceBlock"]
(default) | string array | cell array of character vectors
Properties to report for each system task, specified as a string array or cell array of character vectors. By default, all properties are included. Valid properties are:
Order
— Place of the task in the task execution order at each time step. For Asynchronous and Constant tasks, this property is reported asN/A
.Name
— Name of the task.Type
— Type of the task, for example,Periodic
,Aperiodic
,Asynchronous
, orConstant
.Trigger
— Rate at which periodic tasks execute or the list of times at which aperiodic tasks execute.TaskID
— Task index in the specified system.SourceBlock
— Block that defines the task.
Example: ["Order" "Name" "Type" "Trigger" "TaskID"
"SourceBlock"]
Example: {'Order' 'Name' 'Type'}
ShowEmptyColumns
— Whether to show empty columns in task details table
false
(default) | true
Whether to show empty columns in the task details table, specified as
true
or false
. If
ShowEmptyColumns
is true
, the task details
table includes columns that do not have any data.
Data Types: logical
ShowBlockType
— Whether to show the block type in execution order lists
true
(default) | false
Whether to show the type of each block in the block execution order lists, specified
as true
or false
. If
ShowBlocktype
is true
, the reporter includes
the type of each block next to the block name in the execution order lists.
Data Types: logical
ShowHiddenBlocks
— Whether to show blocks created at compile time
true
(default) | false
Whether to show blocks created at compile time, specified as true
or false
. If ShowHiddenBlocks
is
true
, the reporter includes blocks that Simulink® inserts when the model is compiled. If
ShowHiddenBlocks
is false
, the reporter
includes only user-added blocks.
Data Types: logical
IncludeSubsystemBlocks
— Whether to reference block lists of nonvirtual subsystems
true
(default) | false
Whether to reference block lists of nonvirtual subsystems, specified as
true
or false
. If
IncludeSubsystemBlocks
is true, the reporter includes references to
nonvirtual subsystem blocks. The SubsystemBlocksDisplayPolicy property determines how the nonvirtual
subsystem blocks are referenced.
Data Types: logical
SubsystemBlocksDisplayPolicy
— Policy for referencing execution order lists of blocks in nonvirtual subsystems
"Link"
(default) | "NestedList"
Policy for referencing execution order lists of blocks that are in nonvirtual subsystems, specified as one of these string scalars or character vectors:
"Link"
— (default) A link to a separate block execution order list for the subsystem is inserted next to the subsystem name. The link works only if the report generation program that includes this reporter also includes a separateExecutionOrder
reporter for the subsystem. For each task that includes the subsystem in a multitasking model, the link goes to the block execution order list for the corresponding task reported by the subsystemExecutionOrder
reporter. No link is inserted for MATLAB Function block subsystems."NestedList"
— Subsystem blocks are displayed as a nested list.
TaskFilterFcn
— Function or expression to filter system tasks
[]
(default) | function handle | string scalar | character vector
Function or expression to filter system tasks from a report, specified as a function
handle, string scalar, or character vector. Specify a function as a function handle.
Specify an expression as a string scalar or character vector. If
TaskFilterFcn
is empty, all tasks are included in the
report.
If you provide a function handle, the associated function must:
Take these arguments:
taskName
— Name of the task.taskType
— Type of the task.trigger
— Sample time or hit times of the task. If the hit times for an aperiodic task are specified as an expression, trigger is a string that contains the expression to be evaluated.sourceBlock
— Block that defines the task.
Return
true
to filter the specified task from the report, orfalse
to include the task in the report.
Run the following command to access the supporting files used in this example.
openExample('rptgenext/SimulinkReportGeneratorFilesExample');
For example, this code uses the TaskFilterFcn
property to
report only periodic
tasks:
import slreportgen.finder.* import slreportgen.report.* import mlreportgen.report.* model_name = "slrgex_vdp"; load_system(model_name); rpt = slreportgen.report.Report("ExecutionOrder_example","html"); finder = DiagramFinder(model_name); ch = Chapter("Diagrams"); while hasNext(finder) result = next(finder); % Only report block diagrams and nonvirtual subsystems if (strcmpi(result.Type,"Simulink.SubSystem")... && strcmpi(get_param(result.Object,"IsSubsystemVirtual"),"off")) ... || strcmpi(result.Type,"Simulink.BlockDiagram") sect = Section(result.Name); append(sect,result); % Create ExecutionOrder reporter and add to report rptr = ExecutionOrder(result); % Filter all but periodic tasks filterFcnHandle = @(taskName, taskType, trigger, sourceBlock) ... ~strcmpi(taskType, "Periodic"); rptr.TaskFilterFcn = filterFcnHandle; append(sect,rptr); append(ch,sect); end end append(rpt,ch); close(rpt); rptview(rpt);
If you provide a string scalar or a character vector, it must contain an expression. The expression:
Can use the variables
taskName
,taskType
,trigger
, andsourceBlock
Must set the variable
isFiltered
totrue
to filter the specified task from the report, orfalse
to include the task in the report
For example, this code uses the TaskFilterFcn
property to
report only periodic tasks:
import slreportgen.finder.* import slreportgen.report.* import mlreportgen.report.* model_name = "slrgex_vdp"; load_system(model_name); rpt = slreportgen.report.Report("ExecutionOrder_example","html"); finder = DiagramFinder(model_name); ch = Chapter("Diagrams"); while hasNext(finder) result = next(finder); % Only report block diagrams and nonvirtual subsystems if (strcmpi(result.Type,"Simulink.SubSystem")... && strcmpi(get_param(result.Object,"IsSubsystemVirtual"),"off")) ... || strcmpi(result.Type,"Simulink.BlockDiagram") sect = Section(result.Name); append(sect,result); % Create ExecutionOrder reporter and add to report rptr = ExecutionOrder(result); % Filter all but periodic tasks % Code string to include only asynchronous tasks filterStr = "isFiltered = ~strcmpi(taskType, ""Periodic"");"; rptr.TaskFilterFcn = filterStr; append(sect,rptr); append(ch,sect); end end append(rpt,ch); close(rpt); rptview(rpt);
TableReporter
— Formatter for task details table
mlreportgen.report.BaseTable
object
Formatter for the task details table, specified as an mlreportgen.report.BaseTable
object. The default value of this property is a
BaseTable
object with the TableStyleName
property
set to the ExecutionOrderTable
style, which is defined in the default
template for an ExecutionOrder
reporter. To customize the appearance of
the table, modify the properties of the default BaseTable
object or
replace the object with your own BaseTable
object. If you add content to
the Title
property of the BaseTable
object, the
content appears in front of the table title in the generated report.
DiagramReporter
— Formatter for block execution order diagrams
mlreportgen.report.Diagram
object
Diagram reporter to format the block execution order diagrams, specified as an
slreportgen.report.Diagram
reporter.
ListFormatter
— Formatter for block execution order lists
mlreportgen.dom.OrderedList
object | mlreportgen.dom.UnorderedList
object
Formatter for the block execution order 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.
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.ExecutionOrder.createTemplate | Create execution order reporter template |
slreportgen.report.ExecutionOrder.customizeReporter | Create custom execution order reporter class |
slreportgen.report.ExecutionOrder.getClassFolder | Get location of execution order 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
Report System Tasks and Task Blocks in Execution Order
For each block diagram or virtual subsystem of the vdp
model, report the system tasks and the blocks in each task, in execution order.
Import the MATLAB and Simulink Report API packages so that you do not have to use long, fully qualified class names.
import mlreportgen.report.* import slreportgen.finder.* import slreportgen.report.*
Open the model and create a report.
model_name = "vdp"; load_system(model_name); rpt = slreportgen.report.Report("ExecutionOrder_example","pdf");
Create a finder to find all of the diagrams in the model. Create a Diagrams
chapter.
finder = DiagramFinder(model_name);
ch = Chapter("Diagrams");
For each diagram that is a block diagram or a nonvirtual subsystem, report the system tasks and blocks in execution order, using the default values of the slreportgen.report.ExecutionOrder
reporter properties.
while hasNext(finder) result = next(finder); if (strcmpi(result.Type,"Simulink.SubSystem") &&... strcmpi(get_param(result.Object,"IsSubsystemVirtual"),"off")) ... || strcmpi(result.Type,"Simulink.BlockDiagram") sect = mlreportgen.report.Section(result.Name); append(sect,result); rptr = slreportgen.report.ExecutionOrder(result); append(sect,rptr); append(ch,sect); end end
Append the chapter to the report. Close and view the report.
append(rpt,ch); close(rpt); rptview(rpt);
Version History
Introduced in R2020b
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)