Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jesse Heckman
pbtoolbox
Commits
a10ae900
Commit
a10ae900
authored
Oct 23, 2018
by
Jesse Heckman
Browse files
cleared up runExp
parent
dab5e229
Changes
2
Show whitespace changes
Inline
Side-by-side
pb_vStoreBlockDat.m
0 → 100644
View file @
a10ae900
function
pb_vStoreBlockDat
(
cfg
,
Dat
)
% PB_VSTOREBLOCKDAT()
%
% PB_VSTOREBLOCKDAT() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
file
=
[
cfg
.
dname
'/block_info.m'
];
save
(
file
,
'Dat'
);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
setups/vestibular chair/vPrime/core/pb_vRunExp.m
View file @
a10ae900
...
...
@@ -19,12 +19,12 @@ function pb_vRunExp(handles)
handles
=
pb_gethandles
(
handles
);
handles
=
pb_getblock
(
handles
);
handles
=
pb_createdir
(
handles
);
handles
=
pb_vInitialize
(
handles
,
true
);
handles
=
pb_vInitialize
(
handles
,
true
);
% set block information
block
=
handles
.
block
;
nblocks
=
handles
.
cfg
.
Blocks
;
Dat
(
nblocks
)
=
struct
(
'vestibular_signal'
,[],
'PL'
,[],
'OT'
,[],
'LSL'
,[]);
Dat
(
nblocks
)
=
struct
(
'vestibular_signal'
,[],
'
EV'
,[],
'
PL'
,[],
'OT'
,[],
'LSL'
,[]);
% initialize recordings
rc
=
pb_runPupil
;
...
...
@@ -72,7 +72,7 @@ function pb_vRunExp(handles)
pb_vRunTrial
(
handles
.
cfg
,
stim
);
pb_vTraces
(
handles
);
%
handles
= pb_vStoreData(handles,
bDat
);
handles
=
pb_vStoreData
(
handles
,
sig
);
handles
=
updateCount
(
handles
,
'trial'
,
'count'
);
toc
(
trialTime
)
end
...
...
@@ -94,19 +94,12 @@ function pb_vRunExp(handles)
pb_stopLSL
(
ses
);
% store data
if
~
exist
(
'LSL_Dat'
,
'var'
)
LSL_Data
=
{};
end
LSL_Dat
.
ev_dat
=
streams
(
1
)
.
read
;
LSL_Dat
.
pl_dat
=
streams
(
2
)
.
read
;
% LSL_Dat.ot_dat = str(3).read;
% TODO: SAVE LSL DATA
% save(lsl_file, 'LSL_Dat');
Dat
(
iBlck
)
.
EV
=
streams
(
1
)
.
read
;
Dat
(
iBlck
)
.
PL
=
streams
(
2
)
.
read
;
%Dat(iBlck).OT = streams(3).read;
% update block information
handles
=
updateCount
(
handles
,
'block'
,
'count'
);
handles
.
cfg
=
updateCount
(
handles
.
cfg
,
'block'
,
'count'
);
end
%% CHECK OUT
...
...
@@ -114,28 +107,30 @@ function pb_vRunExp(handles)
% check out experiment
pb_vEndExp
(
handles
.
cfg
);
pb_vInitialize
(
handles
,
false
);
pb_vStoreBlockDat
(
handles
.
cfg
,
Dat
);
pb_vInitialize
(
handles
,
false
);
toc
(
experimentTime
)
end
%-- Feedback functions --%
function
updateTrial
(
handles
)
% Updates the trial information to the GUI
tn
=
handles
.
cfg
.
trialnumber
;
handles
.
figure1
.
Name
=
[
'vPrime - '
num2str
(
tn
(
2
))
'/'
num2str
(
handles
.
cfg
.
Trials
)
' Trials'
];
% counting title
str
=
num2str
(
tn
(
1
),
'%03d'
);
% blocktrial
set
(
handles
.
Tn
,
'string'
,
str
)
set
(
handles
.
Tn
,
'string'
,
str
)
;
end
function
handles
=
updateCount
(
handles
,
varargin
)
function
cfg
=
updateCount
(
cfg
,
varargin
)
% Updates the count of trialnumber and block number during experiment
cfg
=
handles
.
cfg
;
% initializes update information
trial
=
pb_keyval
(
'trial'
,
varargin
);
block
=
pb_keyval
(
'block'
,
varargin
);
% sets trials
if
~
isempty
(
trial
)
switch
trial
case
'count'
...
...
@@ -145,35 +140,15 @@ function handles = updateCount(handles,varargin)
end
end
% sets block
if
~
isempty
(
block
)
switch
block
case
'count'
cfg
.
blocknumber
=
cfg
.
blocknumber
+
1
;
end
end
handles
.
cfg
=
cfg
;
end
%-- Run VC functions --%
% function send_profile(profile)
% % writing profile to servo
%
% vs = vs_servo;
% vs.write_profile(profile.v,profile.h);
% end
% function Dat = read_profile(vs)
% % read profile
%
% [sv.vertical,sv.horizontal] = vs.read_profile_sv;
% [pv.vertical,pv.horizontal] = vs.read_profile_pv;
%
% delete(vs);
%
% Dat.sv = sv;
% Dat.pv = pv;
% end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment