annotate aim-mat/tools/@parameter/enablefield.m @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 20ada0af3d7d
children
rev   line source
tomwalters@0 1 % method of class @parameter
tomwalters@0 2 %
bleeck@3 3 % (c) 2011, University of Southampton
bleeck@3 4 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 5 % download of current version is on the soundsoftware site:
bleeck@3 6 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 7 % documentation and everything is on http://www.acousticscale.org
tomwalters@0 8 function param=enablefield(param,paramtext,enablesthese,inbox)
tomwalters@0 9 % the boolean parameter paramtext switches on or off the fields in
tomwalters@0 10 % enablethese
tomwalters@0 11
tomwalters@0 12
tomwalters@0 13 cont=param.entries;
tomwalters@0 14 nrent=length(cont);
tomwalters@0 15
tomwalters@0 16 if nargin<4 % search in all subsections
tomwalters@0 17 inbox='all';
tomwalters@0 18 end
tomwalters@0 19
tomwalters@0 20 nr=getentrynumberbytext(param,paramtext,inbox);
tomwalters@0 21 inbox=param.entries{nr}.panel;
tomwalters@0 22
tomwalters@0 23 if nr>0
tomwalters@0 24 cval=param.entries{nr}.value;
tomwalters@0 25 if iscell(enablesthese)
tomwalters@0 26 nre=length(enablesthese);
tomwalters@0 27 else
tomwalters@0 28 nre=size(enablesthese,1);
tomwalters@0 29 end
tomwalters@0 30 if nre==1
tomwalters@0 31 param.entries{nr}.enables{1}=enablesthese;
tomwalters@0 32 param.entries{nr}.enables_inbox{1}=inbox;
tomwalters@0 33 param=enable(param,enablesthese,cval,inbox);
tomwalters@0 34 else
tomwalters@0 35 for i=1:nre
tomwalters@0 36 param.entries{nr}.enables{i}=enablesthese{i};
tomwalters@0 37 param.entries{nr}.enables_inbox{i}=inbox;
tomwalters@0 38 param=enable(param,enablesthese{i},cval,inbox);
tomwalters@0 39 end
tomwalters@0 40 end
tomwalters@0 41 else
tomwalters@0 42 error('setvalue::error, the entry does not exist');
tomwalters@0 43 end
tomwalters@0 44