Skip to content
GitLab
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
087e7402
Commit
087e7402
authored
Oct 23, 2018
by
Jesse Heckman
Browse files
clear code
parent
6bc6026d
Changes
7
Hide whitespace changes
Inline
Side-by-side
setups/vestibular chair/vPrime/core/pb_vRunExp.m
View file @
087e7402
...
...
@@ -27,33 +27,33 @@ function pb_vRunExp(handles)
rc
=
pb_runPupil
;
[
ses
,
str
]
=
pb_runLSL
(
'ot'
,
false
);
%% CORE BODY
% iterate experiment
% iterate experiment
for
iBlck
=
1
:
nblocks
% Runs blocks of trials with a vestibular condition
ses
.
start
;
pb_startPupil
(
rc
);
nTrials
=
length
(
block
(
iBlck
)
.
trial
);
handles
=
updateCount
(
handles
,
'trial'
,
'reset'
);
[
bDat
(
iBlck
),
profile
,
dur
]
=
pb_vSignalVC
(
handles
);
% reads, checks, creates & plots vestibular signals
pb_startLSL
(
ses
);
pb_startPupil
(
rc
);
% START CHAIR
if
~
ismac
&&
~
debug
if
~
ismac
&&
~
debug
% START CHAIR
send_profile
(
profile
);
vs
=
vs_servo
;
vs
.
enable
;
pause
(
1
);
vs
.
start
;
blockTime
=
tic
;
pb_sendServo
(
vs
,
profile
);
pb_startServo
(
vs
);
end
blockTime
=
tic
;
%% RUN TRIALS
%% RUN TRIALS
% iterate trials
for
iTrl
=
1
:
nTrials
% Runs all trials within one block
trialTime
=
tic
;
updateTrial
(
handles
);
...
...
@@ -76,19 +76,15 @@ function pb_vRunExp(handles)
elapsedTime
=
toc
(
blockTime
);
if
elapsedTime
<
dur
;
pause
(
dur
-
floor
(
elapsedTime
));
end
% wait untill chair is finished running before disabling.
vs
.
stop
;
vs
.
disable
;
delete
(
vs
);
pb_stopServo
(
vs
)
[
sv
,
pv
]
=
read_profile
;
Dat
.
sv
=
sv
;
Dat
.
pv
=
pv
;
Dat
=
pb_readServo
(
vs
);
end
handles
=
updateCount
(
handles
,
'block'
,
'count'
);
pb_stopPupil
(
rc
);
% STOP LSL
ses
.
stop
;
pb_stopLSL
(
ses
);
if
~
exist
(
'LSL_Dat'
,
'var'
)
LSL_Data
=
{};
...
...
@@ -99,10 +95,11 @@ function pb_vRunExp(handles)
% LSL_Dat.ot_dat = str(3).read;
% TODO: SAVE LSL DATA
% save(lsl_file, 'LSL_Dat');
end
%% CHECK OUT
%% CHECK OUT
% finalizes experiment, and resets handles.
pb_vEndExp
(
handles
.
cfg
);
pb_vInitialize
(
handles
,
false
);
...
...
@@ -151,19 +148,18 @@ function send_profile(profile)
vs
=
vs_servo
;
vs
.
write_profile
(
profile
.
v
,
profile
.
h
);
delete
(
vs
);
end
function
[
sv
,
pv
]
=
read_profile
function
Dat
=
read_profile
(
vs
)
% read profile
vs
=
vs_servo
;
[
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
...
...
subtools/lsl/pb_startLSL.m
0 → 100644
View file @
087e7402
function
pb_startLSL
(
ses
)
% PB_STARTLSL()
%
% PB_STARTLSL() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
ses
.
start
;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
subtools/lsl/pb_stopLSL.m
0 → 100644
View file @
087e7402
function
pb_stopLSL
(
ses
)
% PB_STOPLSL()
%
% PB_STOPLSL() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
ses
.
stop
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
subtools/servo/pb_readServo.m
0 → 100644
View file @
087e7402
function
D
=
pb_readServo
(
vs
)
% PB_READSERVO()
%
% PB_READSERVO() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
[
sv
.
vertical
,
sv
.
horizontal
]
=
vs
.
read_profile_sv
;
[
pv
.
vertical
,
pv
.
horizontal
]
=
vs
.
read_profile_pv
;
delete
(
vs
);
D
.
sv
=
sv
;
D
.
pv
=
pv
;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
subtools/servo/pb_runServo.m
0 → 100644
View file @
087e7402
function
vs
=
pb_runServo
()
% PB_RUNSERVO()
%
% PB_RUNSERVO() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs
=
vs_servo
;
vs
.
enable
;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
subtools/servo/pb_startServo.m
0 → 100644
View file @
087e7402
function
pb_startServo
(
vs
)
% PB_STARTSERVO()
%
% PB_STARTSERVO() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs
.
start
;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
subtools/servo/pb_stopServo.m
0 → 100644
View file @
087e7402
function
pb_stopServo
(
vs
)
% PB_STOPSERVO()
%
% PB_STOPSERVO() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs
.
stop
;
vs
.
disable
;
delete
(
vs
);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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