Plots and progress bars in GUIs

조회 수: 3 (최근 30일)
Jose Caballero
Jose Caballero 2016년 7월 1일
댓글: Jose Caballero 2016년 7월 1일
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
Jose Caballero
Jose Caballero 2016년 7월 1일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by