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

Better checks in case of problems

parent d4c9c00e
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,18 @@ if nargin==1
bus = varargin{1};
else
dd = varargin{1};
busname = varargin{2};
bus=dd.getEntry(busname).getValue; % get from data dictionary
busName = varargin{2};
assert(dd.exist(busName),'%s does not exist in dd',busName)
busEntry=dd.getEntry(busName); % get from data dictionary
if numel(busEntry)>1
report = sprintf('multiple entries found with name %s\n Sources:\n',busName);
for ii=1:numel(busEntry)
report = [report,sprintf('%20s\n',busEntry(ii).DataSource)];
end
error(report);
end
bus = busEntry.getValue;
end
bussize=size(bus.Elements);
signalssize=bussize(1);
......@@ -24,9 +34,9 @@ signalssize=bussize(1);
for ii=1:signalssize
element=bus.Elements(ii);
if contains(element.DataType,'Bus: ')
busname = erase(element.DataType,'Bus: ');
busName = erase(element.DataType,'Bus: ');
% recursive call
out.(element.Name) = SCDconf_createstructfrombus(dd,busname);
out.(element.Name) = SCDconf_createstructfrombus(dd,busName);
else
try
if ~strcmp(element.DataType,'boolean')
......
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