%% Variant Lamp Design
% This example shows how to design a system that uses variant transitions to
% generate code that can be used in a variety of different software situations. 

% Copyright 2020 The MathWorks, Inc.

%%

% Set up charts with white background
set_param(0,'ExportBackgroundColorMode','white');

model = 'sfVariantLampExample';
load_system(model);
open_system([model '/Lamp'])
%%
% Some of the lamps have the ability to be dimmed. Within that subset, 
% there are lamps that can be set high or low and lamps that can only be 
% set to high, medium, or low.
%
% Entry to the variant configurations are guarded by a transition condition
% that uses a Simulink parameter or MATLAB variable that is defined in the
% base workspace. 
%
% In this example, the variant configurations are guarded by a condition
% with a Simulink parameter. In this case, HAS_DIMMER1 and HAS_DIMMER2 are
% parameter objects.
%
% When you generate code from the Simulink model, your code includes only
% the active variant state machine. If using Embedded Coder,
% you have the option to include a preprocessor conditional statement in
% the generated code.
% 