Changeset 856 for trunk/src/series.m


Ignore:
Timestamp:
Jan 26, 2015, 12:37:56 AM (10 years ago)
Author:
sommeria
Message:

civtest_implemented_civ2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r855 r856  
    429429
    430430%------------------------------------------------------------------------
    431 % --- fct activated by the browser under 'Open campaign'
     431% --- fct activated by the browser under 'Open campaign/Browse...'
    432432%------------------------------------------------------------------------
    433433function MenuBrowseCampaign_Callback(hObject, eventdata, handles)
    434434
     435%% look for the previously opened file 'oldfile'
     436InputTable=get(handles.InputTable,'Data');
     437RootPathCell=InputTable(:,1);
     438SubDirCell=InputTable(:,2);
     439oldfile=fullfile(RootPathCell{1},SubDirCell{1});
     440if 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
     450end
     451%% launch the browser
     452fileinput=uigetfile_uvmat('pick an input file in the series',oldfile);
     453hh=dir(fileinput);
     454if numel(hh)>1
     455    msgbox_uvmat('ERROR','invalid input, probably a broken link');
     456else
     457    if ~isempty(fileinput)
     458        display_file_name(handles,fileinput,'one')
     459    end
     460end
     461append='one';
    435462set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])
    436463drawnow
    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
     464browse_campaign(handles,append);
     465
     466%------------------------------------------------------------------------
     467% --- fct activated by the browser under 'Open campaign/Browse...'
     468%------------------------------------------------------------------------
     469function MenuBrowseCampaignAppend_Callback(hObject, eventdata, handles)
     470append='append';
     471browse_campaign(handles,append);
     472
     473%------------------------------------------------------------------------
     474function 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
     487OutPut=browse_data(oldfile);% open the GUI browse_data to get select a campaign dir, experiment and device
    445488if ~isfield(OutPut,'Campaign')
    446489    return
     
    468511MenuCampaign=[{get(handles.MenuCampaign_1,'Label')};{get(handles.MenuCampaign_2,'Label')};...
    469512    {get(handles.MenuCampaign_3,'Label')};{get(handles.MenuCampaign_4,'Label')};{get(handles.MenuCampaign_5,'Label')}];
    470 check_dir=isempty(find(strcmp(DirFull,MenuCampaign)));
     513check_dir=isempty(find(strcmp(DirName,MenuCampaign)));
    471514if check_dir %insert the new campaign in the list if it is not found
    472515    MenuCampaign(end)=[]; %suppress the last item
    473     MenuCampaign=[{DirFull};MenuCampaign];%insert the new campaign
     516    MenuCampaign=[{DirName};MenuCampaign];%insert the new campaign
    474517    for ilist=1:numel(MenuCampaign)
    475518        set(handles.(['MenuCampaign_' num2str(ilist)]),'Label',MenuCampaign{ilist})
     
    479522    profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    480523    if exist(profil_perso,'file')
    481         save (profil_perso,'MenuCampaign','RootPath','-append'); %store the file names for future opening of uvmat
     524        save (profil_perso,'MenuCampaign','-append'); %store the file names for future opening of uvmat
    482525    else
    483         save (profil_perso,'MenuCampaign','RootPath','-V6'); %store the file names for future opening of uvmat
     526        save (profil_perso,'MenuCampaign','-V6'); %store the file names for future opening of uvmat
    484527    end
    485528end
     
    19551998end
    19561999
    1957 %% Activate the Action fct
     2000%% Activate the Action fct to adapt the configuration of the GUI series and bring specific parameters in SeriesData
    19582001Param=read_GUI_series(handles);% read the parameters from the GUI series
    19592002ParamOut=h_fun(Param);%run the selected Action function to get the relevant input
Note: See TracChangeset for help on using the changeset viewer.