Changeset 295 for trunk/src/uvmat.m
- Timestamp:
- Nov 21, 2011, 5:54:40 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r292 r295 2078 2078 return 2079 2079 end 2080 %Ext=get(handles.FileExt,'String');2081 2080 NomType=get(handles.FileIndex,'UserData'); 2082 2081 %update the z position index … … 2275 2274 2276 2275 %% update the display menu for the first velocity type (first menuline) 2277 % veltype_handles=[handles.VelType handles.interp1 handles.filter1 handles.civ2 handles.interp2 handles.filter2];2278 % if ~isequal(FileType,'netcdf')|| isequal(FieldName,'get_field...')2279 % set(veltype_handles,'Visible','off')2280 % else% if isempty(ParamOut.VelType) && ~isequal(FieldName,'get_field...')2281 % set_veltype_display(veltype_handles,ParamOut.CivStage)%update the display of available velocity types for the first field2282 % if isempty(ParamOut.VelType)2283 % reset_vel_type(veltype_handles)2284 % else2285 % handle1=eval(['handles.' ParamOut.VelType]);2286 % reset_vel_type(veltype_handles,handle1)2287 % end2288 % end2289 2276 test_veltype=0; 2290 2277 if ~isequal(FileType,'netcdf')|| isequal(FieldName,'get_field...') … … 2309 2296 2310 2297 %% update the display menu for the second velocity type (second menuline) 2311 % if ~isempty(filename_1)2312 % veltype_handles_1=[handles.VelType_1 handles.interp1_1 handles.filter1_1 handles.civ2_1 handles.interp2_1 handles.filter2_1];2313 % if ~isequal(FileType_1,'netcdf')|| isequal(FieldName_1,'get_field...')2314 % set(veltype_handles_1,'Visible','off')2315 % %reset_vel_type(veltype_handles_1)2316 % else %if isempty(VelType_1) && ~isequal(FieldName_1,'get_field...')2317 % set_veltype_display(veltype_handles_1,ParamOut_1.CivStage)%update the display of available velocity types for the first field2318 % if isempty(ParamOut_1.VelType)2319 % reset_vel_type(veltype_handles_1)2320 % else2321 % handle1=eval(['handles.' ParamOut_1.VelType '_1']);2322 % reset_vel_type(veltype_handles_1,handle1)2323 % end2324 % end2325 % field_index=strcmp(ParamOut_1.FieldName,ParamOut_1.FieldList);2326 % set(handles.Fields_1,'String',ParamOut_1.FieldList); %update the field menu2327 % set(handles.Fields_1,'Value',find(field_index,1))2328 % end2329 2298 test_veltype_1=0; 2330 2299 if isempty(filename_1) … … 2457 2426 ZName=UvData.Field.ListVarName{VarType{imax}.coord_z}; 2458 2427 else 2459 NbDim=2;2460 end 2461 elseif numel(VarType)>=imax && numel(VarType{imax}.coord)>=NbDim && VarType{imax}.coord(NbDim)>0 %structured coordinate 2428 NbDim=2; 2429 end 2430 elseif numel(VarType)>=imax && numel(VarType{imax}.coord)>=NbDim && VarType{imax}.coord(NbDim)>0 %structured coordinate 2462 2431 XName=UvData.Field.ListVarName{VarType{imax}.coord(NbDim)}; 2463 2432 if NbDim>1 2464 2433 YName=UvData.Field.ListVarName{VarType{imax}.coord(NbDim-1)}; %structured coordinates 2465 2434 end 2466 else2467 % errormsg='input field coordinates not defined';2468 % return2469 2435 end 2470 2436 if NbDim==3 … … 2589 2555 set(handles.list_object_2,'String',list_object); 2590 2556 end 2591 % if ~isfield(UvData.Object{1},'plotaxes')2592 % UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis2593 % end2594 2557 testnewseries=UvData.NewSeries; 2595 2558 UvData.NewSeries=0;% put to 0 the test for a new field series (set by RootPath_callback) … … 2603 2566 2604 2567 %% Plot the projections on the selected projection objects 2605 2606 2568 % main projection object (uvmat display) 2607 2569 list_object=get(handles.list_object_1,'String'); … … 3158 3120 field= list_fields{index_fields(1)}; % selected string 3159 3121 if isequal(field,'get_field...') 3160 set(handles.FixVelType,'visible','off') 3161 set(handles.VelType,'visible','off') 3162 set(handles.VelType_1,'visible','off') 3163 % veltype_handles=[handles.VelType handles.interp1 handles.filter1 handles.civ2 handles.interp2 handles.filter2]; 3164 % set_veltype_display(veltype_handles,0) % unvisible civ buttons 3165 filename=read_file_boxes(handles); 3166 hget_field=findobj(allchild(0),'name','get_field'); 3167 if ~isempty(hget_field) 3168 delete(hget_field) 3169 end 3170 hget_field=get_field(filename); 3171 set(hget_field,'Name','get_field') 3172 hhget_field=guidata(hget_field); 3173 set(hhget_field.list_fig,'Value',1) 3174 set(hhget_field.list_fig,'String',{'uvmat'}) 3175 set(handles.transform_fct,'Value',1)% no transform by default 3176 set(handles.path_transform,'String','') 3122 set(handles.FixVelType,'visible','off') 3123 set(handles.VelType,'visible','off') 3124 set(handles.VelType_1,'visible','off') 3125 filename=read_file_boxes(handles); 3126 hget_field=findobj(allchild(0),'name','get_field'); 3127 if ~isempty(hget_field) 3128 delete(hget_field) 3129 end 3130 hget_field=get_field(filename); 3131 set(hget_field,'Name','get_field') 3132 hhget_field=guidata(hget_field); 3133 set(hhget_field.list_fig,'Value',1) 3134 set(hhget_field.list_fig,'String',{'uvmat'}) 3135 set(handles.transform_fct,'Value',1)% no transform by default 3136 set(handles.path_transform,'String','') 3177 3137 return %no action 3178 3138 end … … 3186 3146 [P,F,str1,str2,str_a,str_b,E,NomType]=name2display(['xxx' get(handles.FileIndex,'String') FileExt]); 3187 3147 NomTypeNew=NomType;%default 3188 if isequal(field,'image') 3189 % transform netc type to the corresponding image type 3190 % if isequal(NomType,'_i1-i2_j')||isequal(NomType,'_i_j1-j2')|| isequal(NomType,'#_ab')|| isequal(NomType,'_i1-i2') 3191 % UvData.SubDir=get(handles.SubDir,'String'); %preserve the subdir in memory 3192 % if ~isempty(UvData.SubDir) && (isequal(UvData.SubDir(1),'/')||isequal(UvData.SubDir(1),'/')) 3193 % UvData.SubDir(1)=[]; 3194 % end 3195 % set(handles.SubDir,'String','') 3196 % set(handles.FileExt,'String','.png'); 3197 if isequal(NomType,'_i1-i2_j')||isequal(NomType,'_i_j1-j2') 3198 NomTypeNew='_i_j'; 3199 elseif isequal(NomType,'#_ab') 3200 NomTypeNew='#a'; 3201 elseif isequal(NomType,'_i1-i2') 3202 NomTypeNew='_i'; 3203 end 3204 imagename=name_generator(FileBase,str2double(str1),str2double(str_a),'.png',NomTypeNew,1,str2double(str2),str2double(str_b),''); 3205 if ~exist(imagename,'file') 3206 [FileName,PathName] = uigetfile( ... 3207 {'*.png;*.jpg;*.tif;*.avi;*.AVI;*.vol', ' (*.png, .tif, *.avi,*.vol)'; 3148 if isequal(field,'image') 3149 if isequal(NomType,'_i1-i2_j')||isequal(NomType,'_i_j1-j2') 3150 NomTypeNew='_i_j'; 3151 elseif isequal(NomType,'#_ab') 3152 NomTypeNew='#a'; 3153 elseif isequal(NomType,'_i1-i2') 3154 NomTypeNew='_i'; 3155 end 3156 imagename=name_generator(FileBase,str2double(str1),str2double(str_a),'.png',NomTypeNew,1,str2double(str2),str2double(str_b),''); 3157 if ~exist(imagename,'file') 3158 [FileName,PathName] = uigetfile( ... 3159 {'*.png;*.jpg;*.tif;*.avi;*.AVI;*.vol', ' (*.png, .tif, *.avi,*.vol)'; 3208 3160 '*.jpg',' jpeg image files'; ... 3209 3161 '*.png','.png image files'; ... … … 3212 3164 '*.vol','.volume images (png)'; ... 3213 3165 '*.*', 'All Files (*.*)'}, ... 3214 'Pick an image',imagename); 3215 % display the selected field and related information 3216 imagename=[PathName FileName]; 3217 end 3218 display_file_name(hObject, eventdata, handles,imagename)%display the image 3219 return 3220 % end 3221 % veltype_handles=[handles.VelType handles.interp1 handles.filter1 handles.civ2 handles.interp2 handles.filter2]; 3222 % set_veltype_display(veltype_handles,0) % unvisible civ buttons 3166 'Pick an image',imagename); 3167 imagename=[PathName FileName]; 3168 end 3169 % display the selected field and related information 3170 display_file_name(hObject, eventdata, handles,imagename)%display the image 3171 return 3223 3172 else 3224 3173 ext=get(handles.FileExt,'String'); 3225 3174 if ~isequal(ext,'.nc') %find the new NomType if the previous display was not already a netcdf file 3226 3227 {'*.nc', ' (*.nc)';3175 [FileName,PathName] = uigetfile( ... 3176 {'*.nc', ' (*.nc)'; 3228 3177 '*.nc',' netcdf files'; ... 3229 3178 '*.*', 'All Files (*.*)'}, ... 3230 'Pick a netcdf file',FileBase); 3231 % display the selected field and related information3232 filename=[PathName FileName];3179 'Pick a netcdf file',FileBase); 3180 filename=[PathName FileName]; 3181 % display the selected field and related information 3233 3182 display_file_name(hObject, eventdata, handles,filename) 3234 3183 return 3235 % MenuBrowse_Callback(hObject, eventdata, handles) 3236 end 3237 % if isequal(field,'vort') || isequal(field,'div') || isequal(field,'strain') 3238 % % set(handles.VelType,'BackgroundColor',[0.702 0.702 0.702]) % put their color to grey 3239 % % set(handles.civ2,'BackgroundColor',[0.702 0.702 0.702]) 3240 % % set(handles.interp1,'BackgroundColor',[0.702 0.702 0.702]) 3241 % % set(handles.interp2,'BackgroundColor',[0.702 0.702 0.702]) 3242 % elseif isequal(field,'more...'); 3243 % set(handles.VelType,'BackgroundColor',[0.702 0.702 0.702]) % put their color to grey 3244 % set(handles.civ2,'BackgroundColor',[0.702 0.702 0.702]) 3245 % str=calc_field;%get the list of available scalars by the function calc_scal 3246 % [ind_answer] = listdlg('PromptString','Select a file:',... 3247 % 'SelectionMode','single',... 3248 % 'ListString',str); 3249 % % edit the choice in the field and action menu 3250 % scalar=cell2mat(str(ind_answer)); 3251 % menu=update_menu(handles.Fields,scalar); 3252 % menu=[{''};menu]; 3253 % set(handles.Fields_1,'String',menu);% store the selected scalar type 3254 % end 3184 end 3255 3185 end 3256 3186 indices=name_generator('',str2double(str1),str2double(str_a),'',NomTypeNew,1,str2double(str2),str2double(str_b),''); … … 3270 3200 end 3271 3201 setfield(handles);% update the field structure ('civ1'....) 3272 3273 3202 if ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1)) 3274 3203 run0_Callback(hObject, eventdata, handles) … … 3294 3223 %read the rootfile input display 3295 3224 [FileName,RootPath,FileBase,FileIndices,FileExt_1]=read_file_boxes_1(handles); 3296 [P,F,str1,str2,str_a,str_b,E,NomType ]=name2display(['xxx' get(handles.FileIndex,'String') FileExt_1]);3225 [P,F,str1,str2,str_a,str_b,E,NomType_1]=name2display(['xxx' get(handles.FileIndex,'String') FileExt_1]); 3297 3226 % if isempty(FileExt_prev)|| strcmp(FileExt_prev,'') 3298 3227 % FileExt_1=get(handles.FileExt,'String'); … … 3300 3229 % FileExt_1=FileExt_prev; 3301 3230 % end 3302 NomType_1=get(handles.FileIndex_1,'UserData');3231 % NomType_1=get(handles.FileIndex_1,'UserData'); 3303 3232 if isempty(NomType_1)|| strcmp(NomType_1,'') 3304 NomType_1=get(handles.FileIndex,'UserData'); 3233 [FileName,RootPath,FileBase,FileIndices,FileExt_1]=read_file_boxes(handles); 3234 [P,F,str1,str2,str_a,str_b,E,NomType_1]=name2display(['xxx' get(handles.FileIndex,'String') FileExt_1]); 3235 % NomType_1=get(handles.FileIndex,'UserData'); 3305 3236 end 3306 3237 NomTypeNew=NomType_1;%default … … 3372 3303 set(handles.SubDir_1,'Visible','on') 3373 3304 if ~isequal(FileExt_1,'.nc') %find the new NomType if the previous display was not already a netcdf file 3374 % veltype_handles=[handles.VelType_1 handles.interp1_1 handles.filter1_1 handles.civ2_1 handles.interp2_1 handles.filter2_1];3375 % set_veltype_display(veltype_handles,6); % make all civ buttons visible3376 3305 RootPath_1=get(handles.RootPath_1,'String'); 3377 3306 RootFile_1=get(handles.RootFile_1,'String'); … … 4259 4188 set(handles.VecColBar,'Cdata',A) 4260 4189 4261 4262 4190 %------------------------------------------------------------------- 4263 4191 function update_plot(handles) 4264 4192 %------------------------------------------------------------------- 4265 haxes= handles.axes3;4266 4193 UvData=get(handles.uvmat,'UserData'); 4267 AxeData=UvData.axes3; 4268 %PlotParam=read_plot_param(handles); 4194 AxeData=UvData.axes3;% retrieve the current plotted data 4269 4195 PlotParam=read_GUI(handles.uvmat); 4270 [PP,PlotParamOut]= plot_field(AxeData,ha xes,PlotParam);4196 [PP,PlotParamOut]= plot_field(AxeData,handles.axes3,PlotParam); 4271 4197 write_plot_param(handles,PlotParamOut); %update the auto plot parameters 4272 4198 … … 4649 4575 end 4650 4576 end 4651 if isfield(ObjectData,'Coord')& isfield(ObjectData,'Style')4577 if isfield(ObjectData,'Coord')&& isfield(ObjectData,'Style') 4652 4578 if isequal(ObjectData.Style,'polygon') 4653 4579 X=ObjectData.Coord(:,1); … … 4722 4648 function MenuGrid_Callback(hObject, eventdata, handles) 4723 4649 %------------------------------------------------------------------------ 4724 %UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface4725 4726 4650 %suppress the other options if grid is chosen 4727 4651 set(handles.edit_vect,'Value',0) … … 4735 4659 val=get(handles.transform_fct,'Value'); 4736 4660 set_grid(FileName,CoordList{val});% call the set_object interface 4737 %set(handles.uvmat,'UserData',UvData);4738 4661 4739 4662 %------------------------------------------------------------------------ … … 4774 4697 param.index_fields_1=param.index_fields_1-1; 4775 4698 end 4776 % if isequal(get(handles.VelType,'Visible'),'on')4777 % param.VelTypeMenu=get(handles.VelType,'String');4778 % param.VelTypeIndex=get(handles.VelType,'Value');4779 % end4780 % param.civ1=get(handles.VelType,'Value');4781 % param.civ2=get(handles.civ2,'Value');4782 % param.interp1=get(handles.interp1,'Value');4783 % param.interp2=get(handles.interp2,'Value');4784 % param.filter1=get(handles.filter1,'Value');4785 % param.filter2=get(handles.filter2,'Value');4786 4699 param.menu_coord_str=get(handles.transform_fct,'String'); 4787 4700 param.menu_coord_val=get(handles.transform_fct,'Value'); 4788 4789 4701 series(param); %run the series interface 4790 4702
Note: See TracChangeset
for help on using the changeset viewer.