Home > vbmeg > functions > gui > preAnalysis > yokogawa_meg > pa_yokogawa_meg_callback.m

pa_yokogawa_meg_callback

PURPOSE ^

callback function for yokogawa meg gui.

SYNOPSIS ^

function pa_yokogawa_meg_callback(fig, hObj)

DESCRIPTION ^

 callback function for yokogawa meg gui.
 [USAGE]
    pa_yokogawa_meg_callback(<fig>, <hObj>);
 [IN]
     fig : figure handle of yokogawa meg gui.
    hObj : event component handle.
 [OUT]
    none

 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 pa_yokogawa_meg_callback(fig, hObj)
0002 % callback function for yokogawa meg gui.
0003 % [USAGE]
0004 %    pa_yokogawa_meg_callback(<fig>, <hObj>);
0005 % [IN]
0006 %     fig : figure handle of yokogawa meg gui.
0007 %    hObj : event component handle.
0008 % [OUT]
0009 %    none
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0018     error('invalid figure is specified.');
0019 end
0020 if ~exist('hObj', 'var')
0021     error('hObj is a required parameter.');
0022 end
0023 
0024 %
0025 % --- Main Procedure
0026 %
0027 global vbmeg_inst;
0028 define = vbmeg_inst.const;
0029 
0030 % load data(@see pa_yokogawa_meg_create)
0031 data = guidata(fig);
0032 H = data.H;
0033 
0034 switch(hObj)
0035     case H.project_root_push
0036         dir_name = dir_dialog(get(H.project_root_edit, 'String'));
0037         if dir_name ~= 0
0038             set(H.project_root_edit, 'String', dir_name);
0039         end
0040     case H.meg_file_push
0041         [dir_name fname] = vb_file_select({'.raw', '.ave', '.con'}, 'Select Yokogawa MEG file');
0042         if ~isempty(dir_name)
0043             set(H.meg_file_edit, 'String', [dir_name filesep fname{1}]);
0044             pa_yokogawa_meg_util(fig, 'update_exec_push_status');
0045             pa_yokogawa_meg_util(fig, 'update_output_fname');
0046             % clear eeg_gain information
0047             data.yokogawa_meg_parm.ex_ch_gain = [];
0048             set(H.gain_setting_text, 'String', 'None');
0049             % save data
0050             guidata(fig, data);
0051         end
0052     case H.position_file_push
0053         [dir_name fname] = vb_file_select({'.pos.mat'}, 'Select positioning file');
0054         if ~isempty(dir_name)
0055             set(H.position_file_edit, 'String', [dir_name filesep fname{1}]);
0056             pa_yokogawa_meg_util(fig, 'update_output_fname');
0057         end
0058     case H.ext_gain_push
0059         pa_yokogawa_meg_edit_extra_channel_gain(fig);
0060     case H.save_dir_push
0061         proj_root = get(H.project_root_edit, 'String');
0062         [dir_name canceled] = pa_prjdir_select(proj_root);
0063         if ~canceled
0064             set(H.save_dir_edit, 'String', dir_name);
0065         end
0066         pa_yokogawa_meg_util(fig, 'update_output_fname');
0067     case H.change_output_file_push
0068         res = inputdlg('', 'New output filename');
0069         if iscell(res) && length(res) >= 1
0070             res = res{1};
0071         end
0072         if ~isempty(res)
0073             data.output_filename = res;
0074             guidata(fig, data);
0075         end
0076         pa_yokogawa_meg_util(fig, 'update_output_fname');        
0077     case H.exec_push
0078         pa_yokogawa_meg_util(fig, 'exec_meg');
0079     case {H.figure, H.menu_close}
0080         pa_yokogawa_meg_close(fig);
0081         return;
0082     case H.menu_import_meg_data
0083         url = vb_users_manual_url('MEG data');
0084         vb_browser_show(url);
0085 end
0086 
0087

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