Changeset 287
- Timestamp:
- Nov 19, 2011, 10:40:00 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/check_files.m
r283 r287 143 143 if status==0 144 144 [~,result]=system('svn info'); 145 t=regexp(result,' R[eé]vision\s:\s(?<rev>\d+)','names');145 t=regexp(result,'vision\s:\s(?<rev>\d+)','names'); 146 146 svn_info.cur_rev=num2str(t.rev); 147 147 [~,result]=system('svn info -r ''HEAD'''); 148 t=regexp(result,' R[eé]vision\s:\s(?<rev>\d+)','names');148 t=regexp(result,'vision\s:\s(?<rev>\d+)','names'); 149 149 svn_info.rep_rev=num2str(t.rev); 150 150 [~,result]=system('svn status'); -
trunk/src/civ.m
r286 r287 23 23 %TODO: search range 24 24 25 % Last Modified by GUIDE v2.5 1 8-Nov-2011 15:30:1725 % Last Modified by GUIDE v2.5 19-Nov-2011 10:00:27 26 26 % Begin initialization code - DO NOT EDIT 27 27 gui_Singleton = 1; … … 1529 1529 end 1530 1530 if isequal(get(handles.CheckMask,'Value'),1) 1531 maskname=get(handles. mask_fix2,'String');1531 maskname=get(handles.txt_MaskName,'String'); 1532 1532 if ~exist(maskname,'file') 1533 1533 get_mask_fix2_Callback(hObject, eventdata, handles); … … 1850 1850 param.civ2.filename_nc1=filecell.nc.civ1{ifile,j}; 1851 1851 param.civ2.filename_nc1(end-2:end)=[]; % remove '.nc' 1852 test_mask=get(handles.CheckMask,'Value'); 1853 if test_mask==0 1854 param.civ2.maskname='noFile use default'; 1855 param.civ2.maskflag='n'; 1856 else 1852 if Param.Civ2.CheckMask 1857 1853 maskdispl=get(handles.txt_Mask,'String'); 1858 1854 if exist(maskdispl,'file') … … 1871 1867 end 1872 1868 end 1869 else 1870 param.civ2.maskname='noFile use default'; 1871 param.civ2.maskflag='n'; 1873 1872 end 1874 1873 gridname=get(handles.txt_GridName,'String'); … … 1917 1916 maskname=''; %no mask used 1918 1917 else 1919 maskdispl=get(handles. mask_fix2,'String');1918 maskdispl=get(handles.txt_MaskName,'String'); 1920 1919 maskbase=[filecell.filebase '_' maskdispl]; % 1921 1920 nbslice_mask=str2double(maskdispl(1:end-4)); % … … 2066 2065 end 2067 2066 fix1.LowerBoundCorr=thresh_vecC1; 2068 if get(handles. inf_sup1,'Value')2067 if get(handles.num_MinVel,'Value') 2069 2068 fix1.UppperBoundVel=thresh_vel1; 2070 2069 else … … 2094 2093 if Param.CheckFix2==1 2095 2094 fix2.WarnFlags=[]; 2096 if get(handles. vec_Fmin2_2,'Value')2095 if get(handles.CheckFmin2,'Value') 2097 2096 fix2.WarnFlags=[fix2.WarnFlags -2]; 2098 2097 end 2099 if get(handles. vec_F4,'Value')2098 if get(handles.CheckF4,'Value') 2100 2099 fix2.WarnFlags=[fix2.WarnFlags 4]; 2101 2100 end 2102 if get(handles. vec_F3_2,'Value')2101 if get(handles.CheckF3,'Value') 2103 2102 fix2.WarnFlags=[fix2.WarnFlags 3]; 2104 2103 end 2105 2104 fix2.LowerBoundCorr=thresh_vec2C; 2106 if get(handles. inf_sup2,'Value')2105 if get(handles.num_MinVel,'Value') 2107 2106 fix2.UppperBoundVel=thresh_vel2; 2108 2107 else … … 3234 3233 3235 3234 %------------------------------------------------------------------------ 3236 % --- Executes on button press in SearchRange: determine the search range num_S x,num_Sy3235 % --- Executes on button press in SearchRange: determine the search range num_Searchx,num_Searchy 3237 3236 function SearchRange_Callback(hObject, eventdata, handles) 3238 3237 %------------------------------------------------------------------------ … … 3256 3255 3257 3256 %------------------------------------------------------------------------ 3258 % --- determine the search range num_S x,num_Sy and shift3257 % --- determine the search range num_Searchx,num_Searchy and shift 3259 3258 function get_search_range(hObject, eventdata, handles) 3260 3259 umin=str2double(get(handles.umin,'String')); … … 3322 3321 set(handles.num_Shiftx,'String',num2str(shiftx)); 3323 3322 set(handles.num_Shifty,'String',num2str(shifty)); 3324 set(handles.num_S x,'String',num2str(isx));3325 set(handles.num_S y,'String',num2str(isy));3323 set(handles.num_Searchx,'String',num2str(isx)); 3324 set(handles.num_Searchy,'String',num2str(isy)); 3326 3325 end 3327 3326 … … 3409 3408 % set(handles.txt_MaskName,'String',mask_displ) 3410 3409 % set(handles.txt_Mask,'String',mask_displ) 3411 % set(handles. mask_fix2,'String',mask_displ)3410 % set(handles.txt_MaskName,'String',mask_displ) 3412 3411 % end 3413 3412 % set(handles.CheckMask,'Value',maskval)%update the checkciv2 mask with the same option as checkciv1 … … 3454 3453 set(handles.txt_MaskName,'String',mask_displ) 3455 3454 set(handles.txt_Mask,'String',mask_displ) 3456 set(handles. mask_fix2,'String',mask_displ)3455 set(handles.txt_MaskName,'String',mask_displ) 3457 3456 end 3458 3457 … … 3495 3494 end 3496 3495 set(handles.txt_Mask,'String',mask_displ) 3497 set(handles. mask_fix2,'String',mask_displ)3496 set(handles.txt_MaskName,'String',mask_displ) 3498 3497 end 3499 3498 … … 3504 3503 maskval=get(handles.CheckMask,'Value'); 3505 3504 if isequal(maskval,0) 3506 set(handles. mask_fix2,'String','')3505 set(handles.txt_MaskName,'String','') 3507 3506 else 3508 3507 mask_displ='no mask'; %default … … 3532 3531 set(handles.CheckMask,'Value',0) 3533 3532 end 3534 set(handles. mask_fix2,'String',mask_displ)3533 set(handles.txt_MaskName,'String',mask_displ) 3535 3534 end 3536 3535 … … 3870 3869 % set(handles.num_Bx,'Visible',state) 3871 3870 % set(handles.num_By,'Visible',state) 3872 % set(handles.num_S x,'Visible',state)3873 % set(handles.num_S y,'Visible',state)3871 % set(handles.num_Searchx,'Visible',state) 3872 % set(handles.num_Searchy,'Visible',state) 3874 3873 % set(handles.num_Shiftx,'Visible',state) 3875 3874 % set(handles.num_Shifty,'Visible',state) … … 3938 3937 % set(handles.num_MinCorr,'Visible',state) 3939 3938 % set(handles.thresh_vecC_title,'Visible',state) 3940 % set(handles.num_M axVel,'Visible',state)3941 % set(handles. thresh_vel_text,'Visible',state)3939 % set(handles.num_MinVel,'Visible',state) 3940 % set(handles.TitleMinVel,'Visible',state) 3942 3941 % set(handles.txt_MaskName,'Visible',state) 3943 3942 % set(handles.CheckMask,'Visible',state) 3944 3943 % set(handles.get_ref_fix1,'Visible',state) 3945 3944 % set(handles.ref_fix1,'Visible',state) 3946 % set(handles. inf_sup1,'Visible',state)3945 % set(handles.num_MinVel,'Visible',state) 3947 3946 % set(handles.field_ref1,'Visible',state) 3948 3947 … … 4020 4019 4021 4020 % 4022 % set(handles. ibx_civ2,'Visible',state)4023 % set(handles. iby_civ2,'Visible',state)4024 % set(handles. decimal,'Visible',state)4025 % set(handles. deformation,'Visible',state)4026 % set(handles. rho_civ2,'Visible',state)4021 % set(handles.num_Bx,'Visible',state) 4022 % set(handles.num_By,'Visible',state) 4023 % set(handles.CheckDecimal,'Visible',state) 4024 % set(handles.CheckDeformation,'Visible',state) 4025 % set(handles.num_Rho,'Visible',state) 4027 4026 % set(handles.num_Dx,'Visible',state) 4028 4027 % set(handles.num_Dy,'Visible',state) … … 4042 4041 % set(handles.ImaThreshold_title2,'Visible',state) 4043 4042 % if isequal(state,'off') 4044 % set(handles. MinIma2,'Visible','off')4045 % set(handles. MaxIma2,'Visible','off')4043 % set(handles.num_MinIma,'Visible','off') 4044 % set(handles.num_MaxIma,'Visible','off') 4046 4045 % set(handles.ImaThreshold2,'Value',0) 4047 4046 % if isequal(get(handles.CheckFix2,'Value'),0) & isequal(get(handles.CheckPatch2,'Value'),0) … … 4091 4090 % set(handles.frame_fix2,'BackgroundColor',[1 1 0]) 4092 4091 % set(handles.REMOVE2,'Visible','on') 4093 % set(handles. vec_Fmin2_2,'Visible','on')4094 % set(handles. vec_F4,'Visible','on')4095 % set(handles. vec_F3_2,'Visible','on')4096 % set(handles. thresh_vec2C,'Visible','on')4092 % set(handles.CheckFmin2,'Visible','on') 4093 % set(handles.CheckF4,'Visible','on') 4094 % set(handles.CheckF3,'Visible','on') 4095 % set(handles.num_MinCorr,'Visible','on') 4097 4096 % set(handles.thresh_vec2C_text,'Visible','on') 4098 % set(handles. thresh_vel2,'Visible','on')4099 % set(handles. thresh_vel2_text,'Visible','on')4100 % set(handles. mask_fix2,'Visible','on')4097 % set(handles.num_MinVel,'Visible','on') 4098 % set(handles.TitleMinVel,'Visible','on') 4099 % set(handles.txt_MaskName,'Visible','on') 4101 4100 % set(handles.CheckMask,'Visible','on') 4102 4101 % set(handles.ListPairCiv2,'Visible','on') … … 4105 4104 % set(handles.get_ref_fix2,'Visible','on') 4106 4105 % set(handles.ref_fix2,'Visible','on') 4107 % set(handles. inf_sup2,'Visible','on')4106 % set(handles.num_MinVel,'Visible','on') 4108 4107 % set(handles.field_ref2,'Visible','on') 4109 4108 … … 4113 4112 % set(handles.frame_fix2,'BackgroundColor',[0.831 0.816 0.784]) 4114 4113 % set(handles.REMOVE2,'Visible','off') 4115 % set(handles. vec_Fmin2_2,'Visible','off')4116 % set(handles. vec_F4,'Visible','off')4117 % set(handles. vec_F3_2,'Visible','off')4118 % set(handles. thresh_vec2C,'Visible','off')4114 % set(handles.CheckFmin2,'Visible','off') 4115 % set(handles.CheckF4,'Visible','off') 4116 % set(handles.CheckF3,'Visible','off') 4117 % set(handles.num_MinCorr,'Visible','off') 4119 4118 % set(handles.thresh_vec2C_text,'Visible','off') 4120 % set(handles. thresh_vel2,'Visible','off')4121 % set(handles. thresh_vel2_text,'Visible','off')4122 % set(handles. mask_fix2,'Visible','off')4119 % set(handles.num_MinVel,'Visible','off') 4120 % set(handles.TitleMinVel,'Visible','off') 4121 % set(handles.txt_MaskName,'Visible','off') 4123 4122 % set(handles.CheckMask,'Visible','off') 4124 4123 % set(handles.get_ref_fix2,'Visible','off') 4125 4124 % set(handles.ref_fix2,'Visible','off') 4126 % set(handles. inf_sup2,'Visible','off')4125 % set(handles.num_MinVel,'Visible','off') 4127 4126 % set(handles.field_ref2,'Visible','off') 4128 4127 % if isequal(get(handles.CheckCiv2,'Value'),0) & isequal(get(handles.CheckPatch2,'Value'),0) … … 4211 4210 % iby_val=str2double(get(handles.num_By,'String')); 4212 4211 % par.iby=num2str(iby_val); 4213 % isx=get(handles.num_S x,'String');4214 % if isnan(str2double(isx)), isx='41'; set(handles.num_S x,'String','41'), end; %default4215 % if str2double(isx)<ibx_val+8,isx=num2str(ibx_val+8); set(handles.num_S x,'String',num2str(ibx_val+8)); end4216 % isy=get(handles.num_S y,'String');4217 % if isnan(str2double(isy)), isy='41'; set(handles.num_S y,'String','41'), end;%default4218 % if str2double(isy)<iby_val+8,isy=num2str(iby_val+8); set(handles.num_S y,'String',num2str(iby_val+8)); end4219 % par.isx=get(handles.num_S x,'String');4220 % par.isy=get(handles.num_S y,'String');4212 % isx=get(handles.num_Searchx,'String'); 4213 % if isnan(str2double(isx)), isx='41'; set(handles.num_Searchx,'String','41'), end; %default 4214 % if str2double(isx)<ibx_val+8,isx=num2str(ibx_val+8); set(handles.num_Searchx,'String',num2str(ibx_val+8)); end 4215 % isy=get(handles.num_Searchy,'String'); 4216 % if isnan(str2double(isy)), isy='41'; set(handles.num_Searchy,'String','41'), end;%default 4217 % if str2double(isy)<iby_val+8,isy=num2str(iby_val+8); set(handles.num_Searchy,'String',num2str(iby_val+8)); end 4218 % par.isx=get(handles.num_Searchx,'String'); 4219 % par.isy=get(handles.num_Searchy,'String'); 4221 4220 % par.shiftx=get(handles.num_Shiftx,'String'); 4222 4221 % par.shifty=get(handles.num_Shifty,'String'); 4223 4222 % if isnan(str2double(par.isx)) 4224 4223 % par.isx='41';%default 4225 % set(handles.num_S x,'String','41');4224 % set(handles.num_Searchx,'String','41'); 4226 4225 % end 4227 4226 % if isnan(str2double(par.isy)) 4228 4227 % par.isy='41'; %default 4229 % set(handles.num_S y,'String','41');4228 % set(handles.num_Searchy,'String','41'); 4230 4229 % end 4231 4230 % if isnan(str2double(par.shiftx)) … … 4287 4286 function par=read_param_civ2(handles,file_ima) 4288 4287 %------------------------------------------------------------------------ 4289 par.ibx=get(handles. ibx_civ2,'String');4290 par.iby=get(handles. iby_civ2,'String');4291 par.rho=get(handles. rho_civ2,'String');4292 par.decimal=int2str(get(handles. decimal,'Value'));4293 par.deformation=int2str(get(handles. deformation,'Value'));4288 par.ibx=get(handles.num_Bx,'String'); 4289 par.iby=get(handles.num_By,'String'); 4290 par.rho=get(handles.num_Rho,'String'); 4291 par.decimal=int2str(get(handles.CheckDecimal,'Value')); 4292 par.deformation=int2str(get(handles.CheckDeformation,'Value')); 4294 4293 par.dx=get(handles.num_Dx,'String'); 4295 4294 par.dy=get(handles.num_Dy,'String'); … … 4449 4448 civ2.correlationBoxesSize_Y=par.iby; 4450 4449 civ2.ro=par.rho; 4451 %checkciv2.decimalShift=par. decimal;4452 %checkciv2. deformation=par.deformation;4450 %checkciv2.decimalShift=par.CheckDecimal; 4451 %checkciv2.CheckDeformation=par.CheckDeformation; 4453 4452 if isequal(par.decimal,'1') 4454 4453 civ2.decimalShift='y'; … … 4755 4754 set(handles.field_ref1,'String',menu_field); 4756 4755 set(handles.field_ref1,'Value',length(menu_field)); 4757 set(handles. inf_sup1,'Value',2);4758 set(handles.num_M axVel,'String','1');%default threshold4756 set(handles.num_MinVel,'Value',2); 4757 set(handles.num_MinVel,'String','1');%default threshold 4759 4758 set(handles.ref_fix1,'Enable','on') 4760 4759 … … 4799 4798 set(handles.field_ref2,'String',menu_field); 4800 4799 set(handles.field_ref2,'Value',length(menu_field)); 4801 set(handles. inf_sup2,'Value',2);4802 set(handles. thresh_vel2,'String','1');%default threshold4800 set(handles.num_MinVel,'Value',2); 4801 set(handles.num_MinVel,'String','1');%default threshold 4803 4802 set(handles.ref_fix2,'Enable','on') 4804 4803 set(handles.ref_fix2,'Visible','on') … … 4812 4811 function ref_fix1_Callback(hObject, eventdata, handles) 4813 4812 %------------------------------------------------------------------------ 4814 set(handles. inf_sup1,'Value',1);4813 set(handles.num_MinVel,'Value',1); 4815 4814 set(handles.field_ref1,'Value',1) 4816 4815 set(handles.field_ref1,'String',{' '}) … … 4822 4821 function ref_fix2_Callback(hObject, eventdata, handles) 4823 4822 %------------------------------------------------------------------------ 4824 set(handles. inf_sup2,'Value',1);4823 set(handles.num_MinVel,'Value',1); 4825 4824 set(handles.field_ref2,'Value',1) 4826 4825 set(handles.field_ref2,'String',{' '}) 4827 4826 set(handles.ref_fix2,'UserData',[]); 4828 4827 set(handles.ref_fix2,'String',''); 4829 set(handles. thresh_vel2,'String','0');4828 set(handles.num_MinVel,'String','0'); 4830 4829 4831 4830 %------------------------------------------------------------------------ … … 4870 4869 %------------------------------------------------------------------------ 4871 4870 if isequal(get(handles.ImaThreshold2,'Value'),1) 4872 set(handles. MinIma2,'Visible','on')4873 set(handles. MaxIma2,'Visible','on')4874 else 4875 set(handles. MinIma2,'Visible','off')4876 set(handles. MaxIma2,'Visible','off')4871 set(handles.num_MinIma,'Visible','on') 4872 set(handles.num_MaxIma,'Visible','on') 4873 else 4874 set(handles.num_MinIma,'Visible','off') 4875 set(handles.num_MaxIma,'Visible','off') 4877 4876 end 4878 4877 … … 5301 5300 fprintf(fid, ['ImageSize ' num2str(Param.Civ1.npx) ' ' num2str(Param.Civ1.npy) '\n' ]); %VERIFIER CAS GENERAL ? 5302 5301 fprintf(fid, ['CorrelationBoxesSize ' num2str(Param.Civ1.Bx) ' ' num2str(Param.Civ1.By) '\n' ]); 5303 fprintf(fid, ['SearchBoxeSize ' num2str(Param.Civ1.S x) ' ' num2str(Param.Civ1.Sy) '\n' ]);5302 fprintf(fid, ['SearchBoxeSize ' num2str(Param.Civ1.Searchx) ' ' num2str(Param.Civ1.Searchy) '\n' ]); 5304 5303 fprintf(fid, ['RO ' num2str(Param.Civ1.Rho) '\n' ]); 5305 5304 fprintf(fid, ['GridSpacing ' num2str(Param.Civ1.Dx) ' ' num2str(Param.Civ1.Dy) '\n' ]); … … 5348 5347 %% 5349 5348 filename=regexprep(filename,'.nc',''); 5349 MaskName_string='';%default 5350 if Param.(fixname).CheckMask 5351 MaskName_string=[' -maskName "' Param.(fixname).MaskName]; 5352 end 5353 MaxVel_string='';%default 5354 if ~isempty(Param.(fixname).MaxVel) 5355 MaxVel_string=[' -threshV ' num2str(Param.(fixname).MaxVel)] 5356 end 5350 5357 if isunix 5351 cmd=[Param.xml.FixBin ' -f ' filename '.nc -fi1 ' num2str(Param.(fixname).flagindex(1)) ... 5352 ' -fi2 ' num2str(Param.(fixname).flagindex(2)) ' -fi3 ' num2str(Param.(fixname).flagindex(3)) ... 5353 ' -threshC ' num2str(Param.(fixname).thresh_vecC)...% ' -threshV ' num2str(Param.(fixname).thresh_vel)... 5354 ' -maskName ' Param.(fixname).MaskName... 5355 '" > ' filename '.' lower(fixname) '.log 2>&1']; 5358 cmd=[Param.xml.FixBin ' -f ' filename '.nc -fi1 ' num2str(Param.(fixname).CheckFmin2) ... 5359 ' -fi2 ' num2str(Param.(fixname).CheckF2) ' -fi3 ' num2str(Param.(fixname).CheckF3) ... 5360 ' -threshC ' num2str(Param.(fixname).MinCorr) MaxVel_string MaskName_string... 5361 ' >' filename '.' lower(fixname) '.log 2>&1']; 5356 5362 else 5357 5363 cmd=['"' Param.xml.FixBin '" -f "' filename '.nc" -fi1 ' num2str(Param.(fixname).CheckFmin2)... … … 5387 5393 % ' -max ' thresh_value ' -nopt ' subdomain_patch ' > ' namelog ' 2>&1']; % redirect standard output to the log file 5388 5394 % end 5395 5396 5397 % --- Executes on button press in CheckStereo. 5398 function CheckStereo_Callback(hObject, eventdata, handles) 5399 % hObject handle to CheckStereo (see GCBO) 5400 % eventdata reserved - to be defined in a future version of MATLAB 5401 % handles structure with handles and user data (see GUIDATA) 5402 5403 % Hint: get(hObject,'Value') returns toggle state of CheckStereo -
trunk/src/mouse_alt_gui.m
r252 r287 1 1 %'mouse_alt_gui': function activated when the right mouse button is pressed on a GUI (callback for 'WindowButtonDownFcn') 2 % it displays a msg box with zoom of the current uicontrol display2 % it displays an editable msg box with zoom of the current uicontrol display 3 3 %------------------------------------------------------------------------ 4 4 function mouse_alt_gui(hObject,eventdata,handles) … … 6 6 if isequal(get(hObject,'SelectionType'),'alt') 7 7 set(hObject,'Units','pixels') 8 series_pos=get(hObject,'Position');%position of the current GUI (in pixels), asselected by the mouse8 GUI_pos=get(hObject,'Position');%position on the screen (in pixels) of the GUI selected by the mouse 9 9 set(hObject,'Units','normalized') 10 xy_fig=get(hObject,'CurrentPoint');% current point of the current GUI 11 hchild =get(hObject,'Children');%handles of all objects in the current GUI10 xy_fig=get(hObject,'CurrentPoint');% current point of the current GUI 11 hchildren=get(hObject,'Children');%handles of all objects in the current GUI 12 12 %% loop on all the objects in the current figure (selected by the last mouse click) 13 for ichild=1:length(hchild) 14 obj_pos=get(hchild(ichild),'Position');%position of the object 15 if numel(obj_pos)>=4 && xy_fig(1) >=obj_pos(1) && xy_fig(2) >= obj_pos(2)&& xy_fig(1) <=obj_pos(1)+obj_pos(3) && xy_fig(2) <= obj_pos(2)+obj_pos(4); 16 htype=get(hchild(ichild),'Type');%type of object child of the current figure 17 %if the mouse is over a uicontrol, look at the data 18 if isequal(htype,'uicontrol') && isequal(get(hchild(ichild),'Visible'),'on') 19 msg_pos(1:2)=series_pos(1:2)+obj_pos(1:2).*series_pos(3:4); 20 msgbox_uvmat(['uicontrol: ' get(hchild(ichild),'Tag')],'',get(hchild(ichild),'String'),msg_pos) 21 break 13 for ichild=1:length(hchildren) 14 hchild=hchildren(ichild); 15 obj_pos=get(hchild,'Position');%position of the object 16 if numel(obj_pos)>=4 && xy_fig(1) >=obj_pos(1) && xy_fig(2) >= obj_pos(2)&& xy_fig(1) <=obj_pos(1)+obj_pos(3) && xy_fig(2) <= obj_pos(2)+obj_pos(4); 17 htype=get(hchild,'Type');%type of object child of the current figure 18 switch htype 19 case 'uicontrol' 20 %if the mouse is over a uicontrol, look at the data 21 if strcmp(get(hchild,'Visible'),'on') 22 msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4); 23 output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos); 24 break 25 end 26 case 'uipanel' 27 panel_pos=obj_pos;%position of the panel 28 hhchildren=get(hchild,'Children');%handles of all objects in the current GUI 29 %% loop on all the objects in the current figure (selected by the last mouse click) 30 for iichild=1:length(hhchildren) 31 hchild=hhchildren(iichild); 32 rel_pos=get(hchild,'Position');%position of the object relative to the uipanel 33 obj_pos(1:2)=panel_pos(1:2)+rel_pos(1:2).*panel_pos(3:4); 34 obj_pos(3:4)=panel_pos(3:4).*rel_pos(3:4); 35 if numel(obj_pos)>=4 && xy_fig(1) >=obj_pos(1) && xy_fig(2) >= obj_pos(2)&& xy_fig(1) <=obj_pos(1)+obj_pos(3) && xy_fig(2) <= obj_pos(2)+obj_pos(4); 36 htype=get(hchild,'Type');%type of object child of the current figure 37 %if the mouse is over a uicontrol, look at the data 38 if strcmp(htype,'uicontrol') && strcmp(get(hchild,'Visible'),'on') 39 msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4); 40 output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos); 41 break 42 end 43 end 44 end 22 45 end 46 23 47 end 24 48 end 25 49 set(hObject,'Units','pixels') 50 set(hchild,'String',output_str) 26 51 end -
trunk/src/read_GUI.m
r281 r287 2 2 % --- read a GUI with handle 'handle' producing a structure 'struct' 3 3 function struct=read_GUI(handle) 4 struct=[];%default 4 5 hchild=get(handle,'children'); 5 6 for ichild=1:numel(hchild)
Note: See TracChangeset
for help on using the changeset viewer.