Skip to content
Snippets Groups Projects
SCDconf_setCODEconf.m 941 B
Newer Older
% Sets the code generation configuration settings on all the models
% If called with 0 arguments it copies :
% configurationSettingsCODE -> configurationSettings
% otherwise it takes the first argument as the name of the
% configuration settings to be copied into configurationSettings
function [] = SCDconf_setCODEconf(varargin)
    if nargin==0
        codeconfname='configurationSettingsCODEicc';
    else
        codeconfname=varargin{1};
    end
    fprintf('Setting configurationSettings = %s at configurations.sldd level ...\n', codeconfname);
    d=Simulink.data.dictionary.open('configurations.sldd');
    dd=getSection(d, 'Configurations');
    activeconf=dd.getEntry('configurationSettings');
    codeconf=dd.getEntry(codeconfname);
    configurationSettings=codeconf.getValue;
    configurationSettings.Name='configurationSettings';
    activeconf.deleteEntry;
    dd.addEntry('configurationSettings',configurationSettings);
end