Changeset 503


Ignore:
Timestamp:
Jul 26, 2012, 10:14:52 AM (9 years ago)
Author:
sommeria
Message:

datatree_browse introduced (still work to do)
get_field revised to introduce new transform fcts, like FFT

Location:
trunk/src
Files:
2 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/compile_functions.m

    r481 r503  
     1% check
     2if isempty(which('mcc')
     3    msgbox_uvmat('no Matlab compiler toolbox mcc installed')
     4    return
     5end
     6display('compiling civ_matlab...')
    17% commands to compile civ_matlab and eventually other functions
    2 
    38mcc -m -R -nojvm -R -nodisplay civ_matlab.m
    49system('mv -f civ_matlab bin/');
     
    611system('rm run_civ_matlab.sh');
    712system('chmod +x civ_matlab.sh');
     13display('** END **')
    814
    915
    1016
    11 
  • trunk/src/get_field.m

    r494 r503  
    2222function varargout = get_field(varargin)
    2323
    24 % Last Modified by GUIDE v2.5 31-May-2012 22:52:28
     24% Last Modified by GUIDE v2.5 26-Jul-2012 09:11:23
    2525
    2626% Begin initialization code - DO NOT EDIT
     
    241241end
    242242if maxdim>=2
    243     set(handles.check_1Dplot,'Value',0)
     243    set(handles.CheckPlot1D,'Value',0)
    244244    if ~isempty(VarType{imax}.vector_x) && ~isempty(VarType{imax}.vector_y)     
    245         set(handles.check_vector,'Value',1)
    246         set(handles.check_scalar,'Value',0)
     245        set(handles.CheckVector,'Value',1)
     246        set(handles.CheckScalar,'Value',0)
    247247        set(handles.vector_x,'Value',VarType{imax}.vector_x(1))
    248248        set(handles.vector_y,'Value',VarType{imax}.vector_y(1))
     
    258258        end
    259259    else
    260         set(handles.check_scalar,'Value',1)
    261         set(handles.check_vector,'Value',0)
     260        set(handles.CheckScalar,'Value',1)
     261        set(handles.CheckVector,'Value',0)
    262262        if isfield(VarType{imax},'scalar') && length(VarType{imax}.scalar)>=1
    263263            set(handles.scalar,'Value',VarType{imax}.scalar(1))
     
    282282        end
    283283    end
    284     check_1Dplot_Callback(handles.check_1Dplot, [], handles)
    285     check_scalar_Callback(handles.check_scalar, [], handles)
    286     check_vector_Callback(handles.check_vector, [], handles)
     284    CheckPlot1D_Callback(handles.CheckPlot1D, [], handles)
     285    CheckScalar_Callback(handles.CheckScalar, [], handles)
     286    CheckVector_Callback(handles.CheckVector, [], handles)
    287287end
    288288%scalar_Callback(handles.get_field, eventdata, handles)
     
    323323 Field=get(hselect_field,'UserData');%current input field
    324324 xdispindex=get(handles.abscissa,'Value');%index in the list of abscissa
    325 % test_2D=get(handles.check_vector,'Value');% =1 for vector fields
    326 % test_scalar=get(handles.check_scalar,'Value');% =1 for scalar fields
     325% test_2D=get(handles.CheckVector,'Value');% =1 for vector fields
     326% test_scalar=get(handles.CheckScalar,'Value');% =1 for scalar fields
    327327%if isequal(xdispindex,1)% blank selection, no selected TimeVariable for abscissa
    328328%     Txt=Field.ListVarName;
     
    584584
    585585% select the indices of field variables for 2D plots
    586 test_check_1Dplot=get(handles.check_1Dplot,'Value');
    587 test_scalar=get(handles.check_scalar,'Value');
    588 test_vector=get(handles.check_vector,'Value');
     586test_CheckPlot1D=get(handles.CheckPlot1D,'Value');
     587test_scalar=get(handles.CheckScalar,'Value');
     588test_vector=get(handles.CheckVector,'Value');
    589589
    590590%transform if needed (calibration)
     
    749749if isempty(index_detect)
    750750    VarIndex_tot=[VarIndex_tot VarIndex.x];
    751 elseif ~test_check_1Dplot
     751elseif ~test_CheckPlot1D
    752752    VarIndex.x=[];
    753753    set(handles.abscissa,'Value',1)%vchosen abscissa already chosen, suppres it as abscissa
     
    11581158
    11591159%------------------------------------------------------------------------
    1160 % --- Executes on button press in check_1Dplot.
    1161 function check_1Dplot_Callback(hObject, eventdata, handles)
    1162 %------------------------------------------------------------------------
    1163 val=get(handles.check_1Dplot,'Value');
     1160% --- Executes on button press in CheckPlot1D.
     1161function CheckPlot1D_Callback(hObject, eventdata, handles)
     1162%------------------------------------------------------------------------
     1163val=get(handles.CheckPlot1D,'Value');
    11641164if isequal(val,0)
    11651165    set(handles.Panel1Dplot,'Visible','off')
     
    11691169
    11701170%------------------------------------------------------------------------
    1171 % --- Executes on button press in check_scalar.
    1172 function check_scalar_Callback(hObject, eventdata, handles)
    1173 %------------------------------------------------------------------------
    1174 val=get(handles.check_scalar,'Value');
     1171% --- Executes on button press in CheckScalar.
     1172function CheckScalar_Callback(hObject, eventdata, handles)
     1173%------------------------------------------------------------------------
     1174val=get(handles.CheckScalar,'Value');
    11751175if isequal(val,0)
    11761176    set(handles.PanelScalar,'Visible','off')
     
    11801180
    11811181%------------------------------------------------------------------------
    1182 % --- Executes on button press in check_vector.
    1183 function check_vector_Callback(hObject, eventdata, handles)
    1184 %------------------------------------------------------------------------
    1185 val=get(handles.check_vector,'Value');
     1182% --- Executes on button press in CheckVector.
     1183function CheckVector_Callback(hObject, eventdata, handles)
     1184%------------------------------------------------------------------------
     1185val=get(handles.CheckVector,'Value');
    11861186if isequal(val,0)
    11871187    set(handles.PanelVectors,'Visible','off')
     
    12881288test_vector=0;
    12891289if iscell(GUI_input)
    1290     for ilist=1:length(GUI_input)
    1291         switch GUI_input{ilist}
     1290    for ilist=1:size(GUI_input,1)
     1291        switch GUI_input{ilist,1}
    12921292                           %RootFile always visible
    1293             case 'check_1Dplot'   
    1294                  test_1Dplot=1;
    1295             case 'check_scalar'
    1296                  test_scalar=1;   
    1297             case 'check_vector'   
    1298                  test_vector=1;
    1299         end
    1300     end
    1301 end
    1302 set(handles.check_1Dplot,'Value',test_1Dplot);
    1303 set(handles.check_scalar,'Value',test_scalar);
    1304 set(handles.check_vector,'Value',test_vector);
    1305 check_1Dplot_Callback(hObject, eventdata, handles)
    1306 check_scalar_Callback(hObject, eventdata, handles)
    1307 check_vector_Callback(hObject, eventdata, handles)
     1293            case 'CheckPlot1D'   
     1294                 test_1Dplot=isequal(GUI_input{ilist,2},'on');
     1295            case 'CheckScalar'
     1296                 test_scalar=isequal(GUI_input{ilist,2},'on');   
     1297            case 'CheckVector'   
     1298                 test_vector=isequal(GUI_input{ilist,2},'on');
     1299        end
     1300    end
     1301end
     1302set(handles.CheckPlot1D,'Value',test_1Dplot);
     1303set(handles.CheckScalar,'Value',test_scalar);
     1304set(handles.CheckVector,'Value',test_vector);
     1305CheckPlot1D_Callback(hObject, eventdata, handles)
     1306CheckScalar_Callback(hObject, eventdata, handles)
     1307CheckVector_Callback(hObject, eventdata, handles)
    13081308
    13091309
  • trunk/src/read_get_field.m

    r498 r503  
    2424
    2525% select the indices of field variables for 2D plots
    26 test_1Dplot=get(handles.check_1Dplot,'Value');
    27 test_scalar=get(handles.check_scalar,'Value');
    28 test_vector=get(handles.check_vector,'Value');
     26test_1Dplot=get(handles.CheckPlot1D,'Value');
     27test_scalar=get(handles.CheckScalar,'Value');
     28test_vector=get(handles.CheckVector,'Value');
    2929
    3030nbvar=0;
  • trunk/src/uvmat.m

    r501 r503  
    414414         end
    415415end
    416 % [FileName, PathName] = uigetfile( ...
    417 %        {'*.xml;*.xls;*.civ;*.png;*.jpg;*.tif;*.avi;*.AVI;*.vol;*.nc;*.cmx;*.fig;*.log;*.dat;*.bat;', ' (*.xml,*.xls,*.civ,*.jpg ,*.png, .tif, *.avi,*.vol,*.nc,*.cmx,*.fig,*.log,*.dat,*.bat)';
    418 %        '*.xml',  '.xml files '; ...
    419 %         '*.xls',  '.xls files '; ...
    420 %         '*.civ',  '.civ files '; ...
    421 %         '*.jpg',' jpeg image files'; ...
    422 %         '*.png','.png image files'; ...
    423 %         '*.tif','.tif image files'; ...
    424 %         '*.avi;*.AVI','.avi movie files'; ...
    425 %         '*.vol','.volume images (png)'; ...
    426 %         '*.nc','.netcdf files'; ...
    427 %         '*.cdf','.netcdf files'; ...
    428 %         '*.cmx','.cmx text files ';...
    429 %         '*.fig','.fig files (matlab fig)';...
    430 %         '*.log','.log text files ';...
    431 %         '*.dat','.dat text files ';...
    432 %         '*.bat','.bat system command text files';...
    433 %         '*.*',  'All Files (*.*)'}, ...
    434 %         'Pick a file',oldfile);
    435 
    436416[FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',oldfile);
    437417fileinput=[PathName FileName];%complete file name
    438 sizf=size(fileinput);
    439 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end
    440 
    441 % display the selected field and related information
     418if ~exist(fileinput,'file')
     419    return %abandon of the browser is cancelled
     420end
     421
     422%% display the selected field and related information
    442423display_file_name( handles,fileinput)
    443424
     
    483464%------------------------------------------------------------------------
    484465RootPath=get(handles.RootPath,'String');
    485 % [FileName, PathName, filterindex] = uigetfile( ...
    486 %        {'*.xml;*.xls;*.civ;*.jpg;*.png;*.avi;*.AVI;*.nc;*.cmx;*.fig;*.log;*.dat', ' (*.xml,*.xls,*.civ, *.jpg,*.png, *.avi,*.nc,*.cmx ,*.fig,*.log,*.dat)';
    487 %        '*.xml',  '.xml files '; ...
    488 %         '*.xls',  '.xls files '; ...
    489 %         '*.civ',  '.civ files '; ...
    490 %         '*.jpg','.jpg image files'; ...
    491 %         '*.png','.png image files'; ...
    492 %         '*.avi;*.AVI','.avi movie files'; ...
    493 %         '*.nc','.netcdf files'; ...
    494 %         '*.cdf','.netcdf files'; ...
    495 %         '*.cmx','.cmx text files';...
    496 %         '*.cmx2','.cmx2 text files';...
    497 %         '*.fig','.fig files (matlab fig)';...
    498 %         '*.log','.log text files ';...
    499 %         '*.dat','.dat text files ';...
    500 %         '*.*',  'All Files (*.*)'}, ...
    501 %         'Pick a second file for comparison',RootPath);
    502466[FileName, PathName] = uigetfile({'*.*','All Files(*.*)'},'Pick a file',RootPath);
    503467fileinput_1=[PathName FileName];%complete file name
    504 sizf=size(fileinput_1);
    505 if (~ischar(fileinput_1)||~isequal(sizf(1),1)),return;end
     468if ~exist(fileinput_1,'file')
     469    return %abandon of the browser is cancelled
     470end
    506471
    507472% refresh the current displayed field
     
    734699        set(hfig,'WindowButtonUpFcn','mouse_up')%set mouse click action function
    735700        set(hfig,'WindowButtonUpFcn','mouse_down')%set mouse click action function
    736     case {'xml','xls'}                % edit xml or Excel files
     701    case 'xml'                % edit xml files
     702        if ~isempty(regexp(fileinput,'.project.xml$'))
     703            datatree_browser(fileinput)
     704        else
     705            editxml(fileinput);
     706        end
     707        %             if exist(regexprep(fileinput,'.project.xml$','.link'),'dir')
     708        %                 datatree_browser(regexprep(fileinput,'.project.xml$','.link'))
     709        %                 check_project=1;
     710        %         elseif exist(regexprep(fileinput,'.project.xml$',''),'dir')
     711        %                 datatree_browser(regexprep(fileinput,'.project.xml$',''))
     712        %                 check_project=1;
     713        %             end
     714        %         end
     715        %         if ~check_project
     716        %         editxml(fileinput);
     717    case 'xls'
    737718        editxml(fileinput);
    738719    otherwise
     
    798779        set(handles.MenuExportMovie,'Enable','on')
    799780        set(handles.MenuTools,'Enable','on')
    800 %         set(handles.OBJECT_txt,'Visible','on')
    801 %         set(handles.edit_object,'Visible','on')
    802 %          set(handles.ListObject_1,'Visible','on')
    803 %          set(handles.ViewObject,'Visible','on')
    804 %         set(handles.frame_object,'Visible','on')
    805        
     781
    806782        % initiate input file series and refresh the current field view:     
    807783        update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,index);
    808784
     785end
     786
     787%% update list of recent files in the menubar and save it for future opening
     788MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};...
     789    {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}];
     790str_find=strcmp(fileinput,MenuFile);
     791if isempty(find(str_find,1))
     792    MenuFile=[{fileinput};MenuFile];%insert the current file if not already in the list
     793end
     794for ifile=1:min(length(MenuFile),5)
     795    eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
     796    eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',MenuFile{ifile});'])
     797end
     798dir_perso=prefdir;
     799profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     800if exist(profil_perso,'file')
     801    save (profil_perso,'MenuFile','-append'); %store the file names for future opening of uvmat
     802else
     803    save (profil_perso,'MenuFile','-V6'); %store the file names for future opening of uvmat
    809804end
    810805
     
    11291124    CheckMask_Callback([],[],handles)
    11301125end
    1131 
    1132 %% update list of recent files in the menubar and save it for future opening
    1133 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};...
    1134     {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}];
    1135 str_find=strcmp(FileName,MenuFile);
    1136 if isempty(find(str_find,1))
    1137     MenuFile=[{FileName};MenuFile];%insert the current file if not already in the list
    1138 end
    1139 for ifile=1:min(length(MenuFile),5)
    1140     eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
    1141     eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',MenuFile{ifile});'])
    1142 end
    1143 dir_perso=prefdir;
    1144 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    1145 if exist(profil_perso,'file')
    1146     save (profil_perso,'MenuFile','-append'); %store the file names for future opening of uvmat
    1147 else
    1148     save (profil_perso,'MenuFile','-V6'); %store the file names for future opening of uvmat
    1149 end
    1150 
    11511126
    11521127%------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.