Commit a92434a1 authored by Jay's avatar Jay
Browse files

v1.14.2

-- Fixed some problems with StimEditGUI, and added a feature:
a) GUI would position and resize incorrectly after user opens it, closes it and then reopens.
b) Do not need to redisplay anything if nothing changed
c) Highlight stim that user is about to edit, BEFORE editing (ie user stil has chance to back out by canceling

-- Change line thickness for other wavelength (ie dashed lines) for OD and raw display in MainGUI

-- Fix parsing bug in FuncCallClass
parent 53a24783
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -289,6 +289,9 @@ classdef FuncCallClass < handle
                        if isempty(obj.argIn)
                            obj.argIn = ArgClass();
                        end
                        if length(textstr)<(ii+3)
                            continue
                        end
                        obj.argOut.str = textstr{ii+2};
                        obj.argIn.str = textstr{ii+3};
                        obj.DecodeArgIn();
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ end
if ~isempty(dStd) && (isempty(nTrials) || isempty(condition))
    return;
end
linewidth = [2,1.2,2,2,2,2];
linewidth = [2,2,2,2,2,2];

for iWl=1:length(wl)
    for ii=1:length(ch(chLst))
+46 −12
Original line number Diff line number Diff line
@@ -103,9 +103,11 @@ end
%%%% End parse arguments 

% See if we can set the position
if ~isempty(stimEdit.pos)
    p = stimEdit.pos;
if ~isempty(p)
    set(hObject, 'position', [p(1), p(2), p(3), p(4)]);
    set(hObject, 'units','characters', 'position', [p(1), p(2), p(3), p(4)]);
else
    set(hObject, 'units','characters');
end

stimEdit.version = get(hObject, 'name');
@@ -122,6 +124,7 @@ zoom(hObject,'off');
StimEditGUI_Update(handles);
StimEditGUI_EnableGuiObjects('on', handles);


stimEdit.status=0;


@@ -151,10 +154,16 @@ if isempty(tPts_select)
    return;
end
EditSelectTpts(tPts_select);
if stimEdit.status==0
    return;
end
StimEditGUI_Display(handles);
stimEdit.updateParentGui('StimEditGUI');
figure(handles.figure);

% Reset status
stimEdit.status=0;



%---------------------------------------------------------------------------
@@ -229,11 +238,17 @@ p1 = min(point1,point2);
p2 = max(point1,point2);
t1 = p1(1);
t2 = p2(1);
EditSelectRange(t1, t2);
EditSelectRange(t1, t2, handles);
if stimEdit.status==0
    return;
end
StimEditGUI_Display(handles);
stimEdit.updateParentGui('StimEditGUI');
figure(handles.figure);

% Reset status
stimEdit.status=0;



% ------------------------------------------------
@@ -261,7 +276,27 @@ stims_select = find(s2>=1);


% ------------------------------------------------
function EditSelectRange(t1, t2)
function h = HighlightStims(t, t_select, s, handles)
h = [];
if isempty(t)
    return
end
if isempty(t_select)
    return
end
axes(handles.axes1)
r = ylim();
hold on
for ii=1:length(s)
    h(ii) = line([t(t_select(s(ii))), t(t_select(s(ii)))], [r(1), r(2)], 'color',[0,0,0], 'linewidth',2.5);
end
hold off
drawnow



% ------------------------------------------------
function EditSelectRange(t1, t2, handles)
global stimEdit
t = stimEdit.dataTree.currElem.GetTime();
if ~all(t1==t2)
@@ -271,19 +306,18 @@ else
    tPts_idxs_select = min(find(abs(t-t1)<tVals));
end
stims_select = GetStimsFromTpts(tPts_idxs_select);
if isempty(stims_select) & ~(t1==t2)
if isempty(stims_select) & ~all(t1==t2)
    MessageBox( 'Drag mouse around the stim to edit.');
    return;
end

% Highlight stims user wants to edit
h = HighlightStims(t, tPts_idxs_select, stims_select, handles);
AddEditDelete(tPts_idxs_select, stims_select);
if stimEdit.status==0
    return;
if ~isempty(h)
    delete(h);
end

% Reset status
stimEdit.status=0;



% ------------------------------------------------
function EditSelectTpts(tPts_select)
+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ function vrnnum = getVernum()

vrnnum{1} = '1';   % Major version #
vrnnum{2} = '14';  % Major sub-version #
vrnnum{3} = '1';   % Minor version #
vrnnum{3} = '2';   % Minor version #
vrnnum{4} = '0';   % Minor sub-version # or patch #: 'p1', 'p2', etc