Legend:
- Unmodified
- Added
- Removed
-
trunk/src/read_GUI.m
r309 r323 21 21 separator=regexp(tag,'_'); 22 22 if isempty(separator) 23 input=get(hchild(ichild),' Value');23 input=get(hchild(ichild),'String'); 24 24 else 25 25 switch(tag(1:separator)) … … 44 44 listinput=get(hchild(ichild),'String'); 45 45 value=get(hchild(ichild),'Value'); 46 if ~isempty(listinput) 46 47 input=listinput(value); 48 end 47 49 separator=regexp(tag,'_'); 48 50 if strcmp(tag(1:separator),'num_') -
trunk/src/uvmat.m
r319 r323 522 522 indices(end-length(ext)+1:end)=[]; %remove extension 523 523 set(handles.FileIndex,'String',indices); 524 set(handles.FileIndex,'UserData',NomType); 524 % set(handles.FileIndex,'UserData',NomType); 525 set(handles.NomType,'String',NomType); 525 526 set(handles.FileExt,'String',ext); 526 527 % fill file index counters … … 533 534 if get(handles.SubField,'Value')==1% if the subfield button is activated, update the field numbers 534 535 [ff,rr,FileBase_1,ii,FileExt_1,SubDir_1]=read_file_boxes_1(handles); 535 NomType_1=get(handles.FileIndex_1,'UserData'); 536 NomType_1=get(handles.NomType_1,'String'); 537 % NomType_1=get(handles.FileIndex_1,'UserData'); 536 538 FileName_1=name_generator(FileBase_1,str2double(i1),str2double(i2),FileExt_1,NomType_1,1,stra2num(str_a),stra2num(str_b),SubDir_1); 537 539 if exist(FileName_1,'file') … … 752 754 %transform .Time to a column vector if it is a line vector the nomenclature uses a single index 753 755 if isequal(nbfield,1) && ~isequal(nburst,1)% .Time is a line vector 754 NomType=get(handles.FileIndex,'UserData'); 756 NomType=get(handles.NomType,'String'); 757 % NomType=get(handles.FileIndex,'UserData'); 755 758 if numel(NomType)>=2 &&(strcmp(NomType,'_i')||strcmp(NomType(1:2),'%0')||strcmp(NomType(1:2),'_%')) 756 759 XmlData.Time=(XmlData.Time)'; … … 886 889 887 890 % set the corresponding index navigation options 888 NomType=get(handles.FileIndex,'UserData'); 889 NomType_1=get(handles.FileIndex_1,'UserData'); 891 NomType=get(handles.NomType,'String'); 892 NomType_1=get(handles.NomType_1,'String'); 893 % NomType=get(handles.FileIndex,'UserData'); 894 % NomType_1=get(handles.FileIndex_1,'UserData'); 890 895 last_i_str=get(handles.last_i,'String'); 891 896 nbfield=str2num(last_i_str{1}); … … 1074 1079 heditxml=editxml(fileinput); 1075 1080 return 1076 case {'.image','.nc','.cdf'} 1081 case {'.image','.nc','.cdf'} 1077 1082 % set(handles.FileIndex,'UserData',NomType_1); 1078 1083 otherwise … … 1111 1116 end 1112 1117 end 1113 set(handles.FileIndex_1,'UserData',NomType_1); 1118 set(handles.NomType_1,'String',NomType_1); 1119 % set(handles.FileIndex_1,'UserData',NomType_1); 1114 1120 1115 1121 % make visible and fill the second raw of edit boxes … … 1137 1143 indices(end-length(FileExt_1)+1:end)=[]; %remove extension 1138 1144 set(handles.FileIndex_1,'String',indices) 1139 set(handles.FileIndex_1,'UserData',NomType_1) 1145 set(handles.NomType_1,'String',NomType_1) 1146 % set(handles.FileIndex_1,'UserData',NomType_1) 1140 1147 set(handles.FileExt_1,'String',FileExt_1); 1141 1148 … … 1350 1357 set(handles.scan_i,'Value',0) 1351 1358 set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784]) 1352 NomType=get(handles.FileIndex,'UserData'); 1359 NomType=get(handles.NomType,'String'); 1360 % NomType=get(handles.FileIndex,'UserData'); 1353 1361 switch NomType 1354 1362 case {'_i_j1-j2','#_ab','%3dab'},% pair with j index … … 1368 1376 %------------------------------------------------------------------------ 1369 1377 set(handles.i1,'BackgroundColor',[0.7 0.7 0.7]) 1370 NomType=get(handles.FileIndex,'UserData'); 1378 NomType=get(handles.NomType,'String'); 1379 % NomType=get(handles.FileIndex,'UserData'); 1371 1380 num1=stra2num(get(handles.i1,'String')); 1372 1381 num2=stra2num(get(handles.i2,'String')); … … 1758 1767 1759 1768 %------------------------------------------------------------------------ 1769 % --- function activated by runplus and run minus 1760 1770 function errormsg=runpm(hObject,eventdata,handles,increment) 1761 1771 %------------------------------------------------------------------------ 1762 % check for movie pair status1772 %% check for movie pair status 1763 1773 movie_status=get(handles.movie_pair,'Value'); 1764 1774 if isequal(movie_status,1) 1765 1775 STOP_Callback(hObject, eventdata, handles)%interrupt movie pair if active 1766 1776 end 1767 %read the data on the current input rootfile(s) 1768 [FileName,RootPath,filebase,FileIndices,FileExt,subdir]=read_file_boxes(handles); 1769 NomType=get(handles.FileIndex,'UserData'); 1770 1771 i1=stra2num(get(handles.i1,'String')); 1777 1778 %% read the current input file name(s) and field indices 1779 InputFile=read_GUI(handles.InputFile); 1780 filebase=InputFile.RootPath; %default 1781 if ~isempty(InputFile.SubDir) 1782 InputFile.SubDir=regexprep(InputFile.SubDir,'/|\',''); 1783 % FileName=fullfile(InputFile.RootPath,InputFile.SubDir); 1784 end 1785 if ~isempty(InputFile.RootFile) 1786 InputFile.RootFile=regexprep(InputFile.RootFile,'/|\',''); 1787 filebase=fullfile(filebase,InputFile.RootFile); 1788 end 1789 FileExt=InputFile.FileExt; 1790 subdir=InputFile.SubDir; 1791 % [FileName,RootPath,filebase,FileIndices,FileExt,subdir]=read_file_boxes(handles); 1792 NomType=get(handles.NomType,'String'); 1793 % NomType=get(handles.FileIndex,'UserData'); 1794 i1=stra2num(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name) 1772 1795 i2=stra2num(get(handles.i2,'String')); 1773 1796 j1=stra2num(get(handles.j1,'String')); 1774 1797 j2=stra2num(get(handles.j2,'String')); 1775 1776 1798 sub_value= get(handles.SubField,'Value'); 1777 1799 if sub_value % a second input file has been entered … … 1782 1804 j1_1=stra2num(j1_1_str); 1783 1805 j2_1=stra2num(j2_1_str); 1784 NomType_1=get(handles.FileIndex_1,'UserData'); 1806 NomType_1=get(handles.NomType_1,'String'); 1807 % NomType_1=get(handles.FileIndex_1,'UserData'); 1785 1808 else 1786 1809 filename_1=[]; … … 1788 1811 comp_input=get(handles.fix_pair,'Value'); 1789 1812 1790 % case of scanning along the first direction (rootfile numbers)1813 %% increment (or decrement) the field indices and update the input filename(s) 1791 1814 if get(handles.scan_i,'Value')==1% case of scanning along index i 1792 1815 i1=i1+increment; … … 1809 1832 end 1810 1833 1811 % refresh plots1834 %% refresh plots 1812 1835 errormsg=refresh_field(handles,filename,filename_1,i1,i2,j1,j2); 1813 if isempty(errormsg) %update the index counters 1814 if strcmp(NomType,'*')%case of movies 1815 set(handles.i1,'String',num2str(i1))%update the index display 1836 1837 %% update the index counters if the index move is successfull 1838 if isempty(errormsg) 1839 set(handles.i1,'String',num2stra(i1,NomType,1)); 1840 if isequal(i2,i1) 1841 set(handles.i2,'String',''); 1816 1842 else 1817 [~,~,i1_str,i2_str,j1_str,j2_str]=name2display(filename); 1818 set(handles.i1,'String',i1_str) 1819 set(handles.j1,'String',j1_str) 1820 if ~isequal(movie_status,1) 1821 set(handles.i2,'String',i2_str) 1822 set(handles.j2,'String',j2_str) 1823 end 1824 [indices]=name_generator('',i1,j1,'',NomType,1,i2,j2,''); 1825 set(handles.FileIndex,'String',indices); 1826 if ~isempty(filename_1) 1827 indices_1=name_generator('',i1_1,j1_1,'',NomType_1,1,i2_1,j2_1,''); 1828 set(handles.FileIndex_1,'String',indices_1); 1829 end 1830 end 1831 % set(handles.i1,'String',num2stra(i1,NomType,1)); 1832 % if isequal(i2,i1) 1833 % set(handles.i2,'String',''); 1834 % else 1835 % set(handles.i2,'String',num2stra(num2,NomType,1)); 1836 % end 1837 % set(handles.j1,'String',num2stra(j1,NomType,2)); 1838 % if isequal(j2,j1) 1839 % set(handles.j2,'String',''); 1840 % else 1841 % set(handles.j2,'String',num2stra(j2,NomType,2)); 1842 % end 1843 1843 set(handles.i2,'String',num2stra(i2,NomType,1)); 1844 end 1845 set(handles.j1,'String',num2stra(j1,NomType,2)); 1846 if isequal(j2,j1) 1847 set(handles.j2,'String',''); 1848 else 1849 set(handles.j2,'String',num2stra(j2,NomType,2)); 1850 end 1851 [indices]=name_generator('',i1,j1,'',NomType,1,i2,j2,''); 1852 set(handles.FileIndex,'String',indices); 1853 if ~isempty(filename_1) 1854 indices_1=name_generator('',i1_1,j1_1,'',NomType_1,1,i2_1,j2_1,''); 1855 set(handles.FileIndex_1,'String',indices_1); 1856 end 1844 1857 if isequal(movie_status,1) 1845 1858 set(handles.movie_pair,'Value',1) … … 1871 1884 test_1=0; 1872 1885 [ff,rr,filebase,xx,Ext,SubDir]=read_file_boxes(handles); 1873 NomType=get(handles.FileIndex,'UserData'); 1886 NomType=get(handles.NomType,'String'); 1887 % NomType=get(handles.FileIndex,'UserData'); 1874 1888 else 1875 1889 list_fields=get(handles.Fields_1,'String');% list menu fields … … 1879 1893 test_1=1; 1880 1894 [ff,rr,filebase,xx,Ext,SubDir]=read_file_boxes_1(handles); 1881 NomType=get(handles.FileIndex_1,'UserData'); 1895 NomType=get(handles.NomType_1,'String'); 1896 % NomType=get(handles.FileIndex_1,'UserData'); 1882 1897 else 1883 1898 msgbox_uvmat('ERROR','an image or movie must be first introduced as input') … … 2054 2069 return 2055 2070 end 2056 NomType=get(handles.FileIndex,'UserData'); 2071 NomType=get(handles.NomType,'String'); 2072 % NomType=get(handles.FileIndex,'UserData'); 2057 2073 %update the z position index 2058 2074 nbslice_str=get(handles.nb_slice,'String'); … … 2158 2174 Ext_1=get(handles.FileExt,'String');%read the file extension for the first series (case of veltype comparison within a single file) 2159 2175 end 2160 NomType_1=get(handles.FileIndex_1,'UserData'); 2176 NomType_1=get(handles.NomType_1,'String'); 2177 % NomType_1=get(handles.FileIndex_1,'UserData'); 2161 2178 if isequal(Ext_1,'.nc')||isequal(Ext_1,'.cdf') 2162 2179 FileType_1='netcdf'; … … 3031 3048 3032 3049 %------------------------------------------------------------------------ 3033 % --- read the data displayed for the input rootfile windows (new) 3050 % --- read the data displayed for the input rootfile windows (new): TODO use read_GUI 3051 3034 3052 function [FileName,RootPath,FileBase,FileIndices,FileExt,SubDir]=read_file_boxes(handles) 3035 3053 %------------------------------------------------------------------------ 3036 RootPath=get(handles.RootPath,'String'); 3037 FileName=RootPath; %default 3038 SubDir=get(handles.SubDir,'String'); 3039 if ~isempty(SubDir) && ~isequal(SubDir,'') 3040 if (isequal(SubDir(1),'/')|| isequal(SubDir(1),'\')) 3041 SubDir(1)=[]; %suppress possible / or \ separator 3042 end 3043 FileName=fullfile(RootPath,SubDir); 3044 end 3045 RootFile=get(handles.RootFile,'String'); 3046 if ~isempty(RootFile) && ~isequal(RootFile,'') 3047 if (isequal(RootFile(1),'/')|| isequal(RootFile(1),'\')) 3048 RootFile(1)=[]; %suppress possible / or \ separator 3049 end 3050 FileName=fullfile(FileName,RootFile); 3051 end 3052 FileBase=fullfile(RootPath,RootFile); 3053 FileIndices=get(handles.FileIndex,'String'); 3054 FileExt=get(handles.FileExt,'String'); 3055 FileName=[FileName FileIndices FileExt]; 3054 InputFile=read_GUI(handles.InputFile); 3055 RootPath=InputFile.RootPath; 3056 FileName=InputFile.RootPath; %default 3057 if ~isempty(InputFile.SubDir) 3058 InputFile.SubDir=regexprep(InputFile.SubDir,'/|\',''); 3059 FileName=fullfile(InputFile.RootPath,InputFile.SubDir); 3060 end 3061 if ~isempty(InputFile.RootFile) 3062 InputFile.RootFile=regexprep(InputFile.RootFile,'/|\',''); 3063 FileName=fullfile(FileName,InputFile.RootFile); 3064 end 3065 SubDir=InputFile.SubDir; 3066 % if ~isempty(SubDir) && ~isequal(SubDir,'') 3067 % if (isequal(SubDir(1),'/')|| isequal(SubDir(1),'\')) 3068 % SubDir(1)=[]; %suppress possible / or \ separator 3069 % end 3070 % FileName=fullfile(RootPath,SubDir); 3071 % end 3072 % RootFile=get(handles.RootFile,'String'); 3073 % if ~isempty(RootFile) && ~isequal(RootFile,'') 3074 % if (isequal(RootFile(1),'/')|| isequal(RootFile(1),'\')) 3075 % RootFile(1)=[]; %suppress possible / or \ separator 3076 % end 3077 % FileName=fullfile(FileName,RootFile); 3078 % end 3079 FileBase=fullfile(InputFile.RootPath,InputFile.RootFile); 3080 FileIndices=InputFile.FileIndex; 3081 FileExt=InputFile.FileExt; 3082 FileName=[FileName InputFile.FileIndex InputFile.FileExt]; 3056 3083 3057 3084 %------------------------------------------------------------------------ … … 3170 3197 indices=name_generator('',str2double(str1),str2double(str_a),'',NomTypeNew,1,str2double(str2),str2double(str_b),''); 3171 3198 set(handles.FileIndex,'String',indices) 3172 set(handles.FileIndex,'UserData',NomTypeNew) 3199 set(handles.NomType,'String',NomTypeNew) 3200 % set(handles.FileIndex,'UserData',NomTypeNew) 3173 3201 %common to Fields_1_Callback 3174 3202 if isequal(field,'image')||isequal(field_1,'image') … … 3208 3236 [FileName,RootPath,FileBase,FileIndices,FileExt_1]=read_file_boxes_1(handles); 3209 3237 [P,F,str1,str2,str_a,str_b,E,NomType_1]=name2display(['xxx' get(handles.FileIndex,'String') FileExt_1]); 3210 % if isempty(FileExt_prev)|| strcmp(FileExt_prev,'')3211 % FileExt_1=get(handles.FileExt,'String');3212 % else3213 % FileExt_1=FileExt_prev;3214 % end3215 % NomType_1=get(handles.FileIndex_1,'UserData');3216 3238 if isempty(NomType_1)|| strcmp(NomType_1,'') 3217 3239 [FileName,RootPath,FileBase,FileIndices,FileExt_1]=read_file_boxes(handles); 3218 3240 [P,F,str1,str2,str_a,str_b,E,NomType_1]=name2display(['xxx' get(handles.FileIndex,'String') FileExt_1]); 3219 % NomType_1=get(handles.FileIndex,'UserData');3220 3241 end 3221 3242 NomTypeNew=NomType_1;%default … … 3356 3377 indices=name_generator('',str2num(str1),stra2num(str_a),'',NomTypeNew,1,str2num(str2),stra2num(str_b),''); 3357 3378 set(handles.FileIndex_1,'String',indices) 3358 set(handles.FileIndex_1,'UserData',NomTypeNew) 3379 set(handles.NomType_1,'String',NomTypeNew) 3380 % set(handles.FileIndex_1,'UserData',NomTypeNew) 3359 3381 3360 3382 %common to Fields_Callback … … 3414 3436 % end 3415 3437 3416 %------------------------------------------------------------------- 3438 %------------------------------------------------------------------------ 3417 3439 % --- Executes on button press in VelType. 3418 3440 function VelType_Callback(hObject, eventdata, handles) 3419 %------------------------------------------------------------------- 3420 % if get(handles.VelType,'Value')==1 3421 % reset_vel_type([handles.interp1 handles.civ2 handles.filter1 handles.interp1 handles.interp2 handles.filter2],handles.VelType) 3422 % else 3423 % reset_vel_type([handles.VelType handles.filter1 handles.interp1 handles.civ2 handles.interp2 handles.filter2]) 3424 % end 3441 %------------------------------------------------------------------------ 3425 3442 set(handles.FixVelType,'Value',1) 3426 3443 run0_Callback(hObject, eventdata, handles) 3427 3444 3428 %--------------------------------------------- 3445 %------------------------------------------------------------------------ 3446 % --- Executes on button press in VelType. 3429 3447 function VelType_1_Callback(hObject, eventdata, handles) 3430 %--------------------------------------------- 3448 %------------------------------------------------------------------------ 3431 3449 3432 3450 set(handles.FixVelType,'Value',1)% the velocity type is now imposed by the GUI (not automatic) 3433 3451 %refresh field with a second filename=first fiel name 3434 3452 set(handles.run0,'BackgroundColor',[1 1 0])%paint the command button in yellow 3435 drawnow 3453 drawnow 3454 InputFile=read_GUI(handles.InputFile); 3436 3455 filename=read_file_boxes(handles); 3437 3456 … … 4629 4648 end 4630 4649 end 4631 param.NomType=get(handles.FileIndex,'UserData'); 4632 param.NomType_1=get(handles.FileIndex_1,'UserData'); 4650 param.NomType=get(handles.NomType,'String'); 4651 % param.NomType=get(handles.FileIndex,'UserData'); 4652 param.NomType_1=get(handles.NomType_1,'String'); 4653 % param.NomType_1=get(handles.FileIndex_1,'UserData'); 4633 4654 param.comp_input=get(handles.fix_pair,'Value'); 4634 4655 huvmat=get(handles.MenuSeries,'parent'); … … 4972 4993 end 4973 4994 hset_object=set_object(ObjectData,[],ZBounds); 4995 4996 4997 4998 function NomType_Callback(hObject, eventdata, handles) 4999 5000 5001 function NomType_1_Callback(hObject, eventdata, handles) 5002
Note: See TracChangeset
for help on using the changeset viewer.