Commit 7f2ac0c0 authored by Jesse Heckman's avatar Jesse Heckman
Browse files

update LSL

parent d6de172e
......@@ -24,11 +24,11 @@ function pb_vRunExp(handles)
% set block information
block = handles.block;
nblocks = handles.cfg.Blocks;
Dat(nblocks) = struct('VS',[],'EV',[],'PL_Gaze',[],'PL_Python',[],'OT',[]);
Dat(nblocks) = struct('VS',[],'EV',[],'PL_Gaze',[],'PL_Python',[],'PL_Primitive',[],'OT',[]);
% initialize recordings
% rc = pb_runPupil;
[ses,streams] = pb_runLSL('ot',false);
[ses,streams] = pb_runLSL();
experimentTime = tic;
%% START BLOCK
......@@ -42,7 +42,7 @@ function pb_vRunExp(handles)
handles = updateCount(handles,'trial','reset');
% store signal data
[sig,profile,dur] = pb_vSignalVC(handles); % reads, checks, creates & plots vestibular signals
[sig,profile,dur] = pb_vSignalVC(handles); % reads, checks, creates & plots vestibular signals
Dat(iBlck).VS = sig;
% start recording
......@@ -94,10 +94,11 @@ function pb_vRunExp(handles)
pb_stopLSL(ses);
% store data
Dat(iBlck).EV = streams(1).read;
Dat(iBlck).PL_Python = streams(2).read;
Dat(iBlck).PL_Gaze = streams(3).read;
%Dat(iBlck).OT = streams(4).read;
Dat(iBlck).EV = streams(1).read;
Dat(iBlck).PL_Python = streams(2).read;
Dat(iBlck).PL_Gaze = streams(3).read;
Dat(iBlck).PL_Primitive = streams(4).read;
%Dat(iBlck).OT = streams(5).read;
% update block information
handles.cfg = updateCount(handles.cfg,'block','count');
......
......@@ -10,19 +10,23 @@ function [ses,str] = pb_runLSL(varargin)
de = pb_keyval('de', varargin, true);
pl = pb_keyval('pl', varargin, true);
gz = pb_keyval('gz', varargin, true);
ot = pb_keyval('ot', varargin, true);
pd = pb_keyval('pd', varargin, true);
ot = pb_keyval('ot', varargin, false);
tmp = {};
streams = {'type=''Digital Events @ lslder01'' and name=''Digital Events 0''', ...
'type=''Pupil Capture @ pupil-desktop'' and name=''Pupil Python Representation - Eye 0''', ...
'type=''Pupil Capture @ pupil-desktop'' and name=''Gaze Python Representation''', ...
'type=''Pupil Capture @ pupil-desktop'' and name=''Pupil Primitive Data - Eye 0''', ...
'type=''OptiTrack Mocap @ DCN-VSO3'' and name=''Labeled Markers'''};
if de; tmp(end+1) = streams(1); end
if pl; tmp(end+1) = streams(2); end
if gz; tmp(end+1) = streams(3); end
if ot; tmp(end+1) = streams(4); end
if pd; tmp(end+1) = streams(4); end
if ot; tmp(end+1) = streams(5); end
streams = tmp;
......@@ -53,6 +57,7 @@ function [ses,str] = pb_runLSL(varargin)
if de; addlistener(str(c),'DataAvailable', @ev_listener); c = c+1; end
if pl; addlistener(str(c),'DataAvailable', @pl_listener); c = c+1; end
if gz; addlistener(str(c),'DataAvailable', @gz_listener); c = c+1; end
if pd; addlistener(str(c),'DataAvailable', @pd_listener); c = c+1; end
if ot; addlistener(str(c),'DataAvailable', @ot_listener); end
end
......@@ -71,6 +76,11 @@ function gz_listener(~, event)
%disp(event);
end
function pd_listener(~, event)
%disp('pd_listener called');
%disp(event);
end
function ot_listener(~, event)
%disp('ot_listener called');
%disp(event);
......
......@@ -7,10 +7,10 @@ function pb_delete(varargin)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
type = pb_keyval('Type',varargin,[]);
%type = pb_keyval('Type',varargin,'line');
ax = pb_keyval('Axis',varargin,gca);
h = pb_fobj(ax,'Type',type);
h = pb_fobj(ax);
cnt = 0;
len = length(h);
......
function [cfn,f] = pb_newfig(cfn, varargin)
% PB_NEWFIG(cfn)
%
% PB_NEWFIG(cfn) opens a new figure, and increments the figure count.
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
if nargin == 0 ; cfn = 0; end
if isempty(cfn); cfn = 0; end
ws = pb_keyval('ws',varargin,'Docked');
cfn = cfn+1; f = figure(cfn); clf;
set(f, 'WindowStyle', ws);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment