Home > fcn > DIVA_GUI_callbacks > gui_params_menu_cbk.m

gui_params_menu_cbk

PURPOSE ^

SYNOPSIS ^

function gui_params_menu_cbk(src,eventdata,options)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function gui_params_menu_cbk(src,eventdata,options)
0002   if(strcmp(get(src,'tag'),'glot_params'))
0003     % Plot Glottis parameters
0004     
0005     fname = DIVA('GUI','current_file');
0006     au_info=load(fname);
0007     figure,
0008     subplot(2,1,1)
0009     plot(au_info.Ag0(:,1),au_info.Ag0(:,2),'b',...
0010          au_info.AgP(:,1),au_info.AgP(:,2),'r');
0011     legend({'Ag0','AgP'});
0012     
0013     subplot(2,1,2)
0014     plot(au_info.F0(:,1),au_info.F0(:,2),'b');
0015     legend('F0');
0016     
0017   else
0018     % Edit system parameters
0019     if(strcmp(options.module,'DIVA'))
0020       current = DIVA(options.param);
0021     else
0022       current = DIVA(options.module,options.param);
0023     end
0024     if(strcmp(options.param,'BlockMode')),
0025       if(strcmp(get(src,'Checked'),'on')),
0026         set(src,'Checked','off')
0027         DIVA('BlockMode',0);
0028       else
0029         set(src,'Checked','on');
0030         DIVA('BlockMode',1);
0031       end
0032     else
0033       answer = ...
0034           inputdlg([options.name,...
0035                     ' [',num2str(options.range(1)),'-',num2str(options.range(2)),'] '],...
0036                    ['Update ',options.module,' parameters'],1,{num2str(current)});
0037       
0038       if(~isempty(answer))
0039         new=str2num(answer{1});
0040         while(new<options.range(1) | new>options.range(2)),
0041           answer = ...
0042               inputdlg(sprintf('Choose value within range \n%s',[options.name,...
0043                               ' [',num2str(options.range(1)),'-',num2str(options.range(2)),'] ']),...
0044                        ['Update ',options.module,' parameters'],1,{num2str(current)});
0045           if(isempty(answer))
0046             return;
0047           end      
0048           new=str2num(answer{1});
0049         end
0050         if(strcmp(options.module,'DIVA')),
0051           DIVA(options.param,new);
0052         else
0053           DIVA(options.module,options.param,new);
0054         end
0055       else
0056         return; 
0057       end
0058     end
0059   end

Generated on Tue 27-Mar-2007 12:06:24 by m2html © 2003