Ignore:
Timestamp:
Apr 29, 2013, 11:28:23 PM (11 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/ima_levels.m

    r606 r624  
    7575%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
    7676%% read input parameters from an xml file if input is a file name (batch mode)
    77 ParamOut=[]
     77ParamOut=[];
    7878checkrun=1;
    7979if ischar(Param)
     
    8181    checkrun=0;
    8282end
     83hseries=findobj(allchild(0),'Tag','series');
     84RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     85WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
     86
     87%% subdirectory for output files
     88SubdirOut=[Param.OutputSubDir Param.OutputDirExt];
    8389
    8490%% root input file names and nomenclature type (cell arrays with one element)
     
    8995FileExt=Param.InputTable(:,5);
    9096
    91 %% subdirectory for output files
    92 SubdirOut=[Param.OutputSubDir Param.OutputDirExt];
    9397
    9498%% get the set of input file names (cell array filecell), and file indices
     
    146150j1=[];%default
    147151for ifile=1:nbfield
    148     if checkrun
    149         stopstate=get(Param.RUNHandle,'BusyAction');
    150         update_waitbar(Param.WaitbarHandle,ifile/nbfield)
    151     else
    152         stopstate='queue';
     152            update_waitbar(WaitbarHandle,index/nbfield)
     153    if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     154        disp('program stopped by user')
     155        return
    153156    end
    154157    if ~isequal(stopstate,'queue') % enable STOP command
Note: See TracChangeset for help on using the changeset viewer.