| Simulink® Verification and Validation™ | ![]() |
| On this page… |
|---|
Defining Where Custom Groups Appear |
Groups are used to consolidate checks in the Model Advisor by functionality or usage. You define custom groups in
One or more functions that specify the properties of each instance of the ModelAdvisor.FactoryGroup class.
One or more task definition functions that specify the properties of each instance of the ModelAdvisor.Group class. See Defining Custom Tasks for more information about task definition functions.
You must define one instance of the group classes for each grouping that you want to add to the Model Advisor, and register the custom group as described in Registering Custom Checks, Tasks, and Groups. The sections that follow describe how to define custom groups.
You can specify where custom groups are placed within the Model Advisor tree using the following guidelines:
To define a new group in the Model Advisor Task Manager, use the ModelAdvisor.Group class.
To define a new group in the By Task folder, use the ModelAdvisor.FactoryGroup class.
Note To define a new group in the By Product folder, you must use the ModelAdvisor.Root.publish method within a custom check. See Defining Where Custom Checks Appear for more information. |
The following table describes the properties of the ModelAdvisor.Group and ModelAdvisor.FactoryGroup classes:
| Property | Data Type | Default Value | Description |
|---|---|---|---|
| DisplayName | String | '' (null string) | Name of the group as it should appear in Model Advisor. |
| ID | String | You must provide ID | Permanent, unique identifier for the group that you must specify. |
| Description | String | '' (null string) | Description of the group, which Model Advisor displays in the right pane when you view details about the group. |
| MAObj | Simulink. ModelAdvisor object | Handle to Simulink. ModelAdvisor object | The Model Advisor object you are working on. |
The following is an example of a group definition that places the tasks defined in Code Example: Task Definition Function inside a folder called My Group under the Model Advisor Task Manager folder. This group definition is included in the task definition function.
MAG = ModelAdvisor.Group('com.mathworks.sample.GroupSample');
MAG.DisplayName='My Group';
MAG.addTask(MAT1);
MAG.addTask(MAT2);
MAG.addTask(MAT3);
mdladvRoot.publish(MAG); % publish under Model Advisor Task ManagerThe following is an example of a factory group definition function that places the checks defined in Code Example: Check Definition Function into a folder called Demo Factory Group inside of the By Task folder.
function defineModelAdvisorTasks
mdladvRoot = ModelAdvisor.Root;
% --- sample factory group
rec = ModelAdvisor.FactoryGroup('com.mathworks.sample.factorygroup');
rec.DisplayName='Demo Factory Group';
rec.Description='Demo Factory Group';
rec.addCheck('com.mathworks.sample.Check1');
rec.addCheck('com.mathworks.sample.Check2');
rec.addCheck('com.mathworks.sample.Check3');
mdladvRoot.publish(rec); % publish inside By Task
![]() | Defining Custom Tasks | Defining a Process Callback Function | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |