User`s guide
Model Advisor Code Examples
25-61
% Title and description of first subcheck
setSubTitle(ft1,'Verify Block reduction setting');
setInformation(ft1,'Check whether the ''Block reduction'' check box is cleared.');
% Add See Also section with references to applicable standards
docLinks{1} = {['Reference DO-178B Section 6.3.4e - Source code ' ...
'is traceable to low-level requirements']};
% Review 'Block reduction' optimization
setRefLink(ft1,docLinks);
if strcmp(get_param(system,'BlockReduction'),'off')
% 'Block reduction' is cleared
% Set subresult status to 'Pass' and display text describing the status
setSubResultStatus(ft1,'Pass');
setSubResultStatusText(ft1,'The ''Block reduction'' check box is cleared.');
ResultStatus = true;
else
% 'Block reduction' is selected
% Set subresult status to 'Warning' and display text describing the status
setSubResultStatus(ft1,'Warn');
setSubResultStatusText(ft1,'The ''Block reduction'' check box is selected.');
setRecAction(ft1,['Clear the ''Optimization > Block reduction''' ...
' check box in the Configuration Parameters dialog box.']);
ResultStatus = false;
end
ResultDescription{end+1} = ft1;
% Title and description of second subcheck
ft2 = ModelAdvisor.FormatTemplate('ListTemplate');
setSubTitle(ft2,'Verify Conditional input branch execution setting');
setInformation(ft2,['Check whether the ''Conditional input branch execution'''...
' check box is cleared.'])
% Add See Also section and references to applicable standards
docLinks{1} = {['Reference DO-178B Section 6.4.4.2 - Test coverage ' ...
'of software structure is achieved']};
setRefLink(ft2,docLinks);
% Last subcheck, supress line
setSubBar(ft2,false);
% Check status of the 'Conditional input branch execution' check box
if strcmp(get_param(system,'ConditionallyExecuteInputs'),'off')
% The 'Conditional input branch execution' check box is cleared
% Set subresult status to 'Pass' and display text describing the status
setSubResultStatus(ft2,'Pass');
setSubResultStatusText(ft2,['The ''Conditional input branch execution''' ...
'check box is cleared.']);
else
% 'Conditional input branch execution' is selected
% Set subresult status to 'Warning' and display text describing the status
setSubResultStatus(ft2,'Warn');
setSubResultStatusText(ft2,['The ''Conditional input branch execution'''...
' check box is selected.']);
setRecAction(ft2,['Clear the ''Optimization > Conditional input branch ' ...
'execution'' check box in the Configuration Parameters dialog box.']);