- Timestamp:
- Feb 21, 2013, 11:09:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r570 r571 45 45 %------------------------------------------------------------------------ 46 46 % --- Executes just before browse_data is made visible. 47 function browse_data_OpeningFcn(hObject, eventdata, handles, Campaign , GeometryCalib)47 function browse_data_OpeningFcn(hObject, eventdata, handles, Campaign) 48 48 %------------------------------------------------------------------------ 49 49 % Choose default command line output for browse_data … … 69 69 set(hObject, 'Position', FigPos); 70 70 set(hObject, 'Units', OldUnits); 71 72 if exist('GeometryCalib','var')73 DataviewData.GeometryCalib=GeometryCalib;74 set(hObject,'UserData',DataviewData)75 end71 % 72 % if exist('GeometryCalib','var') 73 % DataviewData.GeometryCalib=GeometryCalib; 74 % set(hObject,'UserData',DataviewData) 75 % end 76 76 if exist('Campaign','var') 77 77 [CampaignPath,CampaignName]=fileparts(Campaign); … … 117 117 function CreateMirror_Callback(hObject, eventdata, handles) 118 118 %------------------------------------------------------------------------ 119 if strcmp(get(handles.CreateMirror,'String'),'create_mirror') 120 SourceDir=get(handles.SourceDir,'String'); 121 [SourcePath,ProjectName]=fileparts(SourceDir); 119 SourceDir=get(handles.SourceDir,'String'); 120 [SourcePath,ProjectName]=fileparts(SourceDir); 121 if strcmp(get(handles.MirrorDir,'Visible'),'on') 122 MirrorDir=get(handles.MirrorDir,'String'); 123 else 122 124 MirrorRoot=uigetdir('','select the dir which must contain the mirror directory, then press OK'); %file browser 123 125 if ~ischar(MirrorRoot) … … 148 150 idir=idir+1; 149 151 ExpName{idir}=hdir(ilist).name; 152 150 153 mirror=fullfile(MirrorDir,ExpName{idir}); 151 154 if ~exist(mirror,'dir') … … 210 213 function ListExperiments_Callback(hObject, eventdata, handles) 211 214 %------------------------------------------------------------------------ 212 SourcePath=get(handles.SourceDir,'String'); 213 MirrorPath=get(handles.MirrorDir,'String'); 215 if strcmp(get(handles.MirrorDir,'Visible'),'on') 216 CampaignPath=get(handles.MirrorDir,'String'); 217 else 218 CampaignPath=get(handles.SourceDir,'String'); 219 end 220 % MirrorPath=get(handles.MirrorDir,'String'); 214 221 ListExperiments=get(handles.ListExperiments,'String'); 215 ListDevices={};216 222 list_val=get(handles.ListExperiments,'Value'); 217 223 if isequal(list_val(1),1) … … 223 229 testList=0; 224 230 end 231 scan_experiments(handles,ListExperiments,CampaignPath) 232 233 234 %------------------------------------------------------------------------ 235 % --- Executes on selection change in ListExperiments. 236 function scan_experiments(handles,ListExperiments,CampaignPath,MirrorPath) 237 %------------------------------------------------------------------------ 238 ListDevices={}; 225 239 for iexp=1:numel(ListExperiments) 226 hdir=dir(fullfile( SourcePath,ListExperiments{iexp})); %list files and dirs240 hdir=dir(fullfile(CampaignPath,ListExperiments{iexp})); %list files and dir in the experiment directory 227 241 idir=0; 228 242 for ilist=1:length(hdir) 229 243 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') 232 246 mirror=fullfile(MirrorPath,ListExperiments{iexp},hdir(ilist).name); 233 if ~exist(mirror) 247 if ~exist(mirror)% create mirror if needed 234 248 system(['ln -s ' source ' ' mirror]) 235 249 end 236 250 end 237 251 check_list=strcmp(hdir(ilist).name,ListDevices); 238 if isempty(find(check_list ))252 if isempty(find(check_list, 1)) 239 253 ListDevices=[ListDevices;hdir(ilist).name]; 240 254 end
Note: See TracChangeset
for help on using the changeset viewer.