Changeset 427 for trunk/src/uvmat.m
- Timestamp:
- May 17, 2012, 11:33:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r426 r427 1625 1625 end 1626 1626 CheckFixPair=get(handles.CheckFixPair,'Value')||(isempty(i2)&&isempty(j2)); 1627 1628 % the pair i1-i2 or j1-j2 is imposed (check box CheckFixPair selected) 1627 1629 if CheckFixPair 1628 1630 if get(handles.scan_i,'Value')==1% case of scanning along index i … … 1641 1643 end 1642 1644 end 1645 1646 % the pair i1-i2 or j1-j2 is free (check box CheckFixPair not selected): 1647 % the list of existing indices recorded in UvData is used 1643 1648 else 1644 1649 UvData=get(handles.uvmat,'UserData'); 1645 1650 ref_i=i1; 1646 1651 if ~isempty(i2) 1647 ref_i=floor((i1+i2)/2); 1652 ref_i=floor((i1+i2)/2);% current reference index i 1648 1653 end 1649 1654 ref_j=1; … … 1651 1656 ref_j=j1; 1652 1657 if ~isempty(j2) 1653 ref_j=floor((j1+j2)/2); 1658 ref_j=floor((j1+j2)/2);% current reference index j 1654 1659 end 1655 1660 end 1656 1661 if ~isempty(increment) 1657 1662 if get(handles.scan_i,'Value')==1% case of scanning along index i 1658 ref_i=ref_i+increment; 1663 ref_i=ref_i+increment;% increment the current reference index i 1659 1664 else % case of scanning along index j (burst numbers) 1660 ref_j=ref_j+increment; 1665 ref_j=ref_j+increment;% increment the current reference index j if scan_j option is used 1661 1666 end 1662 1667 else % free increment … … 1690 1695 return 1691 1696 end 1692 if get(handles.scan_i,'Value')==1% case of scanning along index i 1693 i1_subseries=UvData.i1_series{1}(ref_i+1,ref_j+1,:); 1694 else 1695 i1_subseries=UvData.i1_series{1}(ref_i+1,ref_j+1,:); 1696 end 1697 i1_subseries=UvData.i1_series{1}(ref_i+1,ref_j+1,:); 1697 1698 i1_subseries=i1_subseries(i1_subseries>0); 1698 1699 if isempty(i1_subseries) 1699 1700 errormsg='no next file'; 1700 1701 return 1701 end 1702 i1=i1_subseries(end); 1702 else 1703 i1=i1_subseries(end); 1704 end 1703 1705 if ~isempty(UvData.i2_series{1}) 1704 if get(handles.scan_i,'Value')==1% case of scanning along index i 1705 i2_subseries=UvData.i2_series{1}(ref_i+1,ref_j+1,:); 1706 else 1707 i2_subseries=UvData.i2_series{1}(ref_i+1,ref_j+1,:); 1708 end 1706 i2_subseries=UvData.i2_series{1}(ref_i+1,ref_j+1,:); 1709 1707 i2_subseries=i2_subseries(i2_subseries>0); 1710 1708 i2=i2_subseries(end); 1711 1709 end 1712 1710 if ~isempty(UvData.j1_series{1}) 1713 if get(handles.scan_i,'Value')==1% case of scanning along index i 1714 j1_subseries=UvData.j1_series{1}(ref_i+1,ref_j+1,:); 1715 else 1716 j1_subseries=UvData.j1_series{1}(ref_i+1,ref_j+1,:); 1717 end 1711 j1_subseries=UvData.j1_series{1}(ref_i+1,ref_j+1,:); 1718 1712 j1_subseries=j1_subseries(j1_subseries>0); 1719 1713 j1=j1_subseries(end); 1720 1714 end 1721 1715 if ~isempty(UvData.j2_series{1}) 1722 if get(handles.scan_i,'Value')==1% case of scanning along index i 1723 j2_subseries=UvData.j2_series{1}(ref_i+1,ref_j+1,:); 1724 else 1725 j2_subseries=UvData.j2_series{1}(ref_i+1,ref_j+1,:); 1726 end 1716 j2_subseries=UvData.j2_series{1}(ref_i+1,ref_j+1,:); 1727 1717 j2_subseries=j2_subseries(j2_subseries>0); 1728 1718 j2=j2_subseries(end); 1729 end 1730 1719 end 1720 % case of a second file series 1721 if numel(UvData.i1_series)>=2 1722 i1_subseries=UvData.i1_series{2}(ref_i+1,ref_j+1,:); 1723 i1_subseries=i1_subseries(i1_subseries>0); 1724 i1_1=i1_subseries(end); 1725 if ~isempty(UvData.i2_series{2}) 1726 i2_subseries=UvData.i2_series{2}(ref_i+1,ref_j+1,:); 1727 i2_subseries=i2_subseries(i2_subseries>0); 1728 i2_1=i2_subseries(end); 1729 end 1730 if ~isempty(UvData.j1_series{2}) 1731 j1_subseries=UvData.j1_series{2}(ref_i+1,ref_j+1,:); 1732 j1_subseries=j1_subseries(j1_subseries>0); 1733 j1_1=j1_subseries(end); 1734 end 1735 if ~isempty(UvData.j2_series{2}) 1736 j2_subseries=UvData.j2_series{2}(ref_i+1,ref_j+1,:); 1737 j2_subseries=j2_subseries(j2_subseries>0); 1738 j2_1=j2_subseries(end); 1739 end 1740 end 1731 1741 end 1732 1742 filename=fullfile_uvmat(InputFile.RootPath,InputFile.SubDir,InputFile.RootFile,FileExt,NomType,i1,i2,j1,j2); … … 2104 2114 if test_keepdata_1 2105 2115 Field{2}=UvData.Field_1;% keep the stored field 2116 ParamOut_1=UvData.ParamOut_1; 2106 2117 else 2107 2118 ParamIn_1.FieldName=FieldName_1; … … 2365 2376 [UvData.Field,errormsg]=sub_field(Field{1},Field{2}); 2366 2377 UvData.Field_1=Field{2}; %store the second field for possible use at next RUN 2378 UvData.ParamOut_1=ParamOut_1; 2367 2379 else 2368 2380 UvData.Field=Field{1}; … … 3957 3969 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on UvData.Object{IndexObj(1)} 3958 3970 plot_field(ProjData,handles.axes3,read_GUI(handles.uvmat));%read plotting parameters on the uvmat interfacPlotHandles); 3959 Object_out=update_obj(UvData,get(handles.ListObject_1,'Value'),[]) 3971 Object_out=update_obj(UvData,get(handles.ListObject_1,'Value'),[]); 3960 3972 3961 3973 %% display the object parameters if the GUI set_object is already opened 3962 % hset_object=findobj(allchild(0),'tag','set_object');3963 %if ~isempty(hset_object)3964 3974 if ~get(handles.ViewObject,'Value') 3965 % delete(hset_object)% delete to refesh the content3966 3975 ZBounds=0; % default 3967 3976 if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax') … … 3979 3988 %------------------------------------------------------------------------ 3980 3989 % --- Executes on selection change in ListObject. 3981 3982 3990 function ListObject_Callback(hObject, eventdata, handles) 3983 3991 %------------------------------------------------------------------------ … … 3990 3998 hset_object=findobj(allchild(0),'tag','set_object'); 3991 3999 if ~isempty(hset_object) 3992 % delete(hset_object)% delete to refesh the content3993 4000 ZBounds=0; % default 3994 4001 if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax') … … 4073 4080 end 4074 4081 4075 %------------------------------------------------------------------------4076 % --- Executes on button press in ViewObject.4077 function ViewObject_Callback(hObject, eventdata, handles)4078 %------------------------------------------------------------------------4079 check_view=get(handles.ViewObject,'Value');4080 4081 if check_view %activate set_object4082 IndexObj=get(handles.ListObject,'Value');4083 list_object=get(handles.ListObject,'String');4084 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface4085 UvData.Object{IndexObj}.Name=list_object{IndexObj};4086 if numel(UvData.Object)<IndexObj;% error in UvData4087 msgbox_uvmat('ERROR','invalid object list')4088 return4089 end4090 ZBounds=0; % default4091 if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax')4092 ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider4093 ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider4094 end4095 % set(handles.ListObject_1,'Value',IndexObj);%restore ListObject selection after set_object deletion4096 data=UvData.Object{IndexObj};4097 if ~isfield(data,'Type')% default plane4098 data.Type='plane';4099 end4100 if isfield(UvData,'Field')4101 Field=UvData.Field;4102 if isfield(UvData.Field,'Mesh')&&~isempty(UvData.Field.Mesh)4103 data.RangeX=[UvData.Field.XMin UvData.Field.XMax];4104 if strcmp(data.Type,'line')||strcmp(data.Type,'polyline')4105 data.RangeY=UvData.Field.Mesh;4106 else4107 data.RangeY=[UvData.Field.YMin UvData.Field.YMax];4108 end4109 data.DX=UvData.Field.Mesh;4110 data.DY=UvData.Field.Mesh;4111 end4112 if isfield(Field,'NbDim')&& isequal(Field.NbDim,3)4113 data.Coord=[0 0 0]; %default4114 end4115 if isfield(Field,'CoordUnit')4116 data.CoordUnit=Field.CoordUnit;4117 end4118 end4119 hset_object=set_object(data,[],ZBounds);4120 hhset_object=guidata(hset_object);4121 if get(handles.edit_object,'Value')% edit mode4122 set(hhset_object.PLOT,'Enable','on')4123 set(get(hset_object,'children'),'enable','on')4124 else4125 set(hhset_object.PLOT,'Enable','off')4126 set(get(hset_object,'children'),'enable','off')4127 end4128 else4129 hset_object=findobj(allchild(0),'tag','set_object');4130 if ~isempty(hset_object)4131 delete(hset_object)% delete existing version of set_object4132 end4133 end4134 4135 4082 %------------------------------------------------------------------- 4136 4083 % --- Executes on selection change in edit_object. … … 4169 4116 end 4170 4117 4118 4119 %------------------------------------------------------------------------ 4120 % --- Executes on button press in ViewObject. 4121 function ViewObject_Callback(hObject, eventdata, handles) 4122 %------------------------------------------------------------------------ 4123 check_view=get(handles.ViewObject,'Value'); 4124 4125 if check_view %activate set_object 4126 IndexObj=get(handles.ListObject,'Value'); 4127 list_object=get(handles.ListObject,'String'); 4128 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4129 UvData.Object{IndexObj}.Name=list_object{IndexObj}; 4130 if numel(UvData.Object)<IndexObj;% error in UvData 4131 msgbox_uvmat('ERROR','invalid object list') 4132 return 4133 end 4134 ZBounds=0; % default 4135 if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax') 4136 ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider 4137 ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider 4138 end 4139 % set(handles.ListObject_1,'Value',IndexObj);%restore ListObject selection after set_object deletion 4140 data=UvData.Object{IndexObj}; 4141 if ~isfield(data,'Type')% default plane 4142 data.Type='plane'; 4143 end 4144 if isfield(UvData,'Field') 4145 Field=UvData.Field; 4146 if isfield(UvData.Field,'Mesh')&&~isempty(UvData.Field.Mesh) 4147 data.RangeX=[UvData.Field.XMin UvData.Field.XMax]; 4148 if strcmp(data.Type,'line')||strcmp(data.Type,'polyline') 4149 data.RangeY=UvData.Field.Mesh; 4150 else 4151 data.RangeY=[UvData.Field.YMin UvData.Field.YMax]; 4152 end 4153 data.DX=UvData.Field.Mesh; 4154 data.DY=UvData.Field.Mesh; 4155 end 4156 if isfield(Field,'NbDim')&& isequal(Field.NbDim,3) 4157 data.Coord=[0 0 0]; %default 4158 end 4159 if isfield(Field,'CoordUnit') 4160 data.CoordUnit=Field.CoordUnit; 4161 end 4162 end 4163 hset_object=set_object(data,[],ZBounds); 4164 hhset_object=guidata(hset_object); 4165 if get(handles.edit_object,'Value')% edit mode 4166 set(hhset_object.PLOT,'Enable','on') 4167 set(get(hset_object,'children'),'enable','on') 4168 else 4169 set(hhset_object.PLOT,'Enable','off') 4170 set(get(hset_object,'children'),'enable','inactive')% deactivate the GUI except SAVE 4171 set(hhset_object.SAVE,'Enable','on') 4172 end 4173 else 4174 hset_object=findobj(allchild(0),'tag','set_object'); 4175 if ~isempty(hset_object) 4176 delete(hset_object)% delete existing version of set_object 4177 end 4178 end 4179 4180 4171 4181 %------------------------------------------------------------------------ 4172 4182 % --- Executes on button press in ViewField. … … 4176 4186 4177 4187 if check_view 4178 % set(handles.ViewObject,'Value',0)% unselect ViewObject_14179 4188 IndexObj=get(handles.ListObject,'Value'); 4180 4189 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface … … 4194 4203 list_object=get(handles.ListObject,'String'); 4195 4204 UvData.Object{IndexObj(end)}.Name=list_object{IndexObj(end)}; 4196 % hset_object=set_object(UvData.Object{IndexObj(end)},[],ZBounds);4197 % hhset_object=guidata(hset_object);4198 % if get(handles.edit_object,'Value')% edit mode4199 % set(hhset_object.PLOT,'Enable','on')4200 % set(get(hset_object,'children'),'enable','on')4201 % else4202 % set(hhset_object.PLOT,'Enable','off')4203 % set(get(hset_object,'children'),'enable','inactive')4204 % end4205 4205 4206 4206 %% show the second plot (on view_field) … … 4226 4226 IndexObj=get(handles.ListObject,'Value'); 4227 4227 IndexObj_1=get(handles.ListObject_1,'Value'); 4228 4229 4228 if IndexObj>1 && ~isequal(IndexObj,IndexObj_1) 4230 4229 delete_object(IndexObj) … … 4513 4512 %read the file 4514 4513 data=xml2struct(fileinput); 4515 data.enable_plot=1; 4516 [tild,data.Name]=fileparts(FileName); 4517 hset_object=findobj(allchild(0),'tag','set_object'); 4518 if ~isempty(hset_object) 4519 delete(hset_object)% delete existing version of set_object 4520 end 4521 set_object(data);% call the set_object interface 4514 % data.enable_plot=1; 4515 [tild,data.Name]=fileparts(FileName);% object name set as file name 4516 % hset_object=findobj(allchild(0),'tag','set_object'); 4517 % if ~isempty(hset_object) 4518 % delete(hset_object)% delete existing version of set_object 4519 % end 4520 hset_object=set_object(data);% call the set_object interface 4521 set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object 4522 4522 set(handles.edit_object,'Value',0); %suppress the object edit mode 4523 4523 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 4524 %set(handles.MenuObject,'checked','on')4525 4524 set(handles.delete_object,'Visible','on') 4526 4525
Note: See TracChangeset
for help on using the changeset viewer.