Changeset 771 for trunk/src/series.m
- Timestamp:
- May 3, 2014, 5:20:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r770 r771 234 234 set(handles.FieldName,'Value',Param.index_fields);% selected string index 235 235 end 236 if isfield(Param,'Coord_x_str') && isfield(Param,'Coord_x_val')236 if isfield(Param,'Coord_x_str') && ischar(Param.Coord_x_str) 237 237 set(handles.Coord_x,'String',Param.Coord_x_str);% list menu fields 238 set(handles.Coord_x,'Value',Param.Coord_x_val);% selected string index239 end 240 if isfield(Param,'Coord_y_str')&& is field(Param,'Coord_y_val')238 % set(handles.Coord_x,'Value',Param.Coord_x_val);% selected string index 239 end 240 if isfield(Param,'Coord_y_str')&& ischar(Param.Coord_y_str) 241 241 set(handles.Coord_y,'String',Param.Coord_y_str);% list menu fields 242 set(handles.Coord_y,'Value',Param.Coord_y_val);% selected string index242 % set(handles.Coord_y,'Value',Param.Coord_y_val);% selected string index 243 243 end 244 244 … … 1031 1031 switch FileType 1032 1032 case {'civx','civdata'} 1033 FieldList=set_field_list('U','V'); 1034 set(handles.FieldName,'String',[FieldList;{'C'};{'get_field...'}]);%standard menu for civx data 1035 set(handles.FieldName,'Value',1) % set menu to 'velocity 1036 set(handles.Coord_x,'Value',1); 1037 set(handles.Coord_x,'String',{'X'}); 1038 set(handles.Coord_y,'Value',1); 1039 set(handles.Coord_y,'String',{'Y'}); 1033 FieldList=[set_field_list('U','V');{'C'}];%standard menu for civx data 1034 % set(handles.Coord_x,'Value',1); 1035 set(handles.Coord_x,'String','X'); 1036 % set(handles.Coord_y,'Value',1); 1037 set(handles.Coord_y,'String','Y'); 1040 1038 case 'netcdf' 1041 set(handles.FieldName,'Value',1) 1042 set(handles.FieldName,'String',{'get_field...'}) 1043 if isempty(i2_series) 1044 i2=[]; 1039 ind_x=find(strcmp(get(handles.Coord_x,'String'),FileInfo.ListVarName)); 1040 if isempty(ind_x) 1041 FieldList={};% new kind of file opened, we need to pick variables with get_field... 1042 set(handles.Coord_x,'String','') 1043 set(handles.Coord_y,'String','') 1045 1044 else 1046 i2=i2_series(1,ref_j+1,ref_i+1); 1047 end 1048 if isempty(j1_series) 1049 j1=[];j2=[]; 1050 else 1051 j1=j1_series(1,ref_j+1,ref_i+1); 1052 if isempty(j2_series) 1053 j2=[]; 1045 FileInfo.ListVarName(ind_x)=[];%remove coord-x from the list of variables to display 1046 ind_y=find(strcmp(get(handles.Coord_y,'String'),FileInfo.ListVarName)); 1047 if isempty(ind_y) 1048 FieldList={};% new kind of file opened, we need to pick variables with get_field... 1049 set(handles.Coord_x,'String','') 1050 set(handles.Coord_y,'String','') 1054 1051 else 1055 j2=j2_series(1,ref_j+1,ref_i+1); 1052 FileInfo.ListVarName(ind_y)=[];%remove coord-y from the list of variables to display 1053 FieldList=(FileInfo.ListVarName)'; 1056 1054 end 1057 end 1058 % FieldName_Callback([], [], handles) 1055 end 1059 1056 otherwise 1060 1057 set(handles.FieldName,'Value',1) % set menu to 'image' 1061 1058 set(handles.FieldName,'String',{'image'}) 1062 set(handles.Coord_x,'Value',1); 1063 set(handles.Coord_x,'String',{'AX'}); 1064 set(handles.Coord_y,'Value',1); 1065 set(handles.Coord_y,'String',{'AY'}); 1066 end 1067 1059 set(handles.Coord_x,'String','AX'); 1060 set(handles.Coord_y,'String','AY'); 1061 end 1062 if ismember(FileType,{'civx','civdata','netcdf'}) 1063 PrevMenu=get(handles.FieldName,'String'); 1064 PrevMenu=PrevMenu(get(handles.FieldName,'Value')); 1065 FieldValue=[]; 1066 for ilist=1:numel(PrevMenu) 1067 index_menu=find(strcmp(PrevMenu{ilist},FieldList)); 1068 if ~isempty(index_menu) 1069 FieldValue=[FieldValue index_menu]; 1070 end 1071 end 1072 if isempty(FieldValue) 1073 FieldValue=1; 1074 end 1075 set(handles.FieldName,'Value',FieldValue) 1076 set(handles.FieldName,'String',[FieldList;{'get_field...'}]) 1077 end 1078 1079 1068 1080 %------------------------------------------------------------------------ 1069 1081 function num_first_i_Callback(hObject, eventdata, handles) … … 2311 2323 Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2); 2312 2324 if exist(FirstFileName,'file') 2325 ParamIn.Title='get_field: pick input variables and coordinates for series processing'; 2313 2326 ParamIn.SeriesInput=1; 2314 2327 GetFieldData=get_field(FirstFileName,ParamIn); … … 2322 2335 ['norm(' UName ',' VName ')'];... 2323 2336 UName;VName}; 2324 case {'scalar' ,'pick variables'}2337 case {'scalar'} 2325 2338 FieldList=GetFieldData.PanelScalar.scalar; 2326 2339 YName={GetFieldData.Coordinates.Coord_y}; … … 2328 2341 FieldList={FieldList}; 2329 2342 end 2330 case '1D plot'2331 YName=GetFieldData.PanelOrdinate.ordinate;2332 2343 case 'civdata...' 2333 FieldList=[set_field_list('U','V' ,'C') ;{'C'}];2334 set(handles.FieldName,'Value', 2) % set menu to 'velocity2344 FieldList=[set_field_list('U','V') ;{'C'}]; 2345 set(handles.FieldName,'Value',1) % set menu to 'velocity 2335 2346 XName='X'; 2336 2347 YName='y'; … … 2340 2351 set(handles.FieldName,'String',[FieldList; {'get_field...'}]); 2341 2352 if ~strcmp(GetFieldData.FieldOption,'civdata...') 2342 set(handles.FieldName,'Value', [1:numel(FieldList)])%select all input fields by default2353 set(handles.FieldName,'Value',1:numel(FieldList))%select all input fields by default 2343 2354 set(handles.VelType,'visible','off') 2344 2355 XName=GetFieldData.Coordinates.Coord_x; 2356 YName=GetFieldData.Coordinates.Coord_y; 2345 2357 TimeNameStr=GetFieldData.Time.SwitchVarIndexTime; 2346 2358 switch TimeNameStr … … 2363 2375 end 2364 2376 end 2365 set(handles.Coord_x,'String',{XName})2377 set(handles.Coord_x,'String',XName) 2366 2378 set(handles.Coord_y,'String',YName) 2367 2379 end
Note: See TracChangeset
for help on using the changeset viewer.