source: trunk/src/check_functions.m @ 146

Last change on this file since 146 was 89, checked in by sommeria, 14 years ago

many bug corrections and cleaning. Activation of the BW option in uvmat. Improvement of the interaction of get_field with uvmat.

File size: 7.2 KB
Line 
1%'check_functions': check the path and modification date for all the
2%  function in the toolbox UVMAT. Called at the opening of uvmat
3%----------------------------------------------------------------------
4% function [errormsg,date_str]=check_functions
5%
6% OUTPUT:
7% errormsg: error message listing functions whose paths are not in the directory of uvmat.m
8% date_str: date of the most recent modification of a file in the toolbox
9
10%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
11%  Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org.
12%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
13%     This file is part of the toolbox UVMAT.
14%
15%     UVMAT is free software; you can redistribute it and/or modify
16%     it under the terms of the GNU General Public License as published by
17%     the Free Software Foundation; either version 2 of the License, or
18%     (at your option) any later version.
19%
20%     UVMAT is distributed in the hope that it will be useful,
21%     but WITHOUT ANY WARRANTY; without even the implied warranty of
22%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23%     GNU General Public License (file UVMAT/COPYING.txt) for more details.
24%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
25
26function [errormsg,date_str]=check_functions
27errormsg={};%default
28list_fct={'calc_field';...% defines fields (velocity, vort, div...) from civx data and calculate them 
29          'cell2tab';... %transform a Matlab cell in a character array suitable for display in a table
30          'check_field_structure';...% check the validity of the field struture representation consistant with the netcdf format
31          'check_functions';... 
32          'civ';...   %function associated with the interface 'civ.fig' for PIV and spline interpolation
33          'civ.fig';...
34          'civ_3D';... function associated with the interface 'civ_3D.fig' for PIV in volume (in progress)
35          'civ_3D.fig';...
36          'close_fig';...% function  activated when a figure is closed
37          'copyfields';...% copy fields between two matlab structures
38          'create_grid';...% called by the GUI geometry_calib to create a physical grid
39          'create_grid.fig';...% GUI corresponding to create_grid.m
40          'dataview';...% function for scanning directories in a campaign
41          'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle 
42          'editxml';...%display and edit xml files using a xls schema
43          'editxml.fig';...%interface for editxml
44          'find_field_indices';...% group the variables of a nc-formated Matlab structure into 'fields' with common dimensions
45          'geometry_calib';...%performs geometric calibration from a set of reference points
46          'geometry_calib.fig';...%interface for geometry_calib
47          'get_field';...% choose and plot a field from a Netcdf file
48          'get_field.fig';...%interface for get_field
49          'get_plot_handles';... %provides handles of elements setting the plotting parameters in the uvmat interface
50          'griddata_uvmat';...%make 2D linear interpolation using griddata, with input appropriate for both Matlab 6.5 and 7
51          'hist_update';...%  update of a current global histogram by inclusion of a new field 
52          'imadoc2struct';...%convert the image documentation file ImaDoc into a Matlab structure
53          'keyboard_callback';... % function activated when a key is pressed on the keyboard
54          'ListDir';... scan the structure of the directory tree (for dataview.m)
55          'mouse_down';% function activated when the mouse button is pressed on a figure (callback for 'WindowButtonDownFcn')
56          'mouse_motion';...% permanently called by mouse motion over a figure (callback for 'WindowButtonMotionFcn')
57          'mouse_up';... % function to be activated when the mouse button is released (callback for 'WindowButtonUpFcn')
58          'msgbox_uvmat';... associated with GUI msgbox_uvmat.fig to display message boxes, for error, warning or input calls
59          'msgbox_uvmat.fig';...
60          'name2display';...% extracts the root name and field numbers from an input filename
61          'name_generator';...%creates a file name from a root name and indices.
62          'nc2struct';...% transform a netcdf file in a corresponding matlab structure
63          'peaklock';...%
64          'plot_field';...%displays a vector field and/or scalar or images
65          'plot_object';...%draws a projection object (points, line, plane...)
66          'proj_field';...%project a field on a projection object (plane, line,...)
67          'read_civxdata';...reads civx data from netcdf files
68          'read_imatext';...%read .civ files (obsolete, but can be adapted to other text documentation files)
69           'read_plot_param';... %read the plotting option parameters on the uvmat interface
70           'read_set_object';...%read the data on the set_object interface
71           'read_xls';...%read excel files containing the list of the experiments
72           'reinit';...% suppress the personal parameter file 'uvmat_perso.mat'
73           'RUN_FIX';...% fix velocity fields
74           'RUN_STLIN';...% combine 2 displacement fields for stereo PIV
75           'series';...% master function for analysis field series, with interface 'series.fig'
76           'series.fig';...% interface for 'series'
77           'set_col_vec';...
78           'set_grid';...% creates a grid for PIV
79           'set_grid.fig';...% interface for set_grid
80           'set_object.m';...%  edit a projection object
81           'set_object.fig';...% interface for set_object
82           'sub_field';...% combine the two input fields,
83           'struct2nc';...% %write fields in netcdf files
84           'uvmat';...% master function for file scanning and visualisation of 2D fields
85           'uvmat.fig';...  %interface for uvmat 
86           'update_imadoc';...  %update the ImaDoc xml file
87           'update_obj';... update the object representation graph and its projection field, record it in the uvmat interface
88           'update_waitbar';... update the waitbar display, used for ACTION functions in the GUI 'series'
89            'write_plot_param'};%update plotting parameters after plot
90 dir_fct=which('uvmat');% path to uvmat
91[pathuvmat,name,ext]=fileparts(dir_fct);
92icount=0;
93% loop on the list of functions in the uvmat package
94 for i=1:length(list_fct)
95    dir_fct=which(list_fct{i});% path to fct
96    if isempty(dir_fct)
97        icount=icount+1;
98        errormsg{icount}=[list_fct{i} ' not found'];% test for function not found
99    else
100       [pth,name,ext]=fileparts(dir_fct);
101       if ~isequal(pathuvmat,pth)&~isequal(fullfile(pathuvmat,'private'),pth)
102           icount=icount+1;
103           errormsg{icount}=[dir_fct ' overrides the package UVMAT'];% bad path for the function
104       end
105       datfile=dir(dir_fct);
106       date_str=datfile.date;%string of the date of last modification
107       datnum(i)=0;%default
108       try
109           datnum(i)=datenum(date_str);
110       catch
111           datnum(i)=0;%in case of error with datenum (e.g. date in french)
112       end
113   end
114end
115errormsg=errormsg';
116date_str=datestr(max(datnum));
Note: See TracBrowser for help on using the repository browser.