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/merge_proj.m

    r614 r624  
    6464
    6565%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
     66ParamOut=[] %default output
    6667%% read input parameters from an xml file if input is a file name (batch mode)
    6768checkrun=1;
     
    7071    checkrun=0;
    7172end
    72 
    73 ParamOut=[] %default output
     73hseries=findobj(allchild(0),'Tag','series');
     74RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     75WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
     76
     77%% define the directory for result file (with path=RootPath{1})
     78OutputDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files
     79
    7480if ~isfield(Param,'InputFields')
    7581    Param.InputFields.FieldName='';
    7682end
    77 OutputDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files
    7883
    7984%% root input file type
     
    184189    %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    185190for index=1:NbField
    186     if checkrun
    187         stopstate=get(Param.RUNHandle,'BusyAction');
    188         update_waitbar(Param.WaitbarHandle,index/NbField)
    189     else
    190         stopstate='queue';
    191     end
    192     if ~isequal(stopstate,'queue')% enable STOP command
     191        update_waitbar(WaitbarHandle,index/nbfield)
     192    if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     193        disp('program stopped by user')
    193194        return
    194195    end
Note: See TracChangeset for help on using the changeset viewer.