source: trunk/src/uvmat_doc/FUNCTIONS_DOC/ListDir.html @ 37

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

create_grid.fig ,
uvmat_doc and all the included files added

File size: 10.5 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2                "http://www.w3.org/TR/REC-html40/loose.dtd">
3<html>
4<head>
5  <title>Description of ListDir</title>
6  <meta name="keywords" content="ListDir">
7  <meta name="description" content="'ListDir': scan the structure of the directory tree (for dataview.m)">
8  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
10  <meta name="robots" content="index, follow">
11  <link type="text/css" rel="stylesheet" href="../m2html.css">
12</head>
13<body>
14<a name="_top"></a>
15<div><a href="../index.html">Home</a> &gt;  <a href="index.html">.</a> &gt; ListDir.m</div>
16
17<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
18<td align="right"><a href="index.html">Index for .&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
19
20<h1>ListDir
21</h1>
22
23<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
24<div class="box"><strong>'ListDir': scan the structure of the directory tree (for dataview.m)</strong></div>
25
26<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
27<div class="box"><strong>function [ListDevices,ListRecords,ListXml,List]=ListDir(CurrentPath,ListExperiments,ListDevices_in,ListRecords_in) </strong></div>
28
29<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
30<div class="fragment"><pre class="comment">'ListDir': scan the structure of the directory tree (for dataview.m)
31------------------------------------------------------------------------</pre></div>
32
33<!-- crossreference -->
34<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
35This function calls:
36<ul style="list-style-image:url(../matlabicon.gif)">
37</ul>
38This function is called by:
39<ul style="list-style-image:url(../matlabicon.gif)">
40<li><a href="dataview.html" class="code" title="function varargout = dataview(varargin)">dataview</a>   TEST 'dataview': function for scanning directories in a campaign (TEST)</li><li><a href="editxml.html" class="code" title="function varargout = editxml(varargin)">editxml</a>  'editxml': function for editing xml files using a xml schema (associated with the GUI editxml.fig)</li><li><a href="geometry_calib.html" class="code" title="function varargout = geometry_calib(varargin)">geometry_calib</a>  'geometry_calib': performs geometric calibration from a set of reference points</li></ul>
41<!-- crossreference -->
42
43<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
44<ul style="list-style-image:url(../matlabicon.gif)">
45<li><a href="#_sub1" class="code">function [testnew,testselect]=test_select(name,ListDevices,ListDevices_in)</a></li></ul>
46<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
47<div class="fragment"><pre>0001 <span class="comment">%'ListDir': scan the structure of the directory tree (for dataview.m)</span>
480002 <span class="comment">%------------------------------------------------------------------------</span>
490003 <a name="_sub0" href="#_subfunctions" class="code">function [ListDevices,ListRecords,ListXml,List]=ListDir(CurrentPath,ListExperiments,ListDevices_in,ListRecords_in)</a>
500004
510005 ListRecords={};
520006 ListDevices={};
530007 ListXml={};
540008 irecord_tot=0;
550009 idevice_tot=0;
560010 ixml_tot=0;
570011 <span class="keyword">for</span> iexp=1:length(ListExperiments)
580012     List.Experiment{iexp}.name=ListExperiments{iexp};
590013     hdir=dir(fullfile(CurrentPath,ListExperiments{iexp}));
600014     idevice=0;
610015     <span class="keyword">for</span> isub=1:length(hdir)<span class="comment">% scan the sub-directories  of the current experiment</span>
620016         <span class="keyword">if</span> hdir(isub).isdir
630017             name=hdir(isub).name;<span class="comment">%name of the current device</span>
640018             <span class="keyword">if</span> ~isequal(name(1),<span class="string">'.'</span>)<span class="comment">% subdirectory of the current experiment</span>
650019                 [testnew,testselect]=<a href="#_sub1" class="code" title="subfunction [testnew,testselect]=test_select(name,ListDevices,ListDevices_in)">test_select</a>(name,ListDevices,ListDevices_in);
660020                 <span class="keyword">if</span> testselect
670021                     idevice=idevice+1;
680022                     List.Experiment{iexp}.Device{idevice}.name=name;             
690023                     <span class="keyword">if</span> testnew
700024                          idevice_tot=idevice_tot+1;
710025                          ListDevices{idevice_tot}=name;
720026                     <span class="keyword">end</span>
730027                     CurrentDevice=fullfile(CurrentPath,ListExperiments{iexp},name);
740028                     hsubxml=dir(fullfile(CurrentDevice,<span class="string">'*.xml'</span>));<span class="comment">%look at xml files in the subdirectory of the current device</span>
750029                     <span class="keyword">if</span> isempty(hsubxml) <span class="comment">% the subdirectory of the current device contains directories 'Record''</span>
760030                         hsubdir=dir(fullfile(CurrentPath,ListExperiments{iexp},name));<span class="comment">%list what is inside the directory 'Device'</span>
770031                         irecord=0;
780032                         <span class="keyword">for</span> isubsub=1:length(hsubdir)<span class="comment">% subdirectories of the current device</span>
790033                             <span class="keyword">if</span> hsubdir(isubsub).isdir                       
800034                                 RecordName=hsubdir(isubsub).name; 
810035                                 <span class="keyword">if</span> ~isequal(RecordName(1),<span class="string">'.'</span>)
820036                                     [testnew,testselect]=<a href="#_sub1" class="code" title="subfunction [testnew,testselect]=test_select(name,ListDevices,ListDevices_in)">test_select</a>(RecordName,ListRecords,ListRecords_in);
830037                                     <span class="keyword">if</span> testselect
840038                                         <span class="keyword">if</span> testnew
850039                                             irecord_tot=irecord_tot+1;
860040                                             ListRecords{irecord_tot}=RecordName;
870041                                         <span class="keyword">end</span>
880042                                         irecord=irecord+1;
890043                                         List.Experiment{iexp}.Device{idevice}.Record{irecord}.name=RecordName;
900044                                         hsubsubxml=dir(fullfile(CurrentDevice,RecordName,<span class="string">'*.xml'</span>));<span class="comment">%</span>
910045                                         <span class="keyword">for</span> ixml=1:length(hsubsubxml)
920046                                             XmlName=hsubsubxml(ixml).name;
930047                                             List.Experiment{iexp}.Device{idevice}.Record{irecord}.xmlfile{ixml}=XmlName;
940048                                             testnew=<a href="#_sub1" class="code" title="subfunction [testnew,testselect]=test_select(name,ListDevices,ListDevices_in)">test_select</a>(XmlName,ListXml,{});
950049                                             <span class="keyword">if</span> testnew
960050                                                 ixml_tot=ixml_tot+1;
970051                                                 ListXml{ixml_tot}=XmlName;
980052                                             <span class="keyword">end</span>
990053                                         <span class="keyword">end</span> 
1000054                                     <span class="keyword">end</span>             
1010055                                 <span class="keyword">end</span>
1020056                             <span class="keyword">end</span>
1030057                         <span class="keyword">end</span>
1040058                     <span class="keyword">else</span>
1050059                         <span class="keyword">for</span> ixml=1:length(hsubxml)
1060060                             XmlName=hsubxml(ixml).name;
1070061                             List.Experiment{iexp}.Device{idevice}.xmlfile{ixml}=XmlName;
1080062                             testnew=<a href="#_sub1" class="code" title="subfunction [testnew,testselect]=test_select(name,ListDevices,ListDevices_in)">test_select</a>(XmlName,ListXml,{});
1090063                             <span class="keyword">if</span> testnew
1100064                                 ixml_tot=ixml_tot+1;
1110065                                 ListXml{ixml_tot}=XmlName;
1120066                             <span class="keyword">end</span>
1130067                         <span class="keyword">end</span>
1140068                     <span class="keyword">end</span>
1150069                 <span class="keyword">end</span>
1160070             <span class="keyword">end</span>
1170071         <span class="keyword">end</span>
1180072     <span class="keyword">end</span>
1190073 <span class="keyword">end</span>
1200074
1210075 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1220076 <a name="_sub1" href="#_subfunctions" class="code">function [testnew,testselect]=test_select(name,ListDevices,ListDevices_in)</a>
1230077 <span class="keyword">if</span> ~isempty(ListDevices_in)
1240078     testnew=0;
1250079     testselect=0;
1260080     <span class="keyword">for</span> ilist=1:length(ListDevices_in)
1270081         <span class="keyword">if</span> isequal(name,ListDevices_in{ilist})
1280082             testnew=1;
1290083             testselect=1;
1300084             <span class="keyword">break</span>
1310085         <span class="keyword">end</span>
1320086     <span class="keyword">end</span>
1330087 <span class="keyword">else</span>
1340088     testnew=1;
1350089     testselect=1;
1360090 <span class="keyword">end</span>
1370091 <span class="keyword">if</span> testnew
1380092     <span class="keyword">for</span> ilist=1:length(ListDevices)
1390093          <span class="keyword">if</span> isequal(name,ListDevices{ilist})
1400094               testnew=0;
1410095               <span class="keyword">break</span>
1420096          <span class="keyword">end</span>
1430097     <span class="keyword">end</span>
1440098 <span class="keyword">end</span></pre></div>
145<hr><address>Generated on Fri 13-Nov-2009 11:17:03 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
146</body>
147</html>
Note: See TracBrowser for help on using the repository browser.