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)
block(bn).trial(tn).stim(sn).intensity = par(4);
block(bn).trial(tn).stim(sn).onevent = par(5);
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);
case {'LED','LED1','LED2'}
......@@ -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).offevent = par(6);
block(bn).trial(tn).stim(sn).offdelay = par(7);
block(bn).trial(tn).stim(sn).duration = par(7)-par(5);
case 'TRG0'
% Updates count and writes stimulus
......
......@@ -15,45 +15,53 @@ function pb_editor(varargin)
dc = cd;
if isempty(mode)
% Run mode dialog
quest = 'Choose editor action...';
title = 'Editor Action';
mode = questdlg(quest, title,'Save','Open','Cancel','Cancel');
switch mode
case 'Save'
h = matlab.desktop.editor.getAll;
fns = {h.Filename};
cd(cdir);
uisave('fns','');
cd(dc)
case 'Open'
if isempty(fn)
fn = pb_getfile('dir',cdir);
end
if fn ~= 0
h = matlab.desktop.editor.getAll;
if ~isempty(h)
quest = 'Do you want to empty all current files in editor?';
mode = questdlg(quest, title,'Save','Open','Cancel','Cancel');
end
switch mode
% Switch function mode
case 'Save'
% Save
h = matlab.desktop.editor.getAll;
fns = {h.Filename};
cd(cdir);
uisave('fns','');
cd(dc)
case 'Open'
% Open
if isempty(fn)
fn = pb_getfile('dir',cdir);
end
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';
answer = questdlg(quest, title,'Yes','No','Cancel','Cancel');
if strcmp(answer,'Yes')
pb_closeedit('which','all');
elseif strcmp(answer,'Cancel')
return
end
end
load(fn,'fns');
for idx = 1:length(fns)
edit(fns{idx})
answer = questdlg(quest, title,'Yes','No','Yes');
if strcmp(answer,'Yes'); pb_editor('mode','Save'); end
pb_closeedit('which','all');
elseif strcmp(answer,'Cancel')
return
end
clear('fns');
end
case 'Cancel'
return
end
load(fn,'fns');
for idx = 1:length(fns)
edit(fns{idx})
end
clear('fns');
end
case 'Cancel'
return
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