Changeset 580 for trunk/src/uvmat.m
- Timestamp:
- Mar 7, 2013, 1:47:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r579 r580 1025 1025 set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data 1026 1026 set(handles_Fields,'Value',2) % set menu to 'velocity 1027 if index==1 1028 set(handles.FieldName_1,'Value',1); 1029 set(handles.FieldName_1,'String',[{''};{'image'};FieldList;{'get_field...'}]);%standard menu for civx data reproduced for the second field 1030 end 1027 1031 set(handles.ColorScalar,'Value',1) 1028 1032 set(handles.ColorScalar,'String',ColorList) … … 2138 2142 return 2139 2143 end 2140 Name=FileName_1;2144 % Name=FileName_1; 2141 2145 switch UvData.FileType{2} 2142 2146 case {'civx','civdata','netcdf'}; … … 2188 2192 test_keepdata_1=0;% test for keeping the previous stored data if the input files are unchanged 2189 2193 if ~isequal(NomType_1,'*')&& isfield(UvData,'FileName_1') 2190 test_keepdata_1= strcmp(FileName_1,UvData.FileName_1) ; %&& strcmp(FieldName_1,UvData.FieldName_1);2194 test_keepdata_1= strcmp(FileName_1,UvData.FileName_1) ; 2191 2195 end 2192 2196 if test_keepdata_1 … … 2199 2203 ParamIn_1.GUIName='get_field_1'; 2200 2204 end 2201 [Field{2},ParamOut_1,errormsg] = read_field( Name,UvData.FileType{2},ParamIn_1,frame_index_1);2205 [Field{2},ParamOut_1,errormsg] = read_field(FileName_1,UvData.FileType{2},ParamIn_1,frame_index_1); 2202 2206 if ~isempty(errormsg) 2203 2207 errormsg=['error in reading ' FieldName_1 ' in ' FileName_1 ': ' errormsg]; … … 2256 2260 test_veltype_1=0; 2257 2261 if isempty(FileName_1) 2258 % set(handles.FieldName_1,'Value',1); %update the field menu2259 % if isstruct(ParamOut)2260 % set(handles.FieldName_1,'String',[{''};ParamOut.FieldList]); %update the field menu2261 % end2262 % set(handles.FieldName_1,'Value',1); %update the field menu 2263 % if isstruct(ParamOut) 2264 % set(handles.FieldName_1,'String',[{''};ParamOut.FieldList]); %update the field menu 2265 % end 2262 2266 elseif ~test_keepdata_1 2263 2267 if (~strcmp(UvData.FileType{2},'netcdf')&&~strcmp(UvData.FileType{2},'civdata')&&~strcmp(UvData.FileType{2},'civx'))|| isequal(FieldName_1,'get_field...') … … 2273 2277 % update the second field menu: the same quantity 2274 2278 if isstruct(ParamOut_1) 2275 set(handles.FieldName_1,'String',[{''};ParamOut_1.FieldList]); %update the field menu 2276 % display the FieldName menu from the input file and pick the selected one: 2277 field_index=strcmp(ParamOut_1.FieldName,ParamOut_1.FieldList); 2278 set(handles.FieldName_1,'Value',find(field_index,1)+1) 2279 end 2280 2279 % set(handles.FieldName_1,'String',[{''};ParamOut_1.FieldList]); %update the field menu 2280 % display the FieldName menu from the input file and pick the selected one: 2281 FieldList=get(handles.FieldName_1,'String'); 2282 field_index=strcmp(ParamOut_1.FieldName,FieldList); 2283 if ~isempty(field_index) 2284 set(handles.FieldName_1,'Value',find(field_index,1)) 2285 end 2286 end 2281 2287 end 2282 2288 if test_veltype||test_veltype_1 2283 2289 set(handles.FixVelType,'Visible','on') 2284 2290 else 2285 2291 set(handles.FixVelType,'Visible','off') 2286 2292 end 2287 2293 … … 2963 2969 set(handles.VelType_1,'Value',1);%set to blank state 2964 2970 set(handles.num_Opacity,'String','')% desactivate opacity setting 2971 FieldList=get(handles.FieldName,'String'); 2972 if numel(FieldList)>1 % if a choice of fields exists 2973 set(handles.FieldName_1,'Value',1)% set second field choice to blank 2974 set(handles.FieldName_1,'String',[{''};FieldList])% reproduce the menu FieldName plus a blank option 2975 else 2976 set(handles.FieldName_1,'String',{''})% set second field choice to blank 2977 end 2965 2978 if ~strcmp(get(handles.VelType,'Visible'),'on') 2966 2979 set(handles.VelType_1,'Visible','off') … … 3194 3207 end 3195 3208 otherwise 3196 if check_new3197 UvData.FileType{2}=UvData.FileType{1};3209 check_refresh=1; 3210 if check_new% if a second field was not previously entered, we just read another field in the first input file 3198 3211 set(handles.FileIndex_1,'String',get(handles.FileIndex,'String')) 3199 3212 set(handles.FileExt_1,'String',get(handles.FileExt,'String')) 3213 3214 UvData.FileType{2}=UvData.FileType{1}; 3215 UvData.XmlData{2}= UvData.XmlData{1}; 3216 transform=get(handles.path_transform,'UserData'); 3217 if (~isa(transform,'function_handle')||nargin(transform)<3) 3218 set(handles.uvmat,'UserData',UvData) 3219 set(handles.transform_fct,'value',2); % set transform fct to 'sub_field' if the current fct does not accept two input fields 3220 transform_fct_Callback(hObject, eventdata, handles)% activate transform_fct_Callback and refresh current plot 3221 check_refresh=0; 3222 end 3200 3223 end 3201 3224 if ~isequal(field,'image') … … 3205 3228 end 3206 3229 set(handles.uvmat,'UserData',UvData) 3207 if ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1)) 3230 3231 if check_refresh && ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1)) 3208 3232 run0_Callback(hObject, eventdata, handles) 3209 3233 end … … 3280 3304 FileName_1='';% we plot the first input field without the second field 3281 3305 set(handles.SubField,'Value',0) 3282 SubField_Callback(hObject, eventdata, handles)% activate SubField_Callback and refresh current display, removing the second field3306 SubField_Callback(hObject, eventdata, handles)% activate SubField_Callback and refresh current plot, removing the second field 3283 3307 elseif get(handles.SubField,'Value')% if subfield is already 'on' 3284 3308 FileName_1=[fullfile(RootPath_1,SubDir_1,RootFile_1) FileIndex_1 FileExt_1];% name of the second input file 3285 check_refresh=1;%will refresh the current display3309 check_refresh=1;%will refresh the current plot 3286 3310 else% we introduce the same file (with a different field) for the second series 3287 3311 FileName_1=FileName;% we compare two fields in the same file … … 3291 3315 transform=get(handles.path_transform,'UserData'); 3292 3316 if (~isa(transform,'function_handle')||nargin(transform)<3) 3293 set(handles.transform_fct,'value',2); % set transform to sub_field if the current fct doe not accept two input fields 3294 transform_fct_Callback(hObject, eventdata, handles)% activate transform_fct_Callback and refresh current display 3317 set(handles.uvmat,'UserData',UvData) 3318 set(handles.transform_fct,'value',2); % set transform fct to 'sub_field' if the current fct does not accept two input fields 3319 transform_fct_Callback(hObject, eventdata, handles)% activate transform_fct_Callback and refresh current plot 3295 3320 else 3296 3321 check_refresh=1; … … 3298 3323 end 3299 3324 3300 % refresh the current displayif it has not been done previously3325 % refresh the current plot if it has not been done previously 3301 3326 if check_refresh 3302 3327 UvData.FileName_1='';% desactivate the use of a constant second file … … 3321 3346 end 3322 3347 3323 %----------------------------------------------- 3348 3349 %----------------------------------------------------------------------- 3324 3350 % --- reset civ buttons 3325 3351 function reset_vel_type(handles_civ0,handle1) 3352 %----------------------------------------------------------------------- 3326 3353 for ibutton=1:length(handles_civ0) 3327 3354 set(handles_civ0(ibutton),'BackgroundColor',[0.831 0.816 0.784]) … … 3332 3359 end 3333 3360 3334 %------------------------------------------------------- 3361 %----------------------------------------------------------------------- 3335 3362 % --- Executes on button press in MENUVOLUME. 3336 %-------------------------------------------------------3337 3363 function VOLUME_Callback(hObject, eventdata, handles) 3364 %----------------------------------------------------------------------- 3338 3365 %errordlg('command VOL not implemented yet') 3339 3366 if ishandle(handles.UVMAT_title)
Note: See TracChangeset
for help on using the changeset viewer.