0001 function pa_yokogawa_meg_callback(fig, hObj)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
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
0026
0027 global vbmeg_inst;
0028 define = vbmeg_inst.const;
0029
0030
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
0047 data.yokogawa_meg_parm.ex_ch_gain = [];
0048 set(H.gain_setting_text, 'String', 'None');
0049
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