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

    r616 r624  
    6161
    6262%%%%%%%%%%%%  STANDARD PART  %%%%%%%%%%%%
    63 ParamOut=[];
     63ParamOut=[];%default output
    6464%% read input parameters from an xml file if input is a file name (batch mode)
    6565checkrun=1;
     
    6868    checkrun=0;
    6969end
    70 
    71 %% define the directory for result file
     70hseries=findobj(allchild(0),'Tag','series');
     71RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     72WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
     73
     74%% define the directory for result file (with path=RootPath{1})
    7275OutputDir=[Param.OutputSubDir Param.OutputDirExt];
    7376   
     
    173176%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    174177for index=1:nbfield
    175 %for index=index_slice
    176       if checkrun
    177             stopstate=get(Param.RUNHandle,'BusyAction');
    178             update_waitbar(Param.WaitbarHandle,index/nbfield)
    179       else
    180             stopstate='queue';
    181       end
    182     if isequal(stopstate,'queue')% enable STOP command
    183 
     178    update_waitbar(WaitbarHandle,index/nbfield)
     179    if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     180        disp('program stopped by user')
     181        break
     182    end
     183   
    184184    %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%%
    185185    for iview=1:nbview
     
    194194        end
    195195    end
    196     else
    197         errormsg='stop';
    198     end
    199196    %%%%%%%%%%%%%%%% end loop on views (input lines) %%%%%%%%%%%%%%%%
    200197    %%%%%%%%%%%% END STANDARD PART  %%%%%%%%%%%%
    201198    % EDIT FROM HERE
    202 
     199   
    203200    if isempty(errormsg)
    204201        Field=Data{1}; % default input field structure
     
    224221            end
    225222        end
    226 
     223       
    227224        %% calculate tps coefficients if needed
    228225        if isfield(Param,'ProjObject')&&isfield(Param.ProjObject,'ProjMode')&& strcmp(Param.ProjObject.ProjMode,'interp_tps')
    229226            Field=tps_coeff_field(Field,check_proj_tps);
    230227        end
    231 
     228       
    232229        %field projection on an object
    233230        if Param.CheckObject
     
    239236        end
    240237        nbfiles=nbfiles+1;
    241 
     238       
    242239        %%%%%%%%%%%% MAIN RUNNING OPERATIONS  %%%%%%%%%%%%
    243240        %update sum
     
    288285    end
    289286else  % time from ImaDoc prevails if it exists
    290 %         j1=1;%default
    291 %         if ~isempty(j1_series{1})
    292 %             j1=j1_series{1};
    293 %         end
     287    %         j1=1;%default
     288    %         if ~isempty(j1_series{1})
     289    %             j1=j1_series{1};
     290    %         end
    294291    %DataOut.Time=time(1,i1_series{1}(1),j1);
    295292    %DataOut.Time_end=time(end,i1_series{end}(end),j1_series{end}(end));
     
    317314    end
    318315end  % end averaging  loop
    319 % end
    320 %%%%%%%%%%%%%%%% end loop on slices %%%%%%%%%%%%%%%%
    321316
    322317%% open the result file with uvmat (in RUN mode)
Note: See TracChangeset for help on using the changeset viewer.