Changeset 231 for trunk/src/uvmat.m
- Timestamp:
- Apr 5, 2011, 12:46:34 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r227 r231 302 302 set(handles.transform_fct,'String',menu_str) 303 303 set(handles.transform_fct,'UserData',fct_handle)% store the list of path in UserData of ACTION 304 set(handles.uvmat,'UserData',UvData) 304 305 305 306 306 %% check the path and date of modification of all functions in uvmat … … 324 324 inputfile=input.InputFile; 325 325 end 326 if isfield(Field,'TimeIndex') 327 set(handles.i1,num2str(Field.TimeIndex)) 326 if isfield(input,'TimeIndex') 327 set(handles.i1,num2str(input.TimeIndex)) 328 end 329 if isfield(input,'FieldsString') 330 % set(handles.Fields,'Value',1) 331 UvData.FieldsString=input.FieldsString; 328 332 end 329 333 elseif ischar(input)% file name introduced as input … … 335 339 return 336 340 end 337 Field.ListVarName={'A','coord_y','coord_x'}; 338 Field.VarDimName={{'coord_y','coord_x'},'cord_y','coord_x'}; 339 Field.A=input; 340 Field.coord_x=[0.5 size(input,2)-0.5]; 341 Field.coord_y=[size(input,1)-0.5 0.5]; 342 end 343 if ~isempty(inputfile) 344 %%%%% display the input field %%%%%%% 345 display_file_name(hObject, eventdata, handles,inputfile) 346 %%%%%%% 341 UvData.Field.ListVarName={'A','coord_y','coord_x'}; 342 UvData.Field.VarDimName={{'coord_y','coord_x'},'cord_y','coord_x'}; 343 UvData.Field.A=input; 344 UvData.Field.coord_x=[0.5 size(input,2)-0.5]; 345 UvData.Field.coord_y=[size(input,1)-0.5 0.5]; 347 346 testinputfield=1; 348 347 end … … 360 359 end 361 360 end 361 end 362 set(handles.uvmat,'UserData',UvData) 363 if ~isempty(inputfile) 364 %%%%% display the input field %%%%%%% 365 display_file_name(hObject, eventdata, handles,inputfile) 366 %%%%%%% 367 testinputfield=1; 362 368 end 363 369 … … 856 862 UvData.XmlData=XmlData; 857 863 UvData.NewSeries=1; 858 set(handles.uvmat,'UserData',UvData) 864 859 865 860 866 %display warning message … … 867 873 if ~testima 868 874 testcivx=0; 869 hget_field=findobj('Name','get_field'); 870 % if isequal(FileExt,'.nc')||isequal(FileExt,'.cdf') 871 if isempty(hget_field) 875 % hget_field=findobj('Name','get_field'); 876 % if isequal(FileExt,'.nc')||isequal(FileExt,'.cdf') 877 if isfield(UvData,'FieldsString') && isequal(UvData.FieldsString,{'get_field...'})% field menu defined as input (from get_field) 878 set(handles.Fields,'Value',1) 879 set(handles.Fields,'String',{'get_field...'}) 880 UvData=rmfield(UvData,'FieldsString'); 881 else 882 %if isempty(hget_field) 872 883 Data=nc2struct(FileName,'ListGlobalAttribute','absolut_time_T0','civ'); 873 884 if ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0)%if the new input is Civx … … 878 889 col_vec(1)=[];%remove 'velocity' option for vector color (must be a scalar) 879 890 testcivx=1; 880 end 881 else882 hhget_field=guidata(hget_field);883 if ~strcmp(get(hhget_field.inputfile,'String'),FileName)%delete any existing get_field GUI with file name different than the input884 delete(hget_field)885 end886 end887 if ~testcivx891 end 892 % else 893 % hhget_field=guidata(hget_field); 894 % if ~strcmp(get(hhget_field.inputfile,'String'),FileName)%delete any existing get_field GUI with file name different than the input 895 % delete(hget_field) 896 % end 897 % end 898 if ~testcivx 888 899 set(handles.Fields,'Value',1) % set menu to 'get_field... 889 900 set(handles.Fields,'String',{'get_field...'}) 890 col_vec={'get_field...'}; 891 end 892 set(handles.col_vec,'String',col_vec) 893 % else 894 % msgbox_uvmat('ERROR',['invalid input file extension ' FileExt]) 895 % return 896 % end 897 end 901 col_vec={'get_field...'}; 902 end 903 set(handles.col_vec,'String',col_vec) 904 % else 905 % msgbox_uvmat('ERROR',['invalid input file extension ' FileExt]) 906 % return 907 % end 908 end 909 end 910 set(handles.uvmat,'UserData',UvData) 898 911 899 912 %% set index navigation options and refresh plots … … 2533 2546 end 2534 2547 else 2535 % create a default projection menuplane 2536 %UvData.Object{1}.Style='none';%main plotting plane 2537 UvData.Object{1}.ProjMode='projection';%main plotting plane 2538 UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat 2539 set(handles.list_object_1,'Value',1); 2540 set(handles.list_object_1,'String',{''}); 2548 % create a default projection 2549 % UvData.Object{1}.ProjMode='projection';%main plotting plane 2550 % UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat 2551 % set(handles.list_object_1,'Value',1); 2552 % set(handles.list_object_1,'String',{''}); 2541 2553 end 2542 2554 % if ~isfield(UvData.Object{1},'plotaxes') … … 2573 2585 % second projection object (view_field display) 2574 2586 IndexObj_2=get(handles.list_object_2,'Value');%selected projection object for the second view 2587 if IndexObj_2==0 2588 IndexObj_2=1; 2589 end 2575 2590 if isequal(get(handles.list_object_2,'Visible'),'on') && IndexObj_2 <= numel(UvData.Object)&& ~isempty(UvData.Object{IndexObj_2}) 2576 2591 IndexObj(2)=IndexObj_2; … … 3949 3964 list_object=get(handles.list_object_1,'String'); 3950 3965 set(handles.list_object_1,'Value',1) 3951 set(handles.list_object_1,'String', list_object(1))3966 set(handles.list_object_1,'String',{''}) 3952 3967 set(handles.list_object_2,'Value',2) 3953 set(handles.list_object_2,'String', [list_object(1);{'...'}])3968 set(handles.list_object_2,'String',{''}) 3954 3969 list_object_2_Callback(hObject, eventdata, handles) 3955 3970 … … 4317 4332 IndexObj=get(handles.list_object_1,'Value'); 4318 4333 str_1=list_str{IndexObj}; 4319 val_2=get(handles.list_object_2,'Value');4320 str_2=get(handles.list_object_2,'String');4321 if isequal(val_2,IndexObj)% if the first selection is equal to the second, it will suppress the second4322 set(handles.list_object_2,'Value',numel(str_2))%select the end of the list ('...')4323 list_object_2_Callback(hObject, eventdata, handles)4324 end4334 % val_2=get(handles.list_object_2,'Value'); 4335 % str_2=get(handles.list_object_2,'String'); 4336 % if isequal(val_2,IndexObj)% if the first selection is equal to the second, it will suppress the second 4337 % set(handles.list_object_2,'Value',numel(str_2))%select the end of the list ('...') 4338 % list_object_2_Callback(hObject, eventdata, handles) 4339 % end 4325 4340 update_object(handles,IndexObj,1,str_1) 4326 4341 … … 4331 4346 list_str=get(handles.list_object_2,'String'); 4332 4347 IndexObj=get(handles.list_object_2,'Value'); 4333 if ischar(list_str) || strcmp(list_str{IndexObj},'...')4348 if ischar(list_str) || isempty(list_str{IndexObj})% || strcmp(list_str{IndexObj},'...') 4334 4349 hview_field=findobj(allchild(0),'Tag','view_field'); 4335 4350 if ~isempty(hview_field) … … 4386 4401 PlotHandles=guidata(hview_field); 4387 4402 end 4388 plot_field(ProjData,PlotHandles.axes3,PlotHandles);4403 %plot_field(ProjData,PlotHandles.axes3,PlotHandles); 4389 4404 set(handles.uvmat,'UserData',UvData) 4390 4405 hother=findobj('Tag','proj_object');%find all the proj objects … … 4670 4685 end 4671 4686 end 4672 end 4673 4687 end 4674 4688 %mask name 4675 4689 RootPath=get(handles.RootPath,'String'); … … 4687 4701 4688 4702 %display the mask 4689 figure; 4703 hfigmask=figure; 4704 set(hfigmask,'Name','mask image') 4690 4705 vec=linspace(0,1,256);%define a linear greyscale colormap 4691 4706 map=[vec' vec' vec'];
Note: See TracChangeset
for help on using the changeset viewer.