Ignore:
Timestamp:
Apr 29, 2013, 11:28:23 PM (12 years ago)
Author:
sommeria
Message:

waitbar system for series improved to aloow use as stand alone fcts.

to add at the head of series fcts:
hseries=findobj(allchild(0),'Tag','series');
RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
WaitbarHandle?=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series

call to waitbar:

update_waitbar(WaitbarHandle?,index/nbfield)
if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction?'),'queue')

disp('program stopped by user')
break

end

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/time_series.m

    r609 r624  
    6565
    6666%%%%%%%%%%%% STANDARD PART  %%%%%%%%%%%%
     67ParamOut=[]; %default output
    6768%% read input parameters from an xml file if input is a file name (batch mode)
    6869checkrun=1;
     
    7172    checkrun=0;
    7273end
    73 
    74 ParamOut=[]; %default output
     74hseries=findobj(allchild(0),'Tag','series');
     75RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     76WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
     77
     78%% define the directory for result file (with path=RootPath{1})
    7579OutputDir=[Param.OutputSubDir Param.OutputDirExt];
    7680
     
    205209%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    206210for index=1:nbfield
    207     if checkrun
    208         stopstate=get(Param.RUNHandle,'BusyAction');
    209         update_waitbar(Param.WaitbarHandle,index/nbfield)
    210     else
    211         stopstate='queue';
    212     end
    213     if ~isequal(stopstate,'queue')% enable STOP command
    214         break
     211            update_waitbar(WaitbarHandle,index/nbfield)
     212    if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     213        disp('program stopped by user')
     214        break % leave the loop if stop is ordered
    215215    end
    216216    Data=cell(1,nbview);%initiate the set Data;
Note: See TracChangeset for help on using the changeset viewer.