- Timestamp:
- Nov 30, 2010, 12:03:49 AM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r128 r144 111 111 set(handles.inputfile,'String',filename)% prefill the input file name 112 112 set(handles.inputfile,'Enable','off')% desactivate the input file edit box 113 set(handles.list_fig,'Value',2)% plotting axes =uvmat selected114 set(handles.list_fig,'Visible','off')%115 set(handles.RUN,' Visible','off')% RUN button not visible (passive mode, get_field used to define the field for uvamt)113 % set(handles.list_fig,'Value',2)% plotting axes =uvmat selected 114 % set(handles.list_fig,'Visible','off')% 115 set(handles.RUN,'String','REFRESH')% passive mode, get_field used to define the field for uvamt 116 116 set(handles.MenuOpen,'Visible','off') 117 117 set(handles.MenuExport,'Visible','off') … … 120 120 else %master mode 121 121 set(handles.inputfile,'String','') 122 set(handles.RUN,'String','RUN')% 122 123 % load the list of previously browsed files for the upper bar menu Open 123 124 dir_perso=prefdir; … … 171 172 inputfile=get(handles.inputfile,'String'); 172 173 Field=nc2struct(inputfile);% reads the whole field 173 hfig=get(handles.inputfile,'parent'); 174 set(hfig,'UserData',Field); 174 set(handles.figure1,'UserData',Field); 175 175 Field_input(eventdata,handles,Field); 176 176 … … 792 792 function RUN_Callback(hObject, eventdata, handles) 793 793 %--------------------------------------------------------- 794 index=get(handles.ACTION,'Value'); 795 list_func=get(handles.ACTION,'UserData'); 796 h_fun=list_func{index}; 797 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 798 drawnow 799 SubField=h_fun(handles.figure1);%handles.figure1 =handles of the GUI get_field 800 if ~isempty(SubField) 801 plot_get_field(SubField,handles) 802 end 803 browse_fig(handles.list_fig); %update the list of new existing figures 794 figstring=get(handles.list_fig,'String'); 795 if isequal(figstring,{'uvmat'}) 796 huvmat=findobj(allchild(0),'tag','uvmat'); 797 hhuvmat=guidata(huvmat); 798 uvmat('run0_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat, show the image in phys coordinates 799 else 800 index=get(handles.ACTION,'Value'); 801 list_func=get(handles.ACTION,'UserData'); 802 h_fun=list_func{index}; 803 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 804 drawnow 805 SubField=h_fun(handles.figure1);%handles.figure1 =handles of the GUI get_field 806 if ~isempty(SubField) 807 plot_get_field(SubField,handles) 808 end 809 browse_fig(handles.list_fig); %update the list of new existing figures 810 end 804 811 805 812 %------------------------------------------------------------------------ … … 809 816 val=get(handles.list_fig,'Value'); 810 817 if strcmp(list_fig{val},'uvmat') 811 set(handles.figure1,'Name','uvmat_field')818 % set(handles.figure1,'Name','uvmat_field') 812 819 set(handles.inputfile,'Enable','off')% desactivate the input file edit box 813 820 % set(handles.list_fig,'Visible','off')% … … 816 823 set(handles.MenuExport,'Visible','off') 817 824 uvmat(get(handles.inputfile,'String')) 825 elseif strcmp(list_fig{val},'view_field') 826 view_field(SubField) 818 827 else 819 828 hfig=str2num(list_fig{val});% chosen figure number from tyhe GUI … … 1065 1074 1066 1075 % update dimensions; 1067 if isfield(Field,'VarDimIndex') 1076 if isfield(Field,'ListDimName') 1077 Field.ListDimName 1068 1078 Tabdim={};%default 1069 if isequal(index,1) 1079 if isequal(index,1)%list all dimensions 1070 1080 dim_indices=1:length(Field.ListDimName); 1071 1081 set(handles.dimensions_txt,'String', 'dimensions') 1072 1082 else 1073 dim_indices=Field.VarDimIndex{index-1}; 1083 DimCell=Field.VarDimName{index-1}; 1084 if ischar(DimCell) 1085 DimCell={DimCell}; 1086 end 1087 dim_indices=[]; 1088 for idim=1:length(DimCell) 1089 dim_index=strcmp(DimCell{idim},Field.ListDimName);%vector with size of Field.ListDimName, =0 1090 dim_index=find(dim_index,1); 1091 dim_indices=[dim_indices dim_index]; 1092 end 1093 %dim_indices=find(dim_list) %removes 0 values 1074 1094 set(handles.dimensions_txt,'String', ['dimensions of ' var_select]) 1075 1095 end … … 1251 1271 for ifig=1:length(hh) %look for all existing figures 1252 1272 name=get(hh(ifig),'Name'); 1253 if ~ isequal(name,'uvmat')%case of uvmat GUI1273 if ~strcmp(name,'uvmat')&& ~strcmp(name,'view_field') %case of uvmat GUI 1254 1274 hchild=get(hh(ifig),'children');% look for axes contained in each figure 1255 1275 nbaxe=0; … … 1274 1294 end 1275 1295 end 1276 list=[' new fig...';'uvmat';list];1296 list=['view_field';list]; 1277 1297 set(menu_handle,'Value',1) 1278 1298 set(menu_handle,'String',list) … … 1285 1305 fig_val=get(handles.list_fig,'Value'); 1286 1306 plot_fig=list_fig{fig_val}; 1287 if isequal(plot_fig,'uvmat')1288 huvmat=findobj(allchild(0),'name','uvmat');1289 if ~isempty(huvmat)1290 uistack(huvmat,'top')1291 end1292 else if ~isequal(plot_fig,'new fig...') & ~isequal(plot_fig,'uvmat')1307 if strcmp(plot_fig,'view_field') 1308 % huvmat=findobj(allchild(0),'name','uvmat'); 1309 % if ~isempty(huvmat) 1310 % uistack(huvmat,'top') 1311 % end 1312 else%if ~isequal(plot_fig,'new fig...') & ~isequal(plot_fig,'uvmat') 1293 1313 sep=regexp(plot_fig,'_'); 1294 1314 if ~isempty(sep) -
trunk/src/uvmat.m
r141 r144 2307 2307 if isequal(FileType,'netcdf') %read the first nc field 2308 2308 if isequal(FieldName,'get_field...')% read the field names on the interface get_field. 2309 hget_field=findobj(allchild(0),'Name',' uvmat_field');%find the get_field... GUI2309 hget_field=findobj(allchild(0),'Name','get_field');%find the get_field... GUI 2310 2310 if isempty(hget_field) 2311 2311 hget_field= get_field(filename);%open the get_field GUI 2312 set(hget_field,'name','uvmat_field')2312 % set(hget_field,'name','get_field') 2313 2313 elseif UvData.NewSeries% refresh the fet_field GUI for a new series 2314 2314 delete(hget_field) 2315 2315 hget_field= get_field(filename);%open the get_field GUI 2316 set(hget_field,'name',' uvmat_field')%rename get_field GUI for the 'slave' mode2316 set(hget_field,'name','get_field')%rename get_field GUI for the 'slave' mode 2317 2317 end 2318 2318 hhget_field=guidata(hget_field); 2319 set(hhget_field.list_fig,'Value',1) 2320 set(hhget_field.list_fig,'String',{'uvmat'}) 2319 2321 funct_list=get(hhget_field.ACTION,'UserData'); 2320 2322 funct_index=get(hhget_field.ACTION,'Value'); … … 2335 2337 if ~isempty(filename_1) && ~test_keepdata_1 && isequal(FileType_1,'netcdf') %read the second file 2336 2338 if isequal(FieldName_1,'get_field...')% read the field names on the interface get_field. 2337 hget_field_1=findobj(allchild(0),'Name',' uvmat_field_1');%find the get_field... GUI2339 hget_field_1=findobj(allchild(0),'Name','get_field_1');%find the get_field... GUI 2338 2340 if isempty(hget_field_1) 2339 2341 hget_field_1= get_field(filename_1);%open the get_field GUI 2340 set(hget_field_1,'name','uvmat_field_1') 2342 set(hget_field_1,'name','get_field_1') 2343 elseif UvData.NewSeries% refresh the fet_field GUI for a new series 2344 delete(hget_field_1) 2345 hget_field_1= get_field(filename);%open the get_field GUI 2346 set(hget_field_1,'name','get_field_1')%rename get_field GUI for the 'slave' mode 2341 2347 end 2342 2348 hhget_field_1=guidata(hget_field_1);%handles of GUI elements in get_field 2349 set(hhget_field_1.list_fig,'Value',1) 2350 set(hhget_field_1.list_fig,'String',{'uvmat'}) 2343 2351 funct_list=get(hhget_field_1.ACTION,'UserData'); 2344 2352 funct_index=get(hhget_field_1.ACTION,'Value'); … … 3216 3224 set_veltype_display(veltype_handles,0) % unvisible civ buttons 3217 3225 filename=read_file_boxes(handles); 3218 hget_field=findobj(allchild(0),'name','uvmat_field'); 3219 if isempty(hget_field) 3220 hget_field=get_field(filename); 3221 set(hget_field,'Name','uvmat_field') 3226 hget_field=findobj(allchild(0),'name','get_field'); 3227 if ~isempty(hget_field) 3228 delete(hget_field) 3222 3229 end 3230 hget_field=get_field(filename); 3231 set(hget_field,'Name','get_field') 3232 hhget_field=guidata(hget_field); 3233 set(hhget_field.list_fig,'Value',1) 3234 set(hhget_field.list_fig,'String',{'uvmat'}) 3235 set(handles.transform_fct,'Value',1)% no transform by default 3236 set(handles.path_transform,'String','') 3223 3237 return %no action 3224 3238 end … … 3380 3394 hget_field=get_field(filename); 3381 3395 set(hget_field,'name','get_field_1') 3396 hhget_field=guidata(hget_field); 3397 set(hhget_field.list_fig,'Value',1) 3398 set(hhget_field.list_fig,'String',{'uvmat'}) 3399 set(handles.transform_fct,'Value',1)% no transform by default 3400 set(handles.path_transform,'String','') 3382 3401 return %no action 3383 3402 end -
trunk/src/view_field.m
r116 r144 72 72 handles_mouse=handles; 73 73 huvmat=findobj(allchild(0),'Name','uvmat'); 74 hhuvmat=guidata(huvmat); 75 set(hhuvmat.list_object_2,'Visible','on') 76 % handles_mouse.create=hhuvmat.create; 77 handles_mouse.edit=hhuvmat.edit; 78 pos_uvmat=get(huvmat,'Position'); 79 pos_view_field(1)=pos_uvmat(1)+pos_uvmat(3)/2; 80 pos_view_field(2)=pos_uvmat(2)-pos_uvmat(3)/4; 81 pos_view_field(3:4)=pos_uvmat(3:4); 82 set(hObject,'Position',pos_view_field) 74 if ~isempty(huvmat) 75 hhuvmat=guidata(huvmat); 76 set(hhuvmat.list_object_2,'Visible','on') 77 % handles_mouse.create=hhuvmat.create; 78 handles_mouse.edit=hhuvmat.edit; 79 pos_uvmat=get(huvmat,'Position'); 80 pos_view_field(1)=pos_uvmat(1)+pos_uvmat(3)/2; 81 pos_view_field(2)=pos_uvmat(2)-pos_uvmat(3)/4; 82 pos_view_field(3:4)=pos_uvmat(3:4); 83 set(hObject,'Position',pos_view_field) 84 end 83 85 84 86 %functions for the mouse and keyboard
Note: See TracChangeset
for help on using the changeset viewer.