Changeset 571 for trunk/src


Ignore:
Timestamp:
Feb 21, 2013, 11:09:55 PM (12 years ago)
Author:
sommeria
Message:

further bug corrections in browse_data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/browse_data.m

    r570 r571  
    4545%------------------------------------------------------------------------
    4646% --- Executes just before browse_data is made visible.
    47 function browse_data_OpeningFcn(hObject, eventdata, handles, Campaign, GeometryCalib)
     47function browse_data_OpeningFcn(hObject, eventdata, handles, Campaign)
    4848%------------------------------------------------------------------------
    4949% Choose default command line output for browse_data
     
    6969set(hObject, 'Position', FigPos);
    7070set(hObject, 'Units', OldUnits);
    71 
    72 if exist('GeometryCalib','var')
    73     DataviewData.GeometryCalib=GeometryCalib;
    74     set(hObject,'UserData',DataviewData)
    75 end
     71%
     72% if exist('GeometryCalib','var')
     73%     DataviewData.GeometryCalib=GeometryCalib;
     74%     set(hObject,'UserData',DataviewData)
     75% end
    7676if exist('Campaign','var')
    7777    [CampaignPath,CampaignName]=fileparts(Campaign);
     
    117117function CreateMirror_Callback(hObject, eventdata, handles)
    118118%------------------------------------------------------------------------
    119 if strcmp(get(handles.CreateMirror,'String'),'create_mirror')
    120     SourceDir=get(handles.SourceDir,'String');
    121     [SourcePath,ProjectName]=fileparts(SourceDir);
     119SourceDir=get(handles.SourceDir,'String');
     120[SourcePath,ProjectName]=fileparts(SourceDir);
     121if strcmp(get(handles.MirrorDir,'Visible'),'on')
     122    MirrorDir=get(handles.MirrorDir,'String');
     123else
    122124    MirrorRoot=uigetdir('','select the dir which must contain the mirror directory, then press OK'); %file browser
    123125    if ~ischar(MirrorRoot)
     
    148150                idir=idir+1;
    149151                ExpName{idir}=hdir(ilist).name;
     152
    150153                mirror=fullfile(MirrorDir,ExpName{idir});
    151154                if ~exist(mirror,'dir')
     
    210213 function ListExperiments_Callback(hObject, eventdata, handles)
    211214%------------------------------------------------------------------------
    212 SourcePath=get(handles.SourceDir,'String');
    213 MirrorPath=get(handles.MirrorDir,'String');
     215if strcmp(get(handles.MirrorDir,'Visible'),'on')
     216    CampaignPath=get(handles.MirrorDir,'String');
     217else
     218    CampaignPath=get(handles.SourceDir,'String');
     219end
     220% MirrorPath=get(handles.MirrorDir,'String');
    214221ListExperiments=get(handles.ListExperiments,'String');
    215 ListDevices={};
    216222list_val=get(handles.ListExperiments,'Value');
    217223if isequal(list_val(1),1)
     
    223229    testList=0;
    224230end
     231scan_experiments(handles,ListExperiments,CampaignPath)
     232
     233
     234%------------------------------------------------------------------------
     235% --- Executes on selection change in ListExperiments.
     236 function scan_experiments(handles,ListExperiments,CampaignPath,MirrorPath)
     237%------------------------------------------------------------------------
     238ListDevices={};
    225239for iexp=1:numel(ListExperiments)
    226     hdir=dir(fullfile(SourcePath,ListExperiments{iexp})); %list files and dirs
     240    hdir=dir(fullfile(CampaignPath,ListExperiments{iexp})); %list files and dir in the experiment directory
    227241    idir=0;
    228242    for ilist=1:length(hdir)
    229243        if ~isequal(hdir(ilist).name(1),'.')
    230             source=fullfile(SourcePath,ListExperiments{iexp},hdir(ilist).name);
    231             if ~isempty(MirrorPath)
     244            DataSeries=fullfile(CampaignPath,ListExperiments{iexp},hdir(ilist).name);
     245            if exist('MirrorPath','var')
    232246                mirror=fullfile(MirrorPath,ListExperiments{iexp},hdir(ilist).name);
    233                 if ~exist(mirror)
     247                if ~exist(mirror)% create mirror if needed
    234248                    system(['ln -s ' source ' ' mirror])
    235249                end
    236250            end
    237251            check_list=strcmp(hdir(ilist).name,ListDevices);
    238             if isempty(find(check_list))
     252            if isempty(find(check_list, 1))
    239253                ListDevices=[ListDevices;hdir(ilist).name];
    240254            end
Note: See TracChangeset for help on using the changeset viewer.