Changeset 503 for trunk/src/uvmat.m


Ignore:
Timestamp:
Jul 26, 2012, 10:14:52 AM (12 years ago)
Author:
sommeria
Message:

datatree_browse introduced (still work to do)
get_field revised to introduce new transform fcts, like FFT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r501 r503  
    414414         end
    415415end
    416 % [FileName, PathName] = uigetfile( ...
    417 %        {'*.xml;*.xls;*.civ;*.png;*.jpg;*.tif;*.avi;*.AVI;*.vol;*.nc;*.cmx;*.fig;*.log;*.dat;*.bat;', ' (*.xml,*.xls,*.civ,*.jpg ,*.png, .tif, *.avi,*.vol,*.nc,*.cmx,*.fig,*.log,*.dat,*.bat)';
    418 %        '*.xml',  '.xml files '; ...
    419 %         '*.xls',  '.xls files '; ...
    420 %         '*.civ',  '.civ files '; ...
    421 %         '*.jpg',' jpeg image files'; ...
    422 %         '*.png','.png image files'; ...
    423 %         '*.tif','.tif image files'; ...
    424 %         '*.avi;*.AVI','.avi movie files'; ...
    425 %         '*.vol','.volume images (png)'; ...
    426 %         '*.nc','.netcdf files'; ...
    427 %         '*.cdf','.netcdf files'; ...
    428 %         '*.cmx','.cmx text files ';...
    429 %         '*.fig','.fig files (matlab fig)';...
    430 %         '*.log','.log text files ';...
    431 %         '*.dat','.dat text files ';...
    432 %         '*.bat','.bat system command text files';...
    433 %         '*.*',  'All Files (*.*)'}, ...
    434 %         'Pick a file',oldfile);
    435 
    436416[FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',oldfile);
    437417fileinput=[PathName FileName];%complete file name
    438 sizf=size(fileinput);
    439 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end
    440 
    441 % display the selected field and related information
     418if ~exist(fileinput,'file')
     419    return %abandon of the browser is cancelled
     420end
     421
     422%% display the selected field and related information
    442423display_file_name( handles,fileinput)
    443424
     
    483464%------------------------------------------------------------------------
    484465RootPath=get(handles.RootPath,'String');
    485 % [FileName, PathName, filterindex] = uigetfile( ...
    486 %        {'*.xml;*.xls;*.civ;*.jpg;*.png;*.avi;*.AVI;*.nc;*.cmx;*.fig;*.log;*.dat', ' (*.xml,*.xls,*.civ, *.jpg,*.png, *.avi,*.nc,*.cmx ,*.fig,*.log,*.dat)';
    487 %        '*.xml',  '.xml files '; ...
    488 %         '*.xls',  '.xls files '; ...
    489 %         '*.civ',  '.civ files '; ...
    490 %         '*.jpg','.jpg image files'; ...
    491 %         '*.png','.png image files'; ...
    492 %         '*.avi;*.AVI','.avi movie files'; ...
    493 %         '*.nc','.netcdf files'; ...
    494 %         '*.cdf','.netcdf files'; ...
    495 %         '*.cmx','.cmx text files';...
    496 %         '*.cmx2','.cmx2 text files';...
    497 %         '*.fig','.fig files (matlab fig)';...
    498 %         '*.log','.log text files ';...
    499 %         '*.dat','.dat text files ';...
    500 %         '*.*',  'All Files (*.*)'}, ...
    501 %         'Pick a second file for comparison',RootPath);
    502466[FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',RootPath);
    503467fileinput_1=[PathName FileName];%complete file name
    504 sizf=size(fileinput_1);
    505 if (~ischar(fileinput_1)||~isequal(sizf(1),1)),return;end
     468if ~exist(fileinput_1,'file')
     469    return %abandon of the browser is cancelled
     470end
    506471
    507472% refresh the current displayed field
     
    734699        set(hfig,'WindowButtonUpFcn','mouse_up')%set mouse click action function
    735700        set(hfig,'WindowButtonUpFcn','mouse_down')%set mouse click action function
    736     case {'xml','xls'}                % edit xml or Excel files
     701    case 'xml'                % edit xml files
     702        if ~isempty(regexp(fileinput,'.project.xml$'))
     703            datatree_browser(fileinput)
     704        else
     705            editxml(fileinput);
     706        end
     707        %             if exist(regexprep(fileinput,'.project.xml$','.link'),'dir')
     708        %                 datatree_browser(regexprep(fileinput,'.project.xml$','.link'))
     709        %                 check_project=1;
     710        %         elseif exist(regexprep(fileinput,'.project.xml$',''),'dir')
     711        %                 datatree_browser(regexprep(fileinput,'.project.xml$',''))
     712        %                 check_project=1;
     713        %             end
     714        %         end
     715        %         if ~check_project
     716        %         editxml(fileinput);
     717    case 'xls'
    737718        editxml(fileinput);
    738719    otherwise
     
    798779        set(handles.MenuExportMovie,'Enable','on')
    799780        set(handles.MenuTools,'Enable','on')
    800 %         set(handles.OBJECT_txt,'Visible','on')
    801 %         set(handles.edit_object,'Visible','on')
    802 %          set(handles.ListObject_1,'Visible','on')
    803 %          set(handles.ViewObject,'Visible','on')
    804 %         set(handles.frame_object,'Visible','on')
    805        
     781
    806782        % initiate input file series and refresh the current field view:     
    807783        update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,index);
    808784
     785end
     786
     787%% update list of recent files in the menubar and save it for future opening
     788MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};...
     789    {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}];
     790str_find=strcmp(fileinput,MenuFile);
     791if isempty(find(str_find,1))
     792    MenuFile=[{fileinput};MenuFile];%insert the current file if not already in the list
     793end
     794for ifile=1:min(length(MenuFile),5)
     795    eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
     796    eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',MenuFile{ifile});'])
     797end
     798dir_perso=prefdir;
     799profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     800if exist(profil_perso,'file')
     801    save (profil_perso,'MenuFile','-append'); %store the file names for future opening of uvmat
     802else
     803    save (profil_perso,'MenuFile','-V6'); %store the file names for future opening of uvmat
    809804end
    810805
     
    11291124    CheckMask_Callback([],[],handles)
    11301125end
    1131 
    1132 %% update list of recent files in the menubar and save it for future opening
    1133 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};...
    1134     {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}];
    1135 str_find=strcmp(FileName,MenuFile);
    1136 if isempty(find(str_find,1))
    1137     MenuFile=[{FileName};MenuFile];%insert the current file if not already in the list
    1138 end
    1139 for ifile=1:min(length(MenuFile),5)
    1140     eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
    1141     eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',MenuFile{ifile});'])
    1142 end
    1143 dir_perso=prefdir;
    1144 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    1145 if exist(profil_perso,'file')
    1146     save (profil_perso,'MenuFile','-append'); %store the file names for future opening of uvmat
    1147 else
    1148     save (profil_perso,'MenuFile','-V6'); %store the file names for future opening of uvmat
    1149 end
    1150 
    11511126
    11521127%------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.