Changeset 623 for trunk/src/series.m


Ignore:
Timestamp:
Apr 29, 2013, 11:27:46 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.m

    r620 r623  
    606606    MinIndex_j=1;% index j set to 1 by default
    607607    MaxIndex_j=1;
    608     MinIndex_i=find(i1_series(:,2,:), 1 )-1;
    609     MaxIndex_i=find(i1_series(:,2,:), 1, 'last' )-1;
     608    MinIndex_i=find(i1_series(:,2,:), 1 )-1;% min ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index)
     609    MaxIndex_i=find(i1_series(:,2,:), 1, 'last' )-1;%max ref index i detected in the series (corresponding to the last non-zero value of i1_series)
    610610else
    611611    pair_max=squeeze(max(i1_series,[],1)); %max on pair index
    612612    j_max=max(pair_max,[],1);
    613     MaxIndex_i=find(j_max, 1, 'last' )-1;% max ref index i
    614     MinIndex_i=find(j_max, 1 )-1;% min ref index i
     613    MinIndex_i=find(j_max, 1 )-1;% min ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index)
     614    MaxIndex_i=find(j_max, 1, 'last' )-1;% max ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index)
    615615    diff_i_max=diff(j_max);
    616616    if ~isempty(diff_i_max) && isequal (diff_i_max,diff_i_max(1)*ones(size(diff_i_max)))
     
    618618    end
    619619    i_max=max(pair_max,[],2);
    620     MaxIndex_j=max(find(i_max))-1;% max ref index i
    621     MinIndex_j=min(find(i_max))-1;% min ref index i
     620    MinIndex_j=min(find(i_max))-1;% min ref index j
     621    MaxIndex_j=max(find(i_max))-1;% max ref index j
    622622    diff_j_max=diff(i_max);
    623623    if isequal (diff_j_max,diff_j_max(1)*ones(size(diff_j_max)))
     
    832832update_mode(handles,i1_series,i2_series,j1_series,j2_series,Time)
    833833
    834 %% enable j index visibilitycellfun(@isempty,regexp(PairString,'^j'))
    835 check_jindex=~cellfun(@isempty,SeriesData.j1_series); %look for non empty j indices
    836 if isempty(find(check_jindex))
    837     enable_j(handles,'off') % no j index needed
    838 else
    839     PairString=get(handles.PairString,'Data');
    840     % ~cellfun(@isempty,regexp(PairString,'^j'): gives 1 when the pair string begins by 'j' (burst case)
    841     % cellfun(@isempty,PairString): gives 1 when the pair string is empty
    842     if isempty(find(~cellfun(@isempty,regexp(PairString,'^j'))&cellfun(@isempty,PairString)))% if all pair string begins by j (burst) or empty
    843         enable_j(handles,'off') % no j index needed
    844     else
    845         enable_j(handles,'on')
    846     end
    847 end
     834%% enable j index visibility
     835%check_jindex=~isempty(find(~cellfun(@isempty,SeriesData.j1_series))); %look for non empty j indices
     836status_j='on';%default
     837if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices
     838    status_j='off'; % no j index needed
     839elseif strcmp(get(handles.PairString,'Visible'),'on')
     840        PairString=get(handles.PairString,'Data');       
     841        check_burst=cellfun(@isempty,regexp(PairString,'^j'));%=0 for burst case, 1 otherwise
     842 %   check_nopair=cellfun(@isempty,PairString);
     843    if isempty(find(check_burst))% if all pair string begins by j (burst)
     844        status_j='off'; % no j index needed for bust case
     845    end
     846end
     847enable_j(handles,status_j) % no j index needed
    848848
    849849%% display the set of existing files as an image
     
    14701470%% direct processing on the current Matlab session
    14711471if strcmp (RunMode,'local')
    1472     Series.RUNHandle=handles.RUN;
    1473     Series.WaitbarHandle=handles.Waitbar;
     1472%     Series.RUNHandle=handles.RUN;
     1473%     Series.WaitbarHandle=handles.Waitbar;
    14741474    for iprocess=1:NbProcess
    14751475        if isempty(Series.IndexRange.NbSlice)
Note: See TracChangeset for help on using the changeset viewer.