Changeset 613 for trunk


Ignore:
Timestamp:
Apr 19, 2013, 8:26:15 AM (12 years ago)
Author:
sommeria
Message:

a few bugs repaired, GUI sizes optimized

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r591 r613  
    8989set(hObject,'WindowButtonDownFcn',{'mouse_alt_gui',handles}) % allows mouse action with right button (zoom for uicontrol display)
    9090
    91 %set the position of the interface
    92 if exist('pos','var')&& length(pos)>=4
    93     set(hObject,'Position',pos);
    94 end
     91%% position
     92set(0,'Unit','points')
     93ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right
     94Width=350;% fig width in points (1/72 inch)
     95Height=min(0.9*ScreenSize(4),700);
     96Left=ScreenSize(3)- Width-40; %right edge close to the right, with margin=40
     97Bottom=ScreenSize(4)-Height-40; %put fig at top right
     98set(handles.geometry_calib,'Unit','points')
     99set(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
    95105
    96106%set menu of calibration options
  • trunk/src/read_civdata.m

    r612 r613  
    22%------------------------------------------------------------------
    33%
    4 % function [Field,VelTypeOut]=read_civdata(filename,FieldNames,VelType)
     4% function [Field,VelTypeOut]=read_civdata(FileName,FieldNames,VelType)
    55%
    66% OUTPUT:
     
    3030%
    3131% INPUT:
    32 % filename: file name (string).
     32% FileName: file name (string).
    3333% FieldNames =cell of field names to get, which can contain the strings:
    3434%             'ima_cor': image correlation, vec_c or vec2_C
     
    4545% 'nc2struct': reads a netcdf file
    4646
    47 function [Field,VelTypeOut,errormsg]=read_civdata(filename,FieldNames,VelType)
     47function [Field,VelTypeOut,errormsg]=read_civdata(FileName,FieldNames,VelType)
    4848
    4949%% default input
     
    6060    FieldNames=[]; %default
    6161end
     62Field=[];
     63VelTypeOut=VelType;
    6264errormsg='';
     65if ~exist(FileName,'file')
     66    errormsg=['input file ' FileName ' does not exist'];
     67    return
     68end
    6369if ischar(FieldNames), FieldNames={FieldNames}; end;
    6470ProjModeRequest='';
     
    7581
    7682%% reading data
    77 Data=nc2struct(filename,'ListGlobalAttribute','CivStage');
     83Data=nc2struct(FileName,'ListGlobalAttribute','CivStage');
    7884if isfield(Data,'Txt')
    7985     erromsg=['error in read_civdata: ' Data.Txt];
     
    8591    return
    8692else
    87     [Field,vardetect]=nc2struct(filename,varlist);%read the variables in the netcdf file
     93    [Field,vardetect]=nc2struct(FileName,varlist);%read the variables in the netcdf file
    8894end
    8995if isfield(Field,'Txt')
     
    9298end
    9399if 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'];
    95101     return
    96102end
  • trunk/src/set_object.m

    r606 r613  
    7979guidata(hObject, handles);
    8080
     81%% position
     82set(0,'Unit','points')
     83ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right
     84Width=300;% fig width in points (1/72 inch)
     85Height=min(0.8*ScreenSize(4),500);
     86Left=ScreenSize(3)- Width-40; %right edge close to the right, with margin=40
     87Bottom=ScreenSize(4)-Height-40; %put fig at top right
     88set(handles.set_object,'Unit','points')
     89set(handles.set_object,'Position',[Left Bottom Width Height])
     90
    8191%default
    8292if ~exist('ZBounds','var')
     
    155165%defaul settings
    156166set(get(handles.set_object,'children'),'enable','on')
    157    set(handles.PLOT,'enable','off')
     167set(handles.PLOT,'enable','off')
    158168% 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 uvmat
    163 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 end
     169% 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
    168178
    169179%------------------------------------------------------------------------
  • trunk/src/uigetfile_uvmat.m

    r612 r613  
    4848    uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.97 0.5 0.03],'BackgroundColor',BackgroundColor,...
    4949            '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,...
    5151        'String',InputDir,'FontUnits','points','FontSize',12,'FontWeight','bold');
    5252    uicontrol('Style','pushbutton','Tag','backward','Units','normalized','Position',[0.05 0.75 0.1 0.07],...
     
    9696end
    9797hfig=get(hObject,'parent');
     98hlist=findobj(hfig,'tag','list');% find the list object
     99set(hlist,'BackgroundColor',[1 1 0])
     100drawnow
    98101htitlebox=findobj(hfig,'tag','titlebox');
    99102DirName=get(htitlebox,'String');
     
    105108hcheck_date=findobj(hfig,'tag','check_date');
    106109ListFiles=list_files(DirName,get(hcheck_date,'Value'),sort_option);% list the directory content
    107 hlist=findobj(hfig,'tag','list');% find the list object
     110
    108111set(hlist,'String',ListFiles)
    109112Value=[];
     
    115118end
    116119set(hlist,'Value',Value)
    117 
     120set(hlist,'BackgroundColor',[0.7 0.7 0.7])
    118121if strcmp(get(hfig,'Tag'),'status_display')
    119122    hseries=findobj(allchild(0),'tag','series');
     
    217220    %         FullSelectName=fileparts(fileparts(FullSelectName));
    218221    %     end
     222    set(hObject,'BackgroundColor',[1 1 0])% paint list in yellow to indicate action
     223    drawnow
    219224    hbackward=findobj(hfig,'Tag','backward');
    220225    set(hbackward,'UserData',DirName); %store the current dir for future backward action
     
    225230    end
    226231    hcheck_date=findobj(hfig,'tag','check_date');
     232   
    227233    ListFiles=list_files(FullSelectName,get(hcheck_date,'Value'),sort_option);% list the directory content
    228234    set(hObject,'Value',1)
    229235    set(hObject,'String',ListFiles)
     236    set(hObject,'BackgroundColor',[0.7 0.7 0.7])
    230237    set(htitlebox,'String',FullSelectName)% record the new dir name
    231238elseif exist(FullSelectName,'file')%visualise the field if it exists
     
    288295DirName=pwd;
    289296hfig=get(hObject,'parent');
     297hlist=findobj(hfig,'tag','list');% find the list object
     298set(hlist,'BackgroundColor',[1 1 0])
     299drawnow
    290300sort_option='name';%default
    291301hsort_option=findobj(hfig,'tag','sort_option');
     
    297307htitlebox=findobj(hfig,'Tag','titlebox');
    298308set(htitlebox,'String',DirName)% record the new dir name
    299 hlist=findobj(hfig,'tag','list');% find the list object
     309set(hlist,'Value',1)
    300310set(hlist,'String',ListFiles)
     311set(hlist,'BackgroundColor',[0.7 0.7 0.7])
    301312%------------------------------------------------------------------------
    302313
Note: See TracChangeset for help on using the changeset viewer.