Home > functions > gui > batch > batch_list > vb_batch_list_update_template_parm_listbox.m

vb_batch_list_update_template_parm_listbox

PURPOSE ^

update template parameter listbox

SYNOPSIS ^

function vb_batch_list_update_template_parm_listbox(fig)

DESCRIPTION ^

 update template parameter listbox

 [USAGE]
    vb_batch_list_update_template_parm_listbox(<fig>);
 [IN]
    fig : figure handle

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vb_batch_list_update_template_parm_listbox(fig)
0002 % update template parameter listbox
0003 %
0004 % [USAGE]
0005 %    vb_batch_list_update_template_parm_listbox(<fig>);
0006 % [IN]
0007 %    fig : figure handle
0008 %
0009 % Copyright (C) 2011, ATR All Rights Reserved.
0010 % License : New BSD License(see VBMEG_LICENSE.txt)
0011 
0012 
0013 %
0014 % --- Previous check
0015 %
0016 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0017     error('invalid figure handle is specified.');
0018 end
0019 
0020 %
0021 % --- Main Procedure
0022 %
0023 data = guidata(fig);
0024 
0025 % get the number of parameters in the selected parameter set.
0026 ix_main = 0;
0027 Nparm = vb_batch_mgr_get_num_of_parm(data.bmgr, ix_main);
0028 
0029 % set parameter type to listbox
0030 listbox_str = cell(0);
0031 for k=1:Nparm
0032     ix_sub = k;
0033     [parm, parm_type] = vb_batch_mgr_get_parm(data.bmgr, ix_main, ix_sub);
0034     parm_str = parm_type;
0035     if isfield(parm, 'time_stamp')
0036         parm_str = [parm.time_stamp, ' ', parm_type];
0037     end
0038     listbox_str{k, 1} = parm_str;
0039 end
0040 set(data.H.template_parameter_listbox, 'String', listbox_str);
0041 
0042 % Adjust selected line number
0043 line_no = get(data.H.template_parameter_listbox, 'Value');
0044 if Nparm < 1
0045     line_no = 1;
0046 elseif line_no > Nparm
0047     line_no = Nparm;
0048 end
0049 set(data.H.template_parameter_listbox, 'Value', line_no);
0050 
0051 % Change state of Buttons
0052 components = [data.H.upper_push; data.H.lower_push;
0053               data.H.remove_push; data.H.copy_push;
0054               data.H.edit_push;
0055               data.H.create_concrete_parm_push];
0056               
0057 if Nparm
0058     set(components, 'Enable', 'on');
0059 else
0060     set(components, 'Enable', 'off');
0061 end

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005