Plots and progress bars in GUIs

4 Ansichten (letzte 30 Tage)
Jose Caballero
Jose Caballero am 1 Jul. 2016
Kommentiert: Jose Caballero am 1 Jul. 2016
Hello all,
I a have GUI that with multiple checkboxes, each one showing collected field data for different variables of a Doppler speed log. A certain function of the GUI asks the user for an interval of the signals to run some analyses (noise, calibration,...). When the callback of this function is invoked, it also calls a routine to zoom all plots in the selected intervals.
The refresh plot function is as follows:
function [] = update_cb(hObject,pan_name)
% Get handles
handles=guidata(hObject);
%Get Panel
P_f=getfield(handles,pan_name);
% Get all checkboxes
P_h= findall(P_f,'Style','checkbox');
Lcb=length(P_h);
pbh_prog= 0;
pbh_inc=1/Lcb;
% iterate over checkboxes and run callbacks
for i=1:Lcb
% Get callback Tag
tag=get(P_h(i),'tag');
fname = get(P_h(i),'Callback');
% Run callback function
feval(fname, hObject,handles);
% % Update progress bar
pbh_prog=pbh_prog+pbh_inc;
multiWaitbar( 'Updating Plots', pbh_prog );
end
Thing is , the execution takes some seconds during which the GUI seems frozen to the user. I want to add a progress bar , but that makes that the signals are plot one by one in the new interval, while the app changes each signal representation from old interval (normally the total length of the variables) to the new selected interval.Also, the progress bar loses focus (is minimized) after the refresh of the first signal.All in all, is an ugly effect for the user.
My question: How is it possible to run the progress bar without losing focus, and have all the plots refreshed when the progress bar reaches 100 %?
Thanks in advance,
Jose
  1 Kommentar
Jose Caballero
Jose Caballero am 1 Jul. 2016
Ok , for the loss of focus of the progress bar I have used:
pbh = waitbar(0,'Please wait...');
set(pbh,'windowstyle','modal');
God blesss the forums...! Still have to solve the plot refresh issue.
Jose

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Data Exploration finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by