source: trunk/src/check_functions.m @ 258

Last change on this file since 258 was 252, checked in by sommeria, 14 years ago

various bugs corrected.

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