Changeset 609 for trunk/src/uvmat.m


Ignore:
Timestamp:
Apr 9, 2013, 8:20:00 PM (8 years ago)
Author:
sommeria
Message:

various bugs corrected after tests with Windows OS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r606 r609  
    3232%          .OpenParam: structure containing parameters defined when uvmat is opened
    3333%                       .PosColorbar: position (1x4 vector)of the colorbar (relative to the fig uvmat)
    34 %                       .PosSetObject: position of set_object
    3534%                       .PosGeometryCalib: size of set_object
    3635%                       .NbBuiltin: nbre of functions always displayed in TransformName menu
     
    175174path_uvmat=fileparts(which('uvmat'));
    176175
    177 %% set the position of colorbar and ancillary GUIs:
    178 set(hObject,'Units','Normalized')
    179 movegui(hObject,'center')
     176%% set the position of the GUI, colorbar and ancillary GUIs:
     177set(hObject,'Units','pixels')%
     178set(0,'Units','pixels');
     179ScreenSize=get(0,'ScreenSize');%size of the current screen
     180Width=1050;
     181Height=700;
     182%adjust to screen size (reduced by a min margin)
     183RescaleFactor=min((ScreenSize(3)-80)/Width,(ScreenSize(4)-80)/Height);
     184if RescaleFactor>1
     185    RescaleFactor=RescaleFactor/2+1/2; %reduce the rescale factor to provide an increased margin for a big screen
     186end
     187Width=Width*RescaleFactor;
     188Height=Height*RescaleFactor;
     189LeftX=80*RescaleFactor;%position of the left fig side, in pixels (put to the left side, with some margin)
     190LowY=round(ScreenSize(4)/2-Height/2); % put at the middle height on the screen
     191set(hObject,'Position',[LeftX LowY Width Height])
     192
     193%set(hObject,'Units','Normalized')
     194
    180195%UvData.OpenParam.PosColorbar=[0.8450    0.0900    0.0190    0.3600];
    181196UvData.OpenParam.PosColorbar=[0.805 0.022 0.019 0.445];
    182 UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object
     197%UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object
    183198UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE)
    184199% UvData.OpenParam.CalSize=[0.28 1];
     
    197212
    198213%% initialisation
    199 % set(handles.ListObject,'Value',1)% default: empty projection objectproj_field
    200 % set(handles.ListObject,'String',{''})
    201 % set(handles.ListObject_1,'Value',1)% default: empty projection objectproj_field
    202 % set(handles.ListObject_1,'String',{''})
    203214set(handles.FieldName,'Value',1)
    204215set(handles.FieldName,'string',{''})
     
    337348function MenuBrowse_Callback(hObject, eventdata, handles)
    338349[RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    339 oldfile=fullfile(RootPath,SubDir);
     350oldfile=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
    340351if isempty(oldfile) %loads the previously stored file name and set it as default in the file_input box
    341352    oldfile=get(handles.RootPath,'UserData');
    342353end
    343 hfig=uigetfile_uvmat('file browser',fileparts(oldfile));
    344 uiwait(hfig);
    345 if ishandle(hfig) % stop if browser closed without selection
    346     fileinput=get(hfig,'UserData');% retrieve the input file selection
    347     delete(hfig)
    348     % display the selected field and related information
     354fileinput=uigetfile_uvmat('select an input file:',oldfile);
     355if ~isempty(fileinput)
    349356    display_file_name(handles,fileinput)
    350357end
    351 
    352 %
    353 %
    354 %
    355 % [FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',oldfile);
    356 % if ~ischar(FileName),return,end %abandon if the browser is cancelled
    357 % fileinput=[PathName FileName];%complete file name
    358358
    359359%% display the selected field and related information
     
    435435%------------------------------------------------------------------------
    436436RootPath=get(handles.RootPath,'String');
    437 [FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',RootPath);
    438 if ~ischar(FileName),return,end %abandon if the browser is cancelled
    439 fileinput_1=[PathName FileName];%complete file name
    440 
    441 % refresh the current displayed field
    442 set(handles.SubField,'Value',1)
    443 display_file_name(handles,fileinput_1,2)
    444 
    445 %update list of recent files in the menubar
    446 MenuFile_1=fileinput_1;
    447 MenuFile_2=get(handles.MenuFile_1,'Label');
    448 MenuFile_3=get(handles.MenuFile_2,'Label');
    449 MenuFile_4=get(handles.MenuFile_3,'Label');
    450 MenuFile_5=get(handles.MenuFile_4,'Label');
    451 set(handles.MenuFile_1,'Label',MenuFile_1)
    452 set(handles.MenuFile_2,'Label',MenuFile_2)
    453 set(handles.MenuFile_3,'Label',MenuFile_3)
    454 set(handles.MenuFile_4,'Label',MenuFile_4)
    455 set(handles.MenuFile_5,'Label',MenuFile_5)
    456 set(handles.MenuFile_1_1,'Label',MenuFile_1)
    457 set(handles.MenuFile_2_1,'Label',MenuFile_2)
    458 set(handles.MenuFile_3_1,'Label',MenuFile_3)
    459 set(handles.MenuFile_4_1,'Label',MenuFile_4)
    460 set(handles.MenuFile_5_1,'Label',MenuFile_5)
    461 % dir_perso=prefdir;
    462 % profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    463 % if exist(profil_perso,'file')
    464 %     save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-append'); %store the file names for future opening of uvmat
    465 % else
    466 %     txt=ver('MATLAB');
    467 %     Release=txt.Release;
    468 %     relnumb=str2double(Release(3:4));
    469 %     if relnumb >= 14
    470 %         save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat
    471 %     else
    472 %         save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5'); %store the file names for future opening of uvmat
    473 %     end
    474 % end
     437SubDir=get(handles.SubDir,'String');
     438fileinput_1=uigetfile_uvmat('select a second input file:',fullfile(RootPath,SubDir));
     439if ~isempty(fileinput_1)
     440    % [FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',RootPath);
     441    % if ~ischar(FileName),return,end %abandon if the browser is cancelled
     442    % fileinput_1=[PathName FileName];%complete file name
     443   
     444    % refresh the current displayed field
     445    set(handles.SubField,'Value',1)
     446    display_file_name(handles,fileinput_1,2)
     447   
     448    %update list of recent files in the menubar
     449    MenuFile_1=fileinput_1;
     450    MenuFile_2=get(handles.MenuFile_1,'Label');
     451    MenuFile_3=get(handles.MenuFile_2,'Label');
     452    MenuFile_4=get(handles.MenuFile_3,'Label');
     453    MenuFile_5=get(handles.MenuFile_4,'Label');
     454    set(handles.MenuFile_1,'Label',MenuFile_1)
     455    set(handles.MenuFile_2,'Label',MenuFile_2)
     456    set(handles.MenuFile_3,'Label',MenuFile_3)
     457    set(handles.MenuFile_4,'Label',MenuFile_4)
     458    set(handles.MenuFile_5,'Label',MenuFile_5)
     459    set(handles.MenuFile_1_1,'Label',MenuFile_1)
     460    set(handles.MenuFile_2_1,'Label',MenuFile_2)
     461    set(handles.MenuFile_3_1,'Label',MenuFile_3)
     462    set(handles.MenuFile_4_1,'Label',MenuFile_4)
     463    set(handles.MenuFile_5_1,'Label',MenuFile_5)
     464end
    475465
    476466% --------------------------------------------------------------------
     
    20031993num_j1=stra2num(get(handles.j1,'String'));
    20041994num_j2=stra2num(get(handles.j2,'String'));
    2005 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(FileIndex_1);
     1995[tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(FileIndex_1);% get the indices of the second series from the string FileIndex_1
     1996if isempty(j1_1)% case of movies, the index is not given by file index
     1997    j1_1=num_j1;
     1998end
    20061999
    20072000errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2,i1_1,i2_1,j1_1,j2_1);
     
    22042197            end 
    22052198         case 'multimage'
    2206             if ~strcmp(NomType_1,'*')
    2207                 frame_index_1=j1_1;%frame index for movies or multimage
     2199            if strcmp(NomType_1,'*')%frame index for movies or multimage
     2200                frame_index_1=i1_1;
    22082201            else
    2209                 frame_index_1=i1_1;
     2202                frame_index_1=j1_1;
    22102203            end   
    22112204        case 'vol' %TODO: update
     
    35093502    [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface with action on haxes,
    35103503                                                      % associate the set_object interface handle to the plotting axes
    3511     set(hset_object,'Position',get(handles.uvmat,'Position')+UvData.OpenParam.PosSetObject)
     3504    %set(hset_object,'Position',get(handles.uvmat,'Position')+UvData.OpenParam.PosSetObject)
    35123505    UvData.MouseAction='create_object';
    35133506else
     
    44024395    [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%read plotting parameters on the GUI view_field);
    44034396    errormsg=fill_GUI(PlotParam,hview_field);
    4404                     for list={'Scalar','Vectors'}
    4405                     if ~isfield(PlotParamOut,list{1})
    4406                         set(hhview_field.(list{1}),'Visible','off')
    4407                     end
    4408                 end
     4397    for list={'Scalar','Vectors'}
     4398        if ~isfield(PlotParam,list{1})
     4399            set(hhview_field.(list{1}),'Visible','off')
     4400        end
     4401    end
    44094402    %write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    44104403    haxes=findobj(hview_field,'tag','axes3');
Note: See TracChangeset for help on using the changeset viewer.