Changeset 576 for trunk/src/uvmat.m
- Timestamp:
- Mar 4, 2013, 8:13:53 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r575 r576 216 216 217 217 %% load the list of previously browsed files in menus Open, Open_1 and transform_fct 218 dir_perso=prefdir; % path to the directory .matlab for personal data219 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% personal data file uvma uvmat_perso.mat' in .matlab218 dir_perso=prefdir; % path to the directory .matlab containing the personal data of the current user 219 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% personal data file uvmat_perso.mat' in .matlab 220 220 if exist(profil_perso,'file') 221 221 h=load (profil_perso); 222 222 if isfield(h,'MenuFile')% load the menu of previously opened files 223 223 for ifile=1:min(length(h.MenuFile),5) 224 eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',h.MenuFile{ifile});'])225 eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',h.MenuFile{ifile});'])224 set(handles.(['MenuFile_' num2str(ifile)]),'Label',h.MenuFile{ifile}); 225 set(handles.(['MenuFile_' num2str(ifile) '_1']),'Label',h.MenuFile{ifile}); 226 226 end 227 end 228 if isfield(h,'RootPath') 229 set(handles.RootPath,'UserData',h.RootPath); %store the previous campaign in the UserData of RootPath 227 230 end 228 231 if isfield(h,'transform_fct') && iscell(h.transform_fct) % load the menu of transform fct set by user … … 335 338 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 336 339 oldfile=fullfile(RootPath,SubDir); 337 if isempty(oldfile)||isequal(oldfile,'') %loads the previously stored file name and set it as default in the file_input box 338 dir_perso=prefdir; 339 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 340 if exist(profil_perso,'file') 341 h=load (profil_perso); 342 if isfield(h,'MenuFile_1') 343 oldfile=h.MenuFile_1; 344 end 345 end 340 if isempty(oldfile) %loads the previously stored file name and set it as default in the file_input box 341 oldfile=get(handles.RootPath,'UserData'); 346 342 end 347 343 [FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',oldfile); … … 357 353 function MenuBrowseCampaign_Callback(hObject, eventdata, handles) 358 354 % ----------------------------------------------------------------------- 359 CampaignPath=fileparts(fileparts(get(handles.RootPath,'String'))); 355 RootPath=get(handles.RootPath,'String'); 356 if isempty(RootPath) 357 RootPath=get(handles.RootPath,'UserData');%use Rootpath recored from the personal file at uvmat opening 358 end 359 CampaignPath=fileparts(fileparts(RootPath)); 360 360 DirFull = uigetdir(CampaignPath,'Select a Campaign dir, then press OK'); 361 361 if ~ischar(DirFull)|| ~exist(DirFull,'dir') … … 447 447 set(handles.MenuFile_4_1,'Label',MenuFile_4) 448 448 set(handles.MenuFile_5_1,'Label',MenuFile_5) 449 dir_perso=prefdir;450 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');451 if exist(profil_perso,'file')452 save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-append'); %store the file names for future opening of uvmat453 else454 txt=ver('MATLAB');455 Release=txt.Release;456 relnumb=str2double(Release(3:4));457 if relnumb >= 14458 save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat459 else460 save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5'); %store the file names for future opening of uvmat461 end462 end449 % dir_perso=prefdir; 450 % profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 451 % if exist(profil_perso,'file') 452 % save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-append'); %store the file names for future opening of uvmat 453 % else 454 % txt=ver('MATLAB'); 455 % Release=txt.Release; 456 % relnumb=str2double(Release(3:4)); 457 % if relnumb >= 14 458 % save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat 459 % else 460 % save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5'); %store the file names for future opening of uvmat 461 % end 462 % end 463 463 464 464 % -------------------------------------------------------------------- … … 787 787 end 788 788 for ifile=1:min(length(MenuFile),5) 789 eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])790 eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',MenuFile{ifile});'])789 set(handles.(['MenuFile_' num2str(ifile)]),'Label',MenuFile{ifile}); 790 set(handles.(['MenuFile_' num2str(ifile) '_1']),'Label',MenuFile{ifile}); 791 791 end 792 792 dir_perso=prefdir; 793 793 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 794 794 if exist(profil_perso,'file') 795 save (profil_perso,'MenuFile',' -append'); %store the file names for future opening of uvmat795 save (profil_perso,'MenuFile','RootPath','-append'); %store the file names for future opening of uvmat 796 796 else 797 save (profil_perso,'MenuFile',' -V6'); %store the file names for future opening of uvmat797 save (profil_perso,'MenuFile','RootPath','-V6'); %store the file names for future opening of uvmat 798 798 end 799 799 … … 1411 1411 choice_value=get(handles.transform_fct,'Value'); 1412 1412 transform_name=menu_transform{choice_value};%name of the transform fct given by the menu 'transform_fct' 1413 % transform_list=get(handles.transform_fct,'UserData');1414 % transform=transform_list{choice_value};1415 1413 transform=get(handles.path_transform,'UserData'); 1416 1414 if ~isequal(transform_name,'') && ~isequal(transform_name,'px') … … 1441 1439 axes(handles.PlotAxes) 1442 1440 hold on 1443 size(flagmask)1444 % MaskData.maskhandle=image(Mask.AX,Mask.AY,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*flagmask);1445 1441 MaskData.maskhandle=image(Mask.AX,Mask.AY,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*ones(size(flagmask))); 1446 % set(MaskData.maskhandle,'AlphaData',0.6*flagmask)1447 1442 set(handles.CheckMask,'UserData',MaskData) 1448 1443 end … … 1932 1927 1933 1928 %px to phys or other transform on field 1934 % menu_transform=get(handles.transform_fct,'String');1935 % choice_value=get(handles.transform_fct,'Value');1936 % transform_name=menu_transform{choice_value};%name of the transform fct given by the menu 'transform_fct'1937 % transform_list=get(handles.transform_fct,'UserData');1938 1929 transform=get(handles.path_transform,'UserData'); 1939 1930 if ~isempty(transform) … … 2067 2058 list_fields=get(handles.FieldName,'String');% list menu fields 2068 2059 FieldName= list_fields{get(handles.FieldName,'Value')}; % selected field 2060 % if get_field... is selected, the GUI get_field will be used to enter fields 2069 2061 if ~strcmp(FieldName,'get_field...') 2070 2062 if get(handles.FixVelType,'Value') … … 2073 2065 end 2074 2066 end 2067 % case of input vector field, get the scalar used for vector color 2075 2068 if ~isempty(regexp(FieldName,'^vec(')) 2076 2069 list_code=get(handles.ColorCode,'String');% list menu fields … … 2132 2125 end 2133 2126 Field{1}.ZIndex=z_index; %used for multiplane 3D calibration 2134 % end 2127 2135 2128 2136 2129 %% choose and read a second field FileName_1 if defined … … 2461 2454 end 2462 2455 2456 %UvData.Field=get_bounds(UvData.Field); 2463 2457 2464 2458 %% get bounds and mesh (needed to propose default options for projection objects) … … 3391 3385 %------------------------------------------------------- 3392 3386 % 3393 % UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface3394 3387 if isequal(get(handles.edit_vect,'Value'),1) 3395 3388 test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]); … … 3403 3396 set(handles.CheckZoom,'Value',0) 3404 3397 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 3405 % set(handles.create,'Value',0)3406 % set(handles.create,'BackgroundColor',[0 1 0])3407 3398 set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7]) 3408 3399 set(gcf,'Pointer','arrow') 3409 % UvData.MouseAction='edit_vect';3410 3400 else 3411 3401 set(handles.record,'Visible','off') … … 4143 4133 function edit_object_Callback(hObject, eventdata, handles) 4144 4134 %------------------------------------------------------------------- 4145 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface4146 4135 hset_object=findobj(allchild(0),'Tag','set_object'); 4147 4136 if get(handles.edit_object,'Value') … … 4903 4892 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 4904 4893 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt]; 4905 CoordList=get(handles.transform_fct,'String'); 4906 val=get(handles.transform_fct,'Value'); 4907 set_grid(FileName,CoordList{val});% call the set_object interface 4894 UvData=get(handles.uvmat,'UserData'); 4895 % CoordList=get(handles.transform_fct,'String'); 4896 % val=get(handles.transform_fct,'Value'); 4897 set_grid(FileName,UvData.Field);% call the set_object interface 4908 4898 4909 4899
Note: See TracChangeset
for help on using the changeset viewer.