0001 function pa_biosemi_eeg_callback(fig, hObj)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0019 error('invalid figure is specified.');
0020 end
0021 if ~exist('hObj', 'var')
0022 error('hObj is a required parameter.');
0023 end
0024
0025
0026
0027
0028 global vbmeg_inst;
0029 define = vbmeg_inst.const;
0030
0031
0032 data = guidata(fig);
0033 H = data.H;
0034
0035 switch(hObj)
0036 case H.project_root_push
0037 dir_name = dir_dialog(get(H.project_root_edit, 'String'));
0038 if dir_name ~= 0
0039 set(H.project_root_edit, 'String', dir_name);
0040 end
0041 case H.bdf_file_push
0042 [dir_name fname] = vb_file_select({define.BIOSEMI_DATA_EXTENSION}, ...
0043 'Select Biosemi EEG file');
0044 if ~isempty(dir_name)
0045 set(H.bdf_file_edit, 'String', [dir_name filesep fname{1}]);
0046 end
0047 pa_biosemi_eeg_util(fig, 'update_output_fname');
0048 case H.position_file_push
0049 [dir_name fname] = vb_file_select({'.pos.mat'}, ...
0050 'Select positioning file');
0051 if ~isempty(dir_name)
0052 set(H.position_file_edit, 'String', ...
0053 [dir_name filesep fname{1}]);
0054 end
0055 case H.binary_dir_edit
0056 pa_biosemi_eeg_util(fig, 'update_output_fname');
0057 case H.binary_dir_push
0058 proj_root = get(H.project_root_edit, 'String');
0059 [dir_name cancelled] = pa_prjdir_select(proj_root);
0060 if ~cancelled
0061 set(H.binary_dir_edit, 'String', dir_name);
0062 end
0063 case H.save_dir_push
0064 proj_root = get(H.project_root_edit, 'String');
0065 [dir_name cancelled] = pa_prjdir_select(proj_root);
0066 if ~cancelled
0067 set(H.save_dir_edit, 'String', dir_name);
0068 end
0069 pa_biosemi_eeg_util(fig, 'update_output_fname');
0070 case H.change_output_file_push
0071 res = inputdlg('', 'New output filename');
0072 if iscell(res) && length(res) >= 1
0073 res = res{1};
0074 end
0075 if ~isempty(res)
0076 data.output_filename = res;
0077 guidata(fig, data);
0078 end
0079 pa_biosemi_eeg_util(fig, 'update_output_fname');
0080 case H.exec_push
0081 pa_biosemi_eeg_util(fig, 'execute');
0082
0083
0084 case {H.figure, H.menu_close}
0085 pa_biosemi_eeg_close(fig);
0086 return;
0087 case H.menu_import_eeg_data
0088 url = vb_users_manual_url('EEG data');
0089 vb_browser_show(url);
0090 end
0091
0092
0093 guidata(fig, data);