Changeset 1064 for trunk/src/browse_data.m
- Timestamp:
- Apr 30, 2019, 6:26:20 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r1063 r1064 257 257 ListExperiments=get(handles.ListExperiments,'String'); 258 258 list_val=get(handles.ListExperiments,'Value'); 259 % if isequal(list_val(1),1) 260 % ListExperiments=ListExperiments(2:end); %choose all experiments if the first line '*' is selected 261 % set(handles.ListExperiments,'Value',1) 262 % else 263 ListExperiments=ListExperiments(list_val);%choose selected experiments 264 % end 259 ListExperiments=ListExperiments(list_val);%choose selected experiments 265 260 list_dataseries(handles,ListExperiments,MirrorPath) 266 261 … … 303 298 end 304 299 end 300 if get(handles.CheckDevices,'Value') 301 set(handles.ListDevices,'Value',1) 302 set(handles.ListDevices,'String',sort(DataSeries)) 303 CheckDevices_Callback([],[], handles) 304 else 305 305 set(handles.DataSeries,'Value',1) 306 306 set(handles.DataSeries,'String',sort(DataSeries)) 307 end 307 308 308 309 %------------------------------------------------------------------------ … … 487 488 488 489 %------------------------------------------------------------------------ 489 % --- Executes on button press in Cancel.490 %------------------------------------------------------------------------491 % function Cancel_Callback(hObject, eventdata, handles)492 % % hseries=findobj(allchild(0),'Tag','series');493 % % if ~isempty(hseries)494 % % hhh=guidata(hseries);495 % % set(hhh.Replicate,'Value',0)496 % % end497 % % delete(get(hObject,'parent'))498 499 % handles.output = get(hObject,'String');500 % guidata(hObject, handles); % Update handles structure501 % % Use UIRESUME instead of delete because the OutputFcn needs502 % uiresume(handles.browse_data);503 504 %------------------------------------------------------------------------505 % --- executes when user attempts to close geometry_calib.506 function browse_data_CloseRequestFcn(hObject, eventdata, handles)507 508 %------------------------------------------------------------------------509 490 % --- Executes when user attempts to close browse_data. 510 491 %------------------------------------------------------------------------ … … 553 534 function Up_Callback(hObject, eventdata, handles) 554 535 SourceDir=get(handles.SourceDir,'String'); 555 % Device=DataSeries{get(handles.DataSeries,'Value')};556 % DataSeries=uigetfile_uvmat('open a data folder',Device,'uigetdir');557 % uiresume(handles.browse_data);558 536 browse_data(SourceDir) 559 537 … … 571 549 set(handles.ListExperiments,'Value',ValueDevice) 572 550 ListExperiments_Callback(hObject, [], handles) 573 % Device=regexprep(DataSeries{get(handles.DataSeries,'Value')},'+','');574 % Device=regexprep(Device,'~','');575 % PathDevice=fullfile(SourceDir,SourceFolder,Device);576 % DirDevice=dir(PathDevice);577 % NewDevice=DirDevice(end).name;578 % % uiresume(handles.browse_data);579 % browse_data(fullfile(PathDevice,NewDevice))580 551 581 552 582 553 % --- Executes on selection change in DataSeries. 583 554 function DataSeries_Callback(hObject, eventdata, handles) 584 % hObject handle to DataSeries (see GCBO)585 % eventdata reserved - to be defined in a future version of MATLAB586 % handles structure with handles and user data (see GUIDATA)587 588 % Hints: contents = cellstr(get(hObject,'String')) returns DataSeries contents as cell array589 % contents{get(hObject,'Value')} returns selected item from DataSeries590 555 591 556 … … 594 559 if get(handles.CheckDevices,'Value') 595 560 set(handles.ListDevices,'Visible','on') 596 else 561 ListDevices=get(handles.DataSeries,'String'); 562 Index=get(handles.DataSeries,'Value'); 563 set(handles.ListDevices,'String',ListDevices) 564 set(handles.ListDevices,'Value',Index) 565 set(handles.DataSeries,'Value',1) 566 if strcmp(get(handles.MirrorDir,'Visible'),'on') 567 MirrorPath=get(handles.MirrorDir,'String'); 568 else 569 MirrorPath=get(handles.SourceDir,'String'); 570 end 571 IndexExperiment=get(handles.ListExperiments,'Value'); 572 ListExperiment=get(handles.ListExperiments,'String'); 573 Experiment=ListExperiment{get(handles.ListExperiments,'Value')}; 574 Experiment=regexprep(Experiment,'^\+/','');% remove the +/ used to mark dir 575 Experiment=regexprep(Experiment,'^~','');% remove the ~ used to mark symbolic link 576 Device=regexprep(ListDevices{Index},'^\+/','');% remove the +/ used to mark dir 577 Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link 578 DataSeries=dir(fullfile(MirrorPath,Experiment,Device)); 579 DataSeriesCell=struct2cell(DataSeries); 580 set(handles.DataSeries,'String',DataSeriesCell(1,:)') 581 else 582 ListDevices=get(handles.ListDevices,'String'); 583 Index=get(handles.ListDevices,'Value'); 597 584 set(handles.ListDevices,'Visible','off') 598 end 585 set(handles.DataSeries,'String',ListDevices) 586 set(handles.DataSeries,'Value',Index) 587 end
Note: See TracChangeset
for help on using the changeset viewer.