source: trunk/src/check_functions.m @ 35

Last change on this file since 35 was 19, checked in by gostiaux, 15 years ago

the private files have been moved down to the root folder

File size: 7.7 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.fig
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_functions';... 
31          'civ';...   %function associated with the interface 'civ.fig' for PIV and spline interpolation
32          'civ.fig';...
33          'civ_3D';... function associated with the interface 'civ_3D.fig' for PIV in volume (in progress)
34          'civ_3D.fig';...
35          'close_fig';...% function  activated when a figure is closed
36          'copyfields';...%copy fields between two matlab structures
37          'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle
38          'editxml';...%display and edit xml files using a xls schema
39          'editxml.fig';...%interface for editxml
40          'find_field_indices';...% group the variables of a nc-formated Matlab structure into 'fields' with common dimensions
41          'geometry_calib';...%performs geometric calibration from a set of reference points
42          'geometry_calib.fig';...%interface for geometry_calib
43          'get_field';...% choose and plot a field from a Netcdf file
44          'get_field.fig';...%interface for get_field
45          'get_plot_handles';... %provides handles of elements setting the plotting parameters in the uvmat interface
46          'griddata_uvmat';...%make 2D linear interpolation using griddata, with input appropriate for both Matlab 6.5 and 7
47          'hist_update';...%  update of a current global histogram by inclusion of a new field 
48          'imadoc2struct';...%convert the image documentation file ImaDoc into a Matlab structure
49          'keyboard_callback';... % function activated when a key is pressed on the keyboard
50          'ListDir';... scan the structure of the directory tree (for dataview.m)
51          'mouse_down';% function activated when the mouse button is pressed on a figure (callback for 'WindowButtonDownFcn')
52          'mouse_motion';...% permanently called by mouse motion over a figure (callback for 'WindowButtonMotionFcn')
53          'mouse_up';... % function to be activated when the mouse button is released (callback for 'WindowButtonUpFcn')
54          'msgbox_uvmat';... associated with GUI msgbox_uvmat.fig to display message boxes, for error, warning or input calls
55          'msgbox_uvmat.fig';...
56          'name2display';...% extracts the root name and field numbers from an input filename
57          'name_generator';...%creates a file name from a root name and indices.
58          'nc2struct';...% transform a netcdf file in a corresponding matlab structure
59          'peaklock';...%
60          'phys';...% transforms fields from image (px) to real world (phys) coordinates using geometric calibration parameters
61          'phys_polar';... transform image coordinates (px) to physical ploar coordinates
62          'phys_XYZ';...%transforms image (px) to real world (phys) coordinates using geometric calibration parameters
63          'px';...% transform fields from physical to px coordinates using geometrical calibration parameters
64          'px_XYZ';...% ransform physical to px coordinates using geometrical calibration parameters
65          'plot_field';...%displays a vector field and/or scalar or images
66          'plot_object';...%draws a projection object (points, line, plane...)
67          'proj_field';...%project a field on a projection object (plane, line,...)
68          'read_civxdata';...reads civx data from netcdf files
69          'read_imatext';...%read .civ files (obsolete, but can be adapted to other text documentation files)
70           'read_plot_param';... %read the plotting option parameters on the uvmat interface
71           'read_set_object';...%read the data on the set_object interface
72           'read_xls';...%read excel files containing the list of the experiments
73           'reinit';...% suppress the personal parameter file 'uvmat_perso.mat'
74           'RUN_FIX';...% fix velocity fields
75           'RUN_STLIN';...% combine 2 displacement fields for stereo PIV
76           'series';...% master function for analysis field series, with interface 'series.fig'
77           'series.fig';...% interface for 'series'
78           'set_col_vec';...
79           'set_grid';...% creates a grid for PIV
80           'set_grid.fig';...% interface for set_grid
81           'set_object.m';...%  edit a projection object
82           'set_object.fig';...% interface for set_object
83           'sub_field';...% combine the two input fields,
84           'struct2nc';...% %write fields in netcdf files
85           'uvmat';...% master function for file scanning and visualisation of 2D fields
86           'uvmat.fig';...  %interface for uvmat 
87           'update_imadoc';...  %update the ImaDoc xml file
88           'update_obj';... update the object representation graph and its projection field, record it in the uvmat interface
89           'update_waitbar';... update the waitbar display, used for ACTION functions in the GUI 'series'
90           'warndlg_uvmat';...% display messages (error, warning, confirmation) , OBSOLETE, use msgbox_uvmat
91            'write_plot_param'};%update plotting parameters after plot
92 dir_fct=which('uvmat');% path to uvmat
93[pathuvmat,name,ext]=fileparts(dir_fct);
94icount=0;
95% loop on the list of functions in the uvmat package
96 for i=1:length(list_fct)
97    dir_fct=which(list_fct{i});% path to fct
98    if isempty(dir_fct)
99        icount=icount+1;
100        errormsg{icount}=[list_fct{i} ' not found'];% test for function not found
101    else
102       [pth,name,ext]=fileparts(dir_fct);
103       if ~isequal(pathuvmat,pth)&~isequal(fullfile(pathuvmat,'private'),pth)
104           icount=icount+1;
105           errormsg{icount}=[dir_fct ' overrides the package UVMAT'];% bad path for the function
106       end
107       datfile=dir(dir_fct);
108       date_str=datfile.date;%string of the date of last modification
109       datnum(i)=0;%default
110       char_code=double(date_str);% code of the date characters
111       special_char=(char_code>127); %non standard Ascii character (e.g. date in french)
112       if isempty(find(special_char))% standard Ascii character
113          datnum(i)=datenum(date_str);
114       end
115   end
116end
117errormsg=errormsg';
118date_str=datestr(max(datnum));
Note: See TracBrowser for help on using the repository browser.