Changeset 650 for trunk/src/uvmat.m
- Timestamp:
- Jun 17, 2013, 6:46:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r648 r650 91 91 % name in a netcdf open), it is directly read at the level of Field{1}or Field{2}. 92 92 % Else only its name AName is recorded in Field{i}, and its field is then calculated 93 %by the fuction calc_scal after the coordinate transform or after projection on an edit_object93 %by the fuction calc_scal after the coordinate transform or after projection on an CheckEditObject 94 94 95 95 % Properties attached to plotting figures (standard Matlab properties): … … 111 111 % = calibration: move a calibration point 112 112 % = CheckZoom: isolate a subregion for CheckZoom in=1 if an object is being currently drawn, 0 else (set to 0 by releasing mouse button) 113 % .CurrentOrigin: Origin of a curently drawn edit_object113 % .CurrentOrigin: Origin of a curently drawn CheckEditObject 114 114 % .CurrentLine: currently drawn menuline (A REVOIR) 115 % .CurrentObject: handle of the currently drawn edit_object115 % .CurrentObject: handle of the currently drawn CheckEditObject 116 116 % .CurrentRectZoom: current rectangle used for CheckZoom 117 117 … … 723 723 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 724 724 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]); 725 725 726 if strcmp(FileType,'txt') 726 727 edit(fileinput) … … 954 955 set(handles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FrameRate) 'ms']);%display the elementary time interval in millisec 955 956 if index==1 956 set(handles.TimeName,' video')957 set(handles.TimeName,'String','video') 957 958 else 958 set(handles.TimeName_1,' video')959 set(handles.TimeName_1,'String','video') 959 960 end 960 961 ColorType='truecolor'; … … 1027 1028 if (isfield(XmlData,'Time')&& ~isempty(XmlData.Time)) 1028 1029 if index==1 1029 set(handles.TimeName,' xml')1030 set(handles.TimeName,'String','xml') 1030 1031 else 1031 set(handles.TimeName_1,' xml')1032 set(handles.TimeName_1,'String','xml') 1032 1033 end 1033 1034 else … … 2402 2403 siz=size(UvData.XmlData{1}.Time); 2403 2404 if ~isempty(num_i1)&& ~isempty(num_i2) && num_i1>=0 &&siz(1)>=max(num_i1+1,num_i2+1) && siz(2)>=max(num_j1+1,num_j2+1) 2404 set(handles.TimeName,' xml')% indicate that time is from xml2405 set(handles.TimeName,'String','xml')% indicate that time is from xml 2405 2406 abstime=(UvData.XmlData{1}.Time(num_i1+1,num_j1+1)+UvData.XmlData{1}.Time(num_i2+1,num_j2+1))/2;%overset the time read from files 2406 2407 dt=(UvData.XmlData{1}.Time(num_i2+1,num_j2+1)-UvData.XmlData{1}.Time(num_i1+1,num_j1+1)); … … 2615 2616 set(handles.ListObject,'Value',1); 2616 2617 set(handles.ListObject,'String',{'1-PLANE'}); 2617 set(handles. edit_object,'Value',1)% put the plane in edit mode to enable the z cursor2618 edit_object_Callback([],[], handles)2618 set(handles.CheckEditObject,'Value',1)% put the plane in edit mode to enable the z cursor 2619 CheckEditObject_Callback([],[], handles) 2619 2620 end 2620 2621 %multilevel case (single menuplane in a 3D space) … … 3527 3528 set(handles.edit_vect,'Value',0) 3528 3529 edit_vect_Callback(hObject, eventdata, handles) 3529 set(handles. edit_object,'Value',0)3530 % set(handles. edit_object,'BackgroundColor',[0.7 0.7 0.7])3530 set(handles.CheckEditObject,'Value',0) 3531 % set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7]) 3531 3532 % set(handles.cal,'Value',0) 3532 3533 % set(handles.cal,'BackgroundColor',[0 1 0]) … … 3574 3575 set(handles.record,'Visible','on') 3575 3576 set(handles.edit_vect,'BackgroundColor',[1 1 0]) 3576 set(handles. edit_object,'Value',0)3577 set(handles.CheckEditObject,'Value',0) 3577 3578 set(handles.CheckZoom,'Value',0) 3578 3579 % set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 3579 % set(handles. edit_object,'BackgroundColor',[0.7 0.7 0.7])3580 % set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7]) 3580 3581 set(gcf,'Pointer','arrow') 3581 3582 else … … 3812 3813 set(handles.ListObject_1,'Value',1) 3813 3814 set(handles.ListObject_1,'String',{''}) 3814 set(handles. ViewObject,'value',0)3815 ViewObject_Callback(hObject, eventdata, handles)3816 set(handles. ViewField,'value',0)3817 ViewField_Callback(hObject, eventdata, handles)3818 set(handles. edit_object,'Value',0)3819 edit_object_Callback(hObject, eventdata, handles)3815 set(handles.CheckViewObject,'value',0) 3816 CheckViewObject_Callback(hObject, eventdata, handles) 3817 set(handles.CheckViewField,'value',0) 3818 CheckViewField_Callback(hObject, eventdata, handles) 3819 set(handles.CheckEditObject,'Value',0) 3820 CheckEditObject_Callback(hObject, eventdata, handles) 3820 3821 UvData.ProjObject={[]}; 3821 3822 end … … 4211 4212 4212 4213 %% display the object parameters if the GUI set_object is already opened 4213 if ~get(handles. ViewObject,'Value')4214 if ~get(handles.CheckViewObject,'Value') 4214 4215 ZBounds=0; % default 4215 4216 if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax') … … 4219 4220 ObjectData.Name=list_str{get(handles.ListObject_1,'Value')}; 4220 4221 set_object(ObjectData,[],ZBounds); 4221 set(handles. ViewObject,'Value',1)% show that the selected object in ListObject_1 is currently visualised4222 set(handles.CheckViewObject,'Value',1)% show that the selected object in ListObject_1 is currently visualised 4222 4223 end 4223 4224 4224 4225 % desactivate the edit object mode 4225 set(handles. edit_object,'Value',0)4226 % set(handles. edit_object,'BackgroundColor',[0.7,0.7,0.7])4226 set(handles.CheckEditObject,'Value',0) 4227 % set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7]) 4227 4228 4228 4229 %------------------------------------------------------------------------ … … 4241 4242 4242 4243 %% show object features if view_object isselected 4243 if get(handles. ViewObject,'value')4244 if get(handles.CheckViewObject,'value') 4244 4245 set_object(ObjectData,[],ZBounds); 4245 4246 end … … 4252 4253 % ObjectData.Name=list_str{IndexObj}; 4253 4254 % set_object(ObjectData,[],ZBounds); 4254 % set(handles. ViewField,'Value',1)% show that the selected object in ListObject is currently visualised4255 % set(handles.CheckViewField,'Value',1)% show that the selected object in ListObject is currently visualised 4255 4256 % end 4256 4257 4257 4258 %% desactivate the edit object mode for security 4258 set(handles. edit_object,'Value',0)4259 4260 % set(handles. edit_object,'BackgroundColor',[0.7,0.7,0.7])4259 set(handles.CheckEditObject,'Value',0) 4260 4261 % set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7]) 4261 4262 4262 4263 %% update the plot on view_field if view_field is already openened … … 4342 4343 4343 4344 %------------------------------------------------------------------- 4344 % --- Executes on selection change in edit_object.4345 function edit_object_Callback(hObject, eventdata, handles)4345 % --- Executes on selection change in CheckEditObject. 4346 function CheckEditObject_Callback(hObject, eventdata, handles) 4346 4347 %------------------------------------------------------------------- 4347 4348 hset_object=findobj(allchild(0),'Tag','set_object'); 4348 if get(handles. edit_object,'Value')4349 if get(handles.CheckEditObject,'Value') 4349 4350 %suppress the other options 4350 4351 set(handles.CheckZoom,'Value',0) … … 4355 4356 set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib 4356 4357 end 4357 set(handles. ViewObject,'value',1)4358 ViewObject_Callback(hObject, eventdata, handles)4358 set(handles.CheckViewObject,'value',1) 4359 CheckViewObject_Callback(hObject, eventdata, handles) 4359 4360 else % desactivate object edit mode 4360 4361 if ~isempty(hset_object)% open the … … 4367 4368 4368 4369 %------------------------------------------------------------------------ 4369 % --- Executes on button press in ViewObject.4370 function ViewObject_Callback(hObject, eventdata, handles)4371 %------------------------------------------------------------------------ 4372 check_view=get(handles. ViewObject,'Value');4370 % --- Executes on button press in CheckViewObject. 4371 function CheckViewObject_Callback(hObject, eventdata, handles) 4372 %------------------------------------------------------------------------ 4373 check_view=get(handles.CheckViewObject,'Value'); 4373 4374 4374 4375 if check_view %activate set_object … … 4392 4393 hset_object=set_object(data,[],ZBounds); 4393 4394 hhset_object=guidata(hset_object); 4394 if get(handles. edit_object,'Value')% edit mode4395 if get(handles.CheckEditObject,'Value')% edit mode 4395 4396 set(get(hset_object,'children'),'Enable','on') 4396 4397 else … … 4407 4408 4408 4409 %------------------------------------------------------------------------ 4409 % --- Executes on button press in ViewField.4410 function ViewField_Callback(hObject, eventdata, handles)4411 %------------------------------------------------------------------------ 4412 check_view=get(handles. ViewField,'Value');4410 % --- Executes on button press in CheckViewField. 4411 function CheckViewField_Callback(hObject, eventdata, handles) 4412 %------------------------------------------------------------------------ 4413 check_view=get(handles.CheckViewField,'Value'); 4413 4414 4414 4415 if check_view … … 4465 4466 4466 4467 %------------------------------------------------------------------------ 4467 % --- Executes on button press in delete_object.4468 %------------------------------------------------------------------------ 4469 function delete_object_Callback(hObject, eventdata, handles)4468 % --- Executes on button press in DeleteObject. 4469 %------------------------------------------------------------------------ 4470 function DeleteObject_Callback(hObject, eventdata, handles) 4470 4471 4471 4472 IndexObj=get(handles.ListObject,'Value');%projection object selected for view_field … … 4475 4476 end 4476 4477 4477 %' delete_object': delete a projection object, defined by its index in the Uvmat list or by its graphic handle4478 %------------------------------------------------------------------------ 4479 % function delete_object(hObject)4478 %'DeleteObject': delete a projection object, defined by its index in the Uvmat list or by its graphic handle 4479 %------------------------------------------------------------------------ 4480 % function DeleteObject(hObject) 4480 4481 % 4481 4482 % INPUT: … … 4714 4715 4715 4716 % ----------------------------------------------------------------------- 4717 % --- Callback of the Menu command line 4718 %------------------------------------------------------------------------ 4716 4719 function Menuline_Callback(hObject, eventdata, handles) 4717 4720 %------------------------------------------------------------------------ 4718 4721 data.Type='line'; 4722 data.ProjMode='projection';%default 4723 data.ProjModeMenu={};% do not restrict ProjMode menus 4724 create_object(data,handles) 4725 4726 % ----------------------------------------------------------------------- 4727 % --- Callback of the Menu command line_x 4728 %------------------------------------------------------------------------ 4729 function Menuline_x_Callback(hObject, eventdata, handles) 4730 msgbox_uvmat('ERROR','option not yet implemented, use line') 4731 return 4732 data.Type='line_x'; 4733 data.ProjMode='projection';%default 4734 data.ProjModeMenu={};% do not restrict ProjMode menus 4735 create_object(data,handles) 4736 4737 % ----------------------------------------------------------------------- 4738 % --- Callback of the Menu command line_y 4739 % ----------------------------------------------------------------------- 4740 function Menuline_y_Callback(hObject, eventdata, handles) 4741 msgbox_uvmat('ERROR','option not yet implemented, use line') 4742 return 4743 data.Type='line_y'; 4719 4744 data.ProjMode='projection';%default 4720 4745 data.ProjModeMenu={};% do not restrict ProjMode menus … … 4791 4816 set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib 4792 4817 end 4793 set(handles. edit_object,'Value',0) %desactivate the object edit mode4794 edit_object_Callback([],[],handles)4795 set(handles. ViewObject,'Value',0) % desactivate view_object (new object created)4818 set(handles.CheckEditObject,'Value',0) %desactivate the object edit mode 4819 CheckEditObject_Callback([],[],handles) 4820 set(handles.CheckViewObject,'Value',0) % desactivate view_object (new object created) 4796 4821 set(handles.CheckZoomFig,'Value',0) %desactivate zoom sub fig 4797 4822 set(handles.CheckZoom,'Value',0) %desactivate the zoom action … … 4808 4833 if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh) 4809 4834 data.RangeX=[UvData.Field.XMin UvData.Field.XMax]; 4810 if strcmp(data.Type,'line')||strcmp(data.Type,'polyline')||strcmp(data.Type,'points') 4811 data.RangeY=UvData.Field.CoordMesh; 4812 else 4813 data.RangeY=[UvData.Field.YMin UvData.Field.YMax]; 4835 switch data.Type 4836 case {'line','polyline','points'} 4837 data.RangeY=UvData.Field.CoordMesh; 4838 case 'line_x' 4839 data.RangeX=[UvData.Field.XMin UvData.Field.XMax]; 4840 data.RangeY=UvData.Field.CoordMesh; 4841 data.Coord=[0 (UvData.Field.YMin +UvData.Field.YMax)/2];% put line at the middle of the y axis 4842 case 'line_y' 4843 data.RangeY=UvData.Field.CoordMesh; 4844 data.Coord=[(UvData.Field.XMin +UvData.Field.XMax)/2 0];% put line at the middle of the x axis 4845 case {'rectangle','ellipse'} 4846 data.RangeY=[UvData.Field.YMin UvData.Field.YMax]; 4847 data.RangeX=UvData.Field.CoordMesh; 4848 data.RangeY=UvData.Field.CoordMesh; 4849 otherwise 4850 data.RangeY=[UvData.Field.YMin UvData.Field.YMax]; 4814 4851 end 4815 4852 data.DX=UvData.Field.CoordMesh; 4816 4853 data.DY=UvData.Field.CoordMesh; 4817 if strcmp(data.Type,'rectangle')||strcmp(data.Type,'ellipse')4818 data.RangeX=UvData.Field.CoordMesh;4819 data.RangeY=UvData.Field.CoordMesh;4820 end4821 4854 end 4822 4855 if isfield(Field,'NbDim')&& isequal(Field.NbDim,3) … … 4830 4863 hchild=get(hset_object,'children'); 4831 4864 set(hchild,'enable','on') 4832 set(handles. delete_object,'Visible','on')% make the object delete button visible4865 set(handles.DeleteObject,'Visible','on')% make the object delete button visible 4833 4866 4834 4867 %------------------------------------------------------------------------ … … 4866 4899 hset_object=set_object(data);% call the set_object interface 4867 4900 set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object 4868 set(handles. edit_object,'Value',0); %suppress the object edit mode4869 edit_object_Callback([],[],handles)4870 % set(handles. edit_object,'BackgroundColor',[0.7,0.7,0.7])4871 set(handles. delete_object,'Visible','on')4901 set(handles.CheckEditObject,'Value',0); %suppress the object edit mode 4902 CheckEditObject_Callback([],[],handles) 4903 % set(handles.CheckEditObject,'BackgroundColor',[0.7,0.7,0.7]) 4904 set(handles.DeleteObject,'Visible','on') 4872 4905 4873 4906 … … 4878 4911 % function MenuEditObject_Callback(hObject, eventdata, handles) 4879 4912 % %------------------------------------------------------------------------ 4880 % set(handles. edit_object,'Value',1)4913 % set(handles.CheckEditObject,'Value',1) 4881 4914 % edit_Callback(hObject, eventdata, handles) 4882 4915 % … … 5177 5210 set(handles.edit_vect,'Value',0) 5178 5211 edit_vect_Callback(hObject, eventdata, handles) 5179 % set(handles. edit_object,'BackgroundColor',[0.7 0.7 0.7])5212 % set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7]) 5180 5213 set(handles.ListObject,'Value',1) 5181 5214 … … 5256 5289 %------------------------------------------------------------------------ 5257 5290 % -- open the GUI civ.fig for PIV 5258 function Menu PIV_Callback(hObject, eventdata, handles)5291 function MenuCIVx_Callback(hObject, eventdata, handles) 5259 5292 %------------------------------------------------------------------------ 5260 5293 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 5261 5294 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt]; 5262 5295 civ(FileName);% interface de civ(not in the uvmat file) 5296 5297 5298 % -------------------------------------------------------------------- 5299 function MenuPIV_Callback(hObject, eventdata, handles) 5300 MenuSeries_Callback(hObject, eventdata, handles) 5301 5263 5302 5264 5303 % --------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.