Changeset 856 for trunk/src/series.m
- Timestamp:
- Jan 26, 2015, 12:37:56 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r855 r856 429 429 430 430 %------------------------------------------------------------------------ 431 % --- fct activated by the browser under 'Open campaign '431 % --- fct activated by the browser under 'Open campaign/Browse...' 432 432 %------------------------------------------------------------------------ 433 433 function MenuBrowseCampaign_Callback(hObject, eventdata, handles) 434 434 435 %% look for the previously opened file 'oldfile' 436 InputTable=get(handles.InputTable,'Data'); 437 RootPathCell=InputTable(:,1); 438 SubDirCell=InputTable(:,2); 439 oldfile=fullfile(RootPathCell{1},SubDirCell{1}); 440 if isempty(oldfile) 441 % use a file name stored in prefdir 442 dir_perso=prefdir; 443 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 444 if exist(profil_perso,'file') 445 h=load (profil_perso); 446 if isfield(h,'RootPath') && ischar(h.RootPath) 447 oldfile=h.RootPath; 448 end 449 end 450 end 451 %% launch the browser 452 fileinput=uigetfile_uvmat('pick an input file in the series',oldfile); 453 hh=dir(fileinput); 454 if numel(hh)>1 455 msgbox_uvmat('ERROR','invalid input, probably a broken link'); 456 else 457 if ~isempty(fileinput) 458 display_file_name(handles,fileinput,'one') 459 end 460 end 461 append='one'; 435 462 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0]) 436 463 drawnow 437 InputTable=get(handles.InputTable,'Data'); 438 RootPath=InputTable{1,1}; 439 CampaignPath=fileparts(fileparts(RootPath)); 440 DirFull=uigetfile_uvmat('define this path as the Campaign folder:',CampaignPath,'uigetdir'); 441 if ~ischar(DirFull)|| ~exist(DirFull,'dir') 442 return 443 end 444 OutPut=browse_data(DirFull);% open the GUI browse_data to get select a campaign dir, experiment and device 464 browse_campaign(handles,append); 465 466 %------------------------------------------------------------------------ 467 % --- fct activated by the browser under 'Open campaign/Browse...' 468 %------------------------------------------------------------------------ 469 function MenuBrowseCampaignAppend_Callback(hObject, eventdata, handles) 470 append='append'; 471 browse_campaign(handles,append); 472 473 %------------------------------------------------------------------------ 474 function browse_campaign(handles,append); 475 476 %% look for the previously opened file 'oldfile' 477 478 % 479 % 480 % InputTable=get(handles.InputTable,'Data'); 481 % RootPath=InputTable{1,1}; 482 % CampaignPath=fileparts(fileparts(RootPath)); 483 % DirFull=uigetfile_uvmat('define this path as the Campaign folder:',CampaignPath,'uigetdir'); 484 % if ~ischar(DirFull)|| ~exist(DirFull,'dir') 485 % return 486 % end 487 OutPut=browse_data(oldfile);% open the GUI browse_data to get select a campaign dir, experiment and device 445 488 if ~isfield(OutPut,'Campaign') 446 489 return … … 468 511 MenuCampaign=[{get(handles.MenuCampaign_1,'Label')};{get(handles.MenuCampaign_2,'Label')};... 469 512 {get(handles.MenuCampaign_3,'Label')};{get(handles.MenuCampaign_4,'Label')};{get(handles.MenuCampaign_5,'Label')}]; 470 check_dir=isempty(find(strcmp(Dir Full,MenuCampaign)));513 check_dir=isempty(find(strcmp(DirName,MenuCampaign))); 471 514 if check_dir %insert the new campaign in the list if it is not found 472 515 MenuCampaign(end)=[]; %suppress the last item 473 MenuCampaign=[{Dir Full};MenuCampaign];%insert the new campaign516 MenuCampaign=[{DirName};MenuCampaign];%insert the new campaign 474 517 for ilist=1:numel(MenuCampaign) 475 518 set(handles.(['MenuCampaign_' num2str(ilist)]),'Label',MenuCampaign{ilist}) … … 479 522 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 480 523 if exist(profil_perso,'file') 481 save (profil_perso,'MenuCampaign',' RootPath','-append'); %store the file names for future opening of uvmat524 save (profil_perso,'MenuCampaign','-append'); %store the file names for future opening of uvmat 482 525 else 483 save (profil_perso,'MenuCampaign',' RootPath','-V6'); %store the file names for future opening of uvmat526 save (profil_perso,'MenuCampaign','-V6'); %store the file names for future opening of uvmat 484 527 end 485 528 end … … 1955 1998 end 1956 1999 1957 %% Activate the Action fct 2000 %% Activate the Action fct to adapt the configuration of the GUI series and bring specific parameters in SeriesData 1958 2001 Param=read_GUI_series(handles);% read the parameters from the GUI series 1959 2002 ParamOut=h_fun(Param);%run the selected Action function to get the relevant input
Note: See TracChangeset
for help on using the changeset viewer.