Main Content

slreportgen.report.CCaller Class

Namespace: slreportgen.report

C Caller block reporter

Since R2022a

Description

Use objects of the slreportgen.report.CCaller class to report on C Caller blocks in your Simulink® model.

By default, a CCaller reporter object reports:

  • The name of the C function called by the C Caller block

  • The Description parameter and any custom mask parameters

  • The port properties associated with the C Caller block

  • The C code that the C Caller block invokes

Use the CCaller reporter properties to exclude or modify the reported information.

Note

To use a CCaller reporter in your report, you must create the report using the slreportgen.report.Report class.

The slreportgen.report.CCaller class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

cCallerReporter = slreportgen.report.CCaller creates an empty C Caller block reporter with default property values. Use the object properties to specify report options.

Note

Adding an empty CCaller object to a report causes an error.

cCallerReporter = slreportgen.report.CCaller(Object) creates a reporter for the given C Caller block object and sets the Object property to Object.

Include this reporter in your report to add information about the C Caller block name, available functions, and port specifications. Update the properties of the object to change the display options for the reporter.

example

cCallerReporter = slreportgen.report.CCaller(Name=Value) sets properties by using name-value arguments. Specify multiple name-value arguments in any order.

Properties

expand all

C Caller block to report, specified as a string scalar or character vector that contains the name of a C Caller block, a C Caller block handle, or a slreportgen.report.BlockResult object.

Attributes:

GetAccess
public
SetAccess
public

Include a table of block properties in the report, specified as true or false. This table displays all block dialog parameters except the function name, available functions, and port specifications. If all other dialog parameters are empty, the table is not displayed.

To format this table and the included properties, edit the ObjectPropertiesReporter property.

Attributes:

GetAccess
public
SetAccess
public

Include a list of other available functions in the report, specified as true or false. This list displays the functions that the C Caller block can call.

Attributes:

GetAccess
public
SetAccess
public

Include the C code of the C Caller block in the report, specified as true or false.

Attributes:

GetAccess
public
SetAccess
public

Properties for the block properties table, specified as an slreportgen.report.SimulinkObjectProperties object. The default value for this is an empty slreportgen.report.SimulinkObjectProperties object. Specify the properties to display in the Properties property of the SimulinkObjectProperties object. If Properties is empty, the reporter automatically determines which properties to display.

Attributes:

GetAccess
public
SetAccess
public

Format the port properties of the C Caller block to report, specified as an mlreportgen.report.BaseTable object. The default value for this property is an empty mlreportgen.report.BaseTable object with the StyleName property set to "CCallerPortSpecificationTable". Customize the appearance of the table by modifying the properties of the default BaseTable object.

Attributes:

GetAccess
public
SetAccess
public

Paragraph format for the function name title, specified as an mlreportgen.dom.Paragraph object. The default value is an empty mlreportgen.dom.Paragraph object with StyleName set to "CCallerFunctionNameTitle".

Customize the appearance of the title by modifying the properties of the default object or by replacing it with another Paragraph object.

Attributes:

GetAccess
public
SetAccess
public

Paragraph format for the function name, specified as an mlreportgen.dom.Paragraph object. The default value is an empty mlreportgen.dom.Paragraph object with StyleName set to "CCallerFunctionName".

Customize the appearance of the function name by modifying the properties of the default object or by replacing it with another Paragraph object.

Attributes:

GetAccess
public
SetAccess
public

Paragraph format for the title of the available functions list, specified as an mlreportgen.dom.Paragraph object. The default value is an empty mlreportgen.dom.Paragraph object with StyleName set to "CCallerAvailableFunctionsTitle".

Customize the appearance of the title by modifying the properties of the default object or by replacing it with another Paragraph object.

Attributes:

GetAccess
public
SetAccess
public

List of available functions, specified as an mlreportgen.dom.UnorderedList or mlreportgen.dom.OrderedList object.

The default value is a mlreportgen.dom.UnorderedList object. Customize the appearance of the list by modifying the properties of the default object or by replacing it with another object that does not contain any children.

Attributes:

GetAccess
public
SetAccess
public

Paragraph format for the title of the C code for the C Caller block, specified as an mlreportgen.dom.Paragraph object. The default value is an empty mlreportgen.dom.Paragraph object with the property StyleName set to "CCallerCodeTitle".

Customize the appearance of the title by modifying the properties of the default object or by replacing it with another Paragraph object. Any content added to the Paragraph object in this property appears before the code title in the report.

Attributes:

GetAccess
public
SetAccess
public

Format the C code included in your reporter, specified as an mlreportgen.dom.Preformatted object.

The default value for this property is an empty mlreportgen.dom.Preformatted object with StyleName property set to "CCallerCode". Customize the appearance of the code by modifying the properties of the default object.

Attributes:

GetAccess
public
SetAccess
public

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.

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

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

expand all

Examples

collapse all

This example shows how to add information about C Caller blocks in your Simulink® model to a report.

Create a PDF report and load the required model.

import mlreportgen.report.*
import slreportgen.report.*
import slreportgen.finder.*

rpt = slreportgen.report.Report("CCallerReport","pdf");
rpt.CompileModelBeforeReporting = false;
model_name = 'ExampleModelSLR';
load_system(model_name);

% Create a chapter for the C Caller block information
add(rpt,TitlePage(Title=sprintf('C Caller Blocks in %s', model_name),Author=""));
add(rpt, TableOfContents);

Create a SystemDiagramFinder object to return the diagrams for each C Caller block in the model.

diagFinder = SystemDiagramFinder(model_name);

Iterate through the results of the finder object and find the associated C Caller blocks.

while hasNext(diagFinder)
    diagram = next(diagFinder);
    chapter = Chapter(Title=diagram.Name);
    add(chapter, diagram);

    finder = BlockFinder(diagram.Object);
    finder.BlockTypes = "CCaller";
    results = find(finder);
    
    for result = results 
        rptr = CCaller(result);     
        rptr.IncludeAvailableFunctions = true;
        add(chapter,rptr);
    end
    add(rpt, chapter);
end
close(rpt);
close_system(model_name);
rptview(rpt);

Version History

Introduced in R2022a