Main Content

CallbackStyle property

Callback function type

Values

'DetailStyle' (recommended)
'StyleOne' (default)
'StyleTwo'
'StyleThree'

Description

The CallbackStyle property specifies the type of the callback function.

The ‘DetailStyle’ check callback function is for detailed results collection. This type of callback function is the recommended one and enables you to use the default format of the Model Advisor report. The keyword for this callback function is DetailStyle. The check definition requires this keyword. With the default format, you do not have to use the ModelAdvisor.FormatTemplate class or the other Model Advisor Formatting APIs to format the results that appear in the Model Advisor. This style also allows you to view results by block, subsystem, or recommended action.

The detailed results collection callback function takes the following arguments.

ArgumentI/O TypeDescription
systemInputPath to the model or subsystem analyzed by the Model Advisor.
CheckObjInputModelAdvisor.Check object

To indicate whether a model has passed or failed the check, or to recommend fixing an issue using the Model Advisor Formatting APIs to format results, use the simple check callback function. The keyword for this callback function is StyleOne. The check definition requires this keyword.

The simple check callback function takes the following arguments.

ArgumentI/O TypeDescription
systemInputPath to the model or subsystem analyzed by the Model Advisor.
resultOutputMATLAB® character vector that supports Model Advisor Formatting API calls or embedded HTML tags for text formatting.

Use the detailed check callback function to return and organize results as strings in a layered, hierarchical fashion. The function provides two output arguments so you can associate text descriptions with one or more paragraphs of detailed information. The keyword for the detailed callback function is StyleTwo. The check definition requires this keyword.

The detailed callback function takes the following arguments.

ArgumentI/O TypeDescription
systemInputPath to the model or system analyzed by the Model Advisor.
ResultDescriptionOutputCell array of MATLAB character vectors that supports Model Advisor Formatting API calls or embedded HTML tags for text formatting. The Model Advisor concatenates the ResultDescription character vector with the corresponding array of ResultDetails character vectors.
ResultDetailsOutputCell array of cell arrays, each of which contains one or more character vectors. The ResultDetails cell array must be the same length as the ResultDescription cell array.

To automatically display hyperlinks for every object returned by the check, use the callback function with hyperlinked results. The keyword for this type of callback function is StyleThree. The check definition requires this keyword.

This callback function takes the following arguments.

ArgumentI/O TypeDescription
systemInputPath to the model or system analyzed by the Model Advisor.
ResultDescriptionOutputCell array of MATLAB character vectors that supports the Model Advisor Formatting API calls or embedded HTML tags for text formatting.
ResultDetailsOutputCell array of cell arrays, each of which contains one or more Simulink® objects such as blocks, ports, lines, and Stateflow® charts. The objects must be in the form of a handle or Simulink path. The ResultDetails cell array must be the same length as the ResultDescription cell array.