| Simulink® Verification and Validation™ | ![]() |
The ModelAdvisor.Check class creates a Model Advisor check object. All checks must have an associated ModelAdvisor.Task or ModelAdvisor.Root object to appear in the Model Advisor tree.
You can use one ModelAdvisor.Check object in multiple ModelAdvisor.Task objects, allowing you to place the same check in multiple locations in the Model Advisor tree. For example, Check for implicit signal resolution appears in the By Product > Simulink folder and in the By Task > Model Referencing folder in the Model Advisor tree.
check_obj = ModelAdvisor.Check(check_ID)
A variable representing the check object you create.
A string that uniquely identifies the check. The value of check_ID must remain constant.
| Name | Description |
|---|---|
| getID | Returns the check ID |
| setAction | Specify action |
| setCallbackFcn | Specify callback function |
| setInputParameters | Specify input parameters |
| setInputParametersLayoutGrid | Specify layout grid for input parameters |
Returns the check ID
id = check_obj.getID
A variable representing the check object.
A unique string identifying the check.
The getID method returns a string that uniquely identifies the check. You create this unique identifier when you create the check. This is the equivalent of the ModelAdvisor.Check ID property.
Specify action
check_obj.setAction(action_obj)
A variable representing the check object.
The ModelAdvisor.Action object to use in the check.
The setAction method identifies the action you want to use in a check.
Specify callback function
check_obj.setCallbackFcn(@handle, context, style)
A variable representing the check object.
A handle to a check callback function.
Context for checking the model or subsystem.
None — No special requirements.
PostCompile — The model must be compiled.
Type of callback function:
StyleOne — Simple check callback function
StyleTwo — Detailed check callback function
StyleThree — Check callback function with hyperlinked results
Specify the callback function to use with the check object.
Creating Callback Functions for Checks
Specify input parameters
check_obj.setInputParameters(params)
A variable representing the check object.
A cell array of ModelAdvisor.InputParameter objects.
Specify the input parameters to use in a check object.
Specify layout grid for input parameters
check_obj.setInputParametersLayoutGrid([row col])
A variable representing the check object.
Total number of rows in the layout grid.
Total number of columns in the layout grid.
Specify the layout grid for input parameters in the Model Advisor. Use this method if there are multiple input parameters.
Note The following example is a fragment of code from the sl_customization.m file for the demo model slvnvdemo_mdladv. The example does not execute as shown without the additional content found in the sl_customization.m file. |
See Demo and Code Example for more information.
%Define a check
rec = ModelAdvisor.Check('com.mathworks.sample.Check1');
rec.Title = 'Check Simulink block font';
rec.TitleTips = 'Example style three callback';
rec.setCallbackFcn(@SampleStyleThreeCallback,'None','StyleThree');
% Define input parameters
rec.setInputParametersLayoutGrid([3 2]);
inputParam1 = ModelAdvisor.InputParameter;
inputParam1.Name = 'Skip font checks.';
inputParam2.Name = 'Standard font size';
inputParam2 = ModelAdvisor.InputParameter;
inputParam3.Name='Valid font';
inputParam3 = ModelAdvisor.InputParameter;
rec.setInputParameters({inputParam1,inputParam2,inputParam3});
% define action (fix) operation
myAction = ModelAdvisor.Action;
rec.setAction(myAction);
![]() | ModelAdvisor.Action | ModelAdvisor.FactoryGroup | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |