Changeset 623


Ignore:
Timestamp:
Apr 29, 2013, 11:27:46 PM (8 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

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/check_files.m

    r606 r623  
    4747    'create_grid';...% called by the GUI geometry_calib to create a physical grid
    4848    'create_grid.fig';...% GUI corresponding to create_grid.m
    49     'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle
    5049    'displ_uvmat';...
    5150    'editxml';...%display and edit xml files using a xls schema
  • trunk/src/civ.m

    r621 r623  
    17301730[tild,message]=fileattrib(RootPath);
    17311731if ~isempty(message) && ~isequal(message.UserWrite,1)
    1732     errormsg=['No writting access to ' RootPath];
     1732    errormsg=['No writing access to ' RootPath];
    17331733    return
    17341734end
     
    20012001                    errormsg=['cannot create ' subdir_civ1_new ': ' msg1];
    20022002                    return
    2003                 else
     2003                elseif isunix
    20042004                    [xx,msg2] = fileattrib(fullfile(RootPath,subdir_civ1_new),'+w','g'); %yield writing access (+w) to user group (g)
    20052005                    if ~strcmp(msg2,'')
     
    21162116        if ~exist(fullfile(RootPath,subdir_civ2_new),'dir')
    21172117            [xx,m2]=mkdir(fullfile(RootPath,subdir_civ2_new));
     2118            if isunix
    21182119            [xx,msg2] = fileattrib(fullfile(RootPath,subdir_civ2_new),'+w','g'); %yield writing access (+w) to user group (g)
    21192120            if ~isequal(m2,'')
    21202121                errormsg=['cannot create ' fullfile(RootPath,subdir_civ2_new) ': ' m2];
    21212122                return
     2123            end
    21222124            end
    21232125        end
     
    21482150            if ~exist(fullfile(RootPath,subdir_civ2_new),'dir')
    21492151                [xx,m2]=mkdir(subdir_civ2_new);
     2152                if isunix
    21502153                 [xx,msg2] = fileattrib(fullfile(RootPath,subdir_civ2_new),'+w','g'); %yield writing access (+w) to user group (g)
    21512154                if ~isequal(m2,'')
    21522155                    errormsg= ['cannot create ' fullfile(RootPath,subdir_civ2_new) ': ' m2];%error message for directory creation
    21532156                    return
     2157                end
    21542158                end
    21552159            end
     
    41284132    case {'civ_matlab','civ_matlab.sh'}
    41294133        filename=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml');
     4134        if isunix
    41304135        fileattrib(fileparts(filename),'+w +x','o g');% set writting access
     4136        end
    41314137        save(struct2xml(Param),filename);
    41324138end
  • trunk/src/displ_uvmat.m

    r530 r623  
    55function displ_uvmat(title,display_str,Position)
    66if isequal(Position,0)
    7     display([title ': ' display_str])
     7    disp([title ': ' display_str])
    88else
    99    msgbox_uvmat(title,display_str,'',Position)
  • trunk/src/mouse_down.m

    r622 r623  
    200200
    201201%% creation of a zoom subfig
    202 if get(hhcurrentfig.CheckZoomFig,'Value')
     202if isfield(hhcurrentfig,'CheckZoomFig') && get(hhcurrentfig.CheckZoomFig,'Value')
    203203    AxeData.Drawing='zoom'; %initiate drawing mode
    204204    AxeData.CurrentObject=[];%unselect objects
  • trunk/src/mouse_up.m

    r622 r623  
    171171        end
    172172    else
    173         test_drawing=1;%allow continuation of drawing object
    174          AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the next current origin
     173%         test_drawing=1;%allow continuation of drawing object
     174%          AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the next current origin
    175175    end
    176176    UvData.ProjObject{IndexObj}=ObjectData;
  • 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)
  • trunk/src/update_waitbar.m

    r477 r623  
    66
    77function update_waitbar(hwaitbar,advance_ratio)
    8 
     8if ishandle(hwaitbar)
    99set(hwaitbar,'Units','pixels')
    1010pos=get(hwaitbar,'Position');%read waitbar position in pixels
     
    1515set(hwaitbar,'CData',CData)
    1616drawnow
     17end
  • trunk/src/uvmat.m

    r622 r623  
    34703470if isequal(get(handles.VOLUME,'Value'),1)
    34713471    set(handles.CheckZoom,'Value',0)
    3472     set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
     3472%     set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    34733473    set(handles.edit_vect,'Value',0)
    34743474    edit_vect_Callback(hObject, eventdata, handles)
    34753475    set(handles.edit_object,'Value',0)
    3476     set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
     3476%     set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
    34773477%     set(handles.cal,'Value',0)
    34783478%     set(handles.cal,'BackgroundColor',[0 1 0])
     
    35223522    set(handles.edit_object,'Value',0)
    35233523    set(handles.CheckZoom,'Value',0)
    3524     set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    3525     set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
     3524%     set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
     3525%     set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
    35263526    set(gcf,'Pointer','arrow')
    35273527else
     
    41604160%  desactivate the edit object mode
    41614161set(handles.edit_object,'Value',0)
    4162 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])
     4162% set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])
    41634163
    41644164%------------------------------------------------------------------------
     
    41864186%%  desactivate the edit object mode
    41874187set(handles.edit_object,'Value',0)
    4188 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])
     4188% set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])
    41894189
    41904190%% update the  plot on view_field if view_field is already openened
     
    42754275hset_object=findobj(allchild(0),'Tag','set_object');
    42764276if get(handles.edit_object,'Value')
    4277     set(handles.edit_object,'BackgroundColor',[1,1,0]) 
     4277%     set(handles.edit_object,'BackgroundColor',[1,1,0]) 
    42784278    %suppress the other options
    42794279    set(handles.CheckZoom,'Value',0)
     
    42884288    ViewObject_Callback(hObject, eventdata, handles)
    42894289else % desctivate object edit mode
    4290     set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
     4290%     set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
    42914291    if ~isempty(hset_object)% open the
    42924292        hhset_object=guidata(hset_object);
     
    48624862set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object
    48634863set(handles.edit_object,'Value',0); %suppress the object edit mode
    4864 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
     4864% set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
    48654865set(handles.delete_object,'Visible','on')
    48664866
     
    51675167set(handles.edit_vect,'Value',0)
    51685168edit_vect_Callback(hObject, eventdata, handles)
    5169 set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
     5169% set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
    51705170set(handles.ListObject,'Value',1)     
    51715171
Note: See TracChangeset for help on using the changeset viewer.