|
1 | | -% Eyelink already initialized! |
2 | | -% Running experiment on a 'EYELINK CL 4.56 ' tracker. |
3 | | -% Error in function Open: Usage error |
4 | | -% Could not find *any* audio hardware on your system - or at least not with |
5 | | -% the provided deviceid, if any! |
6 | | -% Error in function FillRect: Invalid Window (or Texture) Index provided: |
7 | | -% It doesn't correspond to an open window or texture. |
8 | | -% Did you close it accidentally via Screen('Close') or Screen('CloseAll') ? |
9 | | -% EYELINK: WARNING! PsychEyelinkCallRuntime() Failed to call eyelink runtime |
10 | | -% callback function PsychEyelinkDispatchCallback [rc = 1]! |
11 | | -% EYELINK: WARNING! Make sure that function is on your Matlab/Octave path and |
12 | | -% properly initialized. |
13 | | -% EYELINK: WARNING! May also be an error during execution of that function. |
14 | | -% Type ple at command prompt for error messages. |
15 | | -% EYELINK: WARNING! Auto-Disabling all callbacks to the runtime environment |
16 | | -% for safety reasons. |
17 | | -% Eyelink: In PsychEyelink_get_input_key(): Error condition detected: Trying |
18 | | -% to send TERMINATE_KEY abort keycode! |
19 | | -% Eyelink: In PsychEyelink_get_input_key(): Error condition detected: Trying |
20 | | -% to send TERMINATE_KEY abort keycode! |
21 | | -% Error in function FillRect: Invalid Window (or Texture) Index provided: |
22 | | -% It doesn't correspond to an open window or texture. |
23 | | -% Did you close it accidentally via Screen('Close') or Screen('CloseAll') ? |
24 | | -% Error using Screen |
25 | | -% Usage: |
26 | | -% |
27 | | -% Screen('FillRect', windowPtr [,color] [,rect] ) |
28 | | -% |
29 | | -% Error in eyeTracker (line 150) |
30 | | -% Screen('FillRect', cfg.screen.win, [0 0 0]); |
31 | | -% |
32 | | -% Error in visualLocTanslational (line 52) |
33 | | -% [el] = eyeTracker('Calibration', cfg); |
34 | | - |
35 | | - |
36 | | -function [el, edfFile] = eyeTracker(input, cfg, varargin) |
37 | | - % [el, edfFile] = eyeTracker(input, cfg, varargin) |
38 | | - % |
39 | | - % Mosto of the comments with explanation (e.g. 'STEP #') come from `EyelinkEventExample.m` |
40 | | - % |
41 | | - % Optional useful functions to implement in future: |
42 | | - % |
43 | | - % - Set level of verbosity for error/warning/status messages. ‘level’ optional, new |
44 | | - % level of verbosity. ‘oldlevel’ is the old level of verbosity. The following |
45 | | - % levels are supported: 0 = Shut up. 1 = Print errors, 2 = Print also warnings, 3 |
46 | | - % = Print also some info, 4 = Print more useful info (default), >5 = Be very |
47 | | - % verbose (mostly for debugging the driver itself). |
48 | | - % |
49 | | - % oldlevel = Eyelink(‘Verbosity’ [,level]); |
50 | | - % |
51 | | - % - Sanity check that ET is set a specific eye that we want, we might forget to check :) |
52 | | - % |
53 | | - % eye_used = Eyelink('EyeAvailable'); |
54 | | - % switch eye_used |
55 | | - % case el.BINOCULAR |
56 | | - % error('tracker indicates binocular') |
57 | | - % case el.LEFT_EYE |
58 | | - % error('tracker indicates left eye') |
59 | | - % case el.RIGHT_EYE |
60 | | - % disp('tracker indicates right eye') |
61 | | - % case -1 |
62 | | - % error('eyeavailable returned -1') |
63 | | - % otherwise |
64 | | - % eye_used |
65 | | - % error('unexpected result from eyeavailable') |
66 | | - % end |
67 | | - % |
68 | | - % - Tag the ET data outout |
69 | | - % |
70 | | - % Eyelink('command', 'add_file_preamble_text', 'Recorded by EyelinkToolbox demo-experiment'); |
71 | | - % |
72 | | - % - Set parser (conservative saccade thresholds) |
73 | | - % |
74 | | - % Eyelink('command', 'saccade_velocity_threshold = 35'); |
75 | | - % Eyelink('command', 'saccade_acceleration_threshold = 9500'); |
76 | | - % |
77 | | - % - Drift correction, do a final check of calibration using driftcorrection. You have to hit |
78 | | - % esc before return. |
79 | | - % |
80 | | - % EyelinkDoDriftCorrection(el); |
81 | | - % success = EyelinkDoDriftCorrection(el); |
82 | | - % if success~=1 |
83 | | - % Eyelink('shutdown'); |
84 | | - % cleanUp() |
85 | | - % return; |
86 | | - % end |
87 | | - % |
88 | | - % or use [status = ] Eyelink(‘DriftCorrStart’, x, y [,dtype=0][, dodraw=1][, allow_setup=0]), |
89 | | - % e.g.: |
90 | | - % |
91 | | - % Perform drift correction: The special flags 1,1,1 request |
92 | | - % interactive correction with video display: |
93 | | - % |
94 | | - % result = Eyelink('DriftCorrStart',30,30,1,1,1); |
95 | | - % |
96 | | - % - Tag the recording, in the past caused delays during the presentation so I avoided to use it |
97 | | - % |
98 | | - % Eyelink('message', 'Trial_1'); |
99 | | - |
100 | | - |
| 1 | +function [el, edfFile] = eyeTracker(input, cfg) |
101 | 2 |
|
102 | 3 | if ~cfg.eyeTracker.do |
103 | 4 |
|
|
0 commit comments