pb_vClearTrial.m 1.42 KB
Newer Older
1
function cfg = pb_vClearTrial(stim, cfg)
2
% PB_VCLEARTRIAL(HANDLES)
3
%
4
5
% PB_VCLEARTRIAL(HANDLES) empties previous trial: data, stimuli, GUI, and
% updates the command window.
6
%
7
% See also PB_VPRIME, PB_VPRIMEGUI, PB_VRUNEXP
8
9

% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
10

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

   %% Remove ledhandle if it exists
   
   nstim = numel(stim);
   for iStm = 1:nstim
      if isfield(stim(iStm),'ledhandle')
         if ~isempty(stim(iStm).ledhandle)
            stim(iStm).ledhandle.delete; 	% delete(leds)/switch off light;
         end
      end
   end
   
   %% Turn off sounds
   
   for muxIdx = 1:2
      % MUX(cfg.RZ6_1,muxIdx,0)
   end
   
   %% Initiate trial

   tn = cfg.trialnumber;
   bn = cfg.blocknumber;
Jesse Heckman's avatar
Jesse Heckman committed
33
      
34
   disp([newline '<strong>New Trial started...</strong> '...
35
         newline ' Trial: ' num2str(tn(2)) ' (B' num2str(bn) 'T' num2str(tn(1)) ')']);
36
37
38
39
      
   if ispc
      cfg.zBus.zBusTrigA(0, 0, 2);                                         % reset, clock start, (0,0,2): trigger entire rack, with a pulse structure, and 2 ms delay(2 ms = minimum).
   end
40
41
42
43
44
45
46
47
48
end
 
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 
%                                                           %
%       Part of Programmeer Beer Toolbox (PBToolbox)        %
%       Written by: Jesse J. Heckman (2018)                 %
%                                                           %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %