| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| function [fileToLoad, matToSave, useKeyword, triggerKeyword] = dlg_parser(callingFcn) |
|
|
| |
| cb_selectSource = ['[filename filepath] = uigetfile2(''*'', ''Select text file - ',callingFcn,'()'');'... |
| 'if filename(1) ~=0,' ... |
| ' set(findobj(''parent'', gcbf, ''tag'', tagToUpdate), ''string'', [ filepath filename ]);' ... |
| 'end;' ... |
| 'clear filename filepath tagToUpdate' ... |
| ]; |
| cb_selectTargetMat = ['[filename filepath] = uiputfile2(''*.mat'', ''Save data in MATLAB format - ',callingFcn,'()'');'... |
| 'if filename(1) ~=0,' ... |
| ' set(findobj(''parent'', gcbf, ''tag'', tagToUpdate), ''string'', [ filepath filename ]);' ... |
| 'end;' ... |
| 'clear filename filepath tagToUpdate' ... |
| ]; |
| cb_useKeyword = ['if get(gcbo,''value''),'... |
| 'newStatus = ''on'';'... |
| 'else ,'... |
| 'newStatus = ''off'';'... |
| 'end ,'... |
| 'set(findobj(''parent'', gcbf,''tag'',''triggerKeyword''),''enable'',newStatus);'... |
| 'clear newStatus;'... |
| ]; |
|
|
| clear filename filepath tagToUpdate |
| geometry = {1 [3.5 2.5 1] [3.5 2.5 1] 1 1 [3.5 2.5 1] [3.5 2.5 1]}; |
| uilist = { ... |
| { 'Style', 'text', 'string', 'Parse eye tracking data and convert it to MATLAB format', 'horizontalalignment', 'right', 'fontweight', 'bold'},... |
| ... |
| { 'Style', 'text', 'string', 'Load raw eye tracking data (text file):', 'horizontalalignment', 'right'},... |
| { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'fileToLoad' },... |
| { 'Style', 'pushbutton', 'string', 'Browse...', 'callback', ['tagToUpdate = ''fileToLoad'';' cb_selectSource] },... |
| ... |
| { 'Style', 'text', 'string', 'Save MATLAB copy (.mat) here:', 'horizontalalignment', 'right'},... |
| { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'matToSave' },... |
| { 'Style', 'pushbutton', 'string', 'Browse...', 'callback', ['tagToUpdate = ''matToSave'';' cb_selectTargetMat] },... |
| ... |
| { },... |
| { 'Style', 'text', 'string', 'Optional: Fill in only if messages were used as synchronization events', 'horizontalalignment', 'right','fontweight','bold' },... |
| ... |
| { 'Style', 'text', 'string', 'Special messages (keyword+number) were sent:'},... |
| { 'Style', 'checkbox', 'tag','useKeyword','callback',cb_useKeyword },... |
| { 'Style', 'text', 'string', ''},... |
| ... |
| { 'Style', 'text', 'string', 'Keyword used (e.g. "MYKEYWORD"):', 'horizontalalignment', 'right'},... |
| { 'Style', 'edit', 'string', 'type keyword here', 'horizontalalignment', 'center', 'tag', 'triggerKeyword','enable','off'},... |
| { 'Style', 'text', 'string', ''} |
| }; |
|
|
| [results userdat str outstruct] = inputgui( geometry, uilist, ['pophelp(''',callingFcn,''');'], ['Parse and save eye tracking data -- ',callingFcn,'()']); |
|
|
| if isempty(results) |
| return |
| end |
|
|
| |
| |
| fileToLoad = outstruct.fileToLoad; |
| matToSave = outstruct.matToSave; |
| useKeyword = outstruct.useKeyword; |
| triggerKeyword = outstruct.triggerKeyword; |
|
|
| end |