Commit 7f27bfe8 authored by James Desjardins's avatar James Desjardins
Browse files

Revert "Performance benefits in 2015a"... caused errors when there were multiple ve_eegplot active

This reverts commit 1000ba1a.

Conflicts:
	vised/branch_func/ve_eegplot.m
parent 994ca18e
......@@ -230,12 +230,6 @@ end
% Setup inputs
% %%%%%%%%%%%%%%%%%%%%%%%%
persistent ax0;
persistent ax1;
persistent hh_etime;
persistent hh_evalue;
persistent hh_eelec;
if ~isstr(data) % If NOT a 'noui' call or a callback from uicontrols
%try
......@@ -604,7 +598,6 @@ if ~isstr(data) % If NOT a 'noui' call or a callback from uicontrols
'Style','text', ...
'Tag','Eelec',...
'string',' ');
hh_eelec = u(9);
u(10) = uicontrol('Parent',figh, ...
'Units', 'normalized', ...
'BackgroundColor',DEFAULT_FIG_COLOR, ...
......@@ -612,7 +605,6 @@ if ~isstr(data) % If NOT a 'noui' call or a callback from uicontrols
'Style','text', ...
'Tag','Etime',...
'string','0.00');
hh_etime = u(10);
u(11) = uicontrol('Parent',figh, ...
'Units', 'normalized', ...
'BackgroundColor',DEFAULT_FIG_COLOR, ...
......@@ -620,7 +612,7 @@ if ~isstr(data) % If NOT a 'noui' call or a callback from uicontrols
'Style','text', ...
'Tag','Evalue',...
'string','0.00');
hh_evalue = u(11);
u(14)= uicontrol('Parent',figh, ...
'Units', 'normalized', ...
'BackgroundColor',DEFAULT_FIG_COLOR, ...
......@@ -1112,8 +1104,8 @@ else
if strcmp(get(figh,'tag'),'dialog')
figh = get(figh,'UserData');
end
%ax0 = findobj('tag','backeeg','parent',figh); % axes handle
%ax1 = findobj('tag','eegaxis','parent',figh); % axes handle
ax0 = findobj('tag','backeeg','parent',figh); % axes handle
ax1 = findobj('tag','eegaxis','parent',figh); % axes handle
g = get(figh,'UserData');
data = get(ax1,'UserData');
......@@ -1373,8 +1365,8 @@ else
case 'drawb' % Draw background ******************************************************
% Redraw EEG and change position
%ax0 = findobj('tag','backeeg','parent',gcf); % axes handle
%ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle
ax0 = findobj('tag','backeeg','parent',gcf); % axes handle
ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle
g = get(gcf,'UserData'); % Data (Note: this could also be global)
......@@ -1521,7 +1513,7 @@ else
tagnum = (alltag-1)/g.trialstag+1;
set(ax0,'XTickLabel', tagnum,'YTickLabel', [],...
'Xlim',[0 g.winlength*multiplier],...
'XTick',alltag-lowlim+g.trialstag/2, 'YTick',[], 'tag','');
'XTick',alltag-lowlim+g.trialstag/2, 'YTick',[], 'tag','backeeg');
axes(ax1);
tagpos = [];
......@@ -1580,7 +1572,7 @@ else
case 'draws'
% Redraw EEG and change scale
%ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle
ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle
g = get(gcf,'UserData');
data = get(ax1, 'userdata');
ESpacing = findobj('tag','ESpacing','parent',gcf); % ui handle
......@@ -1731,7 +1723,7 @@ else
end;
eyeaxes = findobj('tag','eyeaxes','parent',figh);
%ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle
ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle
YLim = get(ax1, 'ylim');
ESpacing = findobj('tag','ESpacing','parent',figh);
......@@ -1784,8 +1776,8 @@ else
case 'zoom' % if zoom
fig = varargin{1};
%ax1 = findobj('tag','eegaxis','parent',fig);
ax2 = ax0; %findobj('tag','backeeg','parent',fig);
ax1 = findobj('tag','eegaxis','parent',fig);
ax2 = findobj('tag','backeeg','parent',fig);
tmpxlim = get(ax1, 'xlim');
tmpylim = get(ax1, 'ylim');
tmpxlim2 = get(ax2, 'xlim');
......@@ -1885,8 +1877,8 @@ else
fig = varargin{1};
g = get(fig,'UserData');
%ax1 = findobj('tag','backeeg','parent',fig);
tmppos = get(ax0, 'currentpoint');
ax1 = findobj('tag','backeeg','parent',fig);
tmppos = get(ax1, 'currentpoint');
if g.trialstag ~= -1,
lowlim = round(g.time*g.trialstag+1);
......@@ -1898,12 +1890,12 @@ else
set(fig,'UserData', g);
ve_eegplot('drawb');
else
%hh = findobj('tag','Etime','parent',fig);
if g.trialstag ~= -1,d
set(hh_etime, 'string', num2str(mod(tmppos(1)+lowlim-1,g.trialstag)/g.trialstag*(g.limits(2)-g.limits(1)) + g.limits(1)));
else set(hh_etime, 'string', num2str((tmppos(1)+lowlim-1)/g.srate)); % put g.time in the box
hh = findobj('tag','Etime','parent',fig);
if g.trialstag ~= -1,
set(hh, 'string', num2str(mod(tmppos(1)+lowlim-1,g.trialstag)/g.trialstag*(g.limits(2)-g.limits(1)) + g.limits(1)));
else set(hh, 'string', num2str((tmppos(1)+lowlim-1)/g.srate)); % put g.time in the box
end;
%ax1 = findobj('tag','eegaxis','parent',fig);
ax1 = findobj('tag','eegaxis','parent',fig);
tmppos = get(ax1, 'currentpoint');
xlims=get(ax1,'XLim');
ylims=get(ax1,'YLim');
......@@ -1932,18 +1924,18 @@ else
tmpelec = round(tmppos(1,2) / g.spacing);
tmpelec = min(max(double(tmpelec), 1),g.chans);
labls = get(ax1, 'YtickLabel');
%hh = findobj('tag','Eelec','parent',fig); % put electrode in the box
hh = findobj('tag','Eelec','parent',fig); % put electrode in the box
if ~g.envelope
set(hh_eelec, 'string', labls(tmpelec+1,:));
set(hh, 'string', labls(tmpelec+1,:));
else
set(hh_eelec, 'string', ' ');
set(hh, 'string', ' ');
end
%hh = findobj('tag','Evalue','parent',fig);
hh = findobj('tag','Evalue','parent',fig);
if ~g.envelope
eegplotdata = get(ax1, 'userdata');
set(hh_evalue, 'string', num2str(eegplotdata(g.chans+1-tmpelec, min(g.frames,max(1,double(round(tmppos(1)+lowlim))))))); % put value in the box
set(hh, 'string', num2str(eegplotdata(g.chans+1-tmpelec, min(g.frames,max(1,double(round(tmppos(1)+lowlim))))))); % put value in the box
else
set(hh_evalue,'string',' ');
set(hh,'string',' ');
end
end;
......@@ -1955,9 +1947,9 @@ else
if ~isstruct(g.eloc_file) || ~isfield(g.eloc_file, 'theta') || isempty( [ g.eloc_file.theta ])
return;
end;
%ax1 = findobj('tag','backeeg','parent',fig);
tmppos = get(ax0, 'currentpoint');
%ax1 = findobj('tag','eegaxis','parent',fig); % axes handle
ax1 = findobj('tag','backeeg','parent',fig);
tmppos = get(ax1, 'currentpoint');
ax1 = findobj('tag','eegaxis','parent',fig); % axes handle
% plot vertical line
yl = ylim;
plot([ tmppos tmppos ], yl, 'color', [0.8 0.8 0.8]);
......@@ -1987,7 +1979,7 @@ else
case 'defupcom'
fig = varargin{1};
g = get(fig,'UserData');
%ax1 = findobj('tag','backeeg','parent',fig);
ax1 = findobj('tag','backeeg','parent',fig);
g.incallback = 0;
set(fig,'UserData', g); % early save in case of bug in the following
if strcmp(g.mocap,'on'), g.winrej = g.winrej(end,:);end; % nima
......@@ -2031,9 +2023,9 @@ else
fig = varargin{1};
g = get(fig,'UserData');
%ax1 = findobj('tag','backeeg','parent',fig);
tmppos = get(ax0, 'currentpoint');
if strcmp(get(fig, 'SelectionType'),'normal')
ax1 = findobj('tag','backeeg','parent',fig);
tmppos = get(ax1, 'currentpoint');
if strcmp(get(fig, 'SelectionType'),'normal');
g = get(fig,'UserData'); % get data of backgroung image {g.trialstag g.winrej incallback}
if g.incallback ~= 1 % interception of nestest calls
if g.trialstag ~= -1,
......
Supports Markdown
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