Changeset 1070 for trunk/src/browse_data.m
- Timestamp:
- Jul 11, 2019, 7:02:27 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r1069 r1070 25 25 function varargout = browse_data(varargin) 26 26 27 % Last Modified by GUIDE v2.5 08-Jul-2019 23:32:3927 % Last Modified by GUIDE v2.5 11-Jul-2019 18:52:06 28 28 29 29 % Begin initialization code - DO NOT EDIT … … 35 35 'gui_LayoutFcn', [] , ... 36 36 'gui_Callback', []); 37 if nargin && ischar(varargin{1}) && ~isempty(regexp(varargin{1},'_Callback','once'))37 if nargin && ischar(varargin{1}) 38 38 gui_State.gui_Callback = str2func(varargin{1}); 39 39 end … … 45 45 end 46 46 % End initialization code - DO NOT EDIT 47 47 48 48 49 %------------------------------------------------------------------------ … … 146 147 varargout{1} = handles.output; 147 148 %%%%%%%%%%%%%%%%%%delete(handles.browse_data) 149 150 %------------------------------------------------------------------------ 151 % --- Executes on button press in SourceDir. 152 function SourceDir_Callback(hObject, eventdata, handles) 153 SourceDir=get(handles.SourceDir,'String'); 154 ListExp=get(handles.ListExperiments,'String'); 155 ListExp=ListExp(get(handles.ListExperiments,'Value')); 156 errormsg=scan_campaign(handles,SourceDir,ListExp); 157 if ~isempty(errormsg) 158 msgbox_uvmat('ERROR',errormsg) 159 return 160 end 161 %------------------------------------------------------------------------ 148 162 149 163 %------------------------------------------------------------------------ … … 397 411 398 412 %------------------------------------------------------------------------ 399 % Provide a list to display413 % Provide the list (ListFilesTot) to display in DataSeries with the selected indices 400 414 %------------------------------------------------------------------------ 401 415 function [ListFilesTot,indices]=list_dir_3(SourceDir,ListDir,ListSub,ListSubSub,check_fix) 416 % INPUT: 417 %SourceDir: path to the displayed directories 418 %ListDir: list of file and folder names under SourceDir (column 'Experiments') 419 %ListSub: list of file and folder in the second column 'Devices') 420 %ListSubSub: prvious list of file and folder in the third column 'DataSeries', used to mark the selected indices 402 421 ListFilesTot={}; 403 422 for ilist=1:numel(ListDir) … … 410 429 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 411 430 ListFiles=ListCells(1,:); 431 check_xml=~cellfun('isempty',regexp(ListFiles,'(\.xml|~)$'));% detect non xml files and files not marked by ~ 412 432 check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files 433 nbfiles=numel(find(~check_xml & ~check_dir));% number of non xml files 434 check_dir=check_dir & cellfun('isempty', regexp(ListFiles,'^(-|\.|\+/\.)'));% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 413 435 ListFiles(check_dir)=regexprep(ListFiles(check_dir),'^.+','+/$0');% put '+/' in front of dir name display 414 cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 415 check_keep=cellfun('isempty', cell_remove); 416 ListFilesTot=[ListFilesTot (ListFiles(check_keep))]; 436 %cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 437 ListFiles=ListFiles(check_dir | check_xml); 438 ListFilesTot=[ListFilesTot ListFiles]; 439 if nbfiles>0 440 ListFilesTot=[ListFilesTot {[num2str(nbfiles) ' files']}]; 441 end 417 442 end 418 443 end … … 426 451 for ilist=1:numel(ListSubSub) 427 452 index=find(strcmp(ListSubSub{ilist},ListFilesTot)); 453 if check_fix && isempty(index) 454 ListFilesTot=[ListFilesTot {['---' ListSubSub{ilist}]}]; 455 index=numel(ListFilesTot); 456 end 428 457 indices=[indices index]; 429 458 end … … 676 705 set(handles.ListDevices,'Value',list_val);%replace Devices by DataSeries 677 706 678 [ListFiles,indices]=list_dir_3(SourceDirNew,ListDevices(DeviceIndices),DataSeries(list_val),[] );707 [ListFiles,indices]=list_dir_3(SourceDirNew,ListDevices(DeviceIndices),DataSeries(list_val),[],0); 679 708 set(handles.DataSeries,'String',ListFiles) 680 709 set(handles.DataSeries,'Value',indices)% initialise the menu selection with the folder defined by the input … … 777 806 % set(handles.DataSeries,'Value',Index) 778 807 % end 808 809 810 % --- Executes when user attempts to close browse_data. 811 function browse_data_CloseRequestFcn(hObject, eventdata, handles) 812 % hObject handle to browse_data (see GCBO) 813 % eventdata reserved - to be defined in a future version of MATLAB 814 % handles structure with handles and user data (see GUIDATA) 815 816 % Hint: delete(hObject) closes the figure 817 delete(hObject);
Note: See TracChangeset
for help on using the changeset viewer.