Changeset 1150 for trunk/src/browse_data.m
- Timestamp:
- Jun 24, 2024, 6:38:26 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r1127 r1150 426 426 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 427 427 ListFiles=ListCells(1,:); 428 check_xml=~cellfun('isempty',regexp(ListFiles,'(\.xml|~)$'));% detect non xml files and files not marked by ~ 428 check_xml=~cellfun('isempty',regexp(ListFiles,'\.xml$'));% detect xml files 429 check_tild=~cellfun('isempty',regexp(ListFiles,'~$'));% detect ~ files 429 430 index_isdir=find(strcmp('isdir',fieldnames(ListStruct))); 430 431 check_dir=cell2mat(ListCells(index_isdir,:));% =1 for directories, =0 for files 431 nbfiles=numel(find(~check_xml & ~check_dir ));% number of non xml files432 nbfiles=numel(find(~check_xml & ~check_dir & ~check_tild));% number of non xml files 432 433 check_dir=check_dir & cellfun('isempty', regexp(ListFiles,'^(-|\.|\+/\.)'));% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 433 434 ListFiles(check_dir)=regexprep(ListFiles(check_dir),'^.+','+/$0');% put '+/' in front of dir name display … … 477 478 ListCells=struct2cell(ListStruct);%transform dir struct to a cell arrray 478 479 ListFiles=ListCells(1,:);%list of dir and file names 479 cell_remove=regexp(ListFiles,'^( -|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . )480 cell_remove=regexp(ListFiles,'^((-|\.|\+/\.))');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 480 481 check_keep=cellfun('isempty', cell_remove); 481 482 index_isdir=find(strcmp('isdir',fieldnames(ListStruct))); … … 721 722 ListDevices=get(handles.ListDevices,'String'); 722 723 DeviceIndices=get(handles.ListDevices,'Value'); 723 set(handles.DataSeries,'String',ListDevices); 724 set(handles.DataSeries,'String',ListDevices);%transfer list of devices to DataSeries 724 725 set(handles.DataSeries,'Value',DeviceIndices); 725 726 726 727 ListExperiments=get(handles.ListExperiments,'String'); 727 728 ExpIndices=get(handles.ListExperiments,'Value'); 728 set(handles.ListDevices,'String',ListExperiments); 729 set(handles.ListDevices,'String',ListExperiments);%transfer list of experiments to devices 729 730 set(handles.ListDevices,'Value',ExpIndices); 730 731 … … 740 741 % set(handles.ListExperiments,'String',DataSeries) 741 742 % set(handles.ListExperiments,'Value',ValueDevice) 742 % ListExperiments_Callback(hObject, [], handles) 743 744 745 % % --- Executes on selection change in DataSeries. 746 % function DataSeries_Callback(hObject, eventdata, handles) 747 % SourceDir=get(handles.SourceDir,'String'); 748 % ListData=get(handles.DataSeries,'String'); 749 % Folder=ListData{get(handles.DataSeries,'Value')}; 750 % if ~isempty(regexp(Folder,'^\+/'))% if a folder is selected 751 % Folder=regexprep(Folder,'\+/',''); 752 % ListExperiments=get(handles.ListExperiments,'String'); 753 % list_val=get(handles.ListExperiments,'Value'); 754 % for iexp=1:numel(list_val) 755 % ExpName=regexprep(ListExperiments{list_val(iexp)},'\+/',''); 756 % FullName=fullfile(SourceDir,ExpName,Folder); 757 % dd=dir(FullName); 758 % check_sub=1; 759 % for idir=1:numel(dd) 760 % ListData{ilist}=dd(ilist).name; 761 % if dd(ilist).isdir && ~strcmp(dd(ilist).name,'.')&& ~strcmp(dd(ilist).name,'..')&& isempty(regexp(dd(ilist).name,'^_LOG'))... 762 % && isempty(regexp(dd(ilist).name,'^_LOG'))&& isempty(regexp(dd(ilist).name,'^_XML')) 763 % check_sub=1; 764 % ListData{ilist}=['+/' dd(ilist).name]; 765 % end 766 % end 767 % if check_sub 768 % set(handles.ListDevices,'String',ListData); 769 % set(handles.ListDevices,'Visible','on'); 770 % set(handles.DataSeries,'String',ListData) 771 % break 772 % end 773 % end 774 % end 775 776 % % --- Executes on button press in CheckDevices. 777 % function CheckDevices_Callback(hObject, eventdata, handles) 778 % if get(handles.CheckDevices,'Value') 779 % set(handles.ListDevices,'Visible','on') 780 % ListDevices=get(handles.DataSeries,'String'); 781 % Index=get(handles.DataSeries,'Value'); 782 % set(handles.ListDevices,'String',ListDevices) 783 % set(handles.ListDevices,'Value',Index) 784 % set(handles.DataSeries,'Value',1) 785 % if strcmp(get(handles.MirrorDir,'Visible'),'on') 786 % MirrorPath=get(handles.MirrorDir,'String'); 787 % else 788 % MirrorPath=get(handles.SourceDir,'String'); 789 % end 790 % IndexExperiment=get(handles.ListExperiments,'Value'); 791 % ListExperiment=get(handles.ListExperiments,'String'); 792 % Experiment=ListExperiment{get(handles.ListExperiments,'Value')}; 793 % Experiment=regexprep(Experiment,'^\+/','');% remove the +/ used to mark dir 794 % Experiment=regexprep(Experiment,'^~','');% remove the ~ used to mark symbolic link 795 % Device=regexprep(ListDevices{Index},'^\+/','');% remove the +/ used to mark dir 796 % Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link 797 % DataSeries=dir(fullfile(MirrorPath,Experiment,Device)); 798 % DataSeriesCell=struct2cell(DataSeries); 799 % set(handles.DataSeries,'String',DataSeriesCell(1,:)') 800 % else 801 % ListDevices=get(handles.ListDevices,'String'); 802 % Index=get(handles.ListDevices,'Value'); 803 % set(handles.ListDevices,'Visible','off') 804 % set(handles.DataSeries,'String',ListDevices) 805 % set(handles.DataSeries,'Value',Index) 806 % end 743 ListExperiments_Callback(hObject, [], handles) 744 SourceDir_Callback(hObject, [], handles) 807 745 808 746
Note: See TracChangeset
for help on using the changeset viewer.