Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
doxygen.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #--------------------------------------------------------------------------------------
4 #
5 # Utility script for generation of HTML Doxygen main page.
6 #
7 #--------------------------------------------------------------------------------------
8 # \author mdejong
9 #
10 script=${0##*/}
11 
12 if [ -z $JPP_DIR ]; then
13  echo "Variable JPP_DIR undefined."
14  exit 1
15 fi
16 
17 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
18 
19 if do_usage $*; then
20  usage "$script"
21 fi
22 
23 setopt +o nomatch
24 
25 set_variable NUMBER_OF_COLUMNS 3
26 
27 #
28 function findapps()
29 {
30  find $* -mindepth 1 -executable ! -regex ".*\.\(\(\|c\|z\)sh\|py\)" -printf "%f\n" | sort
31 }
32 
33 #
34 function findscripts()
35 {
36  find $* -mindepth 1 -executable -regex ".*\.\(\(\|c\|z\)sh\|py\)" -printf "%f\n" | sort
37 }
38 
39 #
40 function findexamples()
41 {
42  find $* -mindepth 1 -executable | sort
43 }
44 
45 #
46 # Method to get file name of source code.
47 #
48 # \param 1 executable file
49 # \return source file
50 #
51 function get_source()
52 {
53  file=`which $1 2> /dev/null`
54 
55  if [[ -n "${file}" && -x ${file} ]]; then
56  if [[ $file == *\.((|c|z)sh|py) ]]; then
57  source=${file}
58  else
59  source=`${file} -v 2> /dev/null | sed -n 's/source: *//p'`
60  fi
61  else
62  source=$1
63  fi
64 
65  echo ${source:a}
66 }
67 
68 
69 echo "/**"
70 echo " * \mainpage Documentation"
71 echo " * \htmlonly"
72 echo " * <style>"
73 echo " * ul.b { list-style-type: none; counter-reset: section; columns: ${NUMBER_OF_COLUMNS}; -moz-column-count: ${NUMBER_OF_COLUMNS}; -webkit-column-count: ${NUMBER_OF_COLUMNS}; column-count: ${NUMBER_OF_COLUMNS}; }"
74 echo " * </style>"
75 
76 # Documents
77 
78 echo " * <hr>"
79 echo " * <h2>Documents</h2>"
80 echo " * <ul class=\"b\">"
81 for file in `ls ${JPP_DOC}/*`; do
82  if [ -f ${file} ]; then
83  echo " * <li><a href=\"${file##*/}\">${file##*/}</a></li>"
84  fi
85 done
86 echo " * </ul>"
87 
88 
89 # Applications header
90 
91 echo " * <hr>"
92 echo " * <h2>Applications</h2>"
93 echo " * <ul class=\"b\">"
94 for file in `findapps ${JPP_BIN}`; do
95  echo " * <li><a href=\"#${file}\">${file}</a></li>"
96 done
97 echo " * </ul>"
98 
99 
100 # Scripts header
101 
102 echo " * <hr>"
103 echo " * <h2>Scripts</h2>"
104 echo " * <ul class=\"b\">"
105 for file in `findscripts ${JPP_BIN}`; do
106  echo " * <li><a href=\"#${file}\">${file}</a></li>"
107 done
108 echo " * </ul>"
109 
110 
111 # Examples header
112 
113 echo " * <hr>"
114 echo " * <h2>Examples</h2>"
115 echo " * <ul class=\"b\">"
116 for dir in `ls $JPP_DIR/examples`; do
117  echo " * <li><a href=\"#examples/${dir}\">${dir}</a></li>"
118 done
119 echo " * </ul>"
120 
121 
122 # Applications data
123 
124 for file in `findapps ${JPP_BIN}`; do
125 
126  source=`get_source ${file}`
127 
128  echo " * <hr>"
129  echo " * <h4 id=\"${file}\">"
130  if [[ -n "${source}" ]]; then
131  if (`ls $JPP_DIR/examples/*/${source:t} >& /dev/null`); then
132  source=${source##${JPP_DIR:a}/}
133  else
134  source=${source:t}
135  fi
136  echo " * \\\\endhtmlonly"
137  echo " * ${source}"
138  echo " * \htmlonly"
139  else
140  echo " * ${file}"
141  fi
142  echo " * </h4>"
143  echo " * <pre>"
144  ${file} -h! 2> /dev/null | sed 's/</\&lt;/g;s/>/\&gt;/g'
145  echo " * </pre>"
146  echo " * <a href="#top">Go back to top of page.</a>"
147 done
148 
149 
150 # Scripts data
151 
152 for file in `findscripts ${JPP_BIN}`; do
153 
154  source=`eval ls $JPP_DIR/software/*/$file`
155 
156  echo " * <hr>"
157  echo " * <h4 id=\"${file}\">"
158  if [[ -n "${source}" ]]; then
159  if (`ls $JPP_DIR/examples/*/${source:t} >& /dev/null`); then
160  source=${source##${JPP_DIR:a}/}
161  else
162  source=${source:t}
163  fi
164  echo " * \\\\endhtmlonly"
165  echo " * ${source}"
166  echo " * \htmlonly"
167  else
168  echo " * ${file}"
169  fi
170  echo " * </h4>"
171  echo " * <pre>"
172  ${file} -h! 2> /dev/null | sed 's/</\&lt;/g;s/>/\&gt;/g'
173  echo " * </pre>"
174  echo " * <a href="#top">Go back to top of page.</a>"
175 done
176 
177 
178 # Examples data
179 
180 for dir in `ls $JPP_DIR/examples`; do
181 
182  echo " * <hr>"
183  echo " * <h4 id=\"examples/${dir}\">${dir}</h4>"
184  echo " * <ul class=\"b\">"
185  for file in `findexamples $JPP_DIR/examples/${dir}`; do
186  echo " * <li><a href=\"#${file}\">${file:t}</a></li>"
187  done
188  echo " * </ul>"
189  echo " * <a href="#top">Go back to top of page.</a>"
190 
191  for file in `findexamples $JPP_DIR/examples/${dir}/`; do
192 
193  if [[ ! $file = *.sh && ! $file = *.csh ]]; then
194  source=`get_source ${file}`
195  else
196  source=$file
197  fi
198 
199  echo " * <hr>"
200  echo " * <h4 id=\"${file}\">"
201  if [[ -n "${source}" ]]; then
202  if (`ls ${JPP_DIR}/software/*/${source:t} >& /dev/null` || `ls ${JPP_DIR}/examples/^${dir}/${source:t} >& /dev/null`); then
203  source=${source##${JPP_DIR:a}/}
204  else
205  source=${source:t}
206  fi
207  echo " * \\\\endhtmlonly"
208  echo " * ${source}"
209  echo " * \htmlonly"
210  else
211  echo " * ${file}"
212  fi
213  echo " * </h4>"
214  echo " * <pre>"
215  ${file} -h! 2>&1 | sed 's/</\&lt;/g;s/>/\&gt;/g'
216  echo " * </pre>"
217  echo " * <a href="#top">Go back to top of page.</a>"
218  done
219 done
220 
221 echo " * \\\\endhtmlonly"
222 echo " */"
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
Definition: JDataQuality.sh:19
exit
Definition: JPizza.sh:36
then
Definition: datalogs.sh:31
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
function get_source()
Definition: doxygen.sh:51
const int n
Definition: JPolint.hh:786
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:21
then JCalibrateToT a
Definition: JTuneHV.sh:113
*fatal Wrong number of arguments esac notice which
Definition: sftpget.zsh:23
* usage
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
data_type v[N+1][M+1]
Definition: JPolint.hh:866
function findexamples()
Definition: doxygen.sh:40
then echo
Definition: JQAQC.sh:90
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
function findscripts()
Definition: doxygen.sh:34
script
Definition: JAcoustics.sh:2
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null if do_usage *then usage $script fi setopt o nomatch set_variable NUMBER_OF_COLUMNS function findapps()
Definition: doxygen.sh:28
esac done
Definition: JAddHDE.sh:21