Code covered by the BSD License  

Highlights from
Color Model from PolySpace Verification

image thumbnail

Color Model from PolySpace Verification

by

 

The tool colors Simulink Model using PolySpace code verification.

sl_customization(cm)
function sl_customization(cm)


% SL_CUSTOMIZATION - Menu customization 
% Displaying Menu Tags
%cm.showWidgetIdAsToolTip=true;

% Register custom menu function.
cm.addCustomMenuFcn('Simulink:ToolsMenu', @AddMyCustomMenuItems);

%% Tag	Usage
%Simulink:MenuBar            Add menus to Model Editor's menu bar.
%Simulink:ContextMenu        Add items to the end of Model Editor's context menu.
%Simulink:PreContextMenu     Add items to the beginning of Model Editor's
%context menu.
%Stateflow:MenuBar           Add menus to Chart Editor's menu bar.
%Stateflow:ContextMenu       Add items to the end of Chart Editor's context menu.
%Stateflow:PreContextMenu    Add items to the beginning of Chart Editor's context menu.

end

%% Define the custom menu function.
function schemaFcns = AddMyCustomMenuItems(callbackInfo) 
  schemaFcns = {@Item_ColorFromCodeVerification}; 
end

%% Define the schema function for first menu item.
function schema = Item_ColorFromCodeVerification(callbackInfo)
  %schema = sl_action_schema;
  schema = sl_toggle_schema;
  schema.label = 'Color from Code Verification';
  system=bdroot; % Do Not use gcs
  
  res_dir = polyspace_get_resultdir;
  if (strcmp(res_dir,''))
      schema.checked = 'unchecked';
  else
      colorfilename = [res_dir '/oldcolor_blocks.txt'];
      
      if (exist(colorfilename,'file') == 2)
          schema.checked = 'checked';
      else
          schema.checked = 'unchecked';
      end
      
      schema.callback = @Color_Model_From_Verification;
  end
end


Contact us