Home > vbmeg > functions > gui > preAnalysis > meeg_processor > signal_processor > vb_signal_processor_change_process_order.m

vb_signal_processor_change_process_order

PURPOSE ^

Change processing order of process list.

SYNOPSIS ^

function data = vb_signal_processor_change_process_order(data, direction)

DESCRIPTION ^

 Change processing order of process list.
 [USAGE]
    data = vb_signal_processor_change_process_order(data, direction);
 [IN]
         data : Application data.
    direction : current selected item will move to the speicifed direction.
                = 'upper' : selected item will move to upper direction.
                = 'lower' : selected item will move to lower direction.
 [OUT]
    data : Updated application data.

 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 data = vb_signal_processor_change_process_order(data, direction)
0002 % Change processing order of process list.
0003 % [USAGE]
0004 %    data = vb_signal_processor_change_process_order(data, direction);
0005 % [IN]
0006 %         data : Application data.
0007 %    direction : current selected item will move to the speicifed direction.
0008 %                = 'upper' : selected item will move to upper direction.
0009 %                = 'lower' : selected item will move to lower direction.
0010 % [OUT]
0011 %    data : Updated application data.
0012 %
0013 % Copyright (C) 2011, ATR All Rights Reserved.
0014 % License : New BSD License(see VBMEG_LICENSE.txt)
0015 
0016 %
0017 % --- Previous check
0018 %
0019 if ~exist('data', 'var')
0020     error('data is a required parameter.');
0021 end
0022 if ~exist('direction', 'var')
0023     error('direction is a required parameter.');
0024 end
0025 
0026 %
0027 % --- Main Procedure
0028 %
0029 
0030 current_pos = get(data.H.process_list_listbox, 'Value');
0031 switch(lower(direction))
0032     case 'upper'
0033         new_pos = current_pos-1;
0034     case 'lower'
0035         new_pos = current_pos+1;
0036     otherwise
0037         error('Unknown direction was specified.');
0038 end
0039 
0040 if (new_pos <= 0) || new_pos > length(data.process_list)
0041     % do nothing
0042 else
0043     current_item = data.process_list{current_pos};
0044     tmp = data.process_list{new_pos};
0045     data.process_list{new_pos} = current_item;
0046     data.process_list{current_pos} = tmp;
0047     set(data.H.process_list_listbox, 'Value', new_pos);
0048 end
0049 
0050 %
0051 % --- After check
0052 %
0053 if nargout ~= 1
0054     error('Function caller should receive an updated application data');
0055 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005