Changeset 626


Ignore:
Timestamp:
May 2, 2013, 7:55:11 PM (11 years ago)
Author:
sommeria
Message:

bug with waitbar repaired

Location:
trunk/src/series
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/check_data_files.m

    r616 r626  
    4545    ParamOut.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
    4646    ParamOut.OutputDirExt='';%set the output dir extension (blank=no output dir)
    47 return
     47    return
    4848end
    4949%%%%%%%%%%%%  STANDARD PART  %%%%%%%%%%%%
     
    5555    checkrun=0;
    5656end
     57hseries=findobj(allchild(0),'Tag','series');
     58RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     59WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
    5760
    5861%% root input file(s) and type
     
    7073% filecell{iview,fileindex}:
    7174%        iview: line in the table corresponding to a given file series
    72 %        fileindex: file index within  the file series, 
    73 % i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j 
     75%        fileindex: file index within  the file series,
     76% i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j
    7477% i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
    7578%%%%%%%%%%%%
     
    8285nbfield_i=size(i1_series{1},2); %nb of fields for the i index
    8386nbfield=nbfield_j*nbfield_i; %total number of fields
    84 nbfield_i=floor(nbfield/NbSlice);%total number of  indexes in a slice (adjusted to an integer number of slices) 
     87nbfield_i=floor(nbfield/NbSlice);%total number of  indexes in a slice (adjusted to an integer number of slices)
    8588nbfield=nbfield_i*NbSlice; %total number of fields after adjustement
    8689
    87 %determine the file type on each line from the first input file 
     90%determine the file type on each line from the first input file
    8891ImageTypeOptions={'image','multimage','mmreader','video'};
    8992NcTypeOptions={'netcdf','civx','civdata'};
     
    101104        Tabchar{2}='';
    102105        Tabchar{3}=[num2str(FileInfo.FrameRate) ' frames/s '];
    103 %         Tabchar{4}='';
    104 %         Tabchar{5}=['  compression' FileInfo.VideoCompression];
    105 %         Tabchar{6}=[ 'quality ' num2str(FileInfo.Quality)];
     106        %         Tabchar{4}='';
     107        %         Tabchar{5}=['  compression' FileInfo.VideoCompression];
     108        %         Tabchar{6}=[ 'quality ' num2str(FileInfo.Quality)];
    106109    else
    107110        Tabchar={};
     
    112115            datnum=zeros(1,nbfield_j);
    113116            for ifile=1:nbfield_i
    114                 if checkrun
    115                     stopstate=get(Param.RUNHandle,'BusyAction');
    116                     update_waitbar(Param.WaitbarHandle,ifile/nbfield_i)
     117                update_waitbar(WaitbarHandle,ifile/nbfield_i)
     118                if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     119                    disp('program stopped by user')
     120                    break
     121                end
     122                file=filecell{iview,index_slice(ifile)};
     123                [Path,Name,ext]=fileparts(file);
     124                detect=exist(file,'file'); % check the existence of the file
     125                if detect==0
     126                    lastfield='not found';
    117127                else
    118                     stopstate='queue';
     128                    datfile=dir(file);
     129                    if isfield(datfile,'datenum')
     130                        datnum(ifile)=datfile.datenum;
     131                        filefound(ifile)={datfile.name};
     132                    end
     133                    lastfield='';
     134                    [FileType{iview},FileInfo,Object]=get_file_type(file);
     135                    if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata')
     136                        if isfield(FileInfo,'CivStage')
     137                            liststage={'civ1','fix1','patch1','civ2','fix2','patch2'};
     138                            lastfield=liststage{FileInfo.CivStage};
     139                        end
     140                    end
     141                    lastfield=[FileType{iview} ', ' lastfield];
    119142                end
    120                 if isequal(stopstate,'queue')% enable STOP command
    121                     file=filecell{iview,index_slice(ifile)};
    122                     [Path,Name,ext]=fileparts(file);
    123                     detect=exist(file,'file'); % check the existence of the file
    124                     if detect==0
    125                         lastfield='not found';
    126                     else
    127                         datfile=dir(file);
    128                         if isfield(datfile,'datenum')
    129                             datnum(ifile)=datfile.datenum;
    130                             filefound(ifile)={datfile.name};
    131                         end
    132                         lastfield='';
    133                         [FileType{iview},FileInfo,Object]=get_file_type(file);
    134                         if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata')
    135                             if isfield(FileInfo,'CivStage')
    136                                 liststage={'civ1','fix1','patch1','civ2','fix2','patch2'};
    137                                 lastfield=liststage{FileInfo.CivStage};
    138                             end
    139                         end
    140                         lastfield=[FileType{iview} ', ' lastfield];
    141                     end
    142                     Tabchar(1,i_slice)={['slice #' num2str(i_slice)]};
    143                     Tabchar(ifile+1,i_slice)={[file '...' lastfield]};
    144                 end
     143                Tabchar(1,i_slice)={['slice #' num2str(i_slice)]};
     144                Tabchar(ifile+1,i_slice)={[file '...' lastfield]};
    145145            end
    146146        end
  • trunk/src/series/merge_proj.m

    r624 r626  
    189189    %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    190190for index=1:NbField
    191         update_waitbar(WaitbarHandle,index/nbfield)
     191        update_waitbar(WaitbarHandle,index/NbField)
    192192    if ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
    193193        disp('program stopped by user')
Note: See TracChangeset for help on using the changeset viewer.