|
77 | 77 | fprintf('\n - Running Block %.0f \n', iBlock); |
78 | 78 |
|
79 | 79 | eyeTracker('Message', cfg, ['start_block-', num2str(iBlock)]); |
80 | | - |
| 80 | + dots=[]; |
| 81 | + previousEvent.target = 0; |
81 | 82 | % For each event in the block |
82 | 83 | for iEvent = 1:cfg.design.nbEventsPerBlock |
83 | 84 |
|
|
98 | 99 | eyeTracker('Message', cfg, ... |
99 | 100 | ['start_trial-', num2str(iEvent), '_', thisEvent.trial_type]); |
100 | 101 |
|
| 102 | + % we want to initialize the dots position when targets type is fixation cross |
| 103 | + % or if this the first event of a target pair |
| 104 | + if strcmp(cfg.target.type, 'static_repeat') && ... |
| 105 | + thisEvent.target == previousEvent.target |
| 106 | + else |
| 107 | + dots = []; |
| 108 | + end |
| 109 | + |
101 | 110 | % play the dots and collect onset and duraton of the event |
102 | | - [onset, duration] = doDotMo(cfg, thisEvent, thisFixation); |
| 111 | + [onset, duration, dots] = doDotMo(cfg, thisEvent, thisFixation, dots); |
103 | 112 |
|
104 | 113 | thisEvent = preSaveSetup( ... |
105 | 114 | thisEvent, ... |
|
121 | 130 | eyeTracker('Message', cfg, ... |
122 | 131 | ['end_trial-', num2str(iEvent), '_', thisEvent.trial_type]); |
123 | 132 |
|
| 133 | + previousEvent = thisEvent; |
| 134 | + |
124 | 135 | waitFor(cfg, cfg.timing.ISI); |
125 | 136 |
|
126 | 137 | end |
|
0 commit comments