annotate aim-mat/gui/aim_display_versions.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 aim_display_versions(handles)
tomwalters@0 3 % INPUT VALUES:
tomwalters@0 4 % RETURN VALUE:
tomwalters@0 5 %
bleeck@3 6 %
tomwalters@0 7 % (c) 2011, University of Southampton
bleeck@3 8 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 9 % download of current version is on the soundsoftware site:
bleeck@3 10 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 11 % documentation and everything is on http://www.acousticscale.org
bleeck@3 12
bleeck@3 13
tomwalters@0 14
tomwalters@0 15
tomwalters@0 16 function aim_display_versions(handles)
tomwalters@0 17
tomwalters@0 18 %PCP
tomwalters@0 19 pcpnames=get(handles.listbox0,'String');
tomwalters@0 20 for i=1:length(pcpnames)
tomwalters@0 21 str=sprintf('ver=handles.all_options.pcp.%s.revision;',pcpnames{i});
tomwalters@0 22 try
tomwalters@0 23 eval(str);
tomwalters@0 24 catch
tomwalters@0 25 ver='Revision not known';
tomwalters@0 26 end
tomwalters@0 27 text{1}{i}.columname='PCP';
tomwalters@0 28 text{1}{i}.modulename=pcpnames{i};
tomwalters@0 29 text{1}{i}.version=ver;
tomwalters@0 30 end
tomwalters@0 31 %BMM
tomwalters@0 32 bmmnames=get(handles.listbox1,'String');
tomwalters@0 33 for i=1:length(bmmnames)
tomwalters@0 34 str=sprintf('ver=handles.all_options.bmm.%s.revision;',bmmnames{i});
tomwalters@0 35 try
tomwalters@0 36 eval(str);
tomwalters@0 37 catch
tomwalters@0 38 ver='Revision not known';
tomwalters@0 39 end
tomwalters@0 40 text{2}{i}.columname='BMM';
tomwalters@0 41 text{2}{i}.modulename=bmmnames{i};
tomwalters@0 42 text{2}{i}.version=ver;
tomwalters@0 43 end
tomwalters@0 44 %NAP
tomwalters@0 45 napnames=get(handles.listbox2,'String');
tomwalters@0 46 for i=1:length(napnames)
tomwalters@0 47 str=sprintf('ver=handles.all_options.nap.%s.revision;',napnames{i});
tomwalters@0 48 try
tomwalters@0 49 eval(str);
tomwalters@0 50 catch
tomwalters@0 51 ver='Revision not known';
tomwalters@0 52 end
tomwalters@0 53 text{3}{i}.columname='NAP';
tomwalters@0 54 text{3}{i}.modulename=napnames{i};
tomwalters@0 55 text{3}{i}.version=ver;
tomwalters@0 56 end
tomwalters@0 57 %STROBES
tomwalters@0 58 strobesnames=get(handles.listbox3,'String');
tomwalters@0 59 for i=1:length(strobesnames)
tomwalters@0 60 str=sprintf('ver=handles.all_options.strobes.%s.revision;',strobesnames{i});
tomwalters@0 61 try
tomwalters@0 62 eval(str);
tomwalters@0 63 catch
tomwalters@0 64 ver='Revision not known';
tomwalters@0 65 end
tomwalters@0 66 text{4}{i}.columname='STROBES';
tomwalters@0 67 text{4}{i}.modulename=strobesnames{i};
tomwalters@0 68 text{4}{i}.version=ver;
tomwalters@0 69 end
tomwalters@0 70 %SAI
tomwalters@0 71 sainames=get(handles.listbox4,'String');
tomwalters@0 72 for i=1:length(sainames)
tomwalters@0 73 str=sprintf('ver=handles.all_options.sai.%s.revision;',sainames{i});
tomwalters@0 74 try
tomwalters@0 75 eval(str);
tomwalters@0 76 catch
tomwalters@0 77 ver='Revision not known';
tomwalters@0 78 end
tomwalters@0 79 text{5}{i}.columname='SAI';
tomwalters@0 80 text{5}{i}.modulename=sainames{i};
tomwalters@0 81 text{5}{i}.version=ver;
tomwalters@0 82 end
tomwalters@0 83 %USER
tomwalters@0 84 usernames=get(handles.listbox6,'String');
tomwalters@0 85 for i=1:length(usernames)
tomwalters@0 86 str=sprintf('ver=handles.all_options.user.%s.revision;',usernames{i});
tomwalters@0 87 try
tomwalters@0 88 eval(str);
tomwalters@0 89 catch
tomwalters@0 90 ver='Revision not known';
tomwalters@0 91 end
tomwalters@0 92 text{6}{i}.columname='USER';
tomwalters@0 93 text{6}{i}.modulename=usernames{i};
tomwalters@0 94 text{6}{i}.version=ver;
tomwalters@0 95 end
tomwalters@0 96 %MOVIES
tomwalters@0 97 movienames=get(handles.listbox5,'String');
tomwalters@0 98 for i=1:length(movienames)
tomwalters@0 99 str=sprintf('ver=handles.all_options.movie.%s.revision;',movienames{i});
tomwalters@0 100 try
tomwalters@0 101 eval(str);
tomwalters@0 102 catch
tomwalters@0 103 ver='Revision not known';
tomwalters@0 104 end
tomwalters@0 105 text{7}{i}.columname='MOVIES';
tomwalters@0 106 text{7}{i}.modulename=movienames{i};
tomwalters@0 107 text{7}{i}.version=ver;
tomwalters@0 108 end
tomwalters@0 109
tomwalters@0 110
tomwalters@0 111 figure;
tomwalters@0 112 win=get(gca,'Parent');
tomwalters@0 113 set(win,'Name','All models and all versions');
tomwalters@0 114 set(win,'NumberTitle','off');
tomwalters@0 115 set(win,'MenuBar','none');
tomwalters@0 116 movegui(win,'center');
tomwalters@0 117 pos=get(win,'Position');
tomwalters@0 118 set(win,'Visible','on');
tomwalters@0 119 box = uicontrol('Style', 'ListBox','Position', [0,0,pos(3),pos(4)],'HorizontalAlignment','left');
tomwalters@0 120 set(box,'Parent',win);
tomwalters@0 121 set(box,'FontSize',10);
tomwalters@0 122
tomwalters@0 123 str=[];
tomwalters@0 124 counter=1;
tomwalters@0 125 for i=1:7
tomwalters@0 126 nr_modules=length(text{i});
tomwalters@0 127 str{counter}=text{i}{1}.columname ;
tomwalters@0 128 counter=counter+1;
tomwalters@0 129 % str=[str text{i}{1}.columname '\n'];
tomwalters@0 130 for j=1:nr_modules
tomwalters@0 131 ver=strrep(text{i}{j}.version,'$','');
tomwalters@0 132 str{counter}=[' ' text{i}{j}.modulename ' ' ver];
tomwalters@0 133 counter=counter+1;
tomwalters@0 134 % str=[str text{i}{j}.modulename '\t' text{i}{j}.version '\n'];
tomwalters@0 135 end
tomwalters@0 136 end
tomwalters@0 137
tomwalters@0 138
tomwalters@0 139 % display the conflicts
tomwalters@0 140
tomwalters@0 141 str{counter}='' ;
tomwalters@0 142 counter=counter+1;
tomwalters@0 143 str{counter}='' ;
tomwalters@0 144 counter=counter+1;
tomwalters@0 145 % conflicts:
tomwalters@0 146 if isfield(handles.info,'conflicts')
tomwalters@0 147 conflicts=handles.info.conflicts;
tomwalters@0 148 else
tomwalters@0 149 return
tomwalters@0 150 end
tomwalters@0 151
tomwalters@0 152
tomwalters@0 153 if isempty(conflicts)
tomwalters@0 154 str{counter}='no conflicts';
tomwalters@0 155 % counter=counter+1;%#ok
tomwalters@0 156 else
tomwalters@0 157 str{counter}='conflicts:';
tomwalters@0 158 counter=counter+1;
tomwalters@0 159 for i=1:length(conflicts)
tomwalters@0 160 str{counter}=conflicts{i};
tomwalters@0 161 counter=counter+1;
tomwalters@0 162 end
tomwalters@0 163 end
tomwalters@0 164
tomwalters@0 165
tomwalters@0 166
tomwalters@0 167 set(box,'String',str);
tomwalters@0 168 set(box,'max',length(str));
tomwalters@0 169
tomwalters@0 170
tomwalters@0 171