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,45 +15,53 @@ function pb_editor(varargin) ...@@ -15,45 +15,53 @@ 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
case 'Save' % Switch function mode
h = matlab.desktop.editor.getAll; case 'Save'
fns = {h.Filename}; % Save
cd(cdir); h = matlab.desktop.editor.getAll;
uisave('fns',''); fns = {h.Filename};
cd(dc) cd(cdir);
case 'Open' uisave('fns','');
if isempty(fn) cd(dc)
fn = pb_getfile('dir',cdir); case 'Open'
end % Open
if fn ~= 0 if isempty(fn)
h = matlab.desktop.editor.getAll; fn = pb_getfile('dir',cdir);
if ~isempty(h) end
quest = 'Do you want to empty all current files in editor?'; if fn ~= 0
h = matlab.desktop.editor.getAll;
if ~isempty(h)
quest = 'Do you want to empty all current files in editor?';
title = 'Editor Action';
answer = questdlg(quest, title,'Yes','No','Cancel','Cancel');
if strcmp(answer,'Yes')
quest = 'Save current editor setup?';
title = 'Editor Action'; title = 'Editor Action';
answer = questdlg(quest, title,'Yes','No','Cancel','Cancel'); answer = questdlg(quest, title,'Yes','No','Yes');
if strcmp(answer,'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
end
end
load(fn,'fns');
for idx = 1:length(fns)
edit(fns{idx})
end end
clear('fns');
end end
case 'Cancel'
return load(fn,'fns');
end for idx = 1:length(fns)
edit(fns{idx})
end
clear('fns');
end
case 'Cancel'
return
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