Changeset 128 for trunk/src/get_field.m
- Timestamp:
- Nov 21, 2010, 10:06:11 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r107 r128 32 32 'gui_LayoutFcn', [] , ... 33 33 'gui_Callback', []); 34 if nargin & isstr(varargin{1})34 if nargin && ischar(varargin{1})&& ~isempty(regexp(varargin{1},'_Callback','once')) 35 35 gui_State.gui_Callback = str2func(varargin{1}); 36 36 end … … 48 48 %------------------------------------------------------------------------ 49 49 global nb_builtin 50 51 %% look at the existing figues in the work space 50 52 browse_fig(handles.list_fig) 51 53 52 % Choose default command line output for get_field54 %% Choose default command line output for get_field 53 55 handles.output = hObject; 54 56 55 % Update handles structure57 %% Update handles structure 56 58 guidata(hObject, handles); 57 59 58 %ACTION menu: builtin fcts 59 menu_str={'PLOT';'FFT';'filter_band';'histogram'}; %list of functions included in 'get_field.m' 60 %% activate the mouse action function: visualise the current field on work space by right click action 61 set(hObject,'WindowButtonUpFcn',{@mouse_up_gui,handles}) 62 63 %% prepare the list of builtin fcts and set their paths 64 menu_str={'PLOT';'FFT';'filter_band';'histogram'}; %list of functions included by default in 'get_field.m' 60 65 nb_builtin=numel(menu_str); 61 66 path_uvmat=fileparts(which('uvmat'));%path of the function 'uvmat' … … 72 77 end 73 78 rmpath(fullfile(path_uvmat,'get_field')) 74 75 79 dir_perso=prefdir; 76 80 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); … … 102 106 set(handles.path_action,'String',fullfile(path_uvmat,'get_field')) 103 107 set(handles.ACTION,'Value',1)% PLOT option selected 104 set(hObject,'WindowButtonUpFcn',{@mouse_up_gui,handles})%set mouse click action function 105 if exist('filename','var')& ischar(filename) 108 109 %% settings for 'slave' mode, called by uvamt, or 'master' mode 110 if exist('filename','var') && ischar(filename) %transfer input file name in slave mode 106 111 set(handles.inputfile,'String',filename)% prefill the input file name 107 112 set(handles.inputfile,'Enable','off')% desactivate the input file edit box … … 113 118 set(handles.MenuHelp,'Visible','off') 114 119 inputfile_Callback(hObject, eventdata, handles) 115 else 120 else %master mode 116 121 set(handles.inputfile,'String','') 117 end 118 %ACTION_Callback(hObject, eventdata, handles) 119 if exist('Field','var') & isstruct(Field) 122 % load the list of previously browsed files for the upper bar menu Open 123 dir_perso=prefdir; 124 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% 125 if exist(profil_perso,'file') 126 h=load (profil_perso); 127 if isfield(h,'MenuFile_1') 128 set(handles.MenuFile_1,'Label',h.MenuFile_1); 129 end 130 if isfield(h,'MenuFile_1') 131 set(handles.MenuFile_2,'Label',h.MenuFile_2); 132 end 133 if isfield(h,'MenuFile_1') 134 set(handles.MenuFile_3,'Label',h.MenuFile_3); 135 end 136 if isfield(h,'MenuFile_1') 137 set(handles.MenuFile_4,'Label',h.MenuFile_4); 138 end 139 if isfield(h,'MenuFile_1') 140 set(handles.MenuFile_5,'Label',h.MenuFile_5); 141 end 142 end 143 end 144 %transfer input field in slave mode 145 if exist('Field','var') && isstruct(Field) 120 146 Field_input(eventdata,handles,Field) 121 if exist('haxes','var') 122 Field.PlotAxes=haxes; 123 end 147 % if exist('haxes','var') 148 % 'TESTget' 149 % get(haxes,'Tag') 150 % Field.PlotAxes=haxes; 151 % end 124 152 set(hObject,'UserData',Field); 125 153 end 126 154 127 %load the list of previously browsed files in menus Open 128 dir_perso=prefdir; 129 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% 130 if exist(profil_perso,'file') 131 h=load (profil_perso); 132 if isfield(h,'MenuFile_1') 133 set(handles.MenuFile_1,'Label',h.MenuFile_1); 134 end 135 if isfield(h,'MenuFile_1') 136 set(handles.MenuFile_2,'Label',h.MenuFile_2); 137 end 138 if isfield(h,'MenuFile_1') 139 set(handles.MenuFile_3,'Label',h.MenuFile_3); 140 end 141 if isfield(h,'MenuFile_1') 142 set(handles.MenuFile_4,'Label',h.MenuFile_4); 143 end 144 if isfield(h,'MenuFile_1') 145 set(handles.MenuFile_5,'Label',h.MenuFile_5); 146 end 147 end 155 148 156 149 157 %------------------------------------------------------------------------ … … 822 830 end 823 831 824 % ------------------------------------------------825 % --- Executes on button press in Plot_histo.826 % RUN global histograms827 % -------------------------------------------------828 function RUN_histo_Callback(hObject, eventdata, handles)829 % hObject handle to RUN (see GCBO)830 % eventdata reserved - to be defined in a future version of MATLAB831 % handles structure with handles and user data (see GUIDATA)832 833 % time plots834 leg={};835 n=0;836 if (get(handles.cm_switch,'Value')==1)837 Uval_p=Uval_cm;838 Vval_p=Vval_cm;839 Uhist_p=Uhist_cm;840 Vhist_p=Vhist_cm;841 xlab='velocity (cm/s)';842 else843 Uval_p=Uval;844 Vval_p=Vval;845 Uhist_p=Uhist;846 Vhist_p=Vhist;847 xlab='velocity (pixels)';848 end849 if (get(handles.vector_y,'Value') == 1)850 hhh=figure(2);851 hold on852 title([filebase ', ' strindex ', ' fieldtitle])853 plot(Uval_p,Uhist_p,'b-')854 n=n+1;855 leg{n}='Uhist';856 xlabel(xlab)857 end858 if (get(handles.Vhist_input,'Value') == 1)859 hhh=figure(2);860 hold on861 title([filebase ', ' strindex ', ' fieldtitle])862 plot(Vval_p,Vhist_p,'r-')863 n=n+1;864 leg{n}='Vhist';865 xlabel(xlab);866 end867 if (get(handles.Chist_input,'Value') == 1)868 hhhh=figure(3);869 hold on870 title([filebase ', ' strindex ', ' fieldtitle])871 plot(Cval,Chist,'k-')872 leg{1}='Chist';873 end874 % hold off875 grid on876 legend(leg);832 % %------------------------------------------------ 833 % % --- Executes on button press in Plot_histo. 834 % %RUN global histograms 835 % %------------------------------------------------- 836 % function RUN_histo_Callback(hObject, eventdata, handles) 837 % % hObject handle to RUN (see GCBO) 838 % % eventdata reserved - to be defined in a future version of MATLAB 839 % % handles structure with handles and user data (see GUIDATA) 840 % 841 % %time plots 842 % leg={}; 843 % n=0; 844 % if (get(handles.cm_switch,'Value')==1) 845 % Uval_p=Uval_cm; 846 % Vval_p=Vval_cm; 847 % Uhist_p=Uhist_cm; 848 % Vhist_p=Vhist_cm; 849 % xlab='velocity (cm/s)'; 850 % else 851 % Uval_p=Uval; 852 % Vval_p=Vval; 853 % Uhist_p=Uhist; 854 % Vhist_p=Vhist; 855 % xlab='velocity (pixels)'; 856 % end 857 % if (get(handles.vector_y,'Value') == 1) 858 % hhh=figure(2); 859 % hold on 860 % title([filebase ', ' strindex ', ' fieldtitle]) 861 % plot(Uval_p,Uhist_p,'b-') 862 % n=n+1; 863 % leg{n}='Uhist'; 864 % xlabel(xlab) 865 % end 866 % if (get(handles.Vhist_input,'Value') == 1) 867 % hhh=figure(2); 868 % hold on 869 % title([filebase ', ' strindex ', ' fieldtitle]) 870 % plot(Vval_p,Vhist_p,'r-') 871 % n=n+1; 872 % leg{n}='Vhist'; 873 % xlabel(xlab); 874 % end 875 % if (get(handles.Chist_input,'Value') == 1) 876 % hhhh=figure(3); 877 % hold on 878 % title([filebase ', ' strindex ', ' fieldtitle]) 879 % plot(Cval,Chist,'k-') 880 % leg{1}='Chist'; 881 % end 882 % % hold off 883 % grid on 884 % legend(leg); 877 885 878 886 % %------------------------------------------------------------- … … 1028 1036 var_select=list_var{index}; 1029 1037 set(handles.attributes_txt,'String', ['attributes of ' var_select]) 1030 if isfield(Field,'VarAttribute')& length(Field.VarAttribute)>=index-11038 if isfield(Field,'VarAttribute')&& length(Field.VarAttribute)>=index-1 1031 1039 % nbline=0; 1032 1040 VarAttr=Field.VarAttribute{index-1}; … … 1050 1058 Tabchar=[{''};Tabchar]; 1051 1059 end 1060 set(handles.attributes,'Value',1);% select the first item 1052 1061 set(handles.attributes,'String',Tabchar); 1053 1062
Note: See TracChangeset
for help on using the changeset viewer.