Changeset 1063 for trunk/src/browse_data.m
- Timestamp:
- Apr 17, 2019, 6:22:25 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r1061 r1063 24 24 function varargout = browse_data(varargin) 25 25 26 % Last Modified by GUIDE v2.5 08-Sep-2018 19:03:4026 % Last Modified by GUIDE v2.5 17-Apr-2019 18:15:24 27 27 28 28 % Begin initialization code - DO NOT EDIT … … 75 75 set(hObject, 'Units', OldUnits); 76 76 if exist('MultiDevices','var') && strcmp(MultiDevices,'on') 77 set(handles. ListDevices,'Max',2)78 else 79 set(handles. ListDevices,'Max',1)77 set(handles.DataSeries,'Max',2) 78 else 79 set(handles.DataSeries,'Max',1) 80 80 end 81 81 if exist('EnableMirror','var') && strcmp(EnableMirror,'on') … … 212 212 % List the experiments in a campaign, filling the menu ListExperiments 213 213 %------------------------------------------------------------------------ 214 function errormsg=scan_campaign(handles,Campaign,Experiment,Data Series)214 function errormsg=scan_campaign(handles,Campaign,Experiment,DataInput) 215 215 %------------------------------------------------------------------------ 216 216 errormsg=''; … … 233 233 set(handles.ListExperiments,'Value',index)% initialise the menu selection with the folder defined by the input 234 234 ListExperiments_Callback([],[], handles) 235 ListDevices=get(handles.ListDevices,'String');236 index=find(strcmp(['+/' Data Series],ListDevices));235 DataSeries=get(handles.DataSeries,'String'); 236 index=find(strcmp(['+/' DataInput],DataSeries)); 237 237 if isempty(index) 238 index=find(strcmp(['~/' Data Series],ListDevices));238 index=find(strcmp(['~/' DataInput],DataSeries)); 239 239 end 240 240 if ~isempty(index) 241 set(handles. ListDevices,'Value',index)241 set(handles.DataSeries,'Value',index) 242 242 end 243 243 else … … 270 270 function list_dataseries(handles,ListExperiments,MirrorPath) 271 271 272 ListDevices={};272 DataSeries={}; 273 273 for iexp=1:numel(ListExperiments) 274 274 if strcmp(ListExperiments{iexp}(1),'+')% if the item is a directory … … 295 295 ListFiles{ilist}=['+/' ListFiles{ilist}];%mark dir by '+' in the list 296 296 end 297 if isempty(find(strcmp(ListFiles{ilist}, ListDevices), 1))% if the item is not already in ListDevices298 ListDevices=[ListDevices;ListFiles{ilist}]; %append the item to the list297 if isempty(find(strcmp(ListFiles{ilist},DataSeries), 1))% if the item is not already in DataSeries 298 DataSeries=[DataSeries;ListFiles{ilist}]; %append the item to the list 299 299 end 300 300 end … … 303 303 end 304 304 end 305 set(handles. ListDevices,'Value',1)306 set(handles. ListDevices,'String',sort(ListDevices))305 set(handles.DataSeries,'Value',1) 306 set(handles.DataSeries,'String',sort(DataSeries)) 307 307 308 308 %------------------------------------------------------------------------ … … 311 311 function update_experiments(handles,ListExperiments,CampaignPath,MirrorPath) 312 312 313 ListDevices={};313 DataSeries={}; 314 314 for iexp=1:numel(ListExperiments) 315 315 if strcmp(ListExperiments{iexp}(1),'+')% if the item is a directory … … 350 350 system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder 351 351 end 352 if isempty(find(strcmp(ListFiles{ilist}, ListDevices), 1))% if the item is not already in ListDevices352 if isempty(find(strcmp(ListFiles{ilist},DataSeries), 1))% if the item is not already in DataSeries 353 353 if check_dir(ilist) 354 354 ListFiles{ilist}=['+/' ListFiles{ilist}];%mark dir by '+' in the list 355 355 end 356 ListDevices=[ListDevices;ListFiles{ilist}]; %append the item to the list356 DataSeries=[DataSeries;ListFiles{ilist}]; %append the item to the list 357 357 end 358 358 end … … 361 361 end 362 362 end 363 set(handles. ListDevices,'String',sort(ListDevices))363 set(handles.DataSeries,'String',sort(DataSeries)) 364 364 365 365 %------------------------------------------------------------------------ … … 464 464 end 465 465 Experiment=regexprep(Experiment,'^\+/','');% remove the +/ used to mark dir 466 Device=get(handles. ListDevices,'String');467 Value=get(handles. ListDevices,'Value');466 Device=get(handles.DataSeries,'String'); 467 Value=get(handles.DataSeries,'Value'); 468 468 Device=Device(Value); 469 469 Device=regexprep(Device,'^\+/','');% remove the +/ used to mark dir … … 553 553 function Up_Callback(hObject, eventdata, handles) 554 554 SourceDir=get(handles.SourceDir,'String'); 555 % Device= ListDevices{get(handles.ListDevices,'Value')};555 % Device=DataSeries{get(handles.DataSeries,'Value')}; 556 556 % DataSeries=uigetfile_uvmat('open a data folder',Device,'uigetdir'); 557 557 % uiresume(handles.browse_data); … … 566 566 SourceFolder=regexprep(ListExperiments{list_val(1)},'+',''); 567 567 set(handles.SourceDir,'String',fullfile(SourceDir,SourceFolder)) 568 ListDevices=get(handles.ListDevices,'String');569 ValueDevice=get(handles. ListDevices,'Value');570 set(handles.ListExperiments,'String', ListDevices)568 DataSeries=get(handles.DataSeries,'String'); 569 ValueDevice=get(handles.DataSeries,'Value'); 570 set(handles.ListExperiments,'String',DataSeries) 571 571 set(handles.ListExperiments,'Value',ValueDevice) 572 572 ListExperiments_Callback(hObject, [], handles) 573 % Device=regexprep( ListDevices{get(handles.ListDevices,'Value')},'+','');573 % Device=regexprep(DataSeries{get(handles.DataSeries,'Value')},'+',''); 574 574 % Device=regexprep(Device,'~',''); 575 575 % PathDevice=fullfile(SourceDir,SourceFolder,Device); … … 578 578 % % uiresume(handles.browse_data); 579 579 % browse_data(fullfile(PathDevice,NewDevice)) 580 581 582 % --- Executes on selection change in DataSeries. 583 function DataSeries_Callback(hObject, eventdata, handles) 584 % hObject handle to DataSeries (see GCBO) 585 % eventdata reserved - to be defined in a future version of MATLAB 586 % handles structure with handles and user data (see GUIDATA) 587 588 % Hints: contents = cellstr(get(hObject,'String')) returns DataSeries contents as cell array 589 % contents{get(hObject,'Value')} returns selected item from DataSeries 590 591 592 % --- Executes on button press in CheckDevices. 593 function CheckDevices_Callback(hObject, eventdata, handles) 594 if get(handles.CheckDevices,'Value') 595 set(handles.ListDevices,'Visible','on') 596 else 597 set(handles.ListDevices,'Visible','off') 598 end
Note: See TracChangeset
for help on using the changeset viewer.