Skip to content
Snippets Groups Projects
Commit f77a66ee authored by Cristian Galperti's avatar Cristian Galperti
Browse files

log signals big cleanup, teady for doublet linear ctrl

parent d57e515b
No related branches found
No related tags found
No related merge requests found
% DEPRECATED JUST AFTER WRITTEN, USE DEL IN THE SIMULATION DATA INSPECTOR
% TO DELETE LOGGED SIGNALS
% This function parses automatically
% all signals of the given modelname
% (comprising all submodels)
% and asks whether to disable log for
% signals (which are marked for logging)
function disablesignalslog(topmodelname)
disp('Getting mdlrefs info ...');
[models,blocks]=find_mdlrefs(topmodelname);
for mod=1:numel(models)
fprintf(['Analyzing model ' char(models{mod}) '\n']);
disablesignalslogsinglemodel(models{mod});
end
end
function disablesignalslogsinglemodel(modelname)
load_system(modelname);
mdlsignals = find_system(modelname,'FindAll','on','LookUnderMasks','all','FollowLinks','on','type','line','SegmentType','trunk');
ph = get_param(mdlsignals,'SrcPortHandle');
for i=1: length(ph)
try
if strcmp(get_param(ph{i},'datalogging'),'on')
answer=input(['MDL: ' modelname ' SIG: ' get_param(ph{i},'Name') ' log is ' get_param(ph{i},'datalogging') ', turn off? [Y/N]:'],'s');
if strcmp(answer,'Y')
set_param(ph{i},'datalogging','off');
end
end
catch ME
continue;
end
end
save_system(modelname);
close_system(modelname);
end
\ No newline at end of file
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