Skip to content
Snippets Groups Projects
Commit 5edea360 authored by Federico Felici's avatar Federico Felici
Browse files

more cleanup

parent 581e8d1b
No related branches found
No related tags found
No related merge requests found
......@@ -191,15 +191,13 @@ classdef SCDclass_algo
% Add buses to data dictionary from .m file descriptions, if
% available. Bus names in obj.inBus, obj.outBus
if ~isempty(which(obj.inBus)) && ~isempty(which(obj.outBus))
dict = Simulink.data.dictionary.open(obj.getdatadictionary);
designDataObj = getSection(dict, 'Design Data');
dictionaryObj = Simulink.data.dictionary.open(obj.getdatadictionary);
designDataObj = getSection(dictionaryObj, 'Design Data');
fprintf('Add buses to data dictionary: %s, %s\n',obj.inBus,obj.outBus);
eval(obj.inBus); eval(obj.outBus); % eval buses in base workspace
dosave = false;
dosave = obj.replaceorcreateddentry(designDataObj,obj.inBus ,evalin('base',obj.inBus )) || dosave;
dosave = obj.replaceorcreateddentry(designDataObj,obj.outBus,evalin('base',obj.outBus )) || dosave;
if dosave, dict.saveChanges; end % Save if necessary
obj.replaceorcreateddentry(designDataObj,obj.inBus ,evalin('base',obj.inBus ));
obj.replaceorcreateddentry(designDataObj,obj.outBus,evalin('base',obj.outBus ));
if dictionaryObj.HasUnsavedChanges, dictionaryObj.saveChanges; end % Save if necessary
evalin('base',sprintf('clear %s %s',obj.inBus,obj.outBus));
else
fprintf('no buses imported in datadictionary - assuming they are already there\n')
......@@ -469,7 +467,7 @@ classdef SCDclass_algo
target = targetnames{iout};
if strcmp(workspace,'datadictionary')
% assign in associated data dictionary
obj.replaceorcreateddentry(dd,target,val) || dosave;
obj.replaceorcreateddentry(dd,target,val);
elseif strcmp(workspace,'base')
% assign in base workspace
assignin('base',target,val)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment