Defining Check List Views

About List Views

List views allow you to provides the information to populate the Model Advisor Result Explorer window, and adds the Explore Result button to a custom check in the Model Advisor window. You define list views using the ModelAdvisor.ListViewParameter class inside a custom check function (see Defining Custom Checks). You must define one instance of this class for each list view that you want to add to a Model Advisor Result Explorer. See Batch-Fixing Warnings or Failuresfor information on using the dialog box.

Properties of List Views

The following table describes the properties of the ModelAdvisor.ListViewParameter class:

PropertyData TypeDefault ValueDescription
NameString'' (null string)Entry in the Show drop-down menu in the Model Advisor Result Explorer.
DataArray of Simulink objects[] (empty array)The objects shown in the Model Advisor Result Explorer.
AttributesCell array{} (empty cell array)The attributes to show in the center pane of the Model Advisor Result Explorer.

Code Example: List View Definition

The following is an example of defining list views. You must make the Explore Result button visible using the ModelAdvisor.Check ListViewVisible property inside a custom check function, and include list view definitions inside a check callback function (see Detailed Check Callback Function).

The following code, when included in a custom check function, adds the Explore Result button to the check in the Model Advisor window.

rec = ModelAdvisor.Check('com.mathworks.sample.Check1');
% add 'Explore Result' button
rec.ListViewVisible = true;

The following code, when included in a check callback function, provides the information to populate the Model Advisor Result Explorer window.

mdladvObj = Simulink.ModelAdvisor.getModelAdvisor(system);
mdladvObj.setCheckResultStatus(true);

% define list view parameters
myLVParam = ModelAdvisor.ListViewParameter;
myLVParam.Name = 'Invalid font blocks'; % the name appeared at pull down filter
myLVParam.Data = get_param(searchResult,'object')';
myLVParam.Attributes = {'FontName'}; % name is default property
mdladvObj.setListViewParameters({myLVParam});
  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS