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

    r616 r624  
    187187    checkrun=0;
    188188end
    189 
     189hseries=findobj(allchild(0),'Tag','series');
     190RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     191WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
    190192%% Input preparation
    191193nbaver_ima=Param.ActionInput.SlidingSequenceLength;
     
    364366if nbfield_i > nbaver_ima
    365367    for ifield = step*ceil(nbaver/2)+1:step:nbfield_i-step*floor(nbaver/2)
    366         if checkrun
    367             stopstate=get(Param.RUNHandle,'BusyAction');
    368             update_waitbar(Param.WaitbarHandle,ifield/nbfield_i)
    369         else
    370             stopstate='queue';
    371         end
    372         if isequal(stopstate,'queue')% enable STOP command
     368                update_waitbar(WaitbarHandle,ifield/nbfield_i)
     369    if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     370        disp('program stopped by user')
     371        return
     372    end
     373%         if isequal(stopstate,'queue')% enable STOP command
    373374            Ak(:,:,1:nbaver_ima-step)=Ak(:,:,1+step:nbaver_ima);% shift the current image series by one burst (step)
    374375            %incorporate next burst in the current image series
     
    409410               
    410411            end
    411         else
    412             return
    413         end
     412%         else
     413%             return
     414%         end
    414415    end
    415416end
Note: See TracChangeset for help on using the changeset viewer.