Changeset 205 for trunk/src/series.m


Ignore:
Timestamp:
Feb 20, 2011, 5:33:46 PM (10 years ago)
Author:
sommeria
Message:

bug in nbfield display conrrected, as well as bug in the storage of ACTION fcts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r188 r205  
    5555%--------------------------------------------------------------------------
    5656function series_OpeningFcn(hObject, eventdata, handles,param)
    57 global nb_builtin nb_transform
     57global nb_builtin_ACTION nb_builtin_transform
    5858% Choose default command line output for series
    5959handles.output = hObject;
     
    6565%load the list of previously browsed files in menus Open and Open_1
    6666dir_perso=prefdir;
     67test_profil_perso=0;
    6768profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    6869if exist(profil_perso,'file')
    6970     h=load (profil_perso);
     71     test_profil_perso=1;
    7072     if isfield(h,'MenuFile_1')
    7173          set(handles.MenuFile_1,'Label',h.MenuFile_1);
     
    136138fct_menu={'check_files';'aver_stat';'time_series';'merge_proj';'clean_civ_cmx'};
    137139transform_menu={'';'phys';'px';'phys_polar'};
    138 nb_builtin=numel(fct_menu); %number of functions
     140nb_builtin_ACTION=numel(fct_menu); %number of functions
    139141nb_transform=numel(transform_menu);
    140142[path_series,name,ext]=fileparts(which('series'));
     
    147149%TRANSFORM menu: loads the information stored in prefdir to initiate  the list of field transform functions
    148150menu_str={'';'phys';'px';'phys_polar'};
    149 nb_builtin=numel(menu_str); %number of functions
     151nb_builtin_transform=numel(menu_str); %number of functions
    150152[path_uvmat,name,ext]=fileparts(which('uvmat'));
    151153addpath(fullfile(path_uvmat,'transform_field'))
     
    163165
    164166% read the list of functions stored in the personal file 'uvmat_perso.mat' in prefdir
    165 dir_perso=prefdir;
    166 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    167 if exist(profil_perso,'file')
    168     h=load (profil_perso);
     167if test_profil_perso
    169168    if isfield(h,'series_fct') && iscell(h.series_fct)
    170169         for ilist=1:length(h.series_fct)
    171170             [path,file]=fileparts(h.series_fct{ilist});
    172171             fct_path=[fct_path; {path}];%concatene the list of paths
    173              transform_menu=[transform_menu; {file}];
     172             fct_menu=[fct_menu; {file}];
    174173         end
    175174    end
     
    259258SeriesData=[];%dfault
    260259if isequal(ext,'.xml')
    261     errordlg('input file type not implemented')%A Faire: ouvrir le fichier pour naviguer
     260    warndlg_uvmat('ERROR','input file type not implemented')%A Faire: ouvrir le fichier pour naviguer
    262261elseif isequal(ext,'.xls')
    263     errordlg('input file type not implemented')%A Faire: ouvrir le fichier pour naviguer
     262    warndlg_uvmat('ERROR','input file type not implemented')%A Faire: ouvrir le fichier pour naviguer
    264263else
    265264    update_file(hObject, eventdata, handles,fileinput,0)
     
    295294    end
    296295end
    297 % set(hseries,'UserData',SeriesData);
    298 % RootFile_Callback(hObject, eventdata, handles);
    299 % FileExt_Callback(hObject, eventdata, handles);
    300 % NomType_Callback(hObject, eventdata, handles)
    301 % mode_Callback(hObject, eventdata, handles)
    302296
    303297
     
    538532time=[];%default
    539533GeometryCalib=[];%default
    540 nb_field=[];%default
    541 nb_field2=[];%default
     534nb_field=NaN;%default
     535nb_field2=NaN;%default
    542536SeriesData.PathCampaign=get(handles.PathCampaign,'String');
    543537
     
    549543    testima=1;
    550544    info=aviinfo([FileBase FileExt]);
    551     time=[0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond]';
     545    time=(0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond)';
    552546    nb_field=info.NumFrames;
    553547    nb_field2=1;
     
    703697    nb_field2=max(floor((max(num_j1)+max(num_j2))/2));
    704698end
    705 if isempty(nb_field)||isnan(nb_field)
     699if isnan(nb_field)
    706700    nb_field_str='?';
    707701    nb_field_str2='?';
     
    888882    end
    889883    switch NomType   
    890             case {'_i_j','_i_j1-j2','_i1-i2_j','#_ab'},% two navigation indices
     884            case {'_1_1','_i_j1-j2','_i1-i2_j','1_ab','01_ab'},% two navigation indices
    891885                state_j='on';
    892886    end
     
    13671361if last_i < first_i | last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),...
    13681362    set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end;
    1369 num_i=[first_i:incr_i:last_i];
    1370 num_j=[first_j:incr_j:last_j];
     1363num_i=first_i:incr_i:last_i;
     1364num_j=first_j:incr_j:last_j;
    13711365nbfield_cell=get(handles.nb_field,'String');
    13721366nbfield=[]; %default
     
    15821576function ACTION_Callback(hObject, eventdata, handles)
    15831577%------------------------------------------------------------------------
    1584 global nb_builtin
     1578global nb_builtin_ACTION
    15851579list_ACTION=get(handles.ACTION,'String');% list menu fields
    15861580index_ACTION=get(handles.ACTION,'Value');% selected string index
     
    16101604   index_ACTION=get(handles.ACTION,'Value');% currently selected index in the list
    16111605   list_path{index_ACTION}=PathName;
    1612    if length(menu_str)>nb_builtin+5; %nb_builtin=nbre of functions always remaining in the initial menu
    1613        nbremove=length(menu_str)-nb_builtin-5;
    1614        menu_str(nb_builtin+1:end-5)=[];
    1615        list_path(nb_builtin+1:end-4)=[];
     1606   if length(menu_str)>nb_builtin_ACTION+5; %nb_builtin=nbre of functions always remaining in the initial menu
     1607       nbremove=length(menu_str)-nb_builtin_ACTION-5;
     1608       menu_str(nb_builtin_ACTION+1:end-5)=[];
     1609       list_path(nb_builtin_ACTION+1:end-4)=[];
    16161610       index_ACTION=index_ACTION-nbremove;
    16171611       set(handles.ACTION,'Value',index_ACTION)
     
    16251619   dir_perso=prefdir;
    16261620   profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    1627    for ilist=nb_builtin+1:length(menu_str)-1
    1628        series_fct{ilist-nb_builtin}=fullfile(list_path{ilist},[menu_str{ilist} '.m']);
     1621   for ilist=nb_builtin_ACTION+1:length(menu_str)-1
     1622       series_fct{ilist-nb_builtin_ACTION}=fullfile(list_path{ilist},[menu_str{ilist} '.m']);     
    16291623   end
    1630    if exist(profil_perso,'file')
     1624   if nb_builtin_ACTION+1>=length(menu_str)-1
     1625   if exist(profil_perso,'file') && nb_builtin_ACTION+1>=length(menu_str)-1
    16311626        save(profil_perso,'series_fct','-append')
    16321627   else
     
    16391634            save(profil_perso, 'series_fct')
    16401635        end
     1636   end
    16411637   end
    16421638end
     
    23412337dirpair=[]; %default
    23422338switch NomType
    2343     case '_i'
     2339    case '_1'
    23442340        dirpair=dir([filebasesub '_*' FileExt]);
    2345     case '_i_j'
     2341    case '_1_1'
    23462342        dirpair=dir([filebasesub '_*_*' FileExt]);
    23472343    case '_i1-i2'
    23482344        dirpair=dir([filebasesub '_*-*' FileExt]);
    2349     case '#_ab'
     2345    case '1_ab'
    23502346        dirpair=dir([filebasesub '*_*' FileExt]);
    23512347    case '_i_j1-j2'
     
    23542350        dirpair=dir([filebasesub '*-*_*' FileExt]);   
    23552351end
    2356 %       nom_type='#' series of indexed images wich is not series_i
    2357 %       [filebase index ext], e.g. 'aa045.jpg' or 'aa45.tif'
    2358 %       nom_type='#a','#A' with a numerical index and an index letter(e.g.'aa045b.png'), OBSOLETE (replaced by 'series_i_j')
    2359 %       nom_type='%03d' or '%04d', series of indexed images with numbers completed with zeros to 3 or 4 digits, e.g.'aa045.tif'
    2360 %       nom_type='_%03d', '_%04d', or '_%05d', series of indexed images with _ and numbers completed with zeros to 3, 4 or 5 digits, e.g.'aa_045.tif'
    2361 %       nom_type='raw_SMD', same as '#a' but with no extension ext='', OBSOLETE
    2362 %       nom_type='#_ab' from pairs of '#a' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')
    2363 %       nom_type='%3dab' from pairs of '%3da' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')
    23642352for ifile=1:length(dirpair)
    23652353    [RootPath,RF,str_1,str_2,str_a,str_b]=name2display(dirpair(ifile).name);
Note: See TracChangeset for help on using the changeset viewer.