annotate aim-mat/gui/aim_loadpersonal_defaults.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 % procedure for 'aim-mat'
tomwalters@0 2 %function handles=aim_loadpersonal_defaults(handles)
tomwalters@0 3 % INPUT VALUES:
tomwalters@0 4 %
tomwalters@0 5 % RETURN VALUE:
tomwalters@0 6 %
tomwalters@0 7 %
bleeck@3 8 %
tomwalters@0 9 % (c) 2011, University of Southampton
bleeck@3 10 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 11 % download of current version is on the soundsoftware site:
bleeck@3 12 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 13 % documentation and everything is on http://www.acousticscale.org
bleeck@3 14
bleeck@3 15
tomwalters@0 16
tomwalters@0 17
tomwalters@0 18 function handles=aim_loadpersonal_defaults(handles)
tomwalters@0 19 % loads the file 'personal_defaults' from the current directory
tomwalters@0 20 % each personal default setting for a parameter must come in the complete
tomwalters@0 21 % parameter format
tomwalters@0 22 % e.g.
tomwalters@0 23 %
tomwalters@0 24
tomwalters@0 25 if exist('personal_defaults.m','file')
tomwalters@0 26
tomwalters@0 27 all_options=handles.all_options;
tomwalters@0 28
tomwalters@0 29 try
tomwalters@0 30 personal_defaults; % evaluates the file and overwrites the
tomwalters@0 31 catch
tomwalters@0 32 disp('aim_loadpersonal_defaults: errors in reading in the personal_defaults.m');
tomwalters@0 33 return
tomwalters@0 34 end
tomwalters@0 35 % if OK, then overwrite the parameters:
tomwalters@0 36 handles.all_options=all_options;
tomwalters@0 37
tomwalters@0 38
tomwalters@0 39 if exist('default_module_pcp','var')==1
tomwalters@0 40 handles=setselection(handles,'pcp',default_module_pcp);
tomwalters@0 41 handles.info.default_start_module_pcp=default_module_pcp;
tomwalters@0 42 end
tomwalters@0 43 if exist('default_module_bmm','var')==1
tomwalters@0 44 handles=setselection(handles,'bmm',default_module_bmm);
tomwalters@0 45 handles.info.default_start_module_bmm=default_module_bmm;
tomwalters@0 46 end
tomwalters@0 47 if exist('default_module_nap','var')==1
tomwalters@0 48 handles=setselection(handles,'nap',default_module_nap);
tomwalters@0 49 handles.info.default_start_module_nap=default_module_nap;
tomwalters@0 50 end
tomwalters@0 51 if exist('default_module_strobes','var')==1
tomwalters@0 52 handles=setselection(handles,'strobes',default_module_strobes);
tomwalters@0 53 handles.info.default_start_module_strobes=default_module_strobes;
tomwalters@0 54 end
tomwalters@0 55 if exist('default_module_sai','var')==1
tomwalters@0 56 handles=setselection(handles,'sai',default_module_sai);
tomwalters@0 57 handles.info.default_start_module_sai=default_module_sai;
tomwalters@0 58 end
tomwalters@0 59 if exist('default_module_usermodule','var')==1
tomwalters@0 60 handles=setselection(handles,'usermodule',default_module_usermodule);
tomwalters@0 61 handles.info.default_start_module_usermodule=default_module_usermodule;
tomwalters@0 62 end
tomwalters@0 63 if exist('default_module_movie','var')==1
tomwalters@0 64 handles=setselection(handles,'pcp',default_module_pcp);
tomwalters@0 65 handles.info.default_start_module_pcp=default_module_pcp;
tomwalters@0 66 end
tomwalters@0 67 if exist('default_module_pcp','var')==1
tomwalters@0 68 handles=setselection(handles,'movie',default_module_movie);
tomwalters@0 69 handles.info.default_start_module_movie=default_module_movie;
tomwalters@0 70 end
tomwalters@0 71 end
tomwalters@0 72
tomwalters@0 73 function handles=setselection(handles,selstr,curmod)
tomwalters@0 74 switch selstr
tomwalters@0 75 case('pcp')
tomwalters@0 76 hand=handles.listbox0;
tomwalters@0 77 handles.info.current_pcp_module=curmod;
tomwalters@0 78 case('bmm')
tomwalters@0 79 hand=handles.listbox1;
tomwalters@0 80 handles.info.current_bmm_module=curmod;
tomwalters@0 81 case('nap')
tomwalters@0 82 hand=handles.listbox2;
tomwalters@0 83 handles.info.current_nap_module=curmod;
tomwalters@0 84 case('strobes')
tomwalters@0 85 hand=handles.listbox3;
tomwalters@0 86 handles.info.current_strobes_module=curmod;
tomwalters@0 87 case('sai')
tomwalters@0 88 hand=handles.listbox4;
tomwalters@0 89 handles.info.current_sai_module=curmod;
tomwalters@0 90 case('usermodule')
tomwalters@0 91 hand=handles.listbox6;
tomwalters@0 92 handles.info.current_usermodule_module=curmod;
tomwalters@0 93 case('movie')
tomwalters@0 94 hand=handles.listbox5;
tomwalters@0 95 handles.info.current_movie_module=curmod;
tomwalters@0 96 end
tomwalters@0 97
tomwalters@0 98 names=get(hand,'String');
tomwalters@0 99 for i=1:length(names)
tomwalters@0 100 if strcmp(names{i},curmod)
tomwalters@0 101 set(hand,'Value',i);
tomwalters@0 102 return
tomwalters@0 103 end
tomwalters@0 104 end
tomwalters@0 105 return
tomwalters@0 106
tomwalters@0 107
tomwalters@0 108
tomwalters@0 109
tomwalters@0 110