Changeset 221
- Timestamp:
- Mar 12, 2011, 11:11:01 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_up.m
r210 r221 201 201 map=colormap(currentaxes); 202 202 colormap(map);%transmit the current colormap to the zoom fig 203 set(hfig2,'Position',[0.2 0.33 0.6 0.6]); 203 set(hfig2,'Position',[0.2 0.33 0.6 0.6]); 204 204 set(hfig2,'Unit','normalized') 205 205 set(hfig2,'KeyPressFcn',{@keyboard_callback,handles})%set keyboard action function … … 229 229 set(hcol_new,'Yticklabel',YTicklabel); 230 230 end 231 end 232 % if ishandle(AxeData.ZoomAxes) 233 % hnew_rect=findobj(AxeData.ZoomAxes,'Tag','rect_zoom'); 234 % if ~isempty(hnew_rect) 235 % delete(hnew_rect); 236 237 ChildAxeData.CurrentRectZoom=[]; % no rect zoom in the new window 238 ChildAxeData.Drawing='off'; 239 ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle as a 'parent' associated to the new axe 240 PosRect=CurrentOrigin; 241 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 242 set(AxeData.ZoomAxes,'Xlim',[PosRect(1) xy(1,1)]) 243 set(AxeData.ZoomAxes,'Ylim',[PosRect(2) xy(1,2)]) 244 % end 231 end 232 ChildAxeData.CurrentRectZoom=[]; % no rect zoom in the new window 233 ChildAxeData.Drawing='off'; 234 ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle as a 'parent' associated to the new axe 235 PosRect=CurrentOrigin; 236 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 237 set(AxeData.ZoomAxes,'Xlim',[PosRect(1) xy(1,1)]) 238 set(AxeData.ZoomAxes,'Ylim',[PosRect(2) xy(1,2)]) 245 239 set(AxeData.ZoomAxes,'UserData',ChildAxeData);%update the AxeData of the new axes 246 240 end … … 253 247 xlim=get(currentaxes,'XLim'); 254 248 ylim=get(currentaxes,'YLim'); 249 % if left mouse button has been pressed, zoom in by a factor of 2 255 250 if isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed, zoom in by a factor of 2 256 251 xlim(1)=0.5*xy(1,1)+0.5*xlim(1); … … 260 255 ylim(1)=0.5*xy(1,2)+0.5*ylim(1); 261 256 set(currentaxes,'YLim',ylim) 262 %zoom out by a factor of 2 out when the right mouse button has been used263 else %if isequal(get(currentfig,'SelectionType'),'alt'); %if right button has been pressed257 % if right mouse button has been pressed, zoom out by a factor of 2 258 else 264 259 xlim(1)=2*xlim(1)-xy(1,1); 265 260 xlim(2)=2*xlim(2)-xy(1,1); 266 261 ylim(1)=2*ylim(1)-xy(1,2); 267 262 ylim(2)=2*ylim(2)-xy(1,2); 268 % ylim_new(1)=(1+alpha)*ylim(1)/2+(1-alpha)*ylim(2)/2;269 % ylim_new(2)=(1-alpha)*ylim(1)/2+(1+alpha)*ylim(2)/2;270 263 if isfield(AxeData,'RangeX')&& isfield(AxeData,'RangeY') 264 'TESTup' 265 AxeData 271 266 xlim(1)=max(AxeData.RangeX(1),xlim(1)); 272 267 xlim(2)=min(AxeData.RangeX(2),xlim(2)); 273 268 ylim(1)=max(AxeData.RangeY(1),ylim(1)); 274 269 ylim(2)=min(AxeData.RangeY(2),ylim(2)); 270 % desactivate the zoom if the full field is visible within the axes 275 271 if isequal(xlim,AxeData.RangeX) && isequal(ylim,AxeData.RangeY) 276 272 set(hhuvmat.zoom,'Value',0) … … 280 276 end 281 277 end 278 xlim 279 ylim 282 280 set(currentaxes,'XLim',xlim) 283 281 set(currentaxes,'YLim',ylim) … … 287 285 end 288 286 end 289 % if isfield(AxeData,'ParentRect')% update the position of the parent rectangle represneting the field290 % hparentrect=AxeData.ParentRect;291 % xlim=get(currentaxes,'XLim');292 % ylim=get(currentaxes,'YLim');293 % rect([1 2])=[xlim(1) ylim(1)];294 % rect([3 4])=[xlim(2)-xlim(1) ylim(2)-ylim(1)];295 % set(hparentrect,'Position',rect)296 287 if isfield(AxeData,'LimEditBox')&& AxeData.LimEditBox% update display of the GUI containing the axis (uvmat or view_field) 297 288 set(hhcurrentfig.MinX,'String',num2str(xlim(1))) … … 327 318 Tabchar=[Tabchar ;{'......'}]; 328 319 set(h_ListCoord,'String',Tabchar) 329 % coord_str=Coord{index_point}; %current line (string)330 % k=findstr('|',coord_str);%find separator indices on the string331 % blanks=blank332 % xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates333 % if numel(k)>=3334 % coord_str=[coord_str(1:k(3)-1) ' | ' num2str(xy(1,1),4) ' | ' num2str(xy(1,2),4)]; %update the pixel information while preserving phys coord335 % else336 % coord_str=[ ' | ' ' | ' ' | ' num2str(xy(1,1),4) ' | ' num2str(xy(1,2),4)];337 % end338 % Coord{index_point}=coord_str;339 % set(h_ListCoord,'String',Coord)340 % data=read_geometry_calib(Coord);%transform char cell to numbers341 320 set(hh,'XData',data.Coord(:,4)) 342 321 set(hh,'YData',data.Coord(:,5)) … … 344 323 end 345 324 end 346 347 325 348 326 %% finalising ruler … … 383 361 currentobj=gco;%default 384 362 end 385 if ((nbselect==0) && isequal(get(currentobj,'Type'),'axes')) || isequal(currentobj,huvmat)386 currentfig=get(currentobj,'parent');387 figname=get(currentfig,'name');388 eval(['global Data_' figname])389 eval(['Data_' figname '=get(currentobj,''UserData'')']);390 evalin('base',['global Data_' figname])%make CurData global in the workspace391 objtype=get(currentobj,'Type');392 display(['UserData of ' objtype ':'])393 evalin('base',['Data_' figname]) %display CurData in the workspace394 commandwindow %brings the Matlab command window to the front395 end363 % if ((nbselect==0) && isequal(get(currentobj,'Type'),'axes')) || isequal(currentobj,huvmat) 364 % currentfig=get(currentobj,'parent'); 365 % figname=get(currentfig,'name'); 366 % eval(['global Data_' figname]) 367 % eval(['Data_' figname '=get(currentobj,''UserData'')']); 368 % evalin('base',['global Data_' figname])%make CurData global in the workspace 369 % objtype=get(currentobj,'Type'); 370 % display(['UserData of ' objtype ':']) 371 % evalin('base',['Data_' figname]) %display CurData in the workspace 372 % commandwindow %brings the Matlab command window to the front 373 % end 396 374 end 397 375 -
trunk/src/name_generator.m
r138 r221 272 272 num_i1=str2double(field_count); 273 273 num_i2=str2double(str2); 274 num_j1=stra2double(str_a); 275 num_j2=stra2double(str_b); 274 if isnan(num_i2) 275 num_i2=num_i1; 276 end 277 num_j1=stra2num(str_a); 278 num_j2=stra2num(str_b); 276 279 pathname=fileparts(filebasesub);% CORRIGE LE 6 JUIN (ETAIT DESACTIVE) 277 280 filename=fullfile(pathname,dirpair(indpair).name); -
trunk/src/plot_field.m
r210 r221 240 240 msgbox_uvmat('ERROR', errormsg) 241 241 end 242 if isfield(PlotParamOut,'MinX') 243 set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX]) 244 set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY]) 245 AxeData.RangeX=[PlotParamOut.MinX PlotParamOut.MaxX]; 246 AxeData.RangeY=[PlotParamOut.MinY PlotParamOut.MaxY]; 242 if isfield(PlotParamOut,'RangeX')&& isfield(PlotParamOut,'RangeY') 243 % 'TESTplot' 244 % haxes 245 % PlotParamOut.MinX 246 % PlotParamOut.MaxY 247 % set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX]) 248 % set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY]) 249 AxeData.RangeX=PlotParamOut.RangeX;%'[PlotParamOut.MinX PlotParamOut.MaxX]; 250 AxeData.RangeY=PlotParamOut.RangeY;%[PlotParamOut.MinY PlotParamOut.MaxY] 247 251 end 248 252 … … 508 512 509 513 %% determine axes bounds 510 fix_lim=isfield(PlotParam,'FixLimits') && PlotParam.FixLimits; 514 PlotParamOut.RangeX=[min(XMin) max(XMax)]; 515 PlotParamOut.RangeY=[min(YMin_cell) max(YMax_cell)]; 516 fix_lim=isfield(PlotParam,'FixLimits') && PlotParam.FixLimits; 511 517 if fix_lim 512 518 if ~isfield(PlotParam,'MinX')||~isfield(PlotParam,'MaxX')||~isfield(PlotParam,'MinY')||~isfield(PlotParam,'MaxY') 513 519 fix_lim=0; %free limits if lits are not set, 514 end %else PlotParamOut.XMin =PlotParam.XMin...520 end 515 521 end 516 522 if ~fix_lim … … 1074 1080 end %else PlotParamOut.XMin =PlotParam.XMin... 1075 1081 end 1076 if ~fix_lim1082 % if ~fix_lim 1077 1083 XMin=[]; 1078 1084 XMax=[]; … … 1091 1097 YMax=[YMax max(vec_Y)]; 1092 1098 end 1099 PlotParamOut.RangeX=[min(XMin) max(XMax)]; %range of x, to be stored in the user data of the plot axes 1100 PlotParamOut.RangeY=[min(YMin) max(YMax)]; %range of x, to be stored in the user data of the plot axes 1101 if ~fix_lim 1093 1102 PlotParamOut.MinX=min(XMin); 1094 1103 PlotParamOut.MaxX=max(XMax); … … 1102 1111 end 1103 1112 end 1104 % if Ylim(2)>Ylim(1)1105 % set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate1106 % end1107 % end1108 % adjust the size of the plot to include the whole field, except if PlotParam.FixLimits=11109 % if ~(isfield(PlotParam,'FixLimits') && PlotParam.FixLimits) && test_lim1110 % PlotParamOut.MinX=Xlim(1);1111 % PlotParamOut.MaxX=Xlim(2);1112 % PlotParamOut.MinY=Ylim(1);1113 % PlotParamOut.MaxY=Ylim(2);1114 % if Xlim(2)>Xlim(1)1115 % set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates1116 % end1117 % if Ylim(2)>Ylim(1)1118 % set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate1119 % end1120 % end1121 1122 1113 set(haxes,'YDir','normal') 1123 1114 set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']); -
trunk/src/read_civxdata.m
r206 r221 111 111 test_civ2=isequal(VelTypeOut,'civ2')||isequal(VelTypeOut,'interp2')||isequal(VelTypeOut,'filter2'); 112 112 Field.Time=0; %default 113 Field.TimeUnit='s'; 113 114 if test_civ1 114 115 if isfield(Field,'absolut_time_T0') … … 162 163 end 163 164 List(ind_remove)=[]; 164 Field.ListGlobalAttribute=[{'NbCoord'},{'NbDim'} List {'Time',' CivStage','CoordUnit'}];165 Field.ListGlobalAttribute=[{'NbCoord'},{'NbDim'} List {'Time','TimeUnit','CivStage','CoordUnit'}]; 165 166 Field.CoordUnit='pixel'; 166 167 -
trunk/src/read_field.m
r186 r221 75 75 if ~test_civx% read the field names on the interface get_field. 76 76 hget_field=findobj(allchild(0),'Name',GUIName);%find the get_field... GUI 77 if isempty(hget_field) 77 if isempty(hget_field)% open the GUI get_field if it is not found 78 78 hget_field= get_field(ObjectName);%open the get_field GUI 79 set(hget_field,'Name',GUIName) 79 set(hget_field,'Name',GUIName)%update the name of get_field (e.g. get_field_1) 80 80 end 81 81 hhget_field=guidata(hget_field); 82 82 %% update the get_field GUI 83 set(hhget_field.inputfile,'String',ObjectName) 83 84 set(hhget_field.list_fig,'Value',1) 84 85 funct_list=get(hhget_field.ACTION,'UserData'); -
trunk/src/uvmat.m
r215 r221 948 948 set(handles.frame_j,'Visible',state_j); 949 949 set(handles.j_text,'Visible',state_j); 950 if strcmp(state_j,'on') 951 set(handles.fix_pair,'Visible','on') 952 else 953 set(handles.fix_pair,'Visible','off') 954 end 950 955 951 956 %% view the field … … 1386 1391 set(handles.scan_i,'Value',0) 1387 1392 set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784]) 1388 NomType=get(handles.FileIndex,'UserData') ;1393 NomType=get(handles.FileIndex,'UserData') 1389 1394 switch NomType 1390 1395 case {'_i_j1-j2','#_ab','%3dab'},% pair with j index … … 2115 2120 index_fields=get(handles.Fields,'Value');% selected string index 2116 2121 FieldName= list_fields{index_fields}; % selected field 2117 if ~strcmp(FieldName,'get_field...') % read the field names on the interface get_field...2118 VelType=setfield(handles); 2122 if ~strcmp(FieldName,'get_field...') 2123 VelType=setfield(handles);% read the velocity type. 2119 2124 end 2120 2125 if strcmp(FieldName,'velocity') … … 2464 2469 UvData.Field.ZMin=ZMin; 2465 2470 else 2466 UvData.Field.Mesh= sqrt(DX*DY);2471 UvData.Field.Mesh=DX;%sqrt(DX*DY); 2467 2472 end 2468 2473 end … … 2711 2716 %% display time 2712 2717 testimedoc=0; 2718 TimeUnit=''; 2719 if isfield(UvData.Field,'Time') 2720 abstime=UvData.Field.Time;%time read from the netcdf input file 2721 end 2722 if isfield(UvData,'Field_1') && isfield(UvData.Field_1,'Time') 2723 abstime_1=UvData.Field_1.Time;%time read from the netcdf input file 2724 end 2725 if isfield(UvData.Field,'dt') 2726 dt=UvData.Field.dt;%dt read from the netcdf input file 2727 if isfield(UvData.Field,'TimeUnit') 2728 TimeUnit=UvData.Field.TimeUnit; 2729 end 2730 elseif isfield(UvData,'Field_1') && isfield(UvData.Field_1,'dt')%dt obtained from the second field if not defined in the first 2731 dt=UvData.Field_1.dt;%dt read from the netcdf input file 2732 if isfield(UvData.Field_1,'TimeUnit') 2733 TimeUnit=UvData.Field_1.TimeUnit; 2734 end 2735 end 2736 % time from xml file overset previous result 2713 2737 if isfield(UvData,'XmlData') && isfield(UvData.XmlData,'Time') 2714 2738 if isempty(num_i2)||isnan(num_i2) … … 2726 2750 dt=(UvData.XmlData.Time(num_i2,num_j2)-UvData.XmlData.Time(num_i1,num_j1)); 2727 2751 testimedoc=1; 2752 if isfield(UvData.XmlData,'TimeUnit') 2753 TimeUnit=UvData.XmlData.TimeUnit; 2754 end 2728 2755 end 2729 2756 end … … 2756 2783 set(handles.Dt_txt,'String','') 2757 2784 else 2758 if ~(isfield(UvData,'TimeUnit') && ~isempty(UvData.TimeUnit))2785 if isempty(TimeUnit) 2759 2786 set(handles.Dt_txt,'String',['Dt=' num2str(1000*dt,3) ' 10^(-3)'] ) 2760 2787 else 2761 set(handles.Dt_txt,'String',['Dt=' num2str(1000*dt,3) ' m' UvData.TimeUnit] )2788 set(handles.Dt_txt,'String',['Dt=' num2str(1000*dt,3) ' m' TimeUnit] ) 2762 2789 end 2763 2790 end
Note: See TracChangeset
for help on using the changeset viewer.