Changeset 671 for trunk/src/uvmat.m
- Timestamp:
- Jul 31, 2013, 11:11:55 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r669 r671 227 227 228 228 %% load the list of previously browsed files in menus Open, Open_1 and TransformName 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 229 dir_perso=prefdir; % path to the directory .matlab containing the personal data of the current user 230 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% personal data file uvmat_perso.mat' in .matlab 231 if exist(profil_perso,'file')% if the file exists 232 h=load (profil_perso); % open the personal file 233 if isfield(h,'MenuFile')% load the saved menu of previously opened files 234 for ifile=1:min(length(h.MenuFile),5) 235 set(handles.(['MenuFile_' num2str(ifile)]),'Label',h.MenuFile{ifile}); 236 end 237 end 238 if isfield(h,'MenuCampaign')% load the saved menu of previously opened campaigns 239 for ifile=1:min(length(h.MenuCampaign),5) 240 set(handles.(['MenuCampaign_' num2str(ifile)]),'Label',h.MenuCampaign{ifile}); 241 end 242 end 243 if isfield(h,'RootPath') 244 set(handles.RootPath,'UserData',h.RootPath); %store the previous campaign in the UserData of RootPath 245 end 246 if isfield(h,'transform_fct') && iscell(h.transform_fct) % load the menu of transform fct set by user 247 for ilist=1:length(h.transform_fct); 248 if exist(h.transform_fct{ilist},'file') 249 [path,file]=fileparts(h.transform_fct{ilist}); 250 transform_menu=[transform_menu; {file}]; 251 path_list=[path_list; {path}]; 252 end 253 end 254 end 255 end 256 256 transform_menu=[transform_menu;{'more...'}];%append the option more.. to the menu 257 257 set(handles.TransformName,'String',transform_menu)% display the menu of transform fcts … … 3535 3535 %------------------------------------------------------------------------ 3536 3536 UvData=get(handles.uvmat,'UserData'); 3537 menu=get(handles.TransformName,'String'); refresh3537 menu=get(handles.TransformName,'String');%refresh 3538 3538 ichoice=get(handles.TransformName,'Value');%item number in the menu 3539 3539 transform_name=menu{ichoice};% choice of the transform fct … … 3546 3546 end 3547 3547 if strcmp(transform_name,'more...'); 3548 transform_fct=uigetfile_uvmat('Pick the transform function',prev_path,'.m'); 3549 % [FileName, PathName] = uigetfile( ... 3550 % {'*.m', ' (*.m)'; 3551 % '*.m', '.m files '; ... 3552 % '*.*', 'All Files (*.*)'}, ... 3553 % 'Pick the transform function', prev_path); 3554 % if ~ischar(FileName),return,end %abandon if the browser is cancelled 3555 % path_transform_fct =fullfile(PathName,FileName); 3556 if ~isempty(transform_fct) 3557 [PathName,transform_name]=fileparts(transform_fct); 3558 % if isempty(regexp(FileName,'\.m$'))% detect file extension .m 3559 % msgbox_uvmat('ERROR','a Matlab function .m must be introduced'); 3560 % return 3561 % else 3562 % transform_name=regexprep(FileName,'\.m',''); 3563 % end 3548 transform_fct_chosen=uigetfile_uvmat('Pick the transform function',prev_path,'.m'); 3549 if ~isempty(transform_fct_chosen) 3550 [PathName,transform_name]=fileparts(transform_fct_chosen); 3564 3551 ichoice=find(strcmp(transform_name,menu),1);%look for the selected fct in the existing menu 3565 3552 if isempty(ichoice)% if the item is not found, add it to the menu (before 'more...' and select it) … … 3587 3574 3588 3575 %% create the function handle of the selected fct 3589 3590 3576 if isempty(list_path{ichoice})% case of no selected fct 3591 3577 transform_handle=[];
Note: See TracChangeset
for help on using the changeset viewer.