Changeset 1022 for trunk/src/uvmat.m
- Timestamp:
- Dec 11, 2017, 1:15:03 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r1010 r1022 446 446 function MenuBrowse_Callback(hObject, eventdata, handles) 447 447 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 448 if isempty(regexp(RootPath,'^http://'))%usual files 448 449 oldfile=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 450 else %Opendap 451 oldfile=[RootPath '/' SubDir '/' RootFile FileIndices FileExt]; 452 end 449 453 if isempty(oldfile) %loads the previously stored file name and set it as default in the file_input box 450 454 oldfile=get(handles.RootPath,'UserData'); … … 452 456 fileinput=uigetfile_uvmat('pick an input file',oldfile); 453 457 hh=dir(fileinput); 454 if numel(hh)>1 fill_GUI458 if numel(hh)>1 455 459 msgbox_uvmat('ERROR','invalid input, probably a broken link'); 456 460 else … … 1800 1804 %% look for the input file existence 1801 1805 errormsg='';%default 1802 if ~exist(fileinput,'file')1806 if isempty(regexp(fileinput,'^http://')) && ~exist(fileinput,'file') 1803 1807 errormsg=['input file ' fileinput ' does not exist']; 1804 1808 msgbox_uvmat('ERROR',errormsg) … … 1841 1845 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 1842 1846 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 1847 % if isempty(regexp(fileinput,'^http://')) 1843 1848 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]); 1849 % else 1850 % FileInfo.FileType='netcdf'; 1851 % [RootPath,SubDir,RootFile,i1,i2,j1,j2,Ext,NomType]=fileparts_uvmat(fileinput); 1852 % i1_series=[0 i1 i2]; 1853 % i2_series=[]; 1854 % j1_series=[0 j1 j1]; 1855 % j2_series=[0 j1 j1]; 1856 % MovieObject=[]; 1857 % % [RootPath,RootFile]=fileparts(fileinput); 1858 % % [RootPath,SubDir]=fileparts(RootPath); 1859 % % NomType='*'; 1860 % end 1844 1861 FileType=FileInfo.FileType; 1845 1862 if strcmp(FileType,'txt') … … 1883 1900 set(handles_SubDir,'String',['/' SubDir]); 1884 1901 set(handles_RootFile,'String',['/' RootFile]); %display the separator 1885 if strcmp(NomType,'level') 1886 rootname=fullfile(RootPath,SubDir,'level'); 1887 rr=regexp(fileinput,['^' rootname '(?<j>\d+)/' RootFile '(?<i>\d+)' FileExt '$'],'names'); 1888 if ~isempty(rr) 1889 set(handles_FileIndex,'String',rr.i); 1890 end 1891 else 1902 % if strcmp(NomType,'level') 1903 % rootname=fullfile(RootPath,SubDir,'level'); 1904 % rr=regexp(fileinput,['^' rootname '(?<j>\d+)/' RootFile '(?<i>\d+)' FileExt '$'],'names'); 1905 % if ~isempty(rr) 1906 % set(handles_FileIndex,'String',rr.i); 1907 % end 1908 % else 1909 if isempty(regexp(RootPath,'^http://')) 1892 1910 rootname=fullfile(RootPath,SubDir,RootFile); 1911 else 1912 rootname=[RootPath '/' SubDir '/' RootFile]; 1913 end 1893 1914 indices=fileinput(length(rootname)+1:end); 1894 1915 indices(end-length(FileExt)+1:end)=[]; %remove extension 1895 1916 set(handles_FileIndex,'String',indices); 1896 end1917 % end 1897 1918 set(handles_NomType,'String',NomType); 1898 1919 set(handles_FileExt,'String',FileExt); … … 3187 3208 if isempty(i2), set(handles.i2,'String',''); end % suppress the second i index display if not used 3188 3209 if isempty(j2), set(handles.j2,'String',''); end % suppress the second j index display if not used 3189 if strcmp(get(handles.NomType,'String'),'level') 3190 jindex=str2num(get(handles.j1,'String')); 3191 filename=[fullfile(RootPath,SubDir,['level' num2str(jindex)],RootFile) FileIndex FileExt];% build the input file name (first line) 3192 else 3210 % if strcmp(get(handles.NomType,'String'),'level') 3211 % jindex=str2num(get(handles.j1,'String')); 3212 % filename=[fullfile(RootPath,SubDir,['level' num2str(jindex)],RootFile) FileIndex FileExt];% build the input file name (first line) 3213 % else 3214 if isempty(regexp(RootPath,'^http://')) 3193 3215 filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line) 3216 else 3217 filename=[RootPath '/' SubDir '/' RootFile FileIndex FileExt];% 3194 3218 end 3195 3219 filename_1='';%default second file name … … 3247 3271 3248 3272 %% determine the main input file information for action 3249 if ~exist(FileName,'file')3273 if isempty(regexp(FileName,'^http://')) &&~exist(FileName,'file') 3250 3274 errormsg=['input file ' FileName ' does not exist']; 3251 3275 return … … 4340 4364 field= list_fields{index_fields(1)}; % selected string 4341 4365 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 4366 if isempty(regexp(RootPath,'^http://')) 4342 4367 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 4368 else 4369 FileName=[RootPath '/' SubDir '/' RootFile FileIndices FileExt]; 4370 end 4343 4371 [tild,tild,tild,i1,i2,j1,j2,tild,NomType]=fileparts_uvmat(['xxx' get(handles.FileIndex,'String') FileExt]); 4344 4372 … … 4385 4413 %read selection from get_field 4386 4414 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 4415 if isempty(regexp(RootPath,'^http://')) 4387 4416 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 4417 else 4418 FileName=[RootPath '/' SubDir '/' RootFile FileIndices FileExt]; 4419 end 4388 4420 GetFieldData=get_field(FileName,ParamIn);% inport field names from the GUI get_field 4389 4421 FieldList={};
Note: See TracChangeset
for help on using the changeset viewer.