Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
iandol committed Sep 28, 2023
2 parents 897a5d4 + f5afd7a commit 3c19e5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion stimuli/baseStimulus.m
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ function run(me, benchmark, runtime, s, forceScreen, showVBL)
Screen('Flip',s.win,0,2,2);
notFinished = nFrames < benchmarkFrames;
else
vbl(nFrames) = flip(s, lastvbl + sv.halfisi); %flip the buffer
vbl(nFrames) = flip(s, lastvbl + sv.halfifi); %flip the buffer
lastvbl = vbl(nFrames);
% the calculation needs to take into account the
% first and last frame times, so we subtract ifi*2
Expand Down
15 changes: 10 additions & 5 deletions stimuli/checkerboardStimulus.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
me.parseArgs(args, me.allowedProperties);

me.isRect = true; %uses a rect for drawing

me.sfCache = me.sf;

me.ignoreProperties = [me.ignorePropertiesBase me.ignoreProperties];
me.salutation('constructor method','Stimulus initialisation complete');
Expand Down Expand Up @@ -211,10 +213,12 @@ function setup(me,sM)
me.res(1), me.res(2), me.maskValue);

me.inSetup = false; me.isSetup = true;
calculateScale(me);
computePosition(me);
setRect(me);

function set_sfOut(me,value)
if value <= 0; value = 0.05; end
me.sfCache = value;
me.sfOut = me.sfCache;
%fprintf('SET SFOut: %.2f | in: %.2f | scale: %.2f\n', me.sfOut, me.sfCache, me.scale);
Expand Down Expand Up @@ -260,6 +264,7 @@ function update(me)
end
glUniform1f(glGetUniformLocation(me.shader, 'radius'), me.maskValue);
glUseProgram(0);
calculateScale(me);
computePosition(me);
setRect(me);
end
Expand Down Expand Up @@ -321,6 +326,7 @@ function reset(me)
if me.mask > 0
me.mask = true;
end
me.sfCache = me.sf;
me.maskValue = [];
removeTmpProperties(me);
end
Expand All @@ -330,11 +336,10 @@ function reset(me)
%>
% ===================================================================
function set.sf(me,value)
if value <= 0
value = 0.05;
end
if value <= 0; value = 0.05; end
me.sfCache = value;
me.sf = value;
me.salutation(['set sf: ' num2str(value)],'Custom set method')
me.salutation(['set sf: ' num2str(me.sf)],'Custom set method')
end

% ===================================================================
Expand Down Expand Up @@ -433,7 +438,7 @@ function setRect(me)
function calculateScale(me,~,~)
me.scale = me.sizeOut/(me.size*me.ppd);
me.maskValue = me.sizeOut / 2;
fprintf('Calculate SFOut: %.2f | in: %.2f | scale: %.2f | size: %.2f\n', me.sfOut, me.sfCache, me.scale, me.sizeOut);
if me.verbose;fprintf('Calculate SFOut: %.2f | in: %.2f | scale: %.2f | size: %.2f\n', me.sfOut, me.sfCache, me.scale, me.sizeOut);end
end

% ===================================================================
Expand Down

0 comments on commit 3c19e5b

Please sign in to comment.