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
a3d92358
Commit
a3d92358
authored
Dec 11, 2018
by
Jesse Heckman
Browse files
update vPrime workflow
parent
053ed782
Changes
3
Hide whitespace changes
Inline
Side-by-side
setups/vestibular chair/vPrime/cfg/pb_updatecount.m
0 → 100644
View file @
a3d92358
function
cfg
=
pb_updatecount
(
cfg
,
varargin
)
% PB_UPDATECOUNT
%
% PB_UPDATECOUNT(cfg,varargin) updates the count of trialnumber and block number during experiment
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
% initializes update information
trial
=
pb_keyval
(
'trial'
,
varargin
);
block
=
pb_keyval
(
'block'
,
varargin
);
% sets trials
if
~
isempty
(
trial
)
switch
trial
case
'count'
cfg
.
trialnumber
=
cfg
.
trialnumber
+
1
;
case
'reset'
cfg
.
trialnumber
(
1
)
=
1
;
end
end
% sets block
if
~
isempty
(
block
)
switch
block
case
'count'
cfg
.
blocknumber
=
cfg
.
blocknumber
+
1
;
end
end
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
\ No newline at end of file
setups/vestibular chair/vPrime/core/experiment/trial/pb_vUpdateTrial.m
0 → 100644
View file @
a3d92358
function
handles
=
pb_vUpdateTrial
(
handles
)
% PB_VUPDATETRIAL
%
% PB_VUPDATETRIAL(handles) will update the vPrime GUI during trials.
%
% See also PB_VPRIME, PB_VPRIMEGUI, PB_VRUNEXP
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
% 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
);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
setups/vestibular chair/vPrime/core/pb_vRunExp.m
View file @
a3d92358
...
...
@@ -40,7 +40,7 @@ function pb_vRunExp(handles)
% set block information
nTrials
=
length
(
block
(
iBlck
)
.
trial
);
handles
=
update
C
ount
(
handles
,
'trial'
,
'reset'
);
handles
=
pb_
update
c
ount
(
handles
,
'trial'
,
'reset'
);
[
profile
,
dur
]
=
pb_vSignalVC
(
handles
);
% start recording
...
...
@@ -63,7 +63,7 @@ function pb_vRunExp(handles)
for
iTrl
=
1
:
nTrials
% setup trial
u
pdateTrial
(
handles
);
handles
=
pb_vU
pdateTrial
(
handles
);
stim
=
handles
.
block
(
iBlck
)
.
trial
(
iTrl
)
.
stim
;
handles
.
cfg
=
pb_vClearTrial
(
stim
,
handles
.
cfg
);
[
~
,
handles
.
cfg
]
=
pb_vSetupTrial
(
stim
,
handles
.
cfg
);
...
...
@@ -75,7 +75,7 @@ function pb_vRunExp(handles)
% save trial
handles
=
pb_vStoreData
(
handles
,
profile
);
handles
.
cfg
=
update
C
ount
(
handles
.
cfg
,
'trial'
,
'count'
);
handles
.
cfg
=
pb_
update
c
ount
(
handles
.
cfg
,
'trial'
,
'count'
);
toc
(
trialTime
);
end
...
...
@@ -85,7 +85,7 @@ function pb_vRunExp(handles)
% stop vestibular chair
if
~
ismac
&&
~
debug
elapsedTime
=
toc
(
blockTime
);
if
elapsedTime
<
dur
;
pause
(
dur
-
floor
(
elapsedTime
)
+
6
);
end
% wait untill chair is finished running before disabling.
if
elapsedTime
<
dur
;
pause
(
dur
-
floor
(
elapsedTime
)
+
6
);
end
% wait untill chair is finished running before disabling.
pb_stopServo
(
vs
);
Dat
(
iBlck
)
=
pb_readServo
(
vs
,
Dat
(
iBlck
));
delete
(
vs
);
...
...
@@ -102,7 +102,7 @@ function pb_vRunExp(handles)
Dat
(
iBlck
)
.
block_info
=
handles
.
block
(
iBlck
);
% update block information
handles
.
cfg
=
update
C
ount
(
handles
.
cfg
,
'block'
,
'count'
);
handles
.
cfg
=
pb_
update
c
ount
(
handles
.
cfg
,
'block'
,
'count'
);
end
%% CHECK OUT
...
...
@@ -112,44 +112,7 @@ function pb_vRunExp(handles)
pb_vEndExp
;
pb_vStoreBlockDat
(
handles
.
cfg
,
Dat
);
pb_vInitialize
(
handles
,
false
);
toc
(
expTime
)
end
%-- GUI 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
);
end
function
cfg
=
updateCount
(
cfg
,
varargin
)
% Updates the count of trialnumber and block number during experiment
% initializes update information
trial
=
pb_keyval
(
'trial'
,
varargin
);
block
=
pb_keyval
(
'block'
,
varargin
);
% sets trials
if
~
isempty
(
trial
)
switch
trial
case
'count'
cfg
.
trialnumber
=
cfg
.
trialnumber
+
1
;
case
'reset'
cfg
.
trialnumber
(
1
)
=
1
;
end
end
% sets block
if
~
isempty
(
block
)
switch
block
case
'count'
cfg
.
blocknumber
=
cfg
.
blocknumber
+
1
;
end
end
toc
(
expTime
);
end
...
...
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