Mercurial > hg > ltpda
view m-toolbox/sltpda/sltpda_verify_model.m @ 38:3aef676a1b20 database-connection-manager
Keep backtrace on error
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function result = sltpda_verify_model(mdlfile) % SLTPDA_VERIFY_MODEL verifies that the given model file only contains % sLTPDA compatible blocks. % % usage: result = sltpda_verify_model(mdlfile) % % result: 0 = failed, 1 = passed % % M Hewitson 28-03-07 % % $Id: sltpda_verify_model.m,v 1.2 2007/04/25 09:06:08 hewitson Exp $ % banner = sprintf('=========== verifying ''%s'' ===========', mdlfile); disp(banner); disp(' '); result = 1; % load the model into memory load_system(mdlfile); % get list of blocks sys = get_param(mdlfile, 'Handle'); blocks = find_system(sys, 'FindAll', 'on', 'type', 'block'); bcmds = getBlockCommands(blocks); % check each block for j=1:length(bcmds) if ~isValidBlock(bcmds(j).fcn) result = 0; end end if result == 0 error(['### model ' mdlfile ' contains invalid blocks.']); end bannerEnd = []; while length(bannerEnd) < length(banner) bannerEnd = [bannerEnd '=']; end disp(' '); disp(bannerEnd); disp(' ') % END