- Timestamp:
- Jun 17, 2013, 6:46:06 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_field_interp.m
r648 r650 32 32 r=regexp(FieldName{ilist},'(?<Operator>(^vec|^norm|^curl|^div|^strain))\((?<UName>.+),(?<VName>.+)\)$','names');% analyse the field name 33 33 if isempty(r) % the field name is a variable itself 34 ivar= strcmp(FieldName{ilist},Data.ListVarName);34 ivar=find(strcmp(FieldName{ilist},Data.ListVarName)); 35 35 if isempty(ivar) 36 36 check_skipped(ilist)=1; %variable not found 37 37 else 38 if isfield(Data.VarAttribute{ivar},'Role')&&strcmp(Data.VarAttribute{ivar}.Role,'ancillary') 39 check_skipped(ilist)=1; % ancillary variable, not found interpolated 38 if isfield(Data.VarAttribute{ivar},'Role') &&... 39 (strcmp(Data.VarAttribute{ivar}.Role,'ancillary')||strcmp(Data.VarAttribute{ivar}.Role,'warnflag')||strcmp(Data.VarAttribute{ivar}.Role,'errorflag')) 40 check_skipped(ilist)=1; % ancillary variable, not interpolated 40 41 elseif isempty(find(strcmp(FieldName{ilist},InputVarList), 1)); 41 42 InputVarList=[InputVarList FieldName{ilist}];% the variable is added to the list of input variables if it is not already in the list -
trunk/src/mouse_down.m
r627 r650 59 59 UvData=get(huvmat,'UserData'); 60 60 test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler action, second priority; 61 test_edit=get(hhuvmat. edit_object,'Value')&& (isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint'));%test for object editing, third priority61 test_edit=get(hhuvmat.CheckEditObject,'Value')&& (isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint'));%test for object editing, third priority 62 62 hset_object=findobj(allchild(0),'tag','set_object'); 63 63 if ~isempty(hset_object) 64 64 hPLOT=findobj(hset_object,'tag','PLOT'); 65 test_create=strcmp(get(hPLOT,'enable'),'on') &&~get(hhuvmat. edit_object,'Value');% create new object if set_object is in mode enable and uvmat not in mode 'edit_object'65 test_create=strcmp(get(hPLOT,'enable'),'on') &&~get(hhuvmat.CheckEditObject,'Value');% create new object if set_object is in mode enable and uvmat not in mode 'EditObject' 66 66 end 67 67 test_edit_vect=get(hhuvmat.edit_vect,'Value') && ~test_create && ~(isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint')) ;%test for vector editing, priority 4 … … 370 370 UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; % axes for plot_object 371 371 UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation 372 set(hhuvmat. ViewObject,'Value',1)372 set(hhuvmat.CheckViewObject,'Value',1) 373 373 end 374 374 ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object -
trunk/src/mouse_motion.m
r627 r650 54 54 if ~isempty(huvmat) 55 55 hhuvmat=guidata(huvmat);%handles of the elements in uvma 56 test_edit_object=get(hhuvmat. edit_object,'Value');56 test_edit_object=get(hhuvmat.CheckEditObject,'Value'); 57 57 test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on'); 58 58 end -
trunk/src/mouse_up.m
r627 r650 169 169 end 170 170 end 171 set(hhuvmat.ViewField,'Value',1);% 172 set(hhuvmat.edit_object,'Value',1);% 173 set(hhuvmat.edit_object,'Enable','on');% 174 % set(hhuvmat.MenuEditObject,'Enable','on');% 175 % set(hhuvmat.MenuEdit,'Enable','on');% 171 set(hhuvmat.CheckViewField,'Value',1);% 172 set(hhuvmat.CheckEditObject,'Value',1);% 173 set(hhuvmat.CheckEditObject,'Enable','on');% 176 174 set(get(h_set_object,'children'),'Enable','on') 177 175 end -
trunk/src/plot_object.m
r625 r650 131 131 132 132 %% determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot 133 test_line= isequal(ObjectData.Type,'points')| isequal(ObjectData.Type,'line')|isequal(ObjectData.Type,'polyline')|...134 isequal(ObjectData.Type,'poly gon')| isequal(ObjectData.Type,'plane')| isequal(ObjectData.Type,'volume');133 test_line= isequal(ObjectData.Type,'points')||isequal(ObjectData.Type,'line')||isequal(ObjectData.Type,'line_x')||isequal(ObjectData.Type,'line_y')||... 134 isequal(ObjectData.Type,'polyline')||isequal(ObjectData.Type,'polygon')|| isequal(ObjectData.Type,'plane')|| isequal(ObjectData.Type,'volume'); 135 135 test_patch=isequal(ObjectData.ProjMode,'inside')||isequal(ObjectData.ProjMode,'outside')||isequal(ObjectData.Type,'volume')... 136 136 ||isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside'); … … 139 139 yline=ObjectData.Coord(:,2); 140 140 nbpoints=numel(xline); 141 if isequal(ObjectData.Type,'polygon') 141 if isequal(ObjectData.Type,'line_x') 142 xline=[xline; ObjectData.RangeX(2)];%creating the line 143 yline=[yline; ObjectData.RangeY(2)];%creating the line 144 elseif isequal(ObjectData.Type,'polygon') 142 145 xline=[xline; ObjectData.Coord(1,1)];%closing the line 143 146 yline=[yline; ObjectData.Coord(1,2)]; -
trunk/src/proj_field.m
r648 r650 622 622 %% identify vector components 623 623 testU=isfield(CellInfo{icell},'VarIndex_vector_x') &&isfield(CellInfo{icell},'VarIndex_vector_y') ;% test for vectors 624 if testU625 UName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x};626 VName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y};627 vector_x=FieldData.(UName);628 vector_y=FieldData.(VName);629 end624 % if testU 625 % UName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x}; 626 % VName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y}; 627 % vector_x=FieldData.(UName); 628 % vector_y=FieldData.(VName); 629 % end 630 630 %identify error flag 631 631 errorflag=0; %default, no error flag … … 635 635 end 636 636 VarName=FieldData.ListVarName(VarIndex);% cell array of the names of variables to pje 637 ivar_U=[]; 638 ivar_V=[]; 637 639 %% check needed object properties for unstructured positions (position given by the variables with role coord_x, coord_y 638 640 … … 647 649 coord_x=FieldData.(XName); 648 650 coord_y=FieldData.(YName); 651 ProjData.ListVarName=[ProjData.ListVarName {XName}]; 652 ProjData.VarDimName=[ProjData.VarDimName {XName}]; 653 nbvar=numel(ProjData.ListVarName); 654 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; 649 655 if isequal(ProjMode,'projection') 650 656 if width==0 … … 663 669 Xproj=(coord_x-ObjectData.Coord(1,1))*costheta + (coord_y-ObjectData.Coord(1,2))*sintheta; %projection on the line 664 670 [Xproj,indsort]=sort(Xproj);% sort points by increasing absissa along the projection line 671 ProjData.(XName)=Xproj; 665 672 for ivar=1:numel(VarIndex) 666 673 ProjData.(VarName{ivar})=FieldData.(VarName{ivar})(flagsel);% restrict vrtibles to the projection band 667 674 ProjData.(VarName{ivar})=ProjData.(VarName{ivar})(indsort);% sort by absissa 668 end 669 % project the velocity components if vectors are projected 670 if testU 671 vector_x=ProjData.(UName); 672 ProjData.(UName)=costheta*vector_x+sintheta*ProjData.(VName);% longitudinal component 673 ProjData.(VName)=-sintheta*vector_x+costheta*ProjData.(VName);%transverse component 675 ProjData.ListVarName=[ProjData.ListVarName VarName{ivar}]; 676 ProjData.VarDimName=[ProjData.VarDimName {XName}]; 677 ProjData.VarAttribute{nbvar+ivar}=FieldData.VarAttribute{VarIndex(ivar)};%reproduce var attribute 678 if isfield(ProjData.VarAttribute{nbvar+ivar},'Role') 679 if strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_x'); 680 ivar_U=ivar; 681 elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y'); 682 ivar_V=ivar; 683 end 684 end 685 ProjData.VarAttribute{ivar+nbvar}.Role='discrete';% will promote plots of the profiles with continuous lines 674 686 end 675 687 elseif isequal(ProjMode,'interp_lin') %filtering %linear interpolation: 676 688 [ProjVar,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_x coord_y],FieldData,CellInfo{icell}.FieldName,XI,YI); 677 689 ProjData.X=Xproj; 678 ProjData.ListVarName=[ProjData.ListVarName {XName}];679 ProjData.VarDimName=[ProjData.VarDimName {XName}];680 nbvar=numel(ProjData.ListVarName);681 ProjData.VarAttribute{nbvar}.long_name='abscissa along line';682 690 ProjData.ListVarName=[ProjData.ListVarName ListFieldProj]; 683 691 ProjData.VarAttribute=[ProjData.VarAttribute VarAttribute]; 684 692 for ivar=1:numel(VarAttribute) 685 693 ProjData.VarDimName=[ProjData.VarDimName {XName}]; 694 if isfield(VarAttribute{ivar},'Role') 695 if strcmp(VarAttribute{ivar}.Role,'vector_x'); 696 ivar_U=ivar; 697 elseif strcmp(VarAttribute{ivar}.Role,'vector_y'); 698 ivar_V=ivar; 699 end 700 end 686 701 ProjData.VarAttribute{ivar+nbvar}.Role='continuous';% will promote plots of the profiles with continuous lines 687 702 ProjData.(ListFieldProj{ivar})=ProjVar{ivar}; … … 696 711 FieldVar=cat(3,FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x_tps}),FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y_tps})); 697 712 end 698 % coord_x_proj=XMin:DX:XMax;699 % coord_y_proj=YMin:DY:YMax;700 % np_x=numel(coord_x_proj);701 % np_y=numel(coord_y_proj);702 713 [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbCentres,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI)); 703 714 ProjData.X=Xproj; 704 ProjData.ListVarName=[ProjData.ListVarName {XName}];705 ProjData.VarDimName=[ProjData.VarDimName {XName}];715 % ProjData.ListVarName=[ProjData.ListVarName {XName}]; 716 % ProjData.VarDimName=[ProjData.VarDimName {XName}]; 706 717 nbvar=numel(ProjData.ListVarName); 707 718 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; … … 711 722 for ivar=1:numel(VarAttribute) 712 723 ProjData.VarDimName=[ProjData.VarDimName {XName}]; 724 if isfield(VarAttribute{ivar},'Role') 725 if strcmp(VarAttribute{ivar}.Role,'vector_x'); 726 ivar_U=ivar; 727 elseif strcmp(VarAttribute{ivar}.Role,'vector_y'); 728 ivar_V=ivar; 729 end 730 end 713 731 ProjData.VarAttribute{ivar+nbvar}.Role='continuous';% will promote plots of the profiles with continuous lines 714 732 ProjData.(ProjVarName{ivar})=DataOut.(ProjVarName{ivar}); … … 822 840 ProjData.VarAttribute{ivar}.Role='continuous';% for plot with continuous line 823 841 end 824 if testU825 vector_x =ProjData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x});826 vector_y =ProjData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y});827 ProjData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x}) =cos(theta)*vector_x+sin(theta)*vector_y;828 ProjData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y}) =-sin(theta)*vector_x+cos(theta)*vector_y;829 end830 ProjData.VarAttribute{nbvar+1}.long_name='abscissa along line';831 842 if nbcolor==3 832 843 ProjData.VarDimName{end}={AXName,'rgb'}; 833 844 end 834 845 end 835 end 846 end 847 if ~isempty(ivar_U) && ~isempty(ivar_V) 848 vector_x =ProjData.(ProjData.ListVarName{nbvar+ivar_U}); 849 ProjData.(ProjData.ListVarName{nbvar+ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{nbvar+ivar_V}); 850 ProjData.(ProjData.ListVarName{nbvar+ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{nbvar+ivar_V}); 851 end 852 836 853 end 837 854 … … 1152 1169 coord_X=coord_X(indsel); 1153 1170 coord_Y=coord_Y(indsel); 1171 for ivar=1:numel(CellInfo{icell}.VarIndex) 1172 VarName=FieldData.ListVarName{CellInfo{icell}.VarIndex(ivar)}; 1173 FieldData.(VarName)=FieldData.(VarName)(indsel); 1174 end 1154 1175 end 1155 1176 % testFF=0; 1156 % nbvar=numel(ProjData.ListVarName); 1157 if isfield(CellInfo{icell},'VarIndex_vector_x')&&isfield(CellInfo{icell},'VarIndex_vector_y')1158 VarName_x=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x};1159 VarName_y=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y};1160 if isfield(CellInfo{icell},'VarIndex_errorflag')1161 FieldData.(VarName_x)=FieldData.(VarName_x)(indsel);1162 FieldData.(VarName_y)=FieldData.(VarName_y)(indsel);1163 end1164 %FieldVar=cat(2,FieldData.(VarName_x),FieldData.(VarName_y));1165 if ~isfield(CellInfo{icell},'CheckSub') || ~CellInfo{icell}.CheckSub1166 vector_x_proj=numel(ProjData.ListVarName)+1;1167 vector_y_proj=numel(ProjData.ListVarName)+2;1168 end1169 end1170 if isfield(CellInfo{icell},'VarIndex_scalar')1171 VarName_scalar=FieldData.ListVarName{CellInfo{icell}.VarIndex_scalar};1172 if isfield(CellInfo{icell},'errorflag') && ~isempty(CellInfo{icell}.errorflag)1173 FieldData.(VarName_scalar)=FieldData.(VarName_scalar)(indsel);1174 end1175 end1176 if isfield(CellInfo{icell},'VarIndex_ancillary')% do not project ancillary data with interp1177 FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_ancillary});1178 end1179 if isfield(CellInfo{icell},'VarIndex_warnflag')% do not project ancillary data with interp1180 FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_warnflag});1181 end1177 % nbvar=numel(ProjData.ListVarName); 1178 % if isfield(CellInfo{icell},'VarIndex_vector_x')&&isfield(CellInfo{icell},'VarIndex_vector_y') 1179 % VarName_x=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x}; 1180 % VarName_y=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y}; 1181 % if isfield(CellInfo{icell},'VarIndex_errorflag') 1182 % FieldData.(VarName_x)=FieldData.(VarName_x)(indsel); 1183 % FieldData.(VarName_y)=FieldData.(VarName_y)(indsel); 1184 % end 1185 % %FieldVar=cat(2,FieldData.(VarName_x),FieldData.(VarName_y)); 1186 % if ~isfield(CellInfo{icell},'CheckSub') || ~CellInfo{icell}.CheckSub 1187 % vector_x_proj=numel(ProjData.ListVarName)+1; 1188 % vector_y_proj=numel(ProjData.ListVarName)+2; 1189 % end 1190 % end 1191 % if isfield(CellInfo{icell},'VarIndex_scalar') 1192 % VarName_scalar=FieldData.ListVarName{CellInfo{icell}.VarIndex_scalar}; 1193 % if isfield(CellInfo{icell},'errorflag') && ~isempty(CellInfo{icell}.errorflag) 1194 % FieldData.(VarName_scalar)=FieldData.(VarName_scalar)(indsel); 1195 % end 1196 % end 1197 % if isfield(CellInfo{icell},'VarIndex_ancillary')% do not project ancillary data with interp 1198 % FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_ancillary}); 1199 % end 1200 % if isfield(CellInfo{icell},'VarIndex_warnflag')% do not project ancillary data with interp 1201 % FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_warnflag}); 1202 % end 1182 1203 % interpolate and calculate field on the grid 1183 1204 [VarVal,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_X coord_Y],FieldData,CellInfo{icell}.FieldName,XI,YI); -
trunk/src/series.m
r648 r650 1763 1763 %create subdirectory for oar command and log files 1764 1764 DirOAR=fullfile(OutputDir,'0_OAR'); 1765 if ~exist(DirOAR,'dir') 1765 if exist(DirOAR,'dir')% delete the content of the dir 0_OAR to allow new input 1766 curdir=pwd; 1767 cd(DirOAR) 1768 delete('*') 1769 cd(curdir) 1770 else 1766 1771 [tild,msg1]=mkdir(DirOAR); 1767 1772 if ~strcmp(msg1,'') -
trunk/src/set_object.m
r648 r650 182 182 if ~isempty(huvmat) 183 183 hhuvmat=guidata(huvmat); 184 % set(hhuvmat.ViewObject_1,'value',0)% desactivate the two view buttons 185 set(hhuvmat.ViewObject,'value',0)% 186 set(hhuvmat.edit_object,'Value',0)% desactivate the edit option 187 % set(hhuvmat.edit_object,'BackgroundColor',[0.7 0.7 0.7])%put unactivated buttons to gree 184 set(hhuvmat.CheckViewObject,'value',0)% 185 set(hhuvmat.CheckEditObject,'Value',0)% desactivate the edit option 188 186 % deselect the object in ListObject when view_field is closed 189 187 if isempty(findobj(allchild(0),'Tag','view_field')) … … 455 453 ListObject=get(hhuvmat.ListObject,'String');% list of objects displayed in uvmat 456 454 457 if isequal(get(hhuvmat. edit_object,'Value'),0) %we append a new object455 if isequal(get(hhuvmat.CheckEditObject,'Value'),0) %we append a new object 458 456 ListObject=[ListObject;{''}]; 459 457 IndexObj=length(ListObject); … … 491 489 set(hhuvmat.ListObject,'String',ListObject);%complement the object list 492 490 set(hhuvmat.ListObject_1,'String',ListObject);%complement the object list 493 set(hhuvmat. ViewObject,'Value',1)% indicate that the currently selected objected is viewed on set_object491 set(hhuvmat.CheckViewObject,'Value',1)% indicate that the currently selected objected is viewed on set_object 494 492 check_handle=isfield(UvData.ProjObject{IndexObj},'DisplayHandle') && isfield(UvData.ProjObject{IndexObj}.DisplayHandle,'uvmat')... 495 493 && ~isempty(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat) && ishandle(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat); … … 554 552 set(hview_field,'Position',Data.GUISize) 555 553 end 556 % set(hhuvmat.ViewField,'Value',1)% indicate that the field projection on the current object is plotted in view_field557 554 end 558 555 end … … 586 583 587 584 %% update the GUI uvmat 588 % set(hhuvmat.MenuEditObject,'enable','on') 589 set(hhuvmat.edit_object,'Value',1) % set uvmat to object edit mode to allow further object update 590 %set(hhuvmat.edit_object,'BackgroundColor',[1 1 0]);% paint the edit text in yellow 591 set(hhuvmat.ViewField,'Value',1) 592 % set(handles.PLOT,'enable','on') 585 set(hhuvmat.CheckEditObject,'Value',1) % set uvmat to object edit mode to allow further object update 586 set(hhuvmat.CheckViewField,'Value',1) 593 587 set(handles.PLOT,'BackgroundColor',[1 0 0]) 594 588 %------------------------------------------------------------------------ -
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 % -------------------------------------------------------------------- -
trunk/src/view_field.m
r644 r650 186 186 if ~isempty(huvmat) 187 187 hhuvmat=guidata(huvmat); 188 set(hhuvmat. ViewField,'Value',0)188 set(hhuvmat.CheckViewField,'Value',0) 189 189 %set(hhuvmat.edit_object,'BackgroundColor',[0.7 0.7 0.7])%put unactivated buttons to gree 190 190 % deselect the object in ListObject when view_field is closed
Note: See TracChangeset
for help on using the changeset viewer.