slreportgen.report.ExecutionOrder Class
Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter
System task and block execution order 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 arguments. You can specify multiple name-value arguments in any order.reporter = slreportgen.report.ExecutionOrder(Name=Value)
Properties
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.BlockResultobjectAn
slreportgen.finder.DiagramResultobject
If you set the Object property to a subsystem reference, the
generated report includes a message stating that it cannot determine the execution order
for the diagram.
Specifying a BlockResult or DiagramResult that
represents an unloaded model or a virtual subsystem results in an error.
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
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
Whether to include block diagrams of block execution order, specified as
true or false. When you set
ShowBlockDiagrams to true, the reporter
includes a diagram that displays the block execution order for each task. If the
ShowBlockExecutionOrder property is also true,
the reporter displays the diagram before the block execution order.
This property requires the model or subsystem to be visible. The system opens when
it is loaded into memory and the ShowBlockDiagrams property is set
to true.
Data Types: logical
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'}
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
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
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
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
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 separateExecutionOrderreporter 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 subsystemExecutionOrderreporter. No link is inserted for MATLAB Function block subsystems."NestedList"— Subsystem blocks are displayed as a nested list.
System tasks to filter, specified as a function handle, string scalar, or character
vector. If TaskFilterFcn is empty, the report includes all system
tasks.
If you specify 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 you specify the hit times for an aperiodic task as an expression, the trigger is a string that contains the expression to evaluate.sourceBlock— Block that defines the task.
Return
trueto filter the specified task from the report, orfalseto include the task in the report.
For example, see Filter Tasks by Using Function Handles.
If you specify a string scalar or a character vector, it must contain an expression. The expression:
Can use the variables
taskName,taskType,trigger, andsourceBlockMust set the variable
isFilteredtotrueto filter the specified task from the report, orfalseto include the task in the report
For example, see Filter Tasks by Using String Scalars.
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.
Diagram reporter to format the block execution order diagrams, specified as an
slreportgen.report.Diagram reporter.
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.
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.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
For each block diagram or virtual subsystem of the vdp model, report the system tasks and the blocks in each task, in execution order.
Open the model.
model_name = "vdp";
load_system(model_name); Create a report.
rpt = slreportgen.report.Report("ExecutionOrder_example","pdf");
Create a finder to find all of the diagrams in the model.
finder = slreportgen.finder.DiagramFinder(model_name);
Create a Diagrams chapter.
ch = mlreportgen.report.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.
append(rpt,ch);
Close and view the report.
close(rpt); rptview(rpt); close_system(model_name)
This example shows how to report periodic tasks by specifying the TaskFilterFcn property as a function handle.
Open the model.
model_name = "vdp";
load_system(model_name);Create a report.
rpt = slreportgen.report.Report("ExecutionOrder_example","html");
Create a finder to find the diagrams in the model.
finder = slreportgen.finder.DiagramFinder(model_name);
Create a Diagrams chapter.
ch = mlreportgen.report.Chapter("Diagrams");For each diagram that is a block diagram or a nonvirtual subsystem, report the system tasks and blocks in execution order. Specify the TaskFilterFcn property as a function handle named filterFcnHandle that filters tasks that are not periodic.
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); filterFcnHandle = @(taskName,taskType,trigger,sourceBlock) ... ~strcmpi(taskType,"Periodic"); rptr.TaskFilterFcn = filterFcnHandle; append(sect,rptr); append(ch,sect); end end
Append the chapter to the report.
append(rpt,ch);
Close and view the report.
close(rpt); rptview(rpt); close_system(model_name)
This example shows how to report periodic tasks by specifying the TaskFilterFcn property as a string.
Open the model.
model_name = "vdp";
load_system(model_name);Create a report.
rpt = slreportgen.report.Report("ExecutionOrder_example","html");
Create a finder to find the diagrams in the model.
finder = slreportgen.finder.DiagramFinder(model_name);
Create a Diagrams chapter.
ch = mlreportgen.report.Chapter("Diagrams");For each diagram that is a block diagram or a nonvirtual subsystem, report the system tasks and blocks in execution order. Specify the TaskFilterFcn property as a string that filters tasks that are not periodic. The string must contain an expression that sets the value of a variable named isFiltered.
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); filterStr = "isFiltered = ~strcmpi(taskType, ""Periodic"");"; rptr.TaskFilterFcn = filterStr; append(sect,rptr); append(ch,sect); end end
Append the chapter to the report.
append(rpt,ch);
Close and view the report.
close(rpt); rptview(rpt); close_system(model_name)
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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)