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
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)
...
@@ -27,33 +27,33 @@ function pb_vRunExp(handles)
rc
=
pb_runPupil
;
rc
=
pb_runPupil
;
[
ses
,
str
]
=
pb_runLSL
(
'ot'
,
false
);
[
ses
,
str
]
=
pb_runLSL
(
'ot'
,
false
);
%% CORE BODY
%% CORE BODY
% iterate experiment
% iterate experiment
for
iBlck
=
1
:
nblocks
for
iBlck
=
1
:
nblocks
% Runs blocks of trials with a vestibular condition
% Runs blocks of trials with a vestibular condition
ses
.
start
;
pb_startPupil
(
rc
);
nTrials
=
length
(
block
(
iBlck
)
.
trial
);
nTrials
=
length
(
block
(
iBlck
)
.
trial
);
handles
=
updateCount
(
handles
,
'trial'
,
'reset'
);
handles
=
updateCount
(
handles
,
'trial'
,
'reset'
);
[
bDat
(
iBlck
),
profile
,
dur
]
=
pb_vSignalVC
(
handles
);
% reads, checks, creates & plots vestibular signals
[
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
);
send_profile
(
profile
);
pb_sendServo
(
vs
,
profile
);
vs
=
vs_servo
;
pb_startServo
(
vs
);
vs
.
enable
;
pause
(
1
);
vs
.
start
;
blockTime
=
tic
;
end
end
blockTime
=
tic
;
%% RUN TRIALS
%% RUN TRIALS
% iterate trials
for
iTrl
=
1
:
nTrials
for
iTrl
=
1
:
nTrials
% Runs all trials within one block
% Runs all trials within one block
trialTime
=
tic
;
trialTime
=
tic
;
updateTrial
(
handles
);
updateTrial
(
handles
);
...
@@ -76,19 +76,15 @@ function pb_vRunExp(handles)
...
@@ -76,19 +76,15 @@ function pb_vRunExp(handles)
elapsedTime
=
toc
(
blockTime
);
elapsedTime
=
toc
(
blockTime
);
if
elapsedTime
<
dur
;
pause
(
dur
-
floor
(
elapsedTime
));
end
% wait untill chair is finished running before disabling.
if
elapsedTime
<
dur
;
pause
(
dur
-
floor
(
elapsedTime
));
end
% wait untill chair is finished running before disabling.
vs
.
stop
;
pb_stopServo
(
vs
)
vs
.
disable
;
delete
(
vs
);
[
sv
,
pv
]
=
read_profile
;
Dat
=
pb_readServo
(
vs
);
Dat
.
sv
=
sv
;
Dat
.
pv
=
pv
;
end
end
handles
=
updateCount
(
handles
,
'block'
,
'count'
);
handles
=
updateCount
(
handles
,
'block'
,
'count'
);
pb_stopPupil
(
rc
);
pb_stopPupil
(
rc
);
% STOP LSL
pb_stopLSL
(
ses
);
ses
.
stop
;
if
~
exist
(
'LSL_Dat'
,
'var'
)
if
~
exist
(
'LSL_Dat'
,
'var'
)
LSL_Data
=
{};
LSL_Data
=
{};
...
@@ -99,10 +95,11 @@ function pb_vRunExp(handles)
...
@@ -99,10 +95,11 @@ function pb_vRunExp(handles)
% LSL_Dat.ot_dat = str(3).read;
% LSL_Dat.ot_dat = str(3).read;
% TODO: SAVE LSL DATA
% TODO: SAVE LSL DATA
% save(lsl_file, 'LSL_Dat');
end
end
%% CHECK OUT
%% CHECK OUT
% finalizes experiment, and resets handles.
pb_vEndExp
(
handles
.
cfg
);
pb_vEndExp
(
handles
.
cfg
);
pb_vInitialize
(
handles
,
false
);
pb_vInitialize
(
handles
,
false
);
...
@@ -151,19 +148,18 @@ function send_profile(profile)
...
@@ -151,19 +148,18 @@ function send_profile(profile)
vs
=
vs_servo
;
vs
=
vs_servo
;
vs
.
write_profile
(
profile
.
v
,
profile
.
h
);
vs
.
write_profile
(
profile
.
v
,
profile
.
h
);
delete
(
vs
);
end
end
function
[
sv
,
pv
]
=
read_profile
function
Dat
=
read_profile
(
vs
)
% read profile
% read profile
vs
=
vs_servo
;
[
sv
.
vertical
,
sv
.
horizontal
]
=
vs
.
read_profile_sv
;
[
sv
.
vertical
,
sv
.
horizontal
]
=
vs
.
read_profile_sv
;
[
pv
.
vertical
,
pv
.
horizontal
]
=
vs
.
read_profile_pv
;
[
pv
.
vertical
,
pv
.
horizontal
]
=
vs
.
read_profile_pv
;
delete
(
vs
);
delete
(
vs
);
Dat
.
sv
=
sv
;
Dat
.
pv
=
pv
;
end
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
Markdown
is supported
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