- Timestamp:
- Apr 19, 2013, 8:26:15 AM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r591 r613 89 89 set(hObject,'WindowButtonDownFcn',{'mouse_alt_gui',handles}) % allows mouse action with right button (zoom for uicontrol display) 90 90 91 %set the position of the interface 92 if exist('pos','var')&& length(pos)>=4 93 set(hObject,'Position',pos); 94 end 91 %% position 92 set(0,'Unit','points') 93 ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right 94 Width=350;% fig width in points (1/72 inch) 95 Height=min(0.9*ScreenSize(4),700); 96 Left=ScreenSize(3)- Width-40; %right edge close to the right, with margin=40 97 Bottom=ScreenSize(4)-Height-40; %put fig at top right 98 set(handles.geometry_calib,'Unit','points') 99 set(handles.geometry_calib,'Position',[Left Bottom Width Height]) 100 101 % %set the position of the interface 102 % if exist('pos','var')&& length(pos)>=4 103 % set(hObject,'Position',pos); 104 % end 95 105 96 106 %set menu of calibration options -
trunk/src/read_civdata.m
r612 r613 2 2 %------------------------------------------------------------------ 3 3 % 4 % function [Field,VelTypeOut]=read_civdata( filename,FieldNames,VelType)4 % function [Field,VelTypeOut]=read_civdata(FileName,FieldNames,VelType) 5 5 % 6 6 % OUTPUT: … … 30 30 % 31 31 % INPUT: 32 % filename: file name (string).32 % FileName: file name (string). 33 33 % FieldNames =cell of field names to get, which can contain the strings: 34 34 % 'ima_cor': image correlation, vec_c or vec2_C … … 45 45 % 'nc2struct': reads a netcdf file 46 46 47 function [Field,VelTypeOut,errormsg]=read_civdata( filename,FieldNames,VelType)47 function [Field,VelTypeOut,errormsg]=read_civdata(FileName,FieldNames,VelType) 48 48 49 49 %% default input … … 60 60 FieldNames=[]; %default 61 61 end 62 Field=[]; 63 VelTypeOut=VelType; 62 64 errormsg=''; 65 if ~exist(FileName,'file') 66 errormsg=['input file ' FileName ' does not exist']; 67 return 68 end 63 69 if ischar(FieldNames), FieldNames={FieldNames}; end; 64 70 ProjModeRequest=''; … … 75 81 76 82 %% reading data 77 Data=nc2struct( filename,'ListGlobalAttribute','CivStage');83 Data=nc2struct(FileName,'ListGlobalAttribute','CivStage'); 78 84 if isfield(Data,'Txt') 79 85 erromsg=['error in read_civdata: ' Data.Txt]; … … 85 91 return 86 92 else 87 [Field,vardetect]=nc2struct( filename,varlist);%read the variables in the netcdf file93 [Field,vardetect]=nc2struct(FileName,varlist);%read the variables in the netcdf file 88 94 end 89 95 if isfield(Field,'Txt') … … 92 98 end 93 99 if vardetect(1)==0 94 errormsg=[ 'requested field not available in ' filename '/' VelType ': need to run patch'];100 errormsg=[ 'requested field not available in ' FileName '/' VelType ': need to run patch']; 95 101 return 96 102 end -
trunk/src/set_object.m
r606 r613 79 79 guidata(hObject, handles); 80 80 81 %% position 82 set(0,'Unit','points') 83 ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right 84 Width=300;% fig width in points (1/72 inch) 85 Height=min(0.8*ScreenSize(4),500); 86 Left=ScreenSize(3)- Width-40; %right edge close to the right, with margin=40 87 Bottom=ScreenSize(4)-Height-40; %put fig at top right 88 set(handles.set_object,'Unit','points') 89 set(handles.set_object,'Position',[Left Bottom Width Height]) 90 81 91 %default 82 92 if ~exist('ZBounds','var') … … 155 165 %defaul settings 156 166 set(get(handles.set_object,'children'),'enable','on') 157 167 set(handles.PLOT,'enable','off') 158 168 % end 159 huvmat=findobj(allchild(0),'tag','uvmat');160 UvData=get(huvmat,'UserData');161 pos_uvmat=get(huvmat,'Position');162 % position the set_object GUI with respect to uvmat163 if isfield(UvData,'SetObjectOrigin')164 pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);165 pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);166 set(hObject,'Position',pos_set_object)167 end169 % huvmat=findobj(allchild(0),'tag','uvmat'); 170 % UvData=get(huvmat,'UserData'); 171 % pos_uvmat=get(huvmat,'Position'); 172 % %position the set_object GUI with respect to uvmat 173 % if isfield(UvData,'SetObjectOrigin') 174 % pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2); 175 % pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4); 176 % set(hObject,'Position',pos_set_object) 177 % end 168 178 169 179 %------------------------------------------------------------------------ -
trunk/src/uigetfile_uvmat.m
r612 r613 48 48 uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.97 0.5 0.03],'BackgroundColor',BackgroundColor,... 49 49 'String','path:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','left'); 50 uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.89 0.9 0.08],'tag','titlebox','Max',2,'BackgroundColor',[1 1 1], ...50 uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.89 0.9 0.08],'tag','titlebox','Max',2,'BackgroundColor',[1 1 1],'Callback',@refresh_GUI,... 51 51 'String',InputDir,'FontUnits','points','FontSize',12,'FontWeight','bold'); 52 52 uicontrol('Style','pushbutton','Tag','backward','Units','normalized','Position',[0.05 0.75 0.1 0.07],... … … 96 96 end 97 97 hfig=get(hObject,'parent'); 98 hlist=findobj(hfig,'tag','list');% find the list object 99 set(hlist,'BackgroundColor',[1 1 0]) 100 drawnow 98 101 htitlebox=findobj(hfig,'tag','titlebox'); 99 102 DirName=get(htitlebox,'String'); … … 105 108 hcheck_date=findobj(hfig,'tag','check_date'); 106 109 ListFiles=list_files(DirName,get(hcheck_date,'Value'),sort_option);% list the directory content 107 hlist=findobj(hfig,'tag','list');% find the list object 110 108 111 set(hlist,'String',ListFiles) 109 112 Value=[]; … … 115 118 end 116 119 set(hlist,'Value',Value) 117 120 set(hlist,'BackgroundColor',[0.7 0.7 0.7]) 118 121 if strcmp(get(hfig,'Tag'),'status_display') 119 122 hseries=findobj(allchild(0),'tag','series'); … … 217 220 % FullSelectName=fileparts(fileparts(FullSelectName)); 218 221 % end 222 set(hObject,'BackgroundColor',[1 1 0])% paint list in yellow to indicate action 223 drawnow 219 224 hbackward=findobj(hfig,'Tag','backward'); 220 225 set(hbackward,'UserData',DirName); %store the current dir for future backward action … … 225 230 end 226 231 hcheck_date=findobj(hfig,'tag','check_date'); 232 227 233 ListFiles=list_files(FullSelectName,get(hcheck_date,'Value'),sort_option);% list the directory content 228 234 set(hObject,'Value',1) 229 235 set(hObject,'String',ListFiles) 236 set(hObject,'BackgroundColor',[0.7 0.7 0.7]) 230 237 set(htitlebox,'String',FullSelectName)% record the new dir name 231 238 elseif exist(FullSelectName,'file')%visualise the field if it exists … … 288 295 DirName=pwd; 289 296 hfig=get(hObject,'parent'); 297 hlist=findobj(hfig,'tag','list');% find the list object 298 set(hlist,'BackgroundColor',[1 1 0]) 299 drawnow 290 300 sort_option='name';%default 291 301 hsort_option=findobj(hfig,'tag','sort_option'); … … 297 307 htitlebox=findobj(hfig,'Tag','titlebox'); 298 308 set(htitlebox,'String',DirName)% record the new dir name 299 hlist=findobj(hfig,'tag','list');% find the list object 309 set(hlist,'Value',1) 300 310 set(hlist,'String',ListFiles) 311 set(hlist,'BackgroundColor',[0.7 0.7 0.7]) 301 312 %------------------------------------------------------------------------ 302 313
Note: See TracChangeset
for help on using the changeset viewer.