Commit 7aaadd82 authored by Jesse Heckman's avatar Jesse Heckman

fixed duration for auditory stimuli in getblock

parent 0a16b599
...@@ -65,6 +65,7 @@ function [block,cfg] = pb_vReadExp(cfg) ...@@ -65,6 +65,7 @@ function [block,cfg] = pb_vReadExp(cfg)
block(bn).trial(tn).stim(sn).intensity = par(4); block(bn).trial(tn).stim(sn).intensity = par(4);
block(bn).trial(tn).stim(sn).onevent = par(5); block(bn).trial(tn).stim(sn).onevent = par(5);
block(bn).trial(tn).stim(sn).ondelay = par(6); block(bn).trial(tn).stim(sn).ondelay = par(6);
block(bn).trial(tn).stim(sn).offdelay = par(5)+par(7);
block(bn).trial(tn).stim(sn).duration = par(7); block(bn).trial(tn).stim(sn).duration = par(7);
case {'LED','LED1','LED2'} case {'LED','LED1','LED2'}
...@@ -81,6 +82,7 @@ function [block,cfg] = pb_vReadExp(cfg) ...@@ -81,6 +82,7 @@ function [block,cfg] = pb_vReadExp(cfg)
block(bn).trial(tn).stim(sn).ondelay = par(5); block(bn).trial(tn).stim(sn).ondelay = par(5);
block(bn).trial(tn).stim(sn).offevent = par(6); block(bn).trial(tn).stim(sn).offevent = par(6);
block(bn).trial(tn).stim(sn).offdelay = par(7); block(bn).trial(tn).stim(sn).offdelay = par(7);
block(bn).trial(tn).stim(sn).duration = par(7)-par(5);
case 'TRG0' case 'TRG0'
% Updates count and writes stimulus % Updates count and writes stimulus
......
...@@ -15,19 +15,22 @@ function pb_editor(varargin) ...@@ -15,19 +15,22 @@ function pb_editor(varargin)
dc = cd; dc = cd;
if isempty(mode) if isempty(mode)
% Run mode dialog
quest = 'Choose editor action...'; quest = 'Choose editor action...';
title = 'Editor Action'; title = 'Editor Action';
mode = questdlg(quest, title,'Save','Open','Cancel','Cancel'); mode = questdlg(quest, title,'Save','Open','Cancel','Cancel');
end
switch mode switch mode
% Switch function mode
case 'Save' case 'Save'
% Save
h = matlab.desktop.editor.getAll; h = matlab.desktop.editor.getAll;
fns = {h.Filename}; fns = {h.Filename};
cd(cdir); cd(cdir);
uisave('fns',''); uisave('fns','');
cd(dc) cd(dc)
case 'Open' case 'Open'
% Open
if isempty(fn) if isempty(fn)
fn = pb_getfile('dir',cdir); fn = pb_getfile('dir',cdir);
end end
...@@ -39,6 +42,12 @@ function pb_editor(varargin) ...@@ -39,6 +42,12 @@ function pb_editor(varargin)
answer = questdlg(quest, title,'Yes','No','Cancel','Cancel'); answer = questdlg(quest, title,'Yes','No','Cancel','Cancel');
if strcmp(answer,'Yes') if strcmp(answer,'Yes')
quest = 'Save current editor setup?';
title = 'Editor Action';
answer = questdlg(quest, title,'Yes','No','Yes');
if strcmp(answer,'Yes'); pb_editor('mode','Save'); end
pb_closeedit('which','all'); pb_closeedit('which','all');
elseif strcmp(answer,'Cancel') elseif strcmp(answer,'Cancel')
return return
...@@ -54,7 +63,6 @@ function pb_editor(varargin) ...@@ -54,7 +63,6 @@ function pb_editor(varargin)
case 'Cancel' case 'Cancel'
return return
end end
end
end end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment