Commit 612bc83c authored by jayd1860's avatar jayd1860
Browse files

v1.32.2

-- Fix the following issues:
   Error in plot ptobe with synch browsing, close exported fig, change curr element
   Keep all exported figures in plot probe open instead of having one exported figure
   Make sync browsing default in plot probe
parent 199eb570
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -269,3 +269,14 @@ Christian found issue when opening Homer3 in random folder that it cannot tell i
generates a groupResults.mat file. We have to add feature where Homer3 decides if a group folder is valid. A group folder is valid if it has acquistion files
generates a groupResults.mat file. We have to add feature where Homer3 decides if a group folder is valid. A group folder is valid if it has acquistion files
that are consiStent with each other in terms of having the same probe. 
that are consiStent with each other in terms of having the same probe. 



==================================
Jul 22, 2021

Fixes need to made 

1. configSettingsGUI bug
2. Error in plot ptobe with synch browsing, close exported fig, change curr element
3. Keep all exported figures in plot probe open instead of having one exported figure 
4. Make sync browsing default in plot probe
−1.92 KiB (62.1 KiB)

File changed.

No diff preview for this file type.

+144 −86
Original line number Original line Diff line number Diff line
@@ -50,8 +50,6 @@ plotprobe.datatypeVals = struct('RAW',1, 'RAW_HRF',2, 'OD',4, 'OD_HRF',8, 'CONC'
plotprobe.name = 'plotprobe';
plotprobe.name = 'plotprobe';
plotprobe.y = {};
plotprobe.y = {};
plotprobe.t = {};
plotprobe.t = {};
plotprobe.handles.data = {};
plotprobe.handles.figureDup = [];
SetGuiControls(handles)
SetGuiControls(handles)


setGuiFonts(handles.figure);
setGuiFonts(handles.figure);
@@ -106,15 +104,15 @@ varargin = args;


% Arguments take precedence over parent gui parameters
% Arguments take precedence over parent gui parameters
if length(varargin)==1
if length(varargin)==1
    if iswholenum(varargin{1}) & length(varargin{1})==1
    if iswholenum(varargin{1}) && length(varargin{1})==1
        plotprobe.datatype = varargin{1};                   % PlotProbeGUI(datatype)
        plotprobe.datatype = varargin{1};                   % PlotProbeGUI(datatype)
    else
    else
        plotprobe.groupDirs = varargin{1};                  % PlotProbeGUI(groupDirs)
        plotprobe.groupDirs = varargin{1};                  % PlotProbeGUI(groupDirs)
    end
    end
elseif length(varargin)==2
elseif length(varargin)==2
    if iswholenum(varargin{1}) & length(varargin{1})==1
    if iswholenum(varargin{1}) && length(varargin{1})==1
        plotprobe.datatype = varargin{1};                   % PlotProbeGUI(datatype)
        plotprobe.datatype = varargin{1};                   % PlotProbeGUI(datatype)
        if isreal(varargin{2}) & length(varargin{2})==4     
        if isreal(varargin{2}) && length(varargin{2})==4     
            plotprobe.pos = varargin{2};                        % PlotProbeGUI(datatype, pos)
            plotprobe.pos = varargin{2};                        % PlotProbeGUI(datatype, pos)
        elseif iswholenum(varargin{2})
        elseif iswholenum(varargin{2})
            plotprobe.condition = varargin{2};                  % PlotProbeGUI(datatype, condition)
            plotprobe.condition = varargin{2};                  % PlotProbeGUI(datatype, condition)
@@ -124,16 +122,16 @@ elseif length(varargin)==2
        plotprobe.format = varargin{2};
        plotprobe.format = varargin{2};
    end    
    end    
elseif length(varargin)==3
elseif length(varargin)==3
    if iswholenum(varargin{1}) & length(varargin{1})==1
    if iswholenum(varargin{1}) && length(varargin{1})==1
        plotprobe.datatype = varargin{1};
        plotprobe.datatype = varargin{1};
        plotprobe.condition = varargin{2};
        plotprobe.condition = varargin{2};
        plotprobe.pos = varargin{3};                        % PlotProbeGUI(datatype, condition, pos)
        plotprobe.pos = varargin{3};                        % PlotProbeGUI(datatype, condition, pos)
    elseif ischar(varargin{2})
    elseif ischar(varargin{2})
        plotprobe.groupDirs = varargin{1};
        plotprobe.groupDirs = varargin{1};
        plotprobe.format = varargin{2};
        plotprobe.format = varargin{2};
        if isreal(varargin{3}) & length(varargin{3})==4     
        if isreal(varargin{3}) && length(varargin{3})==4     
            plotprobe.pos = varargin{3};                    % PlotProbeGUI(groupDirs, format, pos)
            plotprobe.pos = varargin{3};                    % PlotProbeGUI(groupDirs, format, pos)
        elseif iswholenum(varargin{3}) & length(varargin{3})==1
        elseif iswholenum(varargin{3}) && length(varargin{3})==1
            plotprobe.datatype = varargin{3};               % PlotProbeGUI(groupDirs, format, datatype)
            plotprobe.datatype = varargin{3};               % PlotProbeGUI(groupDirs, format, datatype)
        end
        end
    end
    end
@@ -141,7 +139,7 @@ elseif length(varargin)==4
    plotprobe.groupDirs = varargin{1};
    plotprobe.groupDirs = varargin{1};
    plotprobe.format    = varargin{2};
    plotprobe.format    = varargin{2};
    plotprobe.datatype  = varargin{3};
    plotprobe.datatype  = varargin{3};
    if isreal(varargin{4}) & length(varargin{2})==4     
    if isreal(varargin{4}) && length(varargin{2})==4     
        plotprobe.pos = varargin{4};                        % PlotProbeGUI(groupDirs, format, datatype, pos)
        plotprobe.pos = varargin{4};                        % PlotProbeGUI(groupDirs, format, datatype, pos)
    elseif iswholenum(varargin{4})
    elseif iswholenum(varargin{4})
        plotprobe.condition = varargin{4};                  % PlotProbeGUI(groupDirs, format, datatype, condition)
        plotprobe.condition = varargin{4};                  % PlotProbeGUI(groupDirs, format, datatype, condition)
@@ -163,6 +161,9 @@ if isempty(maingui)
    if isempty(plotprobe.format)
    if isempty(plotprobe.format)
        plotprobe.format = 'snirf';
        plotprobe.format = 'snirf';
    end
    end
    if isempty(plotprobe.condition)
        plotprobe.condition = 1;
    end
else
else
    if isempty(plotprobe.groupDirs)
    if isempty(plotprobe.groupDirs)
        plotprobe.groupDirs = maingui.groupDirs;
        plotprobe.groupDirs = maingui.groupDirs;
@@ -170,13 +171,13 @@ else
    if isempty(plotprobe.format)
    if isempty(plotprobe.format)
        plotprobe.format = maingui.format;
        plotprobe.format = maingui.format;
    end
    end
    if isempty(plotprobe.condition)
        plotprobe.condition = maingui.condition;
    end
end
end
if isempty(plotprobe.datatype)
if isempty(plotprobe.datatype)
    plotprobe.datatype = plotprobe.datatypeVals.CONC_HRF;
    plotprobe.datatype = plotprobe.datatypeVals.CONC_HRF;
end
end
if isempty(plotprobe.condition)
    plotprobe.condition = maingui.condition;
end






@@ -265,9 +266,17 @@ else
    set(handles.menuItemSyncBrowsing, 'enable','off');
    set(handles.menuItemSyncBrowsing, 'enable','off');
end
end


setappdata(hObject, 'figures',hObject);
setappdata(hObject, 'data',{});

SetTextFilename(handles);
SetTextFilename(handles);
DisplayData(handles, hObject);
DisplayData(handles, hObject);


if ~menuItemSyncBrowsing_Callback(handles.menuItemSyncBrowsing, 'get')
    menuItemSyncBrowsing_Callback(handles.menuItemSyncBrowsing, '', handles);
end






% ----------------------------------------------------------------------
% ----------------------------------------------------------------------
@@ -313,7 +322,7 @@ end
SetWindowTitle(handles)
SetWindowTitle(handles)


% Clear axes of previous data, before redisplaying it
% Clear axes of previous data, before redisplaying it
ClearAxesData();
ClearAxesData(handles);


hold on
hold on
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
@@ -345,13 +354,13 @@ global plotprobe
foo = str2num( get(hObject,'string') );
foo = str2num( get(hObject,'string') );
if length(foo)<2
if length(foo)<2
    foo = plotprobe.axScl;
    foo = plotprobe.axScl;
elseif foo(1)<=0 | foo(2)<=0
elseif foo(1)<=0 || foo(2)<=0
    foo = plotprobe.axScl;
    foo = plotprobe.axScl;
end    
end    
plotprobe.axScl = foo;
plotprobe.axScl = foo;


% Clear axes of previous data, before redisplaying it
% Clear axes of previous data, before redisplaying it
ClearAxesData();
ClearAxesData(handles);


set(hObject,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );
set(hObject,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
@@ -371,7 +380,7 @@ plotprobe.axScl(2) = plotprobe.axScl(2) - 0.1;
set(hEditScl,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );
set(hEditScl,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );


% Clear axes of previous data, before redisplaying it
% Clear axes of previous data, before redisplaying it
ClearAxesData();
ClearAxesData(handles);


nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
@@ -390,7 +399,7 @@ plotprobe.axScl(2) = plotprobe.axScl(2) + 0.1;
set(hEditScl,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );
set(hEditScl,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );


% Clear axes of previous data, before redisplaying it
% Clear axes of previous data, before redisplaying it
ClearAxesData();
ClearAxesData(handles);


nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
@@ -408,7 +417,7 @@ plotprobe.axScl(1) = plotprobe.axScl(1) - 0.1;
set(hEditScl,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );
set(hEditScl,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );


% Clear axes of previous data, before redisplaying it
% Clear axes of previous data, before redisplaying it
ClearAxesData();
ClearAxesData(handles);


nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
@@ -428,7 +437,7 @@ set(hEditScl,'string', sprintf('%0.1f %0.1f', plotprobe.axScl) );
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();


% Clear axes of previous data, before redisplaying it
% Clear axes of previous data, before redisplaying it
ClearAxesData();
ClearAxesData(handles);


for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
    plotProbeAndSetProperties(handles, iBlk);
    plotProbeAndSetProperties(handles, iBlk);
@@ -437,20 +446,21 @@ end




% ----------------------------------------------------------------------
% ----------------------------------------------------------------------
function radiobuttonShowTimeMarkers_Callback(hObject, ~, ~)
function radiobuttonShowTimeMarkers_Callback(hObject, ~, handles)
global plotprobe
global plotprobe


data = getappdata(handles.figure, 'data');
plotprobe.tMarkShow = get(hObject,'value');
plotprobe.tMarkShow = get(hObject,'value');
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
    ml = plotprobe.dataTree.currElem.GetMeasList(iBlk);
    ml = plotprobe.dataTree.currElem.GetMeasList(iBlk);
    lst = find(ml.MeasList(:,4)==1);
    lst = find(ml.MeasList(:,4)==1);
    mlVis = ml.MeasListVis(lst);
    mlVis = ml.MeasListVis(lst);
    if ~isempty(plotprobe.handles.data{iBlk})
    if ~isempty(data{iBlk})
        if plotprobe.tMarkShow
        if plotprobe.tMarkShow
            set(plotprobe.handles.data{iBlk}(logical(mlVis), 4:end), 'visible','on');
            set(data{iBlk}(logical(mlVis), 4:end), 'visible','on');
        else
        else
            set(plotprobe.handles.data{iBlk}(:,4:end), 'visible', 'off');    
            set(data{iBlk}(:,4:end), 'visible', 'off');    
        end
        end
    end
    end
end
end
@@ -470,7 +480,7 @@ if datatype == datatypeVals.CONC_HRF
end
end


% Clear axes of previous data, before redisplaying it
% Clear axes of previous data, before redisplaying it
ClearAxesData();
ClearAxesData(handles);


nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
@@ -478,6 +488,7 @@ for iBlk=1:nDataBlks
end
end





% ----------------------------------------------------------------------
% ----------------------------------------------------------------------
function editPlotProbeTimeMarkersInt_Callback(hObject, ~, handles)
function editPlotProbeTimeMarkersInt_Callback(hObject, ~, handles)
global plotprobe
global plotprobe
@@ -496,7 +507,7 @@ plotprobe.tMarkInt = foo;
set(hObject,'string', sprintf('%0.1f ',plotprobe.tMarkInt) );
set(hObject,'string', sprintf('%0.1f ',plotprobe.tMarkInt) );


% Clear axes of previous data, before redisplaying it
% Clear axes of previous data, before redisplaying it
ClearAxesData();
ClearAxesData(handles);


nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
@@ -506,12 +517,10 @@ end




% ----------------------------------------------------------------------
% ----------------------------------------------------------------------
function pushbuttonPlotProbeDuplicate_Callback(~, ~, handles) %#ok<*DEFNU>
function pushbuttonPlotProbeExport_Callback(~, ~, handles) %#ok<*DEFNU>
global plotprobe
global plotprobe


if ishandles(plotprobe.handles.figureDup)
figures = getappdata(handles.figure, 'figures');
    delete(plotprobe.handles.figureDup);
end


%%%% Get the zoom level of the original plotProbe axes
%%%% Get the zoom level of the original plotProbe axes
figure(handles.figure);
figure(handles.figure);
@@ -519,41 +528,64 @@ a = get(gca,'xlim');
b = get(gca,'ylim');
b = get(gca,'ylim');
set(gca, 'tag','axes1');
set(gca, 'tag','axes1');


iNew = length(figures)+1;

%%%% Create new figure and use same zoom level and axes position 
%%%% Create new figure and use same zoom level and axes position 
%%%% as original 
%%%% as original 
handles.figureDup = figure('name', plotprobe.dataTreeHandle.currElem.GetName(), 'NumberTitle','off');
figures(iNew) = figure('name', plotprobe.dataTreeHandle.currElem.GetName(), 'NumberTitle','off');
setappdata(handles.figure, 'figures',figures);
xlim(a);
xlim(a);
ylim(b);
ylim(b);
axis off
axis off
pos = getNewFigPos(handles);
pos = getNewFigPos(handles);
set(handles.figureDup, 'position',pos);
if ~isempty(pos)
    set(figures(iNew), 'position',pos);
end


% Display name label and divider
% Display name label and divider
hname = get(handles.textFilename);
hname = get(handles.textFilename);
hnameFrame = get(handles.textFilenameFrame);
hnameFrame = get(handles.textFilenameFrame);
hdiv = get(handles.uipanelDivider);
hdiv = get(handles.uipanelDivider);
uicontrol('parent',handles.figureDup, 'style','text', 'string',hnameFrame.String, 'units',hnameFrame.Units, 'position',hnameFrame.Position, ...
uicontrol('parent',figures(iNew), 'style','text', 'string',hnameFrame.String, 'units',hnameFrame.Units, 'position',hnameFrame.Position, ...
           'backgroundcolor',hnameFrame.BackgroundColor, 'fontsize',hnameFrame.FontSize, 'fontweight',hnameFrame.FontWeight);
           'backgroundcolor',hnameFrame.BackgroundColor, 'fontsize',hnameFrame.FontSize, 'fontweight',hnameFrame.FontWeight);
uicontrol('parent',handles.figureDup, 'style','text', 'string',hname.String, 'units',hname.Units, 'position',hname.Position, ...
uicontrol('parent',figures(iNew), 'style','text', 'string',hname.String, 'units',hname.Units, 'position',hname.Position, ...
           'backgroundcolor',hname.BackgroundColor, 'fontsize',hname.FontSize, 'fontweight',hname.FontWeight);
           'backgroundcolor',hname.BackgroundColor, 'fontsize',hname.FontSize, 'fontweight',hname.FontWeight);
uipanel('parent',handles.figureDup, 'units',hdiv.Units, 'position',hdiv.Position, 'bordertype',hdiv.BorderType);
uipanel('parent',figures(iNew), 'units',hdiv.Units, 'position',hdiv.Position, 'bordertype',hdiv.BorderType);
       
       
% Display data
% Display data
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
    plotProbeAndSetProperties(handles, iBlk, length(plotprobe.handles.data)+1);
    plotProbeAndSetProperties(handles, iBlk, length(figures));
end
end
plotprobe.handles.figureDup = handles.figureDup;
rePositionGuiWithinScreen(figures(iNew));
rePositionGuiWithinScreen(plotprobe.handles.figureDup);






% ---------------------------------------------
% ---------------------------------------------
function pos = getNewFigPos(handles)
function pos = getNewFigPos(handles)
pos = [];
figures = getappdata(handles.figure, 'figures');
if length(figures)<2
    return;
end

hFig = [];
for ii = 1:length(figures)-1
    if ishandles(figures(ii))
        hFig = figures(ii);
    end
end
if ~ishandles(hFig)
    return;
end


hFig = handles.figure;
if ii==1
hFigDup = handles.figureDup;
    kx = .4;
elseif ii>1
    kx = .04;
end


hFigDup = figures(end);
p = get(hFig,'position');
p = get(hFig,'position');
u = get(hFig,'units');
u = get(hFig,'units');
set(hFigDup, 'units',u, 'position',p);
set(hFigDup, 'units',u, 'position',p);
@@ -579,41 +611,64 @@ if c(1)>scrsz(3)/2
else
else
    q=+1;
    q=+1;
end
end
if c(2)>scrsz(4)/2
offsetX = q*scrsz(3)*kx;
    r=-1;
offsetY = p(4)*.02;
else
    r=+1;
end
offsetX = q*scrsz(3)*.4;
offsetY = r*scrsz(4)*.1;


% pos = [p(1)+offsetX p(2)+offsetY p(3) p(4)];
% pos = [p(1)+offsetX p(2)+offsetY p(3) p(4)];
pos = [p(1)+offsetX p(2), p(3) p(4)];
pos = [p(1)+offsetX, p(2)-offsetY, p(3), p(4)];
set(0,'units',u0);
set(0,'units',u0);


% Set relative position with axes to be same in duplicate as in parent 
% Set relative position with axes to be same in duplicate as in parent 
haxes = findobj2(hFig, 'tag','axes1', 'flat');
haxes = findobj2(hFig, 'tag','axes1', 'flat');
p = get(haxes,'position');
p = get(haxes,'position');
set(gca, 'position',p)
if isempty(p)
    return
end
set(gca, 'position',p, 'tag','axes1');




% -------------------------------------------------------------------
function CloseSupporting(hObject)
if ~ishandles(hObject)
    return;
end

% Check to see if any figure associated with this GUI need  to
% be closed as well
msg = sprintf('Do you want to close all supporting figures associated with PlotProbeGUI?');
firstfig = false;
figures = getappdata(hObject, 'figures');
for ii = 2:length(figures)
    if ishandle(figures(ii))
        if firstfig == false
            firstfig = true;
            q = MenuBox(msg, {'YES','NO'});
            if q==2
                break;
            end
        end
        delete(figures(ii));
    end
end
    
    
    
    
    
    
% ----------------------------------------------------------------------
% ----------------------------------------------------------------------
function PlotProbeGUI_Close(~, ~, ~)
function PlotProbeGUI_Close(hObject, ~, ~)
global plotprobe
global plotprobe
if isempty(plotprobe)
if isempty(plotprobe)
    return
    return
end
end
if nargin==0
    hObject = [];
end
if ~isempty(plotprobe.updateParentGui) 
if ~isempty(plotprobe.updateParentGui) 
	plotprobe.updateParentGui('PlotProbeGUI');
	plotprobe.updateParentGui('PlotProbeGUI');
end
end

CloseSupporting(hObject)
% Removed closing of duplicate figure at users' request
% JD: Oct 22, 2020

% if ishandles(plotprobe.handles.figureDup)
%     delete(plotprobe.handles.figureDup);
% end







@@ -646,8 +701,6 @@ nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
plotprobe.y = cell(nDataBlks,1);
plotprobe.y = cell(nDataBlks,1);
plotprobe.t = cell(nDataBlks,1);
plotprobe.t = cell(nDataBlks,1);
   
   
hFigs = [handles.figure, plotprobe.handles.figureDup];
    
for iBlk = 1:nDataBlks
for iBlk = 1:nDataBlks
    if datatype == plotprobe.datatypeVals.OD_HRF
    if datatype == plotprobe.datatypeVals.OD_HRF
        plotprobe.y{iBlk} = plotprobe.dataTreeHandle.currElem.GetDodAvg(condition, iBlk);
        plotprobe.y{iBlk} = plotprobe.dataTreeHandle.currElem.GetDodAvg(condition, iBlk);
@@ -660,39 +713,28 @@ for iBlk = 1:nDataBlks
        plotprobe.tMarkUnits = '(micro-molars)';
        plotprobe.tMarkUnits = '(micro-molars)';
    end
    end
    
    
    for iFig = 1:length(hFigs)
        
        if iFig==1
        
    % Clear axes of previous data, before redisplaying it
    % Clear axes of previous data, before redisplaying it
            ClearAxesData(iFig);
    ClearAxesData(handles);    
            
    plotProbeAndSetProperties(handles);
            if ishandles(hFigs(iFig))
    figure(handles.figure)
                figure(hFigs(iFig))
                plotProbeAndSetProperties(handles, iBlk, iFig);
            end
        end
        
        figure(hFigs(iFig))
        
    end    
end
end






% ----------------------------------------------------------------------
% ----------------------------------------------------------------------
function ClearAxesData(iFig)
function ClearAxesData(handles, iFig)
global plotprobe
data = getappdata(handles.figure, 'data');
if ~exist('iFig','var') || isempty(iFig)
if ~exist('iFig','var') || isempty(iFig)
    iFig=1;
    iFig=1;
end
end
if isempty(plotprobe.handles.data)
if isempty(data)
    return
    return
end
end
if ishandles(plotprobe.handles.data{iFig})
if ishandles(data{iFig})
    delete(plotprobe.handles.data{iFig});
    delete(data{iFig});
    plotprobe.handles.data{iFig} = [];
    data{iFig} = [];
end
end
setappdata(handles.figure, 'data',data);






@@ -768,12 +810,28 @@ set(handles.textFilenameFrame, 'units','normalized');




% --------------------------------------------------------------------
% --------------------------------------------------------------------
function menuItemSyncBrowsing_Callback(hObject, ~, handles)
function b = menuItemSyncBrowsing_Callback(hObject, eventdata, handles)
global plotprobe
global plotprobe

if nargin==1
    eventdata = '';
    handles = [];
elseif nargin==2
    handles = [];
end

b = 0;
if ischar(eventdata) && strcmpi(eventdata, 'get')
    b = strcmpi(get(hObject, 'checked'), 'on');
    return
end

if strcmpi(get(hObject, 'checked'), 'off')
if strcmpi(get(hObject, 'checked'), 'off')
    set(hObject, 'checked', 'on')
    set(hObject, 'checked', 'on')
    SyncBrowsing(plotprobe, 'on');
    SyncBrowsing(plotprobe, 'on');
    if ~isempty(handles)
        PlotProbeGUI_Update(handles);
        PlotProbeGUI_Update(handles);
    end
else
else
    set(hObject, 'checked', 'off')
    set(hObject, 'checked', 'off')
    SyncBrowsing(plotprobe, 'off');
    SyncBrowsing(plotprobe, 'off');
@@ -782,9 +840,9 @@ end




% --------------------------------------------------------------------
% --------------------------------------------------------------------
function radiobuttonShowStd_Callback(hObject, ~, handles)
function radiobuttonShowStd_Callback(~, ~, handles)
global plotprobe
global plotprobe
ClearAxesData();
ClearAxesData(handles);
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
nDataBlks = plotprobe.dataTreeHandle.currElem.GetDataBlocksNum();
for iBlk=1:nDataBlks
for iBlk=1:nDataBlks
    plotProbeAndSetProperties(handles, iBlk);
    plotProbeAndSetProperties(handles, iBlk);
+5 −2
Original line number Original line Diff line number Diff line
@@ -24,7 +24,10 @@ tMarkVis = plotprobe.tMarkShow;
ch       = plotprobe.dataTree.currElem.GetMeasList(iBlk);
ch       = plotprobe.dataTree.currElem.GetMeasList(iBlk);
SD       = plotprobe.dataTree.currElem.GetSDG('2D');
SD       = plotprobe.dataTree.currElem.GetSDG('2D');



data = getappdata(handles.figure, 'data');
set(handles.textTimeMarkersAmpUnits, 'string',plotprobe.tMarkUnits);
set(handles.textTimeMarkersAmpUnits, 'string',plotprobe.tMarkUnits);
hData = plotProbe( y, t, SD, ch, ystd, axScl, tMarkInt, tMarkAmp, tMarkVis );
hData = plotProbe( y, t, SD, ch, ystd, axScl, tMarkInt, tMarkAmp, tMarkVis );
plotprobe.handles.data{iFig} = hData;
data{iFig} = hData;
setappdata(handles.figure, 'data',data);

+38 −3
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@ classdef ChildGuiClass < handle
        args
        args
        visible
        visible
        lastpos
        lastpos
        closeSupporting;
    end
    end
    
    
    methods
    methods
@@ -48,6 +49,7 @@ classdef ChildGuiClass < handle
            obj.args = {};
            obj.args = {};
            obj.visible = 'on';
            obj.visible = 'on';
            obj.lastpos = [];
            obj.lastpos = [];
            obj.closeSupporting = 0;
            
            
            if nargin==0
            if nargin==0
                return;
                return;
@@ -126,6 +128,8 @@ classdef ChildGuiClass < handle
                obj.args = varargin;
                obj.args = varargin;
            end
            end
            
            
            obj.closeSupporting = 0;
            
            % Allow up to 6 arguments to be passed to GUI
            % Allow up to 6 arguments to be passed to GUI
            a = obj.args;
            a = obj.args;
            handles = []; %#ok<*PROPLC>
            handles = []; %#ok<*PROPLC>
@@ -304,14 +308,18 @@ classdef ChildGuiClass < handle
        
        
        % -------------------------------------------------------------------
        % -------------------------------------------------------------------
        function Close(obj, hObject, eventdata) %#ok<INUSD>
        function Close(obj, hObject, eventdata) %#ok<INUSD>
            if isempty(obj.name)
            if ~ishandles(obj.handles.figure)
                return;
                return;
            end
            end
            obj.args = {};
            if isempty(obj.name)
            if ~ishandle(obj.handles.figure)
                return;
                return;
            end
            end
            obj.args = {};
            obj.lastpos = get(obj.handles.figure, 'position');
            obj.lastpos = get(obj.handles.figure, 'position');
            
            obj.CloseSupporting();
            
            % Now delete the parent GUI
            delete(obj.handles.figure);
            delete(obj.handles.figure);
            
            
            % See if there's a private GUI close function to call
            % See if there's a private GUI close function to call
@@ -323,6 +331,33 @@ classdef ChildGuiClass < handle
        
        
        
        
        
        
        % -------------------------------------------------------------------
        function CloseSupporting(obj)
            if ~ishandles(obj.handles.figure)
                return;
            end
            
            % Check to see if any figure associated with this GUI need  to
            % be closed as well
            msg = sprintf('Do you want to close all supporting figures associated with %s?', obj.name);
            figures = getappdata(obj.handles.figure, 'figures');            
            for ii = 2:length(figures)
                if ishandle(figures(ii))
                    if obj.closeSupporting == 2
                        break;
                    end
                    if obj.closeSupporting==0
                        obj.closeSupporting = MenuBox(msg, {'YES','NO'});
                    end
                    if obj.closeSupporting == 1
                        delete(figures(ii));
                    end
                end
            end
        end        
        
        
        
        % -------------------------------------------------------------------
        % -------------------------------------------------------------------
        function [title, vernum] = SetTitle(obj, option)
        function [title, vernum] = SetTitle(obj, option)
            %
            %
Loading