Changeset 1070
- Timestamp:
- Jul 11, 2019, 7:02:27 PM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 4 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); -
trunk/src/dir_uvmat.m
r1061 r1070 28 28 29 29 function [ListFiles,errormsg] = dir_uvmat(DirName) 30 ListFiles=[]; 30 31 errormsg=''; 32 if ~ischar(DirName) 33 errormsg='the function dir_uvmat needs a character string input'; 34 return 35 end 31 36 if regexp(DirName,'^http://') 32 37 % OpeNDAP case - read catalog.xml file … … 35 40 str=urlread(catalog); 36 41 catch ME 37 ListFiles=[];38 42 errormsg=ME.message; 39 43 return -
trunk/src/series.m
r1069 r1070 612 612 function REFRESH_Callback(hObject, eventdata, handles) 613 613 %------------------------------------------------------------------------ 614 check_input_file_series(handles) 615 616 %% enable field and veltype menus, in accordance with the current action 617 ActionInput_Callback([],[], handles) 618 619 620 function check_input_file_series(handles) 614 621 InputTable=get(handles.InputTable,'Data'); 615 622 set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch' … … 676 683 set(handles.series,'Pointer','arrow') % set the mouse pointer to 'watch' 677 684 678 %% enable field and veltype menus, in accordance with the current action679 ActionInput_Callback([],[], handles)680 685 681 686 … … 1661 1666 Param.InputTable(:,1)=ListPath(:,iexp); 1662 1667 Param.InputTable(:,2)=ListSubdir(:,iexp); 1663 if size(Param.InputTable,1)==1% case of single input line 1664 Param.OutputSubDir=ListSubdir{iexp}; 1665 end 1666 set(handles.InputTable,'Data',Param.InputTable) 1667 % set(handles.OutputSubDir,'String',ListSubdir{iexp}) 1668 OutputSubDir=unique(ListSubdir(:,iexp)); 1669 Param.OutputSubDir=OutputSubDir{1}; 1670 if numel(OutputSubDir)>1% case 1671 for iout=2:numel(OutputSubDir) 1672 Param.OutputSubDir=[Param.OutputSubDir '-' OutputSubDir{iout}]; 1673 end 1674 end 1668 1675 end 1669 1676 [xx,ExpName]=fileparts(Param.InputTable{1,1}); 1670 1677 Param.IndexRange.first_i=str2num(get(handles.num_first_i,'String'));%reset the firrst_i and last_i for multiple experiments, modified by the splitting into NbProcess 1671 1678 Param.IndexRange.last_i=str2num(get(handles.num_last_i,'String')); 1672 %% create the output data directory if needed 1679 1680 %% create the output data directory if needed, after chcking its existence 1673 1681 OutputDir=''; 1674 1682 answer=''; 1675 1683 if isfield(Param,'OutputSubDir')% possibly update the output dir if it already exists 1676 SubDirOut=[ get(handles.OutputSubDir,'String')Param.OutputDirExt];1684 SubDirOut=[Param.OutputSubDir Param.OutputDirExt]; 1677 1685 SubDirOutNew=SubDirOut; 1678 1686 detect=exist(fullfile(Param.InputTable{1,1},SubDirOutNew),'dir'); % test if the dir already exist … … 1708 1716 continue 1709 1717 end 1710 Param.OutputDirExt=regexprep(SubDirOutNew, Param.OutputSubDir,'');1718 Param.OutputDirExt=regexprep(SubDirOutNew,['^' Param.OutputSubDir],''); 1711 1719 Param.OutputRootFile=Param.InputTable{1,3}; % the first sorted RootFile taken for output 1712 set(handles.OutputDirExt,'String',Param.OutputDirExt) 1713 OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]) % full name (with path) of output directory 1720 OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]); % full name (with path) of output directory 1714 1721 if check_create % create output directory if it does not exist 1715 1722 [tild,msg1]=mkdir(OutputDir); … … 1722 1729 elseif isfield(Param,'ActionInput')&&isfield(Param.ActionInput,'LogPath')% custom definition of the output dir 1723 1730 OutputDir=Param.ActionInput.LogPath; 1731 end 1732 1733 set(handles.OutputSubDir,'String',Param.OutputSubDir) 1734 set(handles.OutputDirExt,'String',Param.OutputDirExt) 1735 drawnow 1736 if get(handles.Replicate,'Value') 1737 set(handles.InputTable,'Data',Param.InputTable) 1738 check_input_file_series(handles) 1724 1739 end 1725 1740 DirXml=fullfile(OutputDir,'0_XML'); … … 2209 2224 end 2210 2225 set(handles.Replicate,'BackgroundColor',[0 1 0]) 2211 if NbExp>1 2212 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta (input file features need to be updated) 2213 end 2226 2214 2227 %------------------------------------------------------------------------ 2215 2228 function STOP_Callback(hObject, eventdata, handles) … … 3816 3829 % --- Executes on button press in MonitorCluster. 3817 3830 function MonitorCluster_Callback(hObject, eventdata, handles) 3818 disp('format: R/W=run/wait, time lapsed, R=nbre of cores,W=walltime') 3819 system('oarstat |grep N=UVmat')% check the list of jobs launched with uvmat 3831 3832 [rr,ss]=system('oarstat |grep N=UVmat');% check the list of jobs launched with uvmat 3833 if isempty(ss) 3834 disp( 'no job presently submitted with uvmat') 3835 else 3836 disp('format: R/W=run/wait, time lapsed, R=nbre of cores,W=walltime') 3837 disp(ss) 3838 end 3820 3839 3821 3840
Note: See TracChangeset
for help on using the changeset viewer.